Understanding temporal dynamics of video is an essential aspect of learning better video representations. Recently, transformer-based architectural designs have been extensively explored for video tasks due to their capability to capture long-term dependency of input sequences. However, we found that these Video Transformers are still biased to learn spatial dynamics rather than temporal ones, and debiasing the spurious correlation is critical for their performance. Based on the observations, we design simple yet effective self-supervised tasks for video models to learn temporal dynamics better. Specifically, for debiasing the spatial bias, our method learns the temporal order of video frames as extra self-supervision and enforces the randomly shuffled frames to have low-confidence outputs. Also, our method learns the temporal flow direction of video tokens among consecutive frames for enhancing the correlation toward temporal dynamics. Under various video action recognition tasks, we demonstrate the effectiveness of our method and its compatibility with state-of-the-art Video Transformers.READ FULL TEXT VIEW PDF
Understanding videos for action or event recognition is a challenging yet crucial task that has gotten significant attention in computer vision communities(Lin et al., 2019; Cheng et al., 2021). Compared to image data, temporal dynamics between video frames provide additional information that is essential for recognition, as the actions and events generally occur over multiple consecutive frames. Hence, designing video-specific architectures for capturing such temporal dynamics has been a common theme in learning better video representations (Simonyan and Zisserman, 2014; Tran et al., 2015, 2018; Feichtenhofer et al., 2019). Recently, Transformer-based (Vaswani et al., 2017) video models, so-called Video Transformers, have been extensively explored due to their capability to capture long-term dependency among the input sequence; for example, Bertasius et al. (2021) and Patrick et al. (2021) introduce divided space-time and trajectory attentions, respectively.
However, it is still questionable whether these architectural advances are enough to fully capture the temporal dynamics in a video. For example, Fan et al. (2021)
shows that a well-designed image classifier with a flattened video along time dimension could outperform the several state-of-the-art video models on the representative action recognition tasks. As additional clues, we observed that Video Transformers often predict a video action correctly with high confidence even when input video frames are randomly shuffled,i.e., the shuffled video does not contain correct temporal dynamics (see Figure 1(a) and 1(c)). Furthermore, as shown in Figure 1(b), Video Transformers also fail to capture the temporal order of video frames as their layers go deeper. These observations reveal that the recent Video Transformers are likely to be biased to learn spatial dynamics, despite their efforts of designing a better architecture for learning the temporal one. Hence, this limitation inspires us to investigate an independent and complementary direction other than architectural advance, to improve the quality of learned video representations via better temporal modeling.
Contribution. In this paper, we design simple yet effective frame- and token-level self-supervised tasks, coined TIME (Time Is MattEr), for video models which learn temporal dynamics better. First, we train the models to learn two frame-level tasks for debiasing the spurious correlation learned from spatial dynamics. Specifically, (a) we keep the temporal information within the video frame-by-frame by assigning the correct frame order as a self-supervised label to predict the temporal order of video frames (to avoid losing the temporal information), and (b) we simultaneously train the video models to be not able to output high-confident predictions when the input video does not contain the correct temporal order, i.e., randomly shuffled video frames. Moreover, we train the models with a token-level task for enhancing the correlation toward temporal dynamics by predicting the temporal flow direction of video tokens among consecutive frames. To be specific, we adapt an attention-based module on the final representations of tokens in consecutive frames to predict their nine types of flow direction in the time axis (eight angular directions and the center; see Eq.(10)) by assigning their self-supervised labels obtained by Gunnar Farnebäck’s algorithm (Farnebäck, 2003). We provide an overall illustration of our scheme in Figure 2. It is worth noting that our scheme can be adopted to any Video Transformers in a plug-in manner and is beneficial to various video downstream tasks including action recognition without additional human-annotated supervision. Somewhat interestingly, our approach also can be extended to the image domain for alleviating background bias.
To demonstrate the effectiveness of the proposed temporal self-supervised tasks, we incorporate our method with various Video Transformers and mainly evaluate on Something-Something-v2 (SSv2)(Goyal et al., 2017) benchmark.111As Sevilla-Lara et al. (2021) stated, Something-Something-v2 (Goyal et al., 2017) is known to contain a larger proportion of temporal classes requiring temporal information to be recognized. On the other hand, Kinetics (Kay et al., 2017) is not the case, where it is arguably much less suitable for modeling temporal dynamics well, e.g., see Figure 3 and Section 5 for more details. Hence, our method should have marginal gains on Kinetics. Despite its simplicity, our method consistently improves the recent state-of-the-art Video Transformers by debiasing the spurious correlation between spatial and temporal dynamics successfully. For example, ours improves the accuracy of TimeSformer (Bertasius et al., 2021) and X-ViT (Bulat et al., 2021) from 62.1% to 63.7% (+1.6%) and 60.1% to 63.5% (+3.4%) for SSv2, respectively. Furthermore, we also found that our self-supervised idea of debiasing can be naturally extended to image classification models to reduce the spurious correlation learned from the image backgrounds, e.g.,
our method improves the model generalization and robustness on ImageNet-9(Xiao et al., 2021). For example, our idea not only improves DeiT-Ti/16 (Touvron et al., 2020) from 77.3% to 83.3% (+6.0%) on the original dataset but also from 50.3% to 58.9% (+8.6%) on the Only-FG (i.e., remaining foregrounds only and removing backgrounds) in the background shift benchmarks (Xiao et al., 2021).
Overall, our work highlights the importance of debiasing the spurious correlation of visual transformer models with respect to the temporal or spatial dynamics. We believe our work could inspire researchers to rethink the under-explored, yet important problem and provide a new research direction.
Architectural advances for video action recognition.2017). 3D-CNN models (Tran et al., 2018; Feichtenhofer et al., 2019) extract spatio-temporal representations via their own temporal modeling methods; for example, SlowFast (Feichtenhofer et al., 2019) captures short- and long-range of time dependencies by using two different speed of pathways for the video. However, such 3D convolutional designs are limited to capture long-term dependency of video with its small receptive field.
Due to the ability to capture long-term dependency of the self-attention mechanism, transformer-based models (Neimark et al., 2021; Bertasius et al., 2021; Arnab et al., 2021; Patrick et al., 2021; Bulat et al., 2021; Fan et al., 2021; Li et al., 2022) have been recently explored for video action recognition by following the success of Vision Transformer (Dosovitskiy et al., 2021), which has shown competitive performances against CNNs in image domains. In particular, Video Transformers such as TimeSformer (Bertasius et al., 2021) and ViViT (Arnab et al., 2021) propose the use of a temporal attention module with the existing Vision Transformer to better understand temporal dynamics.
Besides, several works attempt to develop a more efficient and powerful attention module to mitigate the quadratic complexity of the self-attention in learning from videos. For example, TimeSformer suggests divided-space-time attention module by decomposing the time and space dimensions separately, X-ViT (Bulat et al., 2021) further restricts time attention to a local temporal window, i.e., local space-time attention. Motionformer (Patrick et al., 2021) introduces a trajectory attention to model the probabilistic path of a token between frames over the entire space-time feature volume.
Static biases in video. In video action recognition, it is essential capturing long-term dependency of temporal dynamics. However, several prior works (Li and Vasconcelos, 2019; Sevilla-Lara et al., 2021; Huang et al., 2018) have shown that video models are often biased to learn spatial dynamics rather than the temporal one due to the presence of static classes, which contain informative frames to predict the action class labels without understanding overall temporal information. In particular, Sevilla-Lara et al. (2021) categorizes action classes in video datasets as temporal and static classes with respect to whether they necessarily require understanding temporal information to recognize them, and shows that training on temporal classes can lead video models to avoid spatial bias and generalize better.
In the end, most recent works have mainly focused on architectural advances to capture temporal dynamics in videos. On the contrary, our method aims to handle this issue by designing self-supervised tasks not only for capturing stronger temporal dynamics, but also for debiasing the spurious correlation learned from spatial dynamics. Meanwhile, some CNN-based works (Misra et al., 2016; Lee et al., 2017; Hu et al., 2021) have also adapted a binary classification task that predicts the correct order of randomly chosen video frames or clips, however, our idea is simple and computationally efficient for Video Transformers; their capabilities to capture long-term dependency enable us to infer all the absolute temporal order frame-by-frame, while the prior works under CNNs do the binary order one-by-one.
|Model||Input frame||Tokenization||Top-1||Top-5||Shuffled Top-1||Shuffled Top-5|
Let be an input video where is the spatial resolution, is the number of frames, and is the number of channels. Video Transformers (e.g., TimeSformer (Bertasius et al., 2021)) process the input video as a sequence of video tokens
and then linearly transform them to-dimensional embeddings , where is the linear transformation and is the positional embedding for the -th token . Following Dosovitskiy et al. (2021), Video Transformers also utilize the token to represent the entire sequence of video tokens (i.e., the input video ) by prepending it to the token embedding sequence as , where . Then, Video Transformers take the sequence as inputs and then output the same size contextualized embeddings with their own spatial-temporal attention module.
Spatio-temporal attentions. Spatio-temporal attention is an extension of the self-attention that operates over space and time dimensions in parallel. For a video input sequence with a space-time location , joint spatio-temporal attention is a natural extension that can be defined:
where are query, key, and value matrices. Here, the joint attention computes attentions of all keys for each query , and it has a limitation of quadratic complexity in both space and time, i.e., . To address this limitation, several Video Transformers (Bertasius et al., 2021; Arnab et al., 2021) propose divided attention, which restricts space or time dimension as below:
The divided attention reduces the complexity to , and TimeSformer (Bertasius et al., 2021) and ViViT (Arnab et al., 2021) utilize this approach alternately for getting spatio-temporal features. On the other hand, Motionformer (Patrick et al., 2021) also introduces trajectory attention, which is designed to capture temporal dynamics by modeling a set of trajectory tokens computed across the frames, with a complexity of .
In order to be concise, we use to denote the encoder of Video Transformers parameterized by as follows:222Note that contains all Video Transformer parameters, including the encoder and the linear classifier head .
where and are the final representations of the token and the -th token, respectively. We remark that is generally utilized for solving video-level downstream tasks such as action recognition with a linear classifier head .
In this section, we describe our empirical observations based on the recent Video Transformers, such as TimeSformer (Bertasius et al., 2021) and Motionformer (Patrick et al., 2021), trained to recognize the actions in video using SSv2 dataset (Goyal et al., 2017). Here, our observations reveal that even the recent state-of-the-art video models still struggle to fully exploit the temporal information in video data. These findings serve as a key intuition for designing our temporal self-supervised tasks for video models.
Spurious correlation on spatial dynamics. Our first observation is that the violation of temporal dynamics within video does not lead to the low confident predictions of Video Transformers. Intuitively, if the models are learned to recognize the actions via capturing the temporal dynamics between the frames, their predictions should have low confidence when the input video does not have the correct temporal order, e.g., frames are randomly shuffled (Misra et al., 2016; Sevilla-Lara et al., 2021). To verify such behavior, we measure the accuracy of Video Transformers on SSv2 test dataset with original and shuffled videos in Table 1; the shuffled video is constructed from the original video where and is a permuted order. Here, it is observed that the models generally achieve the high test accuracy regardless of the shuffling of videos; for example, under 64 frames video, TimeSformer achieves 62.0% accuracy with only 6.9% reduction compared to the accuracy of the original video. We note that such high confident predictions on the violation of temporal dynamics (i.e., incorrect temporal order) often occur even for temporal classes where temporal information is crucial to recognize them (Sevilla-Lara et al., 2021) (see Figure 1(a)). These results indicate that the Video Transformers are likely to be biased to learn the spatial dynamics rather than temporal one despite their specific architectural designs to learn temporal information better.333Such spatial bias in video models may come from the ImageNet pre-trained weights. However, even without the pre-trained weights, we empirically found that our method still achieves significant improvements in training from scratch (see Appendix C).
|TimeSformer (Bertasius et al., 2021)||62.1||86.4|
|TimeSformer + TIME||63.7||87.8|
|Motionformer (Patrick et al., 2021)||63.8||88.5|
|Motionformer + TIME||64.7||89.3|
|X-ViT (Bulat et al., 2021)||60.1||85.2|
|X-ViT + TIME||63.5||88.1|
Vanishing temporal information. Next, we further observe that the deeper the transformer blocks in Video Transformers even fail to keep the temporal order of video frames. Specifically, we first generate temporal labels as the temporal order of -th frames. Then, we train additional linear classifier using to predict based on the frozen output embeddings of input video as follow:
where is an aggregated embedding of across the space axis, and denotes the standard cross-entropy loss between an input and a given label , respectively. To track the change of temporal information within each transformer block, we train a linear classifier on the aggregated embedding of each block and compare the accuracy of the temporal order prediction. As shown in Figure 1(b), the earlier blocks show much higher accuracy, but the performance significantly decreases in the latter blocks; for example, Motionformer achieves 99.5% accuracy at the 3th block, but it decreases to 45.6% at the last block. It might be the results of the learned spurious correlation of video models; as the models are focused on learning the spatial information, the temporal information would be less captured and lost.
Overall, these empirical observations reveal that only designing better video model architecture may not be enough; 444Architectural modifications could be an alternative for keeping temporal information. Nevertheless, we empirically found that our method could further improve the performance (see Appendix D). hence, it motivates us to investigate the independent yet complementary direction for improving the quality of learned video representation.
|SSv2 dataset||Temporal subset||Static subset|
Motivated by the previous observations in Section 3.2, we introduce a simple yet effective self-supervised tasks, coined TIME (Time Is MattEr), to better understand temporal dynamics of videos, which can be beneficial for video recognition in a model-agnostic way. Overall illustration of the proposed scheme is presented in Figure 2.
Debiasing spatial dynamics. First, we reduce a risk of learning the spurious correlation from spatial dynamics by utilizing the shuffled (i.e., temporarily incorrect) for training; we train the video models to output the low confident predictions for the shuffled video. Specifically, we minimize the Kullback-Leibler (KL) divergence from the predictive distribution on randomly shuffled video to the uniform one in order to give less confident predictions as follows:
where KL is a the Kullback-Leibler (KL) divergence, is a softmax function, is a linear classification head, and
is the uniform distribution. As it prevents the model from biased predictions toward spatial dynamics, the model learns to exploit the temporal dynamics better. We remark that the similar approaches have been utilized in other domains, such as image(Lee et al., 2018; Hendrycks et al., 2019) and language (Moon et al., 2021).
Learning temporal order of frames. To avoid losing temporal order information in deeper blocks, we directly regularize the model to keep such information at the final block. Specifically, we simply add a linear classifier on the final aggregated embedding of each frame and train the model using (7) to predict the temporal order of input video frames as described in Section 3.2. This regularization preserves the temporal information until the end of blocks; hence, the model could utilize it for solving the target task, such as action recognition.
Learning temporal flow direction of tokens. To enhance the correlation toward temporal dynamics, we train the model to predict the temporal flow direction of tokens in the consecutive frames and . To be specific, we adopt an attention-based module on pairs of final representations of the consecutive frames , and train the model using to predict their nine types of flow direction in the time axis (eight angular directions and the center) by assigning self-supervised labels obtained by Gunnar Farnebäck’s algorithm (Farnebäck, 2003) as follow:
where and are the magnitude and angle obtained from the frames and via the polarization function and the Gunnar Farnebäck’s algorithm , and is a threshold for the center and angular directions of self-supervised labels .
In this section, we demonstrate the effectiveness of the proposed temporal self-supervision, TIME. Specifically, we incorporate TIME with the state-of-the-art Video Transformers (Bertasius et al., 2021; Patrick et al., 2021; Bulat et al., 2021) and evaluate their temporal modeling ability on Something-Something-v2 (SSv2) (Goyal et al., 2017), which contains a large proportion of temporal classes than other video dataset like Kinetics-400 (Kay et al., 2017). We also use temporal and static classes in the SSv2 dataset, stated by Sevilla-Lara et al. (2021), for validating the importance of temporal information; temporal classes necessarily require temporal information for action recognition. More details of experimental setups are described in each section.
Video Datasets. We use SSv2 (Goyal et al., 2017) datasets and its temporal and static classes following the categorization of Sevilla-Lara et al. (2021) to evaluate whether video models understand the temporal dynamics well. Notably, SSv2 is a challenging dataset that consists of 169k training videos and 25k validation videos over 174 classes; in particular, it contains a large proportion of temporal classes requiring temporal information to be recognized (Sevilla-Lara et al., 2021). To investigate behaviors of video models on relatively different importance of temporal information, we further construct “Temporal subset” and “Static subset” as the benchmarks by choosing 6 temporal classes and 16 static classes from the above temporal and static classes, respectively. We report the specific labels of the Temporal and Static subsets in Appendix A, respectively.
Meanwhile, Kinetics dataset (Kay et al., 2017) (e.g., Kinetics-400) is a large-scale video dataset, which consists of 240k training videos and 20k validation videos in 400 human action categories. However, it arguably contains fewer temporal classes and is comprised of a large amount of static classes (Li and Vasconcelos, 2019; Huang et al., 2018; Sevilla-Lara et al., 2021; Fan et al., 2021); For example, Fan et al. (2021) reports that changing temporal order of kinetic videos does not drop the recognition performance, and we also found similar observations on a 10% subset of Kinetics 400; Figure 3 shows that the state-of-the-art Video Transformers (Bertasius et al., 2021; Patrick et al., 2021) have almost the same accuracy even their input video frames are randomly shuffled, unlike SSv2 in Figure 1(a). To this end, we solely use SSv2 as the main benchmark in a perspective view of validating the importance of temporal modeling.
Baselines. We consider recent Video Transformers as baselines: TimeSformer (Bertasius et al., 2021) with divided space and time attentions, Motionformer (Patrick et al., 2021) with trajectory attention, and X-ViT (Bulat et al., 2021) with space-time mixing attention. All Video Transformers in our experiments are based on ViT-B/16 (Dosovitskiy et al., 2021) (86M parameters), which consists of 12 transformer blocks with 768 embedding dimension. We denote our method built upon an existing method by “+ TIME”, e.g., TimeSformer + TIME. For Figure 1(a) and 1(b) and Table 1 in Section 3, we use publicly available pre-trained models and validate their ability of temporal modeling. We remark that Figure 1(a) shows the importance of temporal order information in the temporal classes, but such information vanishes as the model layers deeper as shown in Figure 1(b).
|Dataset||Baseline||Baseline +||Baseline +||Baseline +|
|Original||77.3||82.0 (4.7)||79.0 (1.7)||83.3 (6.0)|
|Only-FG||50.3||54.2 (3.9)||52.7 (2.4)||58.9 (8.6)|
|Mixed-Same||68.6||72.5 (3.9)||69.7 (1.1)||74.0 (5.4)|
|Mixed-Rand||43.7||48.4 (4.7)||45.1 (1.4)||51.0 (7.3)|
|Mixed-Next||39.9||43.6 (3.7)||40.6 (0.7)||46.4 (6.5)|
|BG-Gap||24.8||24.1 (0.7)||24.6 (0.2)||23.0 (1.8)|
, and we train all models with 300 training epochs on ImageNet-9(Xiao et al., 2021) and evaluate them for background shifts (Xiao et al., 2021). Original denotes original ImageNet-9 dataset, Only-FG, Mixed-Same, Mixed-Rand and Mixed-Next denote variation of ImageNet-9 by shifting image background; Only-FG remains only foregrounds and removing backgrounds, Mixed-Same, -Rand and -Next changes backgrounds to random backgrounds from the same, a random, and the next class, respectively. BG-Gap denotes the difference between Mixed-Same and Mixed-Rand. Values in parenthesis are the performance difference between Baseline and Baseline incorporated with each loss term.
Implementation details. In our experiments, we unify different training details of the recent Video Transformers (Bertasius et al., 2021; Patrick et al., 2021; Bulat et al., 2021), and re-implement all the baselines on our setups for a fair comparison.555Code is available at https://github.com/alinlab/temporal-selfsupervision. Specifically, we fine-tune all the models from ImageNet (Deng et al., 2009) pre-trained weights of ViT-B/16 (Dosovitskiy et al., 2021) for 35 training epochs with Adamw optimizer (Loshchilov and Hutter, 2018) and learning rate of 0.0001 and a batch size of 64. For data augmentation, we follow RandAugment (Cubuk et al., 2020) policy of Patrick et al. (2021). We use the spatial resolution of with patch size of , and eight frame input videos under the same 1 × 16 × 16 tokenization method, including Motionformer. We set all the loss weights to be 1 (i.e., ) unless stated otherwise.
In this section, we evaluate our method on the SSv2 benchmark using eight frame input videos by incorporating with the state-of-the-art Video Transformers; TimeSformer (Bertasius et al., 2021), Motionformer (Patrick et al., 2021), and X-ViT (Bulat et al., 2021). Under the same training details; e.g., optimizer, training scheduling, augmentation policy and tokenization, as shown in Table 2, we found that our method, TIME, consistently improves all the backbone architectures with a large margin. For example, TimeSformer + TIME and X-ViT + TIME achieve 1.6% and 3.4% higher top-1 accuracies compared to their baselines TimeSformer (62.1%) and X-ViT (60.1%), respectively. These results not only show the effectiveness of TIME but also demonstrate the high architectural compatibility of TIME and allow us to conjecture that ours can overcome failure modes in the Video Transformers. One can further verify the advantage of our scheme from the provided qualitative examples in Figure 4. Here, with better temporal modeling from the proposed self-supervised tasks, the model can capture the temporal dynamics in a better way. More examples and details are in Appendix B.
In this section, we perform an ablation study to understand further how TIME works. Specifically, we perform TimeSformer + TIME using eight frame input videos varying loss components (in Eq. (14)) to demonstrate their effectiveness; (a) learning temporal order of frames , (b) debiasing spatial dynamics , and (c) learning temporal flow direction of tokens . To further validate the importance of temporal information in various experimental setups, we train video models with the same training details on the full SSv2 dataset, the Temporal and Static subsets (see Appendix A for their configurations). We report the test accuracies of both original and shuffled videos and their gap as a measurement of avoiding the spatial bias.
Table 3 summarizes the results: our loss components have an orthogonal contribution to the overall improvements in the model generalization (i.e., Original), and TimeSformer + TIME (i.e., using all components , , and ) consistently improves the performances of Original and Gap on all benchmarks. For example, our method in the last row achieves the best score, which are 1.6%, 5.3%, and 2.8% higher Original accuracies on the SSv2, the Temporal and Static subsets, respectively. TimeSformer + TIME also largely surpasses TimeSformer in the metric of Gap by achieving 17.6, 40.2, and 17.6 improvements on the SSv2, the Temporal and Static subsets, respectively.
In addition, Table 3 shows that our loss components contribute more significantly when the dataset requires more temporal understanding (e.g., the Temporal subset). For example, our method in the last row achieves more significant improvements in the metrics of Original and Gap on the Temporal subset compared to the scores on the SSv2 dataset and Static subset. Interestingly, except for the last row, the performances of Shuffled on the Static subset are often close to the Original ones. It arguably results from the static classes that allow video models to predict class labels without understanding temporal information, while our scheme of debiasing spurious correlation (i.e., and ) and enhancing temporal correlation (i.e., ) can lead video models to alleviate spatial bias and learn effective temporal modeling. We believe that an elaborate design for utilizing such property might further improve the video understanding, and we leave it for future work.
In this section, we demonstrate an extension of our self-supervised idea of debiasing to image classification models, e.g., Vision Transformers (Dosovitskiy et al., 2021; Touvron et al., 2020), to reduce the spurious correlation learned from the image backgrounds. For adaptation, our goal is to replace (a) learning temporal order of frames with spatial order of patches and (b) debiasing spatial dynamics with image backgrounds. For brevity, we again use to denote the encoder of Vision Transformers parameterized by where and are the final representations of the token and the -th patch image, respectively. Then, (a) learning spatial order of patches can be written as follow:
where is an linear classification head. On the other hand, (b) debiasing image backgounds objective also can be written as follow:
where is an linear classification head, and is a sequence of randomly shuffled patches to reduce the effect of backgrounds. Then, adapted loss objectives for image classification models can be written as follows:
where and are hyperparameters. In Table 4, we also simply use .
Somewhat surprisingly, we found that adapted TIME loss (18) enhances the model generalization and robustness to background shifts when evaluated on Backgrounds Challenge666https://github.com/MadryLab/backgrounds_challenge as shown in Table 4. Specifically, we train DeiT-Ti/16 (Touvron et al., 2020) with 300 training epochs on ImageNet-9 (Xiao et al., 2021) dataset, which contains 9 super-classes (370 classes in total) of ImageNet (Deng et al., 2009) for both background shifts experiments (Xiao et al., 2021). For example, Only-FG replaces backgrounds with the black, and Mixed-Same, Mixed-Rand, and Mixed-Next replace backgrounds with random backgrounds from the same, a random, and the next class, respectively, for disentangling foregrounds and backgrounds of the images.
Table 4 summarizes the results on the background shifts: our method consistently and significantly improves Baseline on overall benchmarks; e.g., Baseline + not only improves the top-1 accuracy of Baseline from 77.26% to 83.26% on the original dataset but also from 50.27% to 58.91% on the Only-FG benchmark in the background shifts. Also, Table 4 shows that and have an orthogonal contribution to the overall improvements for alleviating background bias. For example, improves Baseline from 50.27% to 54.15%, and improves it again from 54.15% to 58.91% on the Only-FG benchmark. Furthermore, comparing performance gains from each loss component and the combined one, it is worth noting that we confirm the remarkable synergy of spatial order prediction and background debiasing for robust image recognition in most benchmarks. This superiority of our method on background shifts shows its merits come from a widely applicable self-supervised idea for the vision domain.
We propose simple yet effective temporal self-supervision tasks (TIME) for improving video representations by capturing temporal dynamics of video data. Our key observation is that the existing Video Transformers do ineffective temporal modeling; e.g., learning spurious correlation on spatial dynamics and vanishing temporal order information as the model layers deeper. In order to learn effective temporal modeling, we train the model to output low-confident predictions for temporally violated video data (e.g., randomly shuffled video), and to predict both the correct temporal order of video frames and the temporal flow direction of video tokens. Through the extensive experiments, we highlight the importance of debiasing the spurious correlation of visual transformers with respect to the temporal or spatial dynamics. We believe that our work would provide insights toward the under-explored yet important problem.
We thank Seong Hyeon Park for providing helpful feedback and suggestions. This work was mainly supported by Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No.2021-0-02068, Artificial Intelligence Innovation Hub; No.2019-0-00075, Artificial Intelligence Graduate School Program (KAIST)). This work was partly experimented on the NAVER Smart Machine Learning (NSML) platform (Sung et al., 2017; Kim et al., 2018). This work was partly supported by KAIST-NAVER Hypercreative AI Center.
proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Cited by: §2.
Two-frame motion estimation based on polynomial expansion. In Scandinavian conference on Image analysis, pp. 363–370. Cited by: §1, §4.
Contrast and order representations for video self-supervised learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 7939–7949. Cited by: §2.
Shuffle and learn: unsupervised learning using temporal order verification. In International Conference on Computer Vision (ICCV), Cited by: §2, §3.2.
Video transformer network. arXiv preprint arXiv:2102.00719. Cited by: §2.
Temporal classes. “Turning something upside down”, “Approaching something with your camera”, “Moving something away from the camera”, “Moving away from something with your camera”, “Moving something towards the camera”, “Lifting something with something on it”, “Moving something away from something”, “Moving something closer to something”, “Uncovering something”, “Pretending to turn something upside down”, “Covering something with something”, “Lifting up one end of something, then letting it drop down”, “Lifting something up completely without letting it drop down”, “Moving something and something closer to each other”, “Moving something and something away from each other”, “Lifting something up completely, then letting it drop down”, “Stuffing something into something”, “Moving something and something so they collide with each other”.
Specifically, we use 6 temporal classes of “Lifting something up completely without letting it drop down”, “Lifting something up completely, then letting it drop down”, “Lifting up one end of something, then letting it drop down”, “Moving something and something closer to each other”, “Moving something and something away from each other”, and “Moving something and something so they collide with each other” classes as the Temporal subset.
Static classes. “Folding something”, “Turning the camera upwards while filming something”, “Holding something next to something, Pouring something into something”, “Pretending to throw something”, “Squeezing something”, “Holding something in front of something”, “Touching (without moving) part of something”, “Lifting up one end of something without letting it drop down”, “Showing something next to something”, “Poking something so that it falls over”, “Wiping something off of something”, “Scooping something up with something”, “Letting something roll down a slanted surface”, “Sprinkling something onto something”, “Pushing something so it spins”, “Twisting (wringing) something wet until water comes out”. We use all the above 16 static classes as the Static subset.
In this section, we present details of qualitative results in Figure 4, and then provide more examples in Figure 5. To apply GradCAM (Selvaraju et al., 2017), which was originally developed based on CNNs, we use its adaptation for Vision Transformers provided by the original authors.777https://github.com/jacobgil/pytorch-grad-cam As the code is originally proposed for image data, we slightly modify it for video data by considering one more dimension for the temporal dimension (i.e., frames). Here, one can again identify that our method successfully improves the existing Video Transformers with the proposed temporal self-supervised tasks; e.g., focusing on the movements of objects (see Figure 5(a) and 5(b)) or the turning object (see Figure 5(c)).
As many recent Video Transformers depend on pre-trained weights from a large-scale image dataset (e.g., ImageNet (Deng et al., 2009)) for better performances, the pre-trained weights could be one of the reasons for spatial bias in the video models. However, even without the pre-trained weights, we empirically found that our method, TIME, still significantly improves TimeSformer from 39.4% to 64.4% in training from scratch on the Temporal subset using eight frame input videos. Again, we remark that static classes in the video datasets can also make video models biased toward learning spatial dynamics. Still, our method can lead them to alleviate spatial bias and learn temporal modeling better.
Here, we explore an alternative for keeping temporal information in Video Transformers. Specifically, we modify TimeSformer (Bertasius et al., 2021) to repeatedly re-add their temporal positional encodings before each block to maintain the temporal order of video frames and then train them on the Temporal subset. Interestingly, we observed that the re-adding one still loses temporal information at the final layer (27.8%), as shown in Figure 1(b). Furthermore, we found that learning temporal order (7) could improve the re-adding one from 88.2% to 90.0% on the Temporal subset using 16 frame input videos.888We note the baseline (i.e., the original TimeSformer) and the re-adding one + TIME achieve 87.2% and 90.5%, respectively. These results show that architectural modifications for solely guiding temporal information may be limited; however, investigating architectural advances to keep temporal information would be a meaningful future direction.