SFMViT: SlowFast Meet ViT in Chaotic World
Jiaying Lin Jiajun Wen Mengyuan Liu Jinfu Liu Baiqiao Yin Yue Li




𝐱
ŁL









Jiaying Lin^*^12, Jiajun Wen^*^12, Mengyuan Liu^†^1,Jinfu Liu^2, Baiqiao Yin^2, Yue Li^2




^1National Key Laboratory of General Artificial Intelligence, Peking University, Shenzhen Graduate School

^2School of Intelligent Systems Engineering, Sun Yat-sen University 

^* means co-first authors with equal contributions. 

The corresponding author is Mengyuan Liu (e-mail: liumengyuan@pku.edu.cn). 



SFMViT : SlowFast Meet ViT in Chaotic World
    [
    April 29, 2024
===========================================






The task of spatiotemporal action localization in chaotic scenes is a challenging task toward advanced video understanding. Paving the way with high-quality video feature extraction and enhancing the precision of detector-predicted anchors can effectively improve model performance. To this end, we propose a high-performance dual-stream spatiotemporal feature extraction network SFMViT with an anchor pruning strategy. The backbone of our SFMViT is composed of ViT and SlowFast with prior knowledge of spatiotemporal action localization, which fully utilizes ViT's excellent global feature extraction capabilities and SlowFast's spatiotemporal sequence modeling capabilities. Secondly, we introduce the confidence maximum heap to prune the anchors detected in each frame of the picture to filter out the effective anchors. These designs enable our SFMViT to achieve a mAP of 26.62% in the Chaotic World dataset, far exceeding existing models.

Code is available at https://github.com/jfightyr/SlowFast-Meet-ViT.



spatiotemporal action localization, chaotic scenes, dual-stream network, ViT, anchor pruning




§ INTRODUCTION

Spatiotemporal action localization, which involves localizing persons and recognizing their actions from videos, is an important task that has gained attention in recent years <cit.>. Spatiotemporal feature modeling refers to learning the temporal and spatial characteristics present in videos as the most fundamental and critical part of action recognition tasks<cit.>. However, the subpar quality of feature extraction by current methods hampers the advancement of this field, leaving room for improvement in model performance.




The Chaotic World <cit.>, a newly proposed dataset <cit.> in this task, presents more complex and chaotic scenes compared to previous datasets, thus imposing greater demands on comprehending intricate scenes and interactions among individuals. It's not uncommon to encounter difficulties when applying traditional video feature extraction modules such as I3D <cit.> or SlowFast <cit.> directly to datasets like Chaotic World. 

The complexity and chaotic nature of scenes in the Chaotic World dataset may necessitate more advanced or customized approaches for feature extraction and modeling to attain satisfactory results.

On the one hand, VideoMAEv2 <cit.> has achieved state-of-the-art performance across multiple downstream tasks by employing a straightforward yet effective video self-supervised pretraining paradigm. It is reasonable to expect that robust video feature extraction networks pre-trained on large-scale video datasets will perform effectively.

SlowFast <cit.>, a standard backbone network in the Video Recognition field, excels at capturing action features with strong temporal correlations, but it may be sensitive to disruptions in complex environments, resulting in reduced robustness across different scenes. Conversely, Vision Transformer <cit.>, trained on extensive video data, demonstrates robustness in spatiotemporal feature modeling, capable of capturing diverse spatiotemporal features in complex scenes. 

Considering the strengths of both models, we introduce the dual-stream SFMViT video spatiotemporal modeling network. This network utilizes the advantages of SlowFast and ViT to enhance the robustness and effectiveness of spatiotemporal feature modeling in video recognition tasks.





In addition, the action detection of the Chaotic World dataset needs to focus on the action recognition of specific people, so effective actor detection is also very critical. To this end, we designed a Confidence Pruning Strategy to avoid redundant actor extracted by Yolo, thereby ensuring that ACAR <cit.> works better and improving the generalization and accuracy of the SFMViT model.

We conduct extensive experiments on the challenging Chaotic World dataset for spatiotemporal action localization. Our proposed SFMViT leads to significant improvements in localizing spacial-temporal actions. Our contributions are summarized as three-fold:




  * We have introduced the dual-stream spatiotemporal feature modeling network SFMViT, which integrates SlowFast's ability to capture temporal features with Vision Transformer's capability in complex scene spatiotemporal modeling. This fusion enhances overall spatiotemporal modeling capabilities in complex scenes.



  * We introduce a Confidence Pruning Strategy to find the most suitable upper anchor counts of the instances, which can be used to prune and filter out the optimal anchors while taking into account the efficiency and performance, increasing the mAP by nearly 2%.



  * We achieve SOTA performances with significant margins on the Chaotic World datasets. At the time of submission, our method ranks first on the 2024 MMVRAC leaderboard. 






§ RELATED WORK




 §.§ Spatiotemporal Action Localization



The spatiotemporal action localization problem is typically composed of a detector for participant localization on keyframes and a 3D backbone for video feature extraction. Currently, it can be mainly classified into two types based on whether the detector is embedded within the backbone model. One approach implements localization and feature classification as two independent backbones in a two-stage pipeline, while the other employs a unified backbone for spatiotemporal localization and feature classification. Unified backbone models often face challenges such as high complexity, difficulty in optimization, and high training costs <cit.>. Therefore, the most advanced methods currently <cit.> tend to adopt a two-stage pipeline model.
In our model, considering that unified backbone models incur higher training costs compared to two-stage pipeline models for achieving the same performance, we select the two-stage pipeline model as the baseline.





 §.§ Video Foundation Models



Video Foundation Models (ViFMs) have emerged as a pivotal area of research in artificial intelligence <cit.>, with a focus on constructing models capable of comprehending and generating video content through extensive learning from video data. These models have exhibited remarkable performance across various downstream tasks, including action recognition, video-text retrieval, video question answering, and video generation.

InternVideo2 <cit.> represents a recent advancement achieved through progressive training paradigms, demonstrating optimal performance in action recognition, video-text tasks, and video-centric dialogues. Its integration of diverse self-supervised learning frameworks highlights the potential for enhancing the performance of video foundation models. VideoMAEv2 <cit.> has trained a more generalized video foundation model capable of adapting to various downstream tasks by scaling and diversifying pre-training video data. 
These models and methods play a crucial role in advancing video foundation model research and applications, greatly enhancing the model's performance in capturing video features.







§ METHOD





 §.§ Overall  Architecture



We first introduce our overall framework for action localization, where the proposed dual-stream spatiotemporal feature modeling network SVMViT is the key module as the backbone part. The framework is designed to detect all individuals in an input video clip and estimate their action labels. It is constructed using a pre-existing person detector (e.g. YOLOv9 <cit.> ) and a video backbone network (e.g. I3D <cit.> ). The features of individuals and their surroundings are subsequently analyzed by the established ACAR module <cit.> , which incorporates a long-term Actor-Context Feature Bank for the final action prediction.

In detail, the person detector operates on the key frame of the input clip and obtains N detected actors. The detection boxes obtained from the person detector will be further used as annotations for our backbone network, guiding our final action classification of individuals. Simultaneously, our proposed visual feature extraction model SFMViT will extract global spatiotemporal features from input video clips. These feature maps will undergo average pooling along the temporal dimension to reduce computational costs, resulting in feature maps like X ∈ℝ^C × H × W, and C, H, W are channel, height and width respectively. Guided by annotations, these feature maps will further produce a series of N actor features, each containing spatiotemporal context features. Subsequently, these actor features will be fed into the ACAR module for higher-order relationship reasoning, culminating in the classification of the inferred features.





 §.§ SFMViT Module



SFMViT. Leveraging the inherent advantages of the aforementioned architectures, we have adopted the ViT model as our video feature extractor. Additionally, we have incorporated SlowFast as an auxiliary network with domain knowledge in Video Recognition. This integration has led to the development of our proposed SFMViT model architecture. More specifically, we obtain the fused features of the SlowFast and ViT models as:

    f^SFMViT_x,y = [ f^V_x,y, f^S_x,y, f^F_x,y ]

x,y represent the spatial location (x, y). [·,·,·] denotes concatenation along the channel dimension. f^S and f^F refer to feature maps obtained from Slow pathway and Fast pathway respectively and both of them have already undergone average pooling along the temporal dimension. Especially, f^V obtained from the ViT model needs to undergo 3D convolution first to achieve the same spatial dimensions as f^S and then undergo temporal average pooling. Finally, we can get a fused feature map like f^SFMViT_x,y∈ℝ^C × H × W, where C equals the sum of the channel numbers of the three original feature maps.


Vision Transformer. ViT employs a global attention mechanism by transforming videos into patches across spatial and temporal dimensions. Combined with the Transformer architecture, it can effectively captures the overall information available in videos. 
We select the pretrained ViT models on extensive datasets such as Kinetics700 <cit.> and AVA <cit.> to form a robust foundation for transfer learning across diverse downstream tasks.


SlowFast Pathways. The SlowFast feature extraction branch can capture strongly correlated temporal action signals and assist in extracting domain-specific features in our model. We follow the basic instantiation of SlowFast 8×8, R50 as stage res_5 defined in <cit.>.

For the Fast pathway, it has a lower channel capacity, such that it can better capture motion while trading off model capacity. Spatial downsampling is performed with stride 2^2  convolution in the center filter of the first residual block in each stage of both the Slow and Fast pathways.



 §.§ Confidence Pruning Strategy



It needs to be clarified that mAP is the mean average precision of each action category:

    mAP = 1/N∑_i=1^N AP(a_i)


N represents the total number of action categories

; a_i represents the i-th action class; and AP() denotes the average precision for a particular class:



    AP = 1/M∑_k=1^k Precision(k)





M denotes the number of positive samples in the test set, and Precision(s) denotes the precision for the top k test samples.

Because the task of spatiotemporal action localization focuses solely on the actions of key individuals, the detector, if left unprocessed, tends to generate a significant number of unnecessary anchors, leading to resource wastage. Previous methods typically involve extensive training of the detector on the target dataset, which requires substantial resources, takes a long time, and exhibits poor transferability. To address this problem, SFMViT adopts a strategy to store the predicted anchors of each {img_id, time} pair in the maximum heap based on the confidence score, and set the maximum number of nodes as the capacity, so that keep the top capacity anchors with the highest confidence.

It is worth noting that setting the capacity too high or too low can lead to performance degradation and resource wastage, as we will demonstrate in Section <ref>. Furthermore, the optimal capacity value exhibits randomness across different datasets and models, making it inappropriate to fix a single capacity value, as done in prior approaches <cit.>. 

Our SFMViT employs a multi-threaded iterative approach 
(Algorithm <ref>)
, which empirically sets the range for capacity enumeration (abbreviated as capacity_range) and quickly identifies the optimal capacity within this range. This approach prunes the predicted results to retain favorable anchors for the model, thereby capturing the optimal mAP value. Our strategy significantly improves model performance in a short time, aligning with the requirement for fast results in competitive scenarios.










§ EXPERIMENTS

 




 §.§ Dataset



We evaluate our model on the Chaotic World dataset <cit.>, a chaotic scene dataset containing multi-task annotations, with 299,923 annotated instances for spatiotemporal action localization, with 50 action categories, and with time ranges from 5 to 200 seconds per action (10 seconds on average). Officially, the data labels are divided into training sets and test sets according to AVA <cit.> format, and we experimented according to officially provided training and test sets.




 §.§ Experimental Setup
 



Person Detector. We used Yolov8 as our base object detector, which is pre-trained on AVA <cit.> and WiderPerson <cit.>, then we fine-tuned it on our Chaotic World dataset. Due to different training strategies and varying confidence threshold settings, there was a significant impact on the results. Therefore, besides testing on the detector, we also conducted ablation experiments using Ground Truth anchors as the result of the first-stage object detection.

Backbone Network. We will use SFMViT proposed above as our video feature extractor. Specifically, we freeze the ViT model branch and set the SlowFast model branch to a trainable state.

Training and inference. All experiments were conducted 

on 4 * GeForce RTX 3090 GPUs. For the Chaotic World dataset, all given segments were cropped to the central 32 frames. Our model sets the capacity enumeration range to [50, 2200] and utilizes the stochastic gradient descent (SGD) optimizer for training, with Nesterov momentum of 0.9 and weight decay of 10^-7. We employed cross-entropy as the loss function. The training epochs and learning rate were set to 90 and 0.01, respectively, with a batch size of 3 per GPU for each training epoch.





 §.§ Comparison with the state-of-the-art methods



We compared our SFMViT with state-of-the-art methods on the Chaotic World dataset, and SFMViT outperformed all previous models, as shown in Table <ref>. Currently, the best-performing model on the Chaotic World dataset is IntelliCare proposed in its paper, which is a multi-task model that leverages information exchange between tasks to aid performance. Our model achieves a performance improvement of 10.37% over IntelliCare in the task of spatiotemporal action localization, even without additional information.







 §.§ Ablation Studies









We performed an in-depth ablation study to investigate the effectiveness of our design in SFMViT. All results are reported on the Chaotic World dataset. Table <ref> shows the frame-mAP comparisons under different ablation settings. Here, “cap" stands for capacity, and the ablation study regarding capacity is conducted with SFMViT as the baseline.












Backbone Comparison. As shown in Table <ref>, under the condition of capacity=50, SFMViT's mAP is significantly higher than that of single-stream backbone models. This illustrates that our dual-stream backbone complements each other, and the absence of either stream would result in a significant decrease in mAP. In Fig.<ref>, we show a comparison of the action APs of the dual-stream backbone and each stream backbone (SlowFast-ResNet50 and ViT-Giant) in the Chaotic World dataset. Hereafter, we refer to the model with SlowFast-ResNet50 as the backbone as SlowFast*, and the model with ViT-Giant as the backbone as ViT*. 


SFMViT outperforms single-stream backbone models in most action categories and even surpasses all action APs of SlowFast*. This is because the dual-stream backbone combines the powerful global feature extraction capability of ViT with the excellent spatiotemporal modeling capability of SlowFast, a conclusion confirmed in <cit.>.


However, compared to ViT*, SFMViT exhibits a slight decrease in AP for five action categories such as “throwing object" and “walking". This is primarily because SlowFast performs poorly in these categories, leading to a decline in the performance of the fusion model. The reasons can be summarized as follows: 1. These actions are not time-sensitive. Taking the “throwing object" action as an example, the key recognition features mainly focus on the movement of the arm from backward swing to forward throwing, where the speed or accuracy at specific time points is not critical, but rather the trajectory and posture of the arm. 2. SlowFast exhibits a strong bias in action judgment, resulting in a high misclassification rate. SlowFast* has a high misclassification rate for “walking", often confusing it with categories such as “holding signage" that have more training data instances or high temporal similarity. Although the introduction of SlowFast may cause some action APs to decrease slightly, due to SlowFast's advantages in spatiotemporal modeling and prior knowledge of spatiotemporal action localization, it can assist ViT and improve model expression capabilities in a short time.




Comparison of backbone combination methods. Not all advanced video feature extraction models or multi-stream model combinations can achieve the effectiveness of SFMViT. We compared various advanced video backbones such as Hiera and ViT as single-stream backbones and further explored combinations of these backbones into dual-stream or triple-stream configurations. To minimize the bias introduced by detectors on different models and datasets, we replaced detector annotations with ground truth, and conducted comparisons between SFMViT and other methods on a unified baseline, as shown in Table <ref>. The mAP of SFMViT exceeds that of all single-stream and multi-stream backbone models, indicating that the dual-stream configuration of SFMViT is the most appropriate. Additionally, some backbone models (Hiera+ViT, SlowFast+ViT+Hiera) exhibit lower performance after fusion, suggesting that incompatible backbones may interfere with each other, further validating the effectiveness of SFMViT's dual-stream configuration.









Confidence Pruning Strategy: Capacity Comparison. Fig. <ref> shows how the model's mAP changes with capacity, with the size of the envelope reflecting the standard deviation of the mAP change. Capacity is the upper limit of the number of anchors predicted for each {img_id, time} key-value pair. As the capacity increases, mAP first rises and then slowly decreases. SFMViT obtains a maximum mAP value of 26.62% when capacity=1599, and ViT* obtains a maximum mAP value of 18.68% when capacity=157. If the upper limit of the number of anchors is set too small, correctly predicted anchors may be missed, thus affecting performance; if it is set too large, it will affect efficiency and consume memory. In addition, for different data and models, the mAP value is random, so it is not suitable to fix a capacity value to find the best mAP. Therefore, we can find an optimal capacity in a short time through multi-thread iteration, thereby capturing the optimal mAP value.






§ CONCLUSIONS



The Chaotic World dataset contains unique fine-grained complex actions such as destructive behaviors and lifesaving behaviors. In response to this characteristic: 1. SFMViT leverages expert knowledge, pre-trained on large-scale datasets, and fine-tuned on Chaotic World. 2. Its dual-stream backbone combines ViT for global features and SlowFast for spatiotemporal modeling. 3. SFMViT introduces a Confidence Pruning Strategy, which can prune and select the optimal anchors, unleashing the potential of the model.

However, due to time constraints: 1. Our fusion method of the dual-stream backbone is simplistic. 2. Our model's performance relies heavily on the detector. In the future, we will have more time to optimize these shortcomings to fully realize the potential of our model.








§ FOUNDATION



This work was supported by National Natural Science Foundation of China (No. 62203476), Natural Science Foundation of Shenzhen (No. JCYJ20230807120801002).










