Basketball video action recognition analysis algorithm based on improved YOWO
By adding the SE attention mechanism and depth-separable convolution to the ResNeXt-101 network, modifying the convolution kernel size, and combining it with the Darknet-19 network, the large number of parameters in the 3D convolution module and the lack of time in the 2D feature extraction network in the existing technology are solved. The issue of contextual information achieves high-precision action recognition and feature extraction in basketball videos.
Patent Information
- Application Number
- CN202410841789.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-08-30
AI Technical Summary
In the existing technology, in basketball video action recognition, the 3D convolution module has a large number of parameters and complex calculations, resulting in inaccurate temporal feature extraction, and the 2D feature extraction network lacks temporal context information and is prone to misjudgment.
Add the SE attention mechanism to the ResNeXt-101 network, add the BN layer and Leaky Relu activation function, and modify the 3D convolution kernel size to 1×3×3 and 3×1×1, combined with depth-separable convolution to separate space and time. For feature extraction, the Darknet-19 network is used to extract spatial features, and action recognition is achieved through the feature fusion module.
It improves the accuracy of temporal feature extraction, reduces model parameters and computational complexity, enhances attention to detailed features, achieves decoupling of temporal and spatial features, and improves the accuracy and efficiency of basketball action recognition.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] The present invention proposes a basketball video action recognition and analysis algorithm based on improved YOWO. The algorithm adopts 2D convolution module and 3D convolution module to extract different features respectively, uses 2D convolution module to extract spatial action features, and uses 3D convolution module to extract temporal features. Finally, the acquired spatial action features and temporal features are put into the subsequent feature fusion CFAM module for feature fusion, and finally the recognition and detection of basketball video actions are realized. The algorithm is applied and deployed to the mobile client. Through a series of action analysis displayed on the screen, it can quickly help the audience to better understand the basketball game movement, so that the audience has a better visual perception and game experience; through the action recognition and analysis of the basketball video shot by the camera on the basketball game field, it can assist the referee on the basketball game field to make faster, fairer and more accurate penalties; it can also effectively help the coach analyze the situation on the basketball court and make tactical adjustments in time to win the game. Background Art
[0002] In recent years, with the rapid development of the Internet, more and more video information is being generated. Therefore, video understanding technology is increasingly in demand. Among them, behavior recognition technology in video understanding technology is widely used in various industries. It is very practical and brings considerable economic benefits to many industries. As an important sport, basketball has received widespread attention and love worldwide. It has an important position in the field of sports and is also widely present in daily life. Therefore, behavioral analysis of basketball videos has important research significance and practical application value. Traditional methods based on manual features have some limitations in basketball behavior analysis, such as the need to manually design features, difficulty in adapting to changes in different scenes and actions, and requiring a lot of time and manpower, and prone to subjective errors. The rapid development of deep learning technology provides a new way to solve these problems. Therefore, computer vision and deep learning technology are used to analyze basketball video behavior, allowing machines to automatically extract and understand information in the video, greatly reducing the investment in human resources. Moreover, the tasks of recognition and detection achieved by machines are more stable, objective and efficient than those completed by humans.
[0003] In recent years, deep learning has rapidly emerged and has been successfully applied to the field of video analysis and understanding. Deep learning networks can fit video data and learn the action features and temporal features in the video from the video data. Existing video action recognition methods can be mainly divided into two categories: dual-stream based methods and convolution based methods. Among them, the representative algorithm based on dual-stream relies on the use of optical flow information of the image to characterize the trajectory of the motion. As a pixel-level motion vector, the optical flow has a huge amount of calculation, resulting in a slow speed of the overall model and unable to meet the real-time requirements. In addition, the optical flow information generally needs to be calculated separately, so an end-to-end system cannot be realized, and the ability to be used in real-time systems is poor. The convolution-based method can use convolution, especially 3D convolution, to simultaneously obtain temporal and spatial features for end-to-end learning and prediction. However, 3D convolution contains a large number of parameters. When the network is deep, the resource overhead it occupies is huge, which is not conducive to large-scale deployment in actual production environments.
[0004] YOWO is used in the field of video analysis because of its simple model structure and ability to quickly identify video information. However, the original YOWO network has limited sample features on the self-made behavior dataset, so the features learned by the model are also limited, resulting in low detection accuracy of the model. Through analysis, it is found that there are two problems with the network structure of YOWO: one is that YOWO's 2D feature extraction network does not have the ability to obtain temporal context information, so it is easy to misjudge similar behaviors; the other is that YOWO's 3D feature extraction network lacks the ability to obtain key information, so the detailed features in the picture are not easily noticed, resulting in loss of accuracy. Summary of the invention
[0005] The technical problem solved by the present invention is that for the ResNeXt-101 network in the 3D convolution module, since the 3D convolution network has a large number of parameters and complex calculations, the 3×3×3 convolution in the ResNeXt-101 residual block is converted into two convolutions of 1×3×3 and 3×1×1, which can effectively reduce the number of parameters and the complexity of calculations. The original network lacks the ability to obtain key information, and the detailed features in the picture are not easily noticed, which will cause the loss of accuracy. Therefore, a new network structure is proposed, and the SE attention mechanism is added to the original network structure to improve the network's acquisition of key information and make full use of the detailed information of the picture. At the same time, a BN (Batch Normalization) layer and an activation function Leaky Relu layer are added to increase the nonlinear factor and further improve the network's expression ability.
[0006] In order to achieve the above object, the technical solution of the present invention is as follows:
[0007] The basketball video action recognition and analysis algorithm based on improved YOWO includes the following steps: Step 1: Data preprocessing: split the video data into pictures by frame, annotate each picture with action, and finally send it to the network for training; Step 2: Construct a 2D module network model, use the Darknet-19 network model to analyze the spatial information of basketball behavior, and enhance the spatial information features; Step 3: Construct a 3D module network model, adopt the ResNeXt-101 network structure, integrate the SE attention mechanism, add a 3D depth-separable convolution, and change and design the convolution kernel size in the residual module of the ResNeXt-101 network; Step 4: Put the feature maps obtained by the 2D module and the 3D module into the feature fusion module for feature fusion to obtain the results of basketball action recognition.
[0008] The specific process in step 1 is as follows: Basketball video data collects and searches for basketball videos. The videos are divided into continuous frames at 30 frames per second through video processing software, and the relevant motion information is manually annotated. The annotated data set is divided into a training set and a test set. At the same time, the basketball videos in the UCF101_24 data set are used to help network training. The UCF101_24 data set is an action recognition data set for real action videos. UCF101_24 is a subset of the UCF101 data set. It contains 24 types of sports, and the sports videos about basketball are selected as the research objects.
[0009] The specific situation in the step 2 is as follows: The 2D convolution module mainly uses the DarkNet-19 network, which consists of an 11-layer structure, including 6 convolution layers and 5 maximum pooling layers. The key frame of a video frame is sent to the network to extract the spatial action features of the current frame. During the learning process, two filters of 3×3 and 1×1 are used many times, and the initial feature size of the input is C×H×W (C represents the number of channels, which is 3 here; H and W are the height and width of the frame image, which are 224 and 224 respectively). Features are extracted through multiple convolution modules composed of 32, 64, 128, 256, 512, 1024, and 425, with the maximum pooling layer, normalization operation BN (Batch Normalization) and activation function Leaky ReLU embedded in the middle. Among them, the maximum pooling layer is used to reduce the spatial information of the intermediate data; the normalization operation BN can reduce the dependence of the training model on parameter initialization and improve the training speed, thereby allowing the use of a training model with a higher learning rate and increasing the generalization ability of the training model to a certain extent.
[0010] The specific situation in step three is as follows: Step 1. Use the ResNeXt-101 network structure and SE attention mechanism to build the global branch of the 3D convolution module: build the SE attention mechanism in the residual module of the ResNeXt-101 network to form the Bottleneck structure of SE-Inception; Step 2. After adding the SE attention mechanism, add a depth-wise separable convolution to enhance the ability to extract image features; Step 3. Change the size of the convolution kernel of the 3D convolution branch from 3×3×3 to two convolution kernels of 1×3×3 and 3×1×1, where the dimensions correspond to duration D, height H, and width W, respectively. Add a Batch Normalization (BN) layer and a ReLU layer in the middle. The BN layer is used for normalization, and the ReLU layer is used to provide nonlinearity to help the network learn and optimize better. Change the model from extracting spatiotemporal features together to extracting spatial features first and then temporal features in two steps, thus achieving the decoupling of time and space.
[0011] The specific situation in the step 4 is as follows: The channel fusion attention mechanism module fuses the output results of the ResNeXt-101 module and the 2D convolution module and outputs them; at the same time, the final recognition and positioning module is used to predict the category and position of the basketball action through the bounding box regression method.
[0012] Compared with the prior art, the technical solution of the present invention has the following beneficial effects: The present invention combines the ResNeXt-101 network model with the SE attention mechanism and adds a depthwise separable convolution, which further improves the extraction of temporal features without losing a large amount of computation, thereby solving the problem of inaccurate temporal feature extraction by 3D networks. The present invention uses a 2D convolutional network to extract the spatial features of the current frame, and uses a 3D convolutional network to extract spatiotemporal features, thereby obtaining the action features and timing features in the basketball video. By designing and improving the 3D convolution kernel, the original extraction of spatiotemporal features is changed to extracting spatial features first and then temporal features in two steps, thus achieving the decoupling of time and space, thereby enabling better model training. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 The figure is a flow chart of the method of the present invention.
[0014] Figure 2 It is the fusion attention mechanism (CFAM) module in the present invention.
[0015] Figure 3 This is the improved 3D convolutional module network model of the present invention. DETAILED DESCRIPTION
[0016] For those skilled in the art, it is understandable that some well-known structures and their descriptions may be omitted in the drawings. The technical solution of the present invention is further described below in conjunction with the drawings and embodiments.
[0017] The invention provides a basketball video action recognition and analysis algorithm based on improved YOWO, and the method realizes action analysis and prediction of basketball videos.
[0018] Figure 1 This is a flow chart of the method of the present invention. The main part of the present invention is mainly built on the YOWO framework.
[0019] The specific implementation steps are: Obtain a basketball video to be detected containing interactive information, and divide the video to be detected into segments with 30 continuous frames per second to obtain a group of continuous frame images; Send k consecutive frames of images to the 3D convolution module for temporal feature detection to obtain temporal features; The key frame in the k-frame continuous frame picture (the last frame of the video continuous frame) is sent to the 2D convolution module for spatial feature detection to obtain spatial features; The temporal features and spatial features are sent to the channel fusion attention mechanism (CFAM) module for splicing and fusion to obtain the fused features; Finally, the type of basketball action in the video and its location are predicted through the bounding box regression method.
[0020] Figure 2 For the fusion attention mechanism (CFAM) module in the present invention, the "channel fusion + attention mechanism" solution is mainly adopted.
[0021] The specific implementation steps are: Channel fusion: The feature map obtained by the 2D convolution module and the feature map obtained by the 3D convolution module are directly spliced along the channel direction, and then processed using 1×1 convolution and 3×3 convolution to obtain feature F; Attention module: Since the fusion method of directly using channel splicing is insufficient and cannot make the spatial features and temporal features merge well with each other, it is necessary to perform a self-attention mechanism operation on the channel dimension. The specific steps are as follows: First, the input features Flatten it and get the vector ,in ; Then calculate the Q, K, and V required for attention: ; Then calculate the QK product , and then through softmax, we get the final attention matrix : ; Finally, we can get the attention output : ; Then put Reshape back and get ; The final output result also needs a residual connection operation: , is the weight factor, with an initial value of 0, and is a learnable parameter. Determines how much attention information is retained.
[0022] Figure 3 This is an improved 3D convolutional module network model of the present invention.
[0023] The specific implementation steps are:
[0024] Step 1. Add the SE attention mechanism to the residual block of the ResNeXt-101 network and calculate the channel self-attention. There are three main steps: First, through compression operation, feature compression is performed along the spatial dimension, compressing the spatial dimension of each input feature map from H * W to 1; ; By converting each two-dimensional feature channel into a real number, this real number has a global receptive field to some extent, and the dimension of the output matches the number of input feature channels. It represents the global distribution of responses on the feature channels, and enables the layers close to the input to also obtain the global receptive field. This is accomplished through global average pooling in the experiment; Then, through the Excitation operation, a bottleneck structure is used to capture the internal correlation of the channel, thereby learning the scaling factor of the channel. In the experiment, the Bottleneck structure is implemented by first passing through a fully connected layer, then a ReLU layer, then another fully connected layer, and finally a Sigmoid activation function; Finally, the weight of Excitation’s output is regarded as the importance of each feature channel after feature selection, and then weighted to the previous features channel by channel through multiplication to complete the recalibration of the original features in the channel dimension.
[0025] Step 2. Since the SE attention mechanism mainly focuses on the information of the channel dimension, and the convolution layer can further process the information of the spatial dimension. Therefore, through the convolution operation, the network can capture local spatial patterns and combine these patterns with channel information, thereby enhancing the network's ability to process spatial information. And because the deep separable convolution achieves the goal of significantly reducing model parameters and computation while maintaining a certain performance by decomposing the convolution operation, it helps to improve the training speed and inference speed of the model, and further improve the overall performance. The deep separable convolution is mainly achieved through two steps: 2.1. Depthwise separable convolution is to decompose the standard convolution into two smaller operations: depthwise convolution and pointwise convolution, which significantly reduces the number of model parameters and computational complexity. In the channel-by-channel convolution stage, each convolution kernel is responsible for only one input channel, which means that each input channel is convolved separately, and the number of feature map channels generated is the same as the number of input channels. This separable convolution method helps to reduce model parameters while maintaining detailed processing of input features; 2.2. Point-wise convolution (also called 1×1 convolution) is used to combine and transform the output feature maps of channel-wise convolution in the channel dimension to generate new feature representations. This step further enhances the feature learning ability of the model while still maintaining low parameters and computational costs.
[0026] Step 3. Since action detection is more dependent on the features of temporal information and spatial information, but unlike the two-stream method or some methods based on LSTM, 3D convolution extracts these two parts of features at the same time, which easily leads to the coupling of temporal information and spatial information. However, there are actually some differences between these two parts of features. The coupling method of 3D convolution cannot better obtain robust spatiotemporal features, which is not conducive to subsequent processing. In addition, since basketball actions are more diverse and relatively complex, unlike simple actions, a more robust model is required to achieve better results. Therefore, the present invention uses a method based on R (2 + 1) D to decouple the spatiotemporal features and extract them separately. There are two main steps: 3.1. The 3×3×3 convolution kernel in the ResNeXt-101 residual block in the 3D convolution module is modified into two 3D convolution kernels, namely 1×3×3 and 3×1×1 convolution kernels, where the dimensions correspond to the duration D, height H and width W respectively; 3.2. Add Batch Normalization (BN) and ReLU layers between the 1×3×3 and 3×1×1 convolutions. The BN layer is used for normalization, and the ReLU layer is used to provide nonlinearity to help the network learn and optimize better.
[0027] In this way, the model changes from extracting spatiotemporal features together to extracting spatial features first and then temporal features in two steps, thus achieving the decoupling of time and space, so as to better train the model and obtain more suitable features to improve the prediction and positioning of basketball action types by the present invention. At the same time, it can also effectively reduce the number of model parameters, increase the efficiency of model calculation, and reduce the calculation time of the model.
Claims
1. Basketball video action recognition and analysis algorithm based on improved YOWO, characterized by: The following steps are involved: Step 1: Data preprocessing: split the video data into pictures by frame, then annotate each picture with action, and finally send it to the network for training; Step 2: Construct a 2D module network model, use the Darknet-19 network model to analyze the spatial information of basketball behavior, and enhance the spatial information features; Step 3: Construct a 3D module network model, adopt the ResNeXt-101 network structure, integrate the SE attention mechanism, add a 3D depth-separable convolution, and change and design the convolution kernel size in the residual module of the ResNeXt-101 network; Step 4: Put the feature maps obtained by the 2D module and the 3D module into the feature fusion module for feature fusion to obtain the results of basketball action recognition.
2. The basketball video action recognition and analysis algorithm based on improved YOWO according to claim 1 is characterized in that: The specific process in Step 1 is as follows: Step 1.1: Collect and search for basketball video data, divide the video into continuous frame images at 30 frames per second through video processing software, manually annotate relevant motion information, and divide the annotated data set into training set and test set. At the same time, use the basketball video in the UCF101_24 data set to help network training. The UCF101_24 data set is an action recognition data set of real action videos. UCF101_24 is a subset of the UCF101 data set, which contains 24 types of sports. The sports videos about basketball are selected as the research objects.
3. The basketball video action recognition and analysis algorithm based on improved YOWO according to claim 1 is characterized in that: The specific process in Step 2 is as follows: Step 2.1: The 2D convolution module mainly uses the DarkNet-19 network, which consists of 11 layers, including 6 convolution layers and 5 maximum pooling layers. The key frame of a video frame is sent to the network to extract the spatial action features of the current frame. During the learning process, two filters of 3×3 and 1×1 are used many times, and the initial feature size of the input is C×H×W (C represents the number of channels, which is 3 here; H and W are the height and width of the frame image, which are 224 and 224 respectively). Features are extracted through multiple convolution modules composed of 32, 64, 128, 256, 512, 1024, and 425, with the maximum pooling layer, normalization operation BN (Batch Normalization) and activation function Leaky ReLU embedded in the middle. Among them, the maximum pooling layer is used to reduce the spatial information of the intermediate data; the normalization operation BN can reduce the dependence of the training model on parameter initialization and improve the training speed, thereby allowing the use of a training model with a higher learning rate and increasing the generalization ability of the training model to a certain extent.
4. The basketball video action recognition and analysis algorithm based on improved YOWO according to claim 1 is characterized in that: The specific process in Step 3 is as follows: Step 3.1: Use the ResNeXt-101 network structure and SE attention mechanism to build the global branch of the 3D convolution module: Step 3.2: Build the SE attention mechanism into the residual module of the ResNeXt-101 network to form the Bottleneck structure of SE-Inception; Step 3.3: After adding the SE attention mechanism, add a depth-wise separable convolution to enhance the ability to extract image features; Step 3.4: Change the size of the convolution kernel of the 3D convolution branch from 3×3×3 to two convolution kernels of 1×3×3 and 3×1×1, where the dimensions correspond to duration D, height H, and width W, respectively. Add a Batch Normalization (BN) layer and a ReLU layer in the middle. The BN layer is used for normalization, and the ReLU layer is used to provide nonlinearity to help the network learn and optimize better. Change the model from extracting spatiotemporal features together to extracting spatial features first and then temporal features in two steps, thus achieving the decoupling of time and space.
5. The basketball video action recognition and analysis algorithm based on improved YOWO according to claim 1 is characterized in that: The specific process in Step 4 is as follows: Step 4.1: Fuse the output results of the ResNeXt-101 module and the 2D convolution module and output them; Step 4.2: The final recognition and localization module is used to predict the category and location of the basketball action through the bounding box regression method.
