Next Article in Journal
Non-Linear Simulation by Harmonic Balance Techniques of Load Modulated Power Amplifier Driven by Random Modulated Signals
Previous Article in Journal
Self-Evaluation of Trajectory Predictors for Autonomous Driving
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

MgMViT: Multi-Granularity and Multi-Scale Vision Transformer for Efficient Action Recognition

Information Engineering College, Henan University of Science and Technology, Luoyang 471000, China
*
Author to whom correspondence should be addressed.
Electronics 2024, 13(5), 948; https://doi.org/10.3390/electronics13050948
Submission received: 30 January 2024 / Revised: 25 February 2024 / Accepted: 26 February 2024 / Published: 29 February 2024

Abstract

:
Nowadays, the field of video-based action recognition is rapidly developing. Although Vision Transformers (ViT) have made great progress in static image processing, they are not yet fully optimized for dynamic video applications. Convolutional Neural Networks (CNN) and related models perform exceptionally well in video action recognition. However, there are still some issues that cannot be ignored, such as high computational costs and large memory consumption. In the face of these issues, current research focuses on finding effective methods to improve model performance and overcome current limits. Therefore, we present a unique Vision Transformer model based on multi-granularity and multi-scale fusion to accomplish efficient action recognition, which is designed for action recognition in videos to effectively reduce computational costs and memory usage. Firstly, we devise a multi-scale, multi-granularity module that integrates with Transformer blocks. Secondly, a hierarchical structure is utilized to manage information at various scales, and we introduce multi-granularity on top of multi-scale, which allows for a selective choice of the number of tokens to enter the next computational step, thereby reducing redundant tokens. Thirdly, a coarse-fine granularity fusion layer is introduced to reduce the sequence length of tokens with lower information content. The above two mechanisms are combined to optimize the allocation of resources in the model, further emphasizing critical information and reducing redundancy, thereby minimizing computational costs. To assess our proposed approach, comprehensive experiments are conducted by using benchmark datasets in the action recognition domain. The experimental results demonstrate that our method has achieved state-of-the-art performance in terms of accuracy and efficiency.

1. Introduction

With the advent of the information age in human society, the rapid progress of the Internet has propelled significant advancements in video technology. Videos have become a fundamental medium for information transmission due to their expressiveness and effectiveness, which have been widely applied in various fields of daily life and business. Video streaming is growing at an exponential rate, and video understanding is one of the most important areas of research in computer vision and is developing quickly as well. Human action recognition has garnered considerable attention due to its high practicality in various applications such as video surveillance and human–computer interaction. Action recognition aims to identify and understand human actions and activities in video sequences. In the complex interplay of computer vision and machine learning, researchers are striving to explore innovative approaches to enhance the accuracy, efficiency, and robustness of action recognition systems.
Action recognition mostly relied on traditional computer vision techniques before the development of deep learning. These traditional methods require manually extracting and expressing important feature regions in videos, and they are represented as dense vectors or sparse sets of interest points. However, this manual extraction approach has obvious drawbacks, one of which is its heavy reliance on human intervention, leading to inefficiency. Moreover, the extracted features have strong subjectivity and lack sufficient robustness. Due to the emergence of deep learning, neural networks can be used to automatically learn feature representations, overcoming the limitations of traditional methods, which not only enhances the performance of action recognition systems but also reduces the need for manual intervention. However, Convolutional Neural Networks (CNNs) still have some limitations and weaknesses as follows. Firstly, they are sensitive to translation invariance and hyperparameters. Secondly, CNNs often require large-scale annotated data for training, particularly when deep learning is involved, demanding significant computational resources. Lastly, when confronted with irregular data, CNNs may yield less satisfactory results. The Transformer [1] is first applied in the field of natural language processing, achieving unprecedented success in tasks such as machine translation. The model mainly consists of self-attention mechanisms, positional encoding, encoder–decoder architecture, feedforward neural networks, layer normalization, and residual connections, which exhibits a robust ability to capture long-range dependencies in sequential data, particularly excelling in tasks involving structured data with sequential or spatial characteristics. Therefore, it was introduced into computer vision, leading to the development of the Vision Transformer (ViT) [2], which has also achieved remarkable results. Unlike traditional CNNs that use convolutional kernels to manipulate local image regions, ViT adopts a patch-wise processing approach, where each patch is linearly embedded to form a sequence. Its performance in diverse tasks has motivated researchers to explore further the Transformer architecture, resulting in the development of different variations and enhancements.
This paper presents a new vision Transformer model named MgMViT, which uses a fusion approach with multi-scale and multi-granularity. The purpose of our method is to reduce the computational cost and number of parameters in the model for identifying human behavior more quickly and effectively. MgMViT begins with multi-scale computations that incorporate multi-granularity calculations within each scale. Following the output, a mixed-granularity layer is introduced to combine coarse-grained and fine-grained information, effectively reducing the complexity of the computation sequence. By incorporating the multi-scale multi-granularity module into the model structure of Transformer blocks, the computational burden of the original module can be effectively reduced. In addition, the introduced mixed-granularity layer possesses a plug-and-play characteristic without introducing additional parameters. The structure of MgMViT is shown in Figure 1. It is one of the most direct and effective methods to shorten the sequence length involved in computation and reduce the number of tokens to improve computational efficiency. The proposed MgMViT model has been evaluated on widely used action recognition datasets such as Kinetics-400 [3] and Something-SomethingV2 [4]. The results indicate that MgMViT is capable of significantly reducing the model runtime and parameter count while maintaining effective performance. Compared with existing models, MgMViT is more efficient in terms of both processing time and parameter quantity.

2. Related Work

With the advent of large annotated datasets, computational resources, and deep learning, action recognition has made significant progress in recent years. Before 2010, early action recognition methods typically rely on manually crafted features and traditional machine learning. These approaches are constrained by the complexity of human behavior and the challenge of designing effective features. Since the rise of deep learning in 2012, especially with the introduction of convolutional neural networks (CNNs), the landscape of action recognition has undergone a radical transformation. AlexNet [5] introduces a novel deep architecture and the dropout method. The two-stream network model [6], which integrates both spatial and temporal information by combining RGB frames and motion flow(optical flow), represents a significant shift from handcrafted feature extraction to machine-learned features. Limin Wang et al. [7,8] introduce Temporal Segment Networks(TSN), which creatively segmented videos into multiple segments and sampled frames within each segment to model the structure of long videos. This has led to significant advancements in action recognition with the help of deep learning. Simultaneously, 3D Convolutional Neural Networks (3D CNNs) [9,10] extend the network from traditional 2D convolutional neural networks (2D CNNs) to three dimensions, allowing action recognition to directly capture spatial and temporal features from video data without requiring additional input streams. This innovation has led to the widespread application of 3D convolutional networks in action recognition. In addition, several large datasets concerning action recognition have emerged, such as Kinetics [3], Something-Something [4], etc., which provide a more extensive and diverse range of data for training and evaluating action recognition research. Additionally, the introduction of benchmark challenges, such as the Activity Networks Challenge, has facilitated the standardization of evaluation metrics and the comparison of performance among different models. In the same period, Non-Local Neural Network [11] and R(1 + 2)D [12] are introduced. The SlowFast network [13] introduces a dual-stream architecture with different frame rates to capture both slow and fast motion information in videos, thereby enhancing the recognition of actions with varying temporal dynamics. Since 2020, there has been a significant advancement in self-supervised learning and models based on pre-text tasks for action recognition. The main focus has been on developing training methods that do not require extensive labeled data. The prevailing approach has been to pre-train models on large datasets and then fine-tune them on smaller, task-specific datasets.
The architecture based on Transformer [1] models is a relatively recent development. Transformer is originally designed for natural language processing and has gained widespread attention due to its capability to capture long-range dependencies and model complex relationships. Subsequently, researchers began to explore the application of the Transformer in the field of computer vision. In 2020, the Vision Transformer (ViT) [2] was presented to initially applied to image classification. The researchers view image sequences as sequences of frames, considering the frame sequence as a temporal dimension beyond the spatial dimensions, to address video data for action recognition tasks. Since the introduction of ViT, it has been widely adopted in the field of action recognition as the backbone structure for action recognition models. The Swin Transformer (Swin) [14,15], which was released in 2021, introduces an adaptive computation strategy. It restricts self-attention computations to non-overlapping local windows by using a mobile window and performs cross-window connections simultaneously. TimeSFormer [16] captures information from a series of frame-level patches by learning spatiotemporal features and employs a standard Transformer architecture to adapt to the processing of video data. ViViT [17] is a purely Transformer-based model, which extracts spatiotemporal tokens from input videos and encodes them through a series of Transformer layers. Transformer-based action recognition models [18,19,20] develop rapidly. However, due to the large size of the Transformer as the backbone network, recent research has shifted focus towards reducing the complexity of attention mechanisms, aiming to make the Transformer more efficient in practical applications. For instance, MViT [21,22] combines multi-scale feature hierarchies with Transformer models, starting from a lower input resolution and smaller channel dimensions. The channel capacity is progressively increased in stages while reducing spatial resolution to lower costs. Meanwhile, some studies such as Video Transformer Network (VTN) [23] and MoViNets [24] have explored ways to enhance the efficiency of Transformer models. These endeavors focus on reducing computational and memory costs while maintaining performance, aiming to better accommodate real-world applications.
Inspired by the efficient model [25,26] and other multi-granularity models [27,28] in various domains, we propose a Vision Transformer model with Multi-Scale and Multi-Granularity Fusion, which can involve embedding a multi-scale and multi-granularity module into the Transformer block to reduce secondary attention computations, enhance efficiency in terms of computational costs and memory requirements, and maintain performance levels.

3. Multi-Granularity and Multi-Scale Vision Transformer

We present a Multi-Scale Multi-Granularity Fusion Transformer model in this paper, which is built upon the concepts of multi-scale and multi-granularity mechanisms. In contrast to the substantial computational load introduced by the traditional attention mechanism, where each frame’s query attends to all key-value pairs, the introduction of multi-scale and multi-granularity helps reduce the computational complexity of the model. The combination of multiple granularities and scales achieves savings in computational costs in terms of both sequence length and sampling.

3.1. The Base Model

The Transformer model represents a novel architectural paradigm. One of its most crucial innovations is the self-attention mechanism, allowing the model to simultaneously consider contextual information across the input sequence. This marks a significant departure from earlier models that sequentially processed input sequences. In the field of computer vision, the application of attention mechanisms is primarily employed to explore the relationships between different blocks. When we aim to identify specific objects, these mechanisms enable the model to discern which blocks are relevant to the identified object and which ones are irrelevant. Consequently, the model learns to focus on key information, enhancing its ability to recognize and process pertinent features. The computation of attention primarily involves three vectors: query, key, and value. The entire calculation process maps a query and a set of key-value pairs to an output, which is the weighted sum of values. The weights are determined by the relevance between the query and the current key, which is defined as Equation (1).
A t t e n t i o n ( Q , K , V ) = softmax ( Q K T C ) V .
where Q R N q × C , K R N k × C , V R N ν × C serves as input, C is introduced to address concerns related to weight concentration and gradient vanishing.
With the emergence of attention mechanisms, researchers have further enhanced the performance of self-attention layers by introducing multi-head self-attention. Different attention heads correspond to distinct representation subspaces, achieved by splitting the output into multiple heads along the channel dimension. This allows the model to focus on different aspects of information, such as the following Equations
Q i = X W i Q , K i = X W i K , V i = X W i V , i = 1 , , 8
h e a d i = A t t e n t i o n ( Q i , K i , V i ) , i = 1 , , 8
M u l t i H e a d ( Q , K , V ) = C o n c a c t ( h e a d 1 , , h e a d 8 ) W o
where h e a d i R n × C h represents the output of the i-th attention head, W o R C × C is the result of dot-multiplication of the weight matrix with the 8-header merge.

3.2. Multi-Scale and Multi-Granularity Fusion

Currently, the Transformer models used for action recognition rely heavily on direct attention computation, which can become quite computationally demanding, particularly as the number of tokens increases. To address this challenge, we develop a new multi-scale and multi-granularity fused Vision Transformer, which utilizes multi-scale processing to shorten the sequence length required for self-attention computation, and leverages multi-granularity modules to sample only the most useful tokens for future calculations. Additionally, mixed-granularity layers are incorporated to reduce the length of token sequences that contain less informative content. We propose a scale-granularity fusion module, which can effectively reduce computational costs by decreasing the length and quantity involved in quadratic attention computations. This module initially performs multi-scale computation, followed by further multi-granularity computation based on the multi-scale foundation. Multi-scale computation is achieved through pooled multi-head attention mechanisms, aiding in the reduction of the sequence length of output tokens. Subsequently, multi-granularity computation further diminishes the number of samples collected. The structure of the multi-scale and multi-granularity module is shown in Figure 2. This section will provide a detailed overview of our model.
We first introduce the multi-scale module. The mechanism of multi-scale is described as follows. Starting with the resolution of the inputs and smaller channel sizes, the channel capacity is expanded hierarchically while reducing the spatial resolution. Regarding the reduction of spatial resolution, since the Transformer operates based on patches, video signals are transformed into one-dimensional signals ( L , D ) after being processed through patches.
S Q = ( L Q , D ) , S K = ( L K , D ) , S V = ( L V , D )
S ( Q K T ) = ( L Q , D ) × ( D , L K ) = ( L Q , L K ) , S ( Q K T × V ) = ( L Q , L K ) × ( L V , D ) = ( L Q , D )
where L = T × H × W . Therefore, to reduce spatial resolution, it is necessary to modify the sequence length of the query. The attention layer has a total of N + 1 input tokens. During the attention computation, Q, K, and V are involved in pooling. Specifically, for a D-dimensional input X with a sequence length of L, the head-pooled attention mechanism projects the input X onto Q, K, and V, which are necessary for calculating attention.
Q ^ = X W Q K ^ = X W K V ^ = X W V
The pooling operations are applied by using the intermediate tensor and the pooling operator P ( · ; Θ ) , in which pooling operations involve the pooling operator performing calculations along each dimension of the input tensor. Here, · Θ : = ( k , s , p ) , k T × k H × k w represents the pooling kernel dimension, s T × s H × s w denotes the stride dimension, and p T × p H × p w represents the padding dimension. To reduce the length of the input tensor, the specific formula is:
L ˜ = L + 2 p k s + 1
The input tensor is shortened to L ˜ = T ˜ × H ˜ × W ˜ , and the output tensor obtained after the pooling operation shrinks overall to S T S H S W .
After the pooling operation, the attention vectors become Q = p ( Q ˜ ; Θ Q ) , K = p ( K ˜ ; Θ K ) and V = p ( V ˜ ; Θ V ) . To compute the attention matrix on these vectors that have been shortened in sequence length, after pooling the computed, the query becomes Q ˜ R L ˜ × d , the key becomes K ˜ R L ˜ × d and the value becomes V ˜ R L ˜ × d . The relative positions are also added into the pooled self-attention computation, which depends on the relative positional distance between the tokens of the attention matrix calculation formula, which now becomes:
A = Softmax ( ( p ( Q ; Θ Q ) p ( K ; Θ K ) T + E ( r e l ) ) / d ) w h e r e E i j ( r e l ) = Q i · R p ( i ) , p ( j )
where R p ( i ) , p ( j ) is the positional embedding encoded in the relative position between i, j, p(i), p(j) is the spatio-temporal location of i, j. The formula is given as follows:
R p ( i ) , p ( j ) = R h ( i ) , h ( j ) h + R w ( i ) , w ( j ) w + R t ( i ) , t ( j ) t
The resolution of the channel gradually increases, i.e., increases the dimensionality by pooling, and simultaneously decreases the spatio-temporal resolution i.e., decreases the sequence length. For increasing the number of channels, it is necessary to map the vector dimension D through a fully connected layer, and there is a transition operation between the two phases, specifically, up-sampling the channel dimension, i.e., upscaling the dimension of the final MLP layer by a factor of two in the previous phase to perform only the operation of increasing the number of channels, which is then inputted into the next phase of the computation. Due to the larger stride in K and V compared to Q, and Q undergoes downsampling only during stage changes, an additional residual connection is added to the attention block to enhance information flow and facilitate training and convergence. Specifically, the pooled query Q is added to the output sequence, and the formula for attention becomes:
O = A p ( V ; Θ V ) + p ( Q ; Θ Q )
Sequence lengths and channel dimensions have changed, so residual joins need to avoid mismatches in dimensions at both ends. To handle this mismatch, we cannot add input X directly to the output. On the contrary, we need to pool the input X in the same way as for query Q.
For multi-granularity, we divide coarse-grained and fine-grained sampling into two parts. The first part is added to the multi-scale module to operate on the attention matrix, and the second aspect is the attention computation followed by the operation on the output tokens. Multi-granularity computation consists of two aspects: token scoring strategies and combined coarse and fine granularity computation.
(1) Significance Score
The key step in the multi-granularity module is to compute the significance score of the input token, which is the basis for performing the next step of coarse- and fine-granularity differentiation computation. The computation of the significance score relies on the self-attention matrix. Specifically, since the attention matrix of each row in the attention mechanism sums to 1, the computation of the output token is obtained by weighted summation of the attention weights. The attention weights reflect the importance of the input tokens to the output tokens, and the first row of the attention matrix A 1 , : represents the attention weights of the categorized tokens. Our significance score calculation is also divided into two parts. Firstly, at the level of self-attention, the computation of output tokens relies heavily on the attention matrix A and the pooling operator p ( V ; Θ V ) , we use the paradigm specification to improve the results. The calculation of the attention significance score can be expressed by the following formula.
S j = A 1 , j × p ( V j ; Θ V j ) i = 2 A 1 , i × p ( V i ; Θ V i ) i , j 2 L ˜
After the computation of the attention layer, the resulting output token is then passed through a layer of Hybrid granularity and then output to further reduce the length of the computational sequence, and the token significance score is computed by the following formula.
I ( x j ( t ) ) = i = 1 , i j n A i , j I ( x j ) = 1 h t = 1 h I ( x j ( t ) )
(2) Token Sampling with Combined Coarse and Fine Granularity
After obtaining the significance score, the process of combining coarse and fine granularity through sampling begins. Previous methods typically employ pruning operations directly, trimming tokens with low saliency scores to reduce the number of parameters involved in attention matrix computation. However, such pruning operations may lead to a certain degree of information loss and may filter out tokens that may be useful at a later date. Even though tokens that are pruned may contain less or similar information, direct discarding can result in the loss of valuable information. To circumvent the above issues, our model employs a more efficient sampling method and computational units, maintaining a high level of accuracy while conserving memory consumption. The proposed token sampling for the integration of coarse and fine granularity is also divided into two parts. Firstly, the fine-grained attention matrix reduces redundant output tokens based on the first step. Secondly, the added granularity fusion layer further reduces the length of the token sequence with less informative content.
First, we achieve adaptive sampling by refining the attention matrix through the attention significance score. This step filters out redundant tokens, and when encountering tokens with high similarity, performs coarse sampling. The probability of sampling one token from a set of similar tokens is equal to the sum of their saliency scores. The Cumulative Distribution Function (CDF) is used to sample the tokens based on the significance score, which can be considered as a probability distribution considering that the significance score has been normalized. The inverse of the cumulative distribution function is used as the sampling function.
C D F i = j = 2 j = i S j Ψ ( k ) = C D F 1 ( k ) k 0 , 1
The K samples can be obtained by sampling K times from a uniform distribution U [ 0 , 1 ] . To avoid the issue of excessive randomization in the Top-k method with a large K value, we adopt a fixed sampling approach by selecting k = 1 2 K , 3 2 K , , 2 K 1 2 K . Because Ψ ( . ) R we select the index of the token with the nearest significance score as the sampling index. When a token is sampled more than once, we retain only one instance of that token. Therefore, the number of unique indices selected K is typically less than the total number of samples K. Cases where the number of unique indices is equal to K = 1 or K = K exceeds it only occur in extreme situations. The number and position of the tokens vary at different stages of the model computation and with the input image. By stage, it is common to sample more tokens in the early stages and fewer tokens in the later stages. For image types with large uniform backgrounds, only a few tokens may need to be sampled, whereas for more cluttered images, more tokens need to be involved in the computation for classification. In this way, the refined attention matrix is obtained after combining coarse and fine granularity, and then the output token is obtained by computation. With the indexes, the attention matrix is refined by sampling its corresponding rows to obtain A s R ( K + 1 ) × ( N + 1 ) , and the final output token is given as follows.
O = A S p ( V ; Θ V ) + p ( Q ; Θ Q )
After obtaining the output tokens by refining the matrix, we add a Hybrid granularity layer to further reduce the length of the computational sequence, and sort the output tokens by using the Top-k method. The Hybrid granularity layer architecture is shown in Figure 3. Meanwhile, instead of violently pruning the tokens at the bottom of the ordering list, we use better computational units to replace these tokens. This approach aims to guarantee the amount of information while reducing the computational cost loss from pruning.According to the token significance score Equation (13), the information is first classified at the token level into more informative tokens and less informative tokens.We let x c l s X be the sequence of input token vectors, where X = [ x 1 , x 2 , , x s ] s is the length of the sequence of output tokens after adaptive sampling in the previous step. We use Top-k to set the token vectors in the top k positions of the significance score as X i n , and form the rest of the tokens into a sequence of less informative tokens X l s , here X i n R k × D , X l s R ( K k ) × D . These uninformative tokens are not cut off by pruning operations, and we perform aggregation operations along the sequence dimension, such as average pooling:
X l s = P o o l i n g ( X l s )
or average weighted pooling:
α x k = softmax ( I ( x l s ) ) X l s = P o o l i n g ( α X l s )
where X l s R ( K k ) × D is the aggregation of the token sequence. The length of the token sequence becomes [ x c l s X i n X l s ] after granularity mixing. Concerning the determination of k, we set up a new set of parameters to learn k, denoted by R = [ r 1 , , r s ] , while the parameters are restricted to r i [ 0 ; 1 ] , determined by a uniform distribution, at which point the output token x i is changed to x i r p o s ( x i ) x i where p o s ( x i ) is the ranked position of the amount of information contained in x i The l-th layer in which it is located k l is given by:
k l = c e i l ( s u m ( l ; R ) ) s . t . k l + 1 k l

3.3. Implementing Regulation

In this section, we provide a detailed overview of the specific instance of the model. For the multi-scale module, we follow the pattern of MViTv2, dividing the network model into four scale stages. Each scale consists of Transformer blocks with the same channel size. The initial data is first divided into patches with a shape of 1 × 16 × 16 . The inception cropping operation is then performed using the operator 4 × 1 × 1 , resulting in data input with a shape of 16 × 224 × 224 . This input is projected into overlapping spatiotemporal cubes with a shape of 3 × 7 × 7 , where the channel dimension is D = 96. Subsequently, after transforming the four scale stages, resolution downsampling, and channel dimension upsampling by a factor of 2 at each stage, the final input sequence length becomes 8 × 7 × 7 , and the channel dimension becomes D = 768. Importantly, all pooling operations do not involve the processed class token embeddings. For the attention mechanism, we increase the number of heads with the growth of the channel dimension, initially set to h = 1. In the multi-granularity module, we primarily focus on incorporating the multi-granularity module into the scale module. The parameter governing the sampling in the attention layer is set to K = 197. For the token level, the initialization method for the parameter sequence R, which is used to determine the value of k, is a uniform distribution.

4. Experiments

4.1. Datasets

The datasets used in this paper are all larger communal datasets that have been established in the field of video action recognition in the last few years, i.e., Kinetics-400, and Something-Something-v2. Kinetics-400 is a high-quality dataset that encompasses a wide range of human activities. It comprises 400 action categories, with each category containing at least 400 videos. Each video clip has a duration of approximately 10 s. The dataset is sourced from the YouTube platform, but due to video removals or takedowns, the actual number of videos may be less than initially reported. The Something-Something-v2 dataset primarily adopts a first-person perspective and showcases humans performing predefined basic actions with everyday objects. It consists of 220,847 videos, with 168,913 in the training set, 24,777 in the validation set, and 27,157 in the test set. The dataset includes 174 labels, allowing models to perform fine-grained action recognition.

4.2. Experimental Details

In terms of model configuration, our model is developed based on MViTv2-S. The training and experimental setups with MViTv2-S are basically the same, except for some differences in epoch selection. In the pre-normalization setup, we utilize residual connections [29] and layer normalization [30]. Layer normalization is applied at the beginning of the residual function. The MLP layer consists of linear layers with the GELU activation function. The first layer of this MLP layer expands the dimensionality from D to 4D, and the second layer restores it to the input dimension D. At the end of a scale expansion stage, we increase the channel dimension to match the input for the next scale expansion stage due to the multi-scale nature of the model. We train the model on GPU using the AdamW optimizer [31] for 100 epochs. For learning rate decay, we employ cosine scheduling [32], with an initial learning rate of 1.6 × 10 3 . The batch size is set to 8, and a linear warm-up strategy is applied in the early epochs. The cosine scheduling is completed when the final learning rate reaches. For weight decay, we set it to 0.05, and the final classifier utilizes a dropout of 0.5. In terms of temporal sampling, we sample a segment from the full-length video, with the network’s input consisting of T frames, and the temporal stride is τ , denoted as T × τ . For spatial sampling, we employ inception-style [33] cropping. The size of the input region is randomly adjusted between [min, max], with a scale of [0.05, 1.00], followed by cropping to H × W = 224 × 224 . Regarding data augmentation, we apply the same set of augmentations to all frames, including random horizontal flipping, mixup, cutmix [34], random erasing [35], and RandAugment [36].

4.3. Ablation Experiment

In typical scenarios, we randomly initialize and train the model from the dataset. We conduct ablation experiments on the Kinetics-400 dataset, providing data related to Top-1 accuracy and computational complexity. Based on these findings, we perform an in-depth analysis of the proposed multi-scale and multi-granularity Vision Transformer.
Pooling function. The configuration of the multi-scale module relies heavily on the multi-head pooled self-attention mechanism, making the choice of pooling function crucial. To validate which pooling method yields better experimental results, we conduct ablation experiments and test three different pooling methods, including max pooling, average pooling, and channel-wise convolution with layer normalization (LN) pooling. Under the same pooling kernel, average pooling reduces the length of the input sequence by sliding a window over the sequence and averaging all elements within the window to a single value. However, this leads to significant performance degradation as it causes the attention mechanism to overlook a portion of information. Compared to max pooling and convolutional pooling, average pooling results in a reduction of 1.8% and 2.5%, respectively. Experimental results demonstrate that the method of channel-wise convolution with LN pooling can achieve the best performance. Compared to max pooling, this method shows a performance improvement of 0.9%, as detailed in Table 1.
Coarse-grained pooling and units. In the granularity fusion layer of the multi-granularity module, pooling is employed for aggregating tokens subjected to coarse-grained processing. We propose two pooling methods: average pooling and weighted average pooling, and conduct ablation experiments to evaluate their effectiveness. Different configurations are applied to the coarse-grained units for mixed granularity, with one set having 1 coarse-grained unit and another set having 5 coarse-grained units. The use of pooling to aggregate coarsely sampled tokens reduces the computational sequence length while retaining information. Experimental analysis shows that the weighted average pooling achieves an overall accuracy of 0.4% higher than direct average pooling. This is because the weighted average pooling retains information more comprehensively, considering the importance of each token, thereby preserving the input sequence’s information more effectively and aiding in feature capture. After performing the reduction operation on the fine-grained attention matrix, setting the coarse-grained sampling units to 5 in the later stages compensates the model with more recognition feature information. The model’s performance increased by 0.3% compared to when the units were set to 1. The specific results are shown in Table 2.
For the second step of coarse-grained sampling, we investigate the impact of pooling on all tokens versus pooling on tokens ranked later. We uniformly employ the weighted average pooling with all coarse-grained units set to 5. However, the results do not meet expectations. Pooling on all tokens leads to a 3.9% decrease in model accuracy. Average pooling can weaken the feature information, especially when the model underwent two rounds of coarse-fine granularity combined token sampling. This feature information has a significant impact on the final classification. In contrast, pooling only on tokens ranked lower not only further saves the model’s computational expenses, but also reduces the impact on the classification results. Details are shown in Figure 4.
Attention significance score rating strategy. The foundation of the model’s multi-scale mechanism is the calculation of significance scores. We evaluate different methods for computing attention significance scores, including randomly selecting a token, self-attention scores (sum of attention weights for all tokens), and attention weights for classification tokens. In the end, we adopt the attention weights of classification tokens as significance scores. This approach allows us to identify tokens with a greater impact on the results, as classification tokens directly participate in the final category confirmation. This helps the model focus more on tokens that are significant for the classification results, enhancing the model’s sensitivity to key features. To improve effectiveness, we add the L2 norm of the value, resulting in better performance, which is shown in Table 3.
Sampling method. For the choice of sampling method, we compare the commonly used Top-k subsampling method for input tokens with the inverse transformation sampling and the combined method with the mixed granularity layer used in this paper. The Top-k method selects the top K tokens with the highest significance scores. For tokens not in the top K rankings, a pruning function is directly applied to discard them. This method leads to the removal of some effective tokens, reducing accuracy. Moreover, Top-k leads to a fixed token selection rate at each stage of the model, and it cannot adaptively reduce token sampling in the later stages. This significantly limits the model’s performance. On the other hand, inverse transform sampling based on CDF rarely discards tokens with lower significance scores, providing more diverse information for the lower layers. This also contributes to the final Transformer block outputting classification tokens. The hybrid granularity layer uses more efficient computation units to replace tokens discarded by the Top-k method. This allows the model to reduce computational costs without losing a significant amount of information. As shown in Figure 5, our method outperforms the results obtained by the Top-k method both in terms of high FLOPs and low FLOPs.

4.4. Comparison with State-of-the-Art Methods

In this section, we compare the performance of the Multi-Granularity Multi-Scale Vision Transformer model with recent methods proposed for human action recognition in the past few years, which include VTN [23], TimeSFormer [16], ViViT [17], MViT [21,22] and others. Table 4 primarily lists the Top-1 and Top-5 classification accuracies, the FLOPs generated by the model, and the number of network parameters. Table 4 presents the results obtained by various models on the Kinetics-400 dataset. Table 4 categorizes models into those based on CNNs and those based on ViTs. Additionally, a separate section lists models that require pretraining on the ImageNet dataset. Table 5 displays the comparison between the proposed model and other pre-trained models on the Something-Something-v2 dataset. The experiments on Kinetics-400 indicate that the multi-scale, multi-granularity fusion model proposed in this paper has a shorter runtime and fewer parameters compared to other models. VTN, TimeSFormer, and ViViT rely on pre-training on ImageNet-21K. TimeSFormer and ViViT achieve further accuracy improvement with an increase in parameters and FLOPs. The MViT series models, including MgMViT, do not require pre-training. Among the compared models, MViT models have relatively lower parameters and computational costs. However, MgMViT specifically has fewer FLOPs. The lower accuracy of MgMViT compared to the base architecture MViTv2-S can be attributed to the multi-granularity filtering. While adaptive sampling reduces the computational sequence length, the adoption of more efficient computational units to replace the directly discarded units in the original method inevitably leads to some information loss. This results in a slight decrease in accuracy compared to the base model. However, despite the lower accuracy compared to models requiring pre-training, MgMViT offers significantly reduced computational costs.

5. Discussion

Although our proposed MgMViT model drastically reduces the computational cost of the model, in terms of computation time and number of model parameters, compared to the existing models, there are still limitations. For example, our recognition accuracy is lower than existing models such as MoViNet and MViTv2. In addition, our model is only for action recognition models, does not address other video understanding domains, and has thin metrics. Therefore, we will further improve the accuracy of the proposed model and add more metrics to measure model performance. Furthermore, we will try to apply the proposed modules to different areas of video understanding.

6. Conclusions

It is a crucial challenge in the practical application of computer vision to reduce computational costs and improve efficiency. To address this issue, we present a model that introduces a multi-level refinement strategy by integrating multi-scale and multi-granularity mechanisms. The proposed model encompasses key aspects of attention and tokens, aiming to optimize the model’s performance in real-world scenarios. This strategy further adds the selection of multiple granularities on top of multi-scale, which effectively shortens the computational sequence length and thus reduces the computational cost in action recognition tasks. The extensive experimental results also demonstrate the effectiveness of the proposed method. We expect that our proposed model will be further developed in the future in a wider range of application scenarios, and further take into account the retention of feature information while saving computational costs.

Author Contributions

Conceptualization, B.L. and H.H.; methodology, B.L.; software, B.L.; validation, B.L.; formal analysis, B.L.; investigation, B.L.; resources, H.H.; data curation, B.L.; writing—original draft preparation, B.L.; writing—review and editing, H.H.; visualization, B.L.; supervision, H.H.; project administration, H.H.; funding acquisition, H.H. All authors have read and agreed to the published version of the manuscript.

Funding

This research was supported by the National Natural Science Foundation of China under grant NSFC 61672210, the Major Science and Technology Programs in Henan Province under grant 221100210500, the Central Government Guiding Local Science and Technology Development Fund Program of Henan Province under grant no. Z20221343032.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data are contained within the article.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł.; Polosukhin, I. Attention is all you need. Adv. Neural Inf. Process. Syst. 2017, 30. [Google Scholar] [CrossRef]
  2. Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S.; et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv 2020, arXiv:2010.11929. [Google Scholar]
  3. Carreira, J.; Zisserman, A. Quo vadis, action recognition? A new model and the kinetics dataset. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 6299–6308. [Google Scholar]
  4. Goyal, R.; Ebrahimi Kahou, S.; Michalski, V.; Materzynska, J.; Westphal, S.; Kim, H.; Haenel, V.; Fruend, I.; Yianilos, P.; Mueller-Freitag, M.; et al. The “something something” video database for learning and evaluating visual common sense. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 5842–5850. [Google Scholar]
  5. Krizhevsky, A.; Sutskever, I.; Hinton, G.E. Imagenet classification with deep convolutional neural networks. Adv. Neural Inf. Process. Syst. 2012, 25. [Google Scholar] [CrossRef]
  6. Simonyan, K.; Zisserman, A. Two-stream convolutional networks for action recognition in videos. Adv. Neural Inf. Process. Syst. 2014, 27. [Google Scholar] [CrossRef]
  7. Wang, L.; Xiong, Y.; Wang, Z.; Qiao, Y.; Lin, D.; Tang, X.; Van Gool, L. Temporal segment networks: Towards good practices for deep action recognition. In Proceedings of the European Conference on Computer Vision, Amsterdam, The Netherlands, 11–14 October 2016; Springer: Cham, Switzerland, 2016; pp. 20–36. [Google Scholar]
  8. Wang, L.; Xiong, Y.; Wang, Z.; Qiao, Y.; Lin, D.; Tang, X.; Van Gool, L. Temporal segment networks for action recognition in videos. IEEE Trans. Pattern Anal. Mach. Intell. 2018, 41, 2740–2755. [Google Scholar] [CrossRef] [PubMed]
  9. Tran, D.; Bourdev, L.; Fergus, R.; Torresani, L.; Paluri, M. Learning spatiotemporal features with 3d convolutional networks. In Proceedings of the IEEE International Conference on Computer Vision, Santiago, Chile, 7–13 December 2015; pp. 4489–4497. [Google Scholar]
  10. Qiu, Z.; Yao, T.; Mei, T. Learning spatio-temporal representation with pseudo-3d residual networks. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 5533–5541. [Google Scholar]
  11. Wang, X.; Girshick, R.; Gupta, A.; He, K. Non-local neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–22 June 2018; pp. 7794–7803. [Google Scholar]
  12. Tran, D.; Wang, H.; Torresani, L.; Ray, J.; LeCun, Y.; Paluri, M. A closer look at spatiotemporal convolutions for action recognition. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–22 June 2018; pp. 6450–6459. [Google Scholar]
  13. Feichtenhofer, C.; Fan, H.; Malik, J.; He, K. Slowfast networks for video recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Rrepublic of Korea, 27 October–2 November 2019; pp. 6202–6211. [Google Scholar]
  14. Liu, Z.; Lin, Y.; Cao, Y.; Hu, H.; Wei, Y.; Zhang, Z.; Lin, S.; Guo, B. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, BC, Canada, 11–17 October 2021; pp. 10012–10022. [Google Scholar]
  15. Liu, Z.; Ning, J.; Cao, Y.; Wei, Y.; Zhang, Z.; Lin, S.; Hu, H. Video swin transformer. In Proceedings of the IEEE/CVF Conference On Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 3202–3211. [Google Scholar]
  16. Bertasius, G.; Wang, H.; Torresani, L. Is space-time attention all you need for video understanding? In Proceedings of the ICML Conference, Virtual, 18–24 July 2021; Volume 2, p. 4. [Google Scholar]
  17. Arnab, A.; Dehghani, M.; Heigold, G.; Sun, C.; Lučić, M.; Schmid, C. Vivit: A video vision transformer. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, BC, Canada, 11–17 October 2021; pp. 6836–6846. [Google Scholar]
  18. Zhang, C.L.; Wu, J.; Li, Y. Actionformer: Localizing moments of actions with transformers. In Proceedings of the European Conference on Computer Vision, Tel Aviv, Israel, 23–27 October 2022; Springer: Cham, Switzerland, 2022; pp. 492–510. [Google Scholar]
  19. Beltagy, I.; Peters, M.E.; Cohan, A. Longformer: The long-document transformer. arXiv 2020, arXiv:2004.05150. [Google Scholar]
  20. Shi, D.; Zhong, Y.; Cao, Q.; Zhang, J.; Ma, L.; Li, J.; Tao, D. React: Temporal action detection with relational queries. In Proceedings of the European Conference on Computer Vision, Tel Aviv, Israel, 23–27 October 2022; Springer: Cham, Switzerland, 2022; pp. 105–121. [Google Scholar]
  21. Fan, H.; Xiong, B.; Mangalam, K.; Li, Y.; Yan, Z.; Malik, J.; Feichtenhofer, C. Multiscale vision transformers. In Proceedings of the IEEE/CVF international conference on computer vision, Montreal, BC, Canada, 11–17 October 2021; pp. 6824–6835. [Google Scholar]
  22. Li, Y.; Wu, C.Y.; Fan, H.; Mangalam, K.; Xiong, B.; Malik, J.; Feichtenhofer, C. Mvitv2: Improved multiscale vision transformers for classification and detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 4804–4814. [Google Scholar]
  23. Neimark, D.; Bar, O.; Zohar, M.; Asselmann, D. Video transformer network. In Proceedings of the IEEE/CVF international conference on computer vision, Montreal, BC, Canada, 11–17 October 2021; pp. 3163–3172. [Google Scholar]
  24. Kondratyuk, D.; Yuan, L.; Li, Y.; Zhang, L.; Tan, M.; Brown, M.; Gong, B. Movinets: Mobile video networks for efficient video recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 19–25 June 2021; pp. 16020–16030. [Google Scholar]
  25. Shi, D.; Zhong, Y.; Cao, Q.; Ma, L.; Li, J.; Tao, D. Tridet: Temporal action detection with relative boundary modeling. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 18857–18866. [Google Scholar]
  26. Fayyaz, M.; Koohpayegani, S.A.; Jafari, F.R.; Sengupta, S.; Joze, H.R.V.; Sommerlade, E.; Pirsiavash, H.; Gall, J. Adaptive token sampling for efficient vision transformers. In Proceedings of the European Conference on Computer Vision, Tel Aviv, Israel, 23–27 October 2022; Springer: Cham, Switzerland; pp. 396–414. [Google Scholar]
  27. Zhao, J.; Wang, Y.; Bao, J.; Wu, Y.; He, X. Fine-and Coarse-Granularity Hybrid Self-Attention for Efficient BERT. arXiv 2022, arXiv:2203.09055. [Google Scholar]
  28. Zhang, X.; Li, P.; Li, H. AMBERT: A pre-trained language model with multi-grained tokenization. arXiv 2020, arXiv:2008.11869. [Google Scholar]
  29. He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 26 June–1 July 2016; pp. 770–778. [Google Scholar]
  30. Ba, J.L.; Kiros, J.R.; Hinton, G.E. Layer normalization. arXiv 2016, arXiv:1607.06450. [Google Scholar]
  31. Loshchilov, I.; Hutter, F. Fixing weight decay regularization in adam. In Proceedings of the 6th International Conference on Learning Representations, Vancouver, BC, Canada, 30 April–3 May 2018. [Google Scholar]
  32. Loshchilov, I.; Hutter, F. Sgdr: Stochastic gradient descent with warm restarts. arXiv 2016, arXiv:1608.03983. [Google Scholar]
  33. Szegedy, C.; Liu, W.; Jia, Y.; Sermanet, P.; Reed, S.; Anguelov, D.; Erhan, D.; Vanhoucke, V.; Rabinovich, A. Going deeper with convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 7–12 June 2015; pp. 1–9. [Google Scholar]
  34. Yun, S.; Han, D.; Oh, S.J.; Chun, S.; Choe, J.; Yoo, Y. Cutmix: Regularization strategy to train strong classifiers with localizable features. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Rrepublic of Korea, 27 October–2 November 2019; pp. 6023–6032. [Google Scholar]
  35. Zhong, Z.; Zheng, L.; Kang, G.; Li, S.; Yang, Y. Random erasing data augmentation. In Proceedings of the AAAI Conference On Artificial Intelligence, New York, NY, USA, 7–12 February 2020; Volume 34, pp. 13001–13008. [Google Scholar]
  36. Cubuk, E.D.; Zoph, B.; Shlens, J.; Le, Q.V. Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, Seattle, WA, USA, 13–19 June 2020; pp. 702–703. [Google Scholar]
  37. Feichtenhofer, C. X3d: Expanding architectures for efficient video recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 203–213. [Google Scholar]
  38. Lin, J.; Gan, C.; Han, S. Tsm: Temporal shift module for efficient video understanding. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Rrepublic of Korea, 27 October–2 November 2019; pp. 7083–7093. [Google Scholar]
Figure 1. The structure of the Vision Transformer model with Multi-Granularity Multi-Scale Fusion. The Multi-Granularity Multi-Scale module is integrated into the Transformer module. Multi-granularity modules that add attention levels to multi-scale modules. The attention matrix A is reduced to A by CDF sampling and then connected to the pooled values p ( V ; Θ V ) and residuals p ( Q ; Θ Q ) are computed and fed into the mixed granularity layer of multiple granularities to obtain tokens containing coarser and finer granularities to proceed to the next step in the computation.
Figure 1. The structure of the Vision Transformer model with Multi-Granularity Multi-Scale Fusion. The Multi-Granularity Multi-Scale module is integrated into the Transformer module. Multi-granularity modules that add attention levels to multi-scale modules. The attention matrix A is reduced to A by CDF sampling and then connected to the pooled values p ( V ; Θ V ) and residuals p ( Q ; Θ Q ) are computed and fed into the mixed granularity layer of multiple granularities to obtain tokens containing coarser and finer granularities to proceed to the next step in the computation.
Electronics 13 00948 g001
Figure 2. The structure of the multi-scale and multi-granularity module. Adding Multi-Granularity Module (Attention) to Multi-Scale Module. With pooled Q, K, and V input into the Multi-Granularity Attention Module with significance scores filtering the token with inverse transformer sampling is input into the following calculations. R p ( i ) , p ( j ) is embedded relative to the position.
Figure 2. The structure of the multi-scale and multi-granularity module. Adding Multi-Granularity Module (Attention) to Multi-Scale Module. With pooled Q, K, and V input into the Multi-Granularity Attention Module with significance scores filtering the token with inverse transformer sampling is input into the following calculations. R p ( i ) , p ( j ) is embedded relative to the position.
Electronics 13 00948 g002
Figure 3. Hybrid granularity layer architecture. Blue is fine-grained tokens, green is aggregated coarse-grained tokens, yellow is classified tokens; fine-grained tokens are directly output, and coarse-grained tokens are aggregated and then output. The combination of the two enters the Feed-Forward Network.
Figure 3. Hybrid granularity layer architecture. Blue is fine-grained tokens, green is aggregated coarse-grained tokens, yellow is classified tokens; fine-grained tokens are directly output, and coarse-grained tokens are aggregated and then output. The combination of the two enters the Feed-Forward Network.
Electronics 13 00948 g003
Figure 4. Whether pooling all tokens or only tokens with less information, when the model operates at the same FLOPs level, it can be observed that pooling all tokens significantly degrades the model performance compared to pooling a subset of tokens.
Figure 4. Whether pooling all tokens or only tokens with less information, when the model operates at the same FLOPs level, it can be observed that pooling all tokens significantly degrades the model performance compared to pooling a subset of tokens.
Electronics 13 00948 g004
Figure 5. For the choice of sampling method. we also set the model to run at the desired FLOPs. Running at the same FLOPs, the results of Top-k and our model using CDF with a mixed granularity layer are recorded, with each point corresponding to the Top-1 accuracy.
Figure 5. For the choice of sampling method. we also set the model to run at the desired FLOPs. Running at the same FLOPs, the results of Top-k and our model using CDF with a mixed granularity layer are recorded, with each point corresponding to the Top-1 accuracy.
Electronics 13 00948 g005
Table 1. Comparison of three different pooling functions.max pooling, average pooling, and channel-wise convolution with layer normalization (LN) pooling.
Table 1. Comparison of three different pooling functions.max pooling, average pooling, and channel-wise convolution with layer normalization (LN) pooling.
KernelPooling FuncAccParam
s + 1Max79.228.5
s + 1Average77.428.5
s + 1Conv79.228.7
3 × 3 × 3Conv80.128.7
Table 2. Comparison of coarse-grained aggregation methods. The table also compares the effects of coarse-grained units set to 1 and 5. 1 and 5 represent the number of coarse-grained units.
Table 2. Comparison of coarse-grained aggregation methods. The table also compares the effects of coarse-grained units set to 1 and 5. 1 and 5 represent the number of coarse-grained units.
Pool MethAccParam
Avg Pool-179.428.3
Avg Pool-579.728.3
Weight Avg-179.828.7
Weight Avg-580.128.7
Table 3. The impact of attention significance score strategies. Three different attention significance scores on model performance at average FLOPs.
Table 3. The impact of attention significance score strategies. Three different attention significance scores on model performance at average FLOPs.
Scoring StrategyAccParam
Random76.328.7
Self-Attention79.628.7
CLS + |V|80.128.7
Table 4. Comparison with previous work on kinetics400. We compare Top-1 and Top-5 accuracies, model run FLOPs, number of views, number of parameters, etc., respectively. The magnitudes of FLOPs and Param are Giga ( 10 9 ) and Mega ( 10 6 ), respectively.
Table 4. Comparison with previous work on kinetics400. We compare Top-1 and Top-5 accuracies, model run FLOPs, number of views, number of parameters, etc., respectively. The magnitudes of FLOPs and Param are Giga ( 10 9 ) and Mega ( 10 6 ), respectively.
ModelPre-TrainTop-1Top-5ViewsFLOPsParam
SlowFast [13]-78.793.53 × 1011659.9
X3D [37]-79.193.93 × 1048.411.0
VTN [23]IN-21K78.693.71 × 14218114.0
TimeSFormer [16]IN-21K80.794.73 × 12380121.4
ViViT [17]IN-21K81.394.73 × 4399287.2
Swin-L [15]IN-21K84.996.75 × 102107200.0
MoViNet-A6 [24]-81.595.31 × 138631.4
MViTv1, 16 × 4 [21]-78.493.51 × 570.336.6
MViTv2-S [22]-81.094.61 × 56434.5
MgMViT (Ours)-80.193.71 × 543.828.7
Table 5. Compared with previous work performed on Something-Something-v2.
Table 5. Compared with previous work performed on Something-Something-v2.
ModelPre-TrainTop-1Top-5ViewsFLOPsParam
TSM-RGB [38]IN-21K + K40063.388.23 × 262.442.9
SlowFast R50, 8 × 8 [13]K40061.987.03 × 165.734.1
TimeSformer [16]K40062.5-3 × 11703121.4
MoViNet-A3 [24]N/A64.188.81 × 1245.3
Swin-B [15]IN-21K + K40069.692.73 × 132188.8
MViTv1-B [21]K40064.789.23 × 170.536.6
MViTv2-S [22]K40068.291.43 × 164.534.4
MgMViT (Ours)K40067.390.43 × 144.128.7
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Huo, H.; Li, B. MgMViT: Multi-Granularity and Multi-Scale Vision Transformer for Efficient Action Recognition. Electronics 2024, 13, 948. https://doi.org/10.3390/electronics13050948

AMA Style

Huo H, Li B. MgMViT: Multi-Granularity and Multi-Scale Vision Transformer for Efficient Action Recognition. Electronics. 2024; 13(5):948. https://doi.org/10.3390/electronics13050948

Chicago/Turabian Style

Huo, Hua, and Bingjie Li. 2024. "MgMViT: Multi-Granularity and Multi-Scale Vision Transformer for Efficient Action Recognition" Electronics 13, no. 5: 948. https://doi.org/10.3390/electronics13050948

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop