Soft-teacher based semi-supervised learning method for video behavior recognition

By employing a semi-supervised learning method using Soft-Teacher, optimizing the Transformer model through local feature learning and multi-head attention computation modules, and combining it with a teacher model to generate pseudo-labels, the problems of high data annotation cost and low recognition accuracy in video behavior recognition models are solved, achieving efficient video behavior recognition and model generalization.

CN118982869BActive Publication Date: 2026-11-24SOUTH CHINA UNIV OF TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411069987.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2026-11-24
Estimated Expiration
2044-08-06

AI Technical Summary

Technical Problem

Existing video behavior recognition models consume a lot of time and manpower in data annotation and localization, and unsupervised learning leads to low accuracy or excessively long training time. Semi-supervised learning methods have failed to effectively combine supervised and unsupervised learning to reduce annotation costs and improve accuracy.

Method used

We adopt a semi-supervised learning method based on Soft-Teacher, which extracts video features through a local feature learning module and a multi-head attention calculation module, and combines pseudo-labels generated by a teacher model for semi-supervised learning, thereby optimizing the Transformer model training and reducing the dependence on label data.

Benefits of technology

It improves the recognition performance and generalization ability of video behavior recognition models, reduces data annotation costs, and solves the problems of model convergence difficulty and low recognition accuracy, making it suitable for practical deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118982869B_ABST
    Figure CN118982869B_ABST
Patent Text Reader

Abstract

This invention discloses a semi-supervised learning video action recognition method based on Soft-Teacher, belonging to the field of video processing technology. It involves acquiring video sample data and dividing it into labeled and unlabeled data; then inputting the labeled and unlabeled data into a trained video action recognition model to obtain the final classification result of the video action category. This invention reduces the workload of video data annotation by relying on a small amount of labeled data and a large amount of labeled data for training; to address the lost space bias problem of Transformer, a local feature learning module is introduced; and to better utilize the data of the entire sequence, sequence pooling technology is introduced to optimize the predicted values.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of video processing technology, and in particular to a semi-supervised learning video behavior recognition method based on Soft-Teacher. Background Technology

[0002] Behavior recognition plays a crucial role in many applications, including intelligent surveillance, video sequence analysis, and human-computer interaction. In recent years, with the continuous development of computer science and technology, the field of artificial intelligence has also flourished, greatly promoting the intelligence of computers and enabling them to perform simple tasks such as image classification. Behavior recognition is a research hotspot in control science and computer science. As a key technology for machines to understand the world and human behavior, it has received widespread attention from academia and industry in recent years, with significant social demand in areas such as smart elderly care and smart city security construction. Furthermore, since most information people encounter is dynamic, video is more relevant to real life than images.

[0003] As behavior recognition models are continuously optimized, their accuracy and speed are constantly improving. However, the current difficulty in creating video datasets, and the annotation and localization of data require a significant amount of time and manpower, which greatly restricts the development of the video field. While unsupervised or semi-supervised learning methods can solve this problem to some extent, unsupervised learning requires no labels to guide the learning process. Using clustering or K-nearest neighbor methods to classify and judge data can lead to low accuracy or excessively long training times.

[0004] Semi-supervised learning combines supervised and unsupervised learning. It uses a majority of unlabeled data and a small portion of labeled data for training. This reduces the model's strong dependence on labeled data, thus reducing the time and labor costs of data labeling. At the same time, it can use some labeled data to train the model, thus ensuring the training speed and accuracy of the model.

[0005] Therefore, proposing a semi-supervised learning video behavior recognition method based on Soft-Teacher to solve the difficulties of existing technologies is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] In view of this, the present invention provides a semi-supervised learning video behavior recognition method based on Soft-Teacher, which solves the problem of the heavy task of current video data annotation, thus restricting the development of video behavior recognition models.

[0007] To achieve the above objectives, the present invention adopts the following technical solution:

[0008] Semi-supervised learning methods for video behavior recognition based on Soft-Teacher include:

[0009] Obtain video sample data and divide the video sample data into labeled data and unlabeled data;

[0010] Labeled and unlabeled data are input into the trained video behavior recognition model to obtain the final classification result of the video behavior category.

[0011] The above method, optionally, includes a video behavior recognition model comprising: a model to be trained and an exponential average model of the model to be trained;

[0012] The model to be trained is defined as the student model, and the exponential average model of the model to be trained is defined as the teacher model. The teacher model is the sum of multiple iterative versions of the model to be trained.

[0013] The above methods, optionally, include a student model comprising a feature extractor and a classifier;

[0014] Feature extractors are used to process labeled and unlabeled data to obtain feature maps;

[0015] A classifier is used to classify the feature maps obtained by the feature extractor to obtain the final classification result.

[0016] The final classification results include vectors used for supervised learning and vectors used for semi-supervised learning.

[0017] Optionally, the feature extractor in the above method includes: a local feature learning module and multiple sequentially connected multi-head attention calculation modules;

[0018] The local feature learning module consists of three parts: the first part includes 1×1×1 3D convolution, batch normalization, and activation function; the second part includes 1×3×3 depthwise convolution, batch normalization, and activation function; and the third part includes 1×1×1 3D convolution and batch normalization.

[0019] The above method, optionally, maps the feature maps of labeled and unlabeled data to a high-dimensional feature space through a 1×1×1 three-dimensional convolution in the first part, and then adds non-linear information of the features through batch normalization and activation functions.

[0020] The feature map after the first part of processing is then processed in the second part by 1×3×3 depth convolution, batch normalization and activation function single channel processing to obtain the feature map after single channel feature extraction.

[0021] The feature map obtained after single-channel feature extraction in the second part is then subjected to 1×1×1 three-dimensional convolution and batch normalization in the third part. The convolution operation is used to map the feature map after single-channel feature extraction to a low-dimensional space to extract key features, and finally obtain a feature map containing local feature information.

[0022] Optionally, the above method may input the feature map containing local feature information into multiple sequentially connected multi-head attention computing modules to obtain a spatiotemporal feature map.

[0023] The above method may optionally include a sequence pooling module and a multilayer perceptron module as the classifier;

[0024] The weights of the current spatiotemporal feature map are obtained through the sequence pooling module, and the weights of the current spatiotemporal feature map are multiplied by the current spatiotemporal feature map to obtain a weighted spatiotemporal feature map;

[0025] The weighted spatiotemporal feature map is input into the multilayer perceptron module to obtain the final classification result.

[0026] Optionally, the above method involves inputting unlabeled data into the teacher model and outputting pseudo-labels, then comparing and learning the pseudo-labels with the vectors used for semi-supervised learning to obtain a trained recognition model.

[0027] As can be seen from the above technical solution, compared with the prior art, the present invention provides a semi-supervised learning video behavior recognition method based on Soft-Teacher, which has the following beneficial effects:

[0028] 1) To address the issue of spatial information loss during Transformer computation, a local feature learning module is introduced to learn local feature information, enabling better subsequent spatial information learning; 2) Features containing local feature information are then input into a multi-scale visual Transformer, utilizing a multi-head attention mechanism to obtain feature maps. This results in feature maps containing more contextual information, which are then used for behavior category prediction, enabling prediction of the behavior category of a person in a video, such as whether they are riding a bicycle or a horse; 3) The multi-scale visual Transformer model serves as a student model for continuous optimization training, while an exponentially averaged version of the multi-scale visual Transformer serves as a teacher model to generate pseudo-labels for semi-supervised learning training. This reduces the workload of labeling video samples, facilitating model promotion and practical deployment, while also improving the model's generalization ability. The introduction of the teacher model guides the training of the model under test, avoiding problems such as model convergence difficulties and low recognition accuracy, thus improving the model's recognition performance. Attached Figure Description

[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0030] Figure 1 This is a network architecture diagram of the video behavior recognition model disclosed in this invention;

[0031] Figure 2 This is a network architecture diagram of the local feature learning module disclosed in this invention;

[0032] Figure 3 This is a diagram of the classifier network architecture disclosed in this invention;

[0033] Figure 4 This is a schematic diagram illustrating the result of behavior recognition of a person in a video according to an embodiment of the present invention;

[0034] Figure 5 This is a schematic diagram illustrating the results of behavior recognition of a person in a video, as disclosed in another embodiment of the present invention. Detailed Implementation

[0035] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0036] In this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0037] This invention can be used in a wide variety of general-purpose or special-purpose computing environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor devices, distributed computing environments including any of the above devices, etc.

[0038] This invention discloses a semi-supervised learning video behavior recognition method based on Soft-Teacher, comprising:

[0039] Obtain video sample data and divide the video sample data into labeled data and unlabeled data;

[0040] Labeled and unlabeled data are input into the trained video behavior recognition model to obtain the final classification result of the video behavior category.

[0041] Further, see Figure 1 As shown, the video behavior recognition model includes: the model to be trained and the exponential average exponential model of the model to be trained;

[0042] The model to be trained is defined as the student model, and the exponential average model of the model to be trained is defined as the teacher model. The teacher model is the sum of multiple iterative versions of the model to be trained.

[0043] Furthermore, the student model includes: a feature extractor and a classifier;

[0044] Feature extractors are used to process labeled and unlabeled data to obtain feature maps;

[0045] A classifier is used to classify the feature maps obtained by the feature extractor to obtain the final classification result.

[0046] The final classification results include vectors used for supervised learning and vectors used for semi-supervised learning.

[0047] Furthermore, the feature extractor includes: a local feature learning module and multiple sequentially connected multi-head attention computation modules;

[0048] See Figure 2 As shown, the local feature learning module consists of three parts: the first part includes 1×1×1 three-dimensional convolution, batch normalization, and activation function; the second part includes 1×3×3 depthwise convolution, batch normalization, and activation function; and the third part includes 1×1×1 three-dimensional convolution and batch normalization.

[0049] Furthermore, labeled and unlabeled data are mapped to a high-dimensional feature space through a 1×1×1 three-dimensional convolution in the first part. This is used for subsequent feature extraction based on high-dimensional tensors, thereby enabling the extraction of global information and avoiding the problem of information loss in low-dimensional cases. Then, batch normalization and activation functions are used to increase the non-linear information of the features.

[0050] The feature map after the first part of processing is then processed in the second part by 1×3×3 depth convolution, batch normalization and activation function single channel processing to obtain the feature map after single channel feature extraction. Unlike conventional convolution where one convolution kernel is responsible for all channels, in this case, one convolution kernel is responsible for only one channel, which can be used to extract features and has a lower computational cost compared to conventional convolution.

[0051] The feature map obtained after single-channel feature extraction in the second part is then subjected to 1×1×1 three-dimensional convolution and batch normalization in the third part. The convolution operation is used to map the feature map after single-channel feature extraction to a low-dimensional space to extract key features, and finally obtain a feature map containing local feature information.

[0052] Therefore, the local feature learning module only calculates local feature information for the space of each frame, and then obtains a feature map containing local feature information.

[0053] Furthermore, the feature map containing local feature information is input into multiple sequentially connected multi-head attention computing modules to obtain a spatiotemporal feature map.

[0054] Specifically, the feature map containing local feature information is then input into the multi-head attention computation module of the multi-scale visual Transformer to calculate the spatiotemporal feature map for the final video features. The overall computation flow of the multi-scale visual Transformer is as follows:

[0055] First, the 5-dimensional input feature map is converted into a vector form, where a 3-dimensional convolution transforms the feature map from 5-dimensional to 3-dimensional. Convert to

[0056] The input vector is used to calculate three vectors—the query vector, the key vector, and the value vector—using three learnable weight matrices. The calculation process can be simply represented as follows:

[0057] Q = XW Q

[0058] K = XW K

[0059] V = XW V

[0060] The attention feature map is calculated based on the three obtained vectors, and the calculation process can be represented as follows:

[0061]

[0062] If the attention calculation module in the architecture uses a multi-head attention calculation mechanism, it is equivalent to performing the attention calculation process multiple times. The overall calculation process of a module can be represented as follows:

[0063] X1=MHA(LN(X))+X

[0064] Block(X) = MLP(LN(X1)) + X1

[0065] Here, MHA represents multi-head attention computation, LN is layer normalization, which performs a normalization operation on the layer, and MLP is a fully connected layer that yields the final feature map, i.e., the spatiotemporal feature map.

[0066] Furthermore, the classifier includes a sequence pooling module and a multilayer perceptron module;

[0067] The weights of the current spatiotemporal feature map are obtained through the sequence pooling module, and the weights of the current spatiotemporal feature map are multiplied by the current spatiotemporal feature map to obtain a weighted spatiotemporal feature map;

[0068] The weighted spatiotemporal feature map is input into the multilayer perceptron module to obtain the final classification result.

[0069] For details, see Figure 3 As shown, the sequence pooling module includes: layer normalization, average pooling, and activation functions; the multilayer perceptron module includes: layer normalization and linear layers.

[0070] The overall calculation process can be expressed as follows:

[0071]

[0072]

[0073] Here, g represents the average pooling technique, and the final weighted feature vector is represented by Z. Then, the feature vector Z is mapped to the feature space of the true label through a multilayer perceptron to obtain the final prediction vector.

[0074] The above describes the prediction process of the student model. It outputs two types of vectors: one is a prediction vector used for supervised learning, which is then compared with the true label using cross-entropy; the other is a vector used for semi-supervised learning, which is compared with the pseudo-labels of the teacher model.

[0075] Furthermore, labeled data is input into the teacher model to output pseudo-labels. The pseudo-labels are then compared with the vectors used for semi-supervised learning to obtain a trained video behavior recognition model.

[0076] Specifically, the steps of semi-supervised learning are as follows:

[0077] The input data includes labeled and unlabeled data, and the ratio of labeled to unlabeled data is selected according to the characteristics of the downstream task. The unlabeled data will be input into the student model and the teacher model for semi-supervised learning training, while the labeled data will be input into the student model for supervised learning training.

[0078] Unlabeled data is divided into two types: one type, which has been randomly erased and is more difficult to identify, is input into the student model for prediction; the other type, after simple cropping, is input into the teacher model.

[0079] For constructing the teacher model, this invention uses the exponential average of the student model weights to obtain the teacher model weights, as the weights obtained by the exponential average are more stable and reliable. The calculation method for updating the teacher model weights is as follows:

[0080] v t =β·v t-1 +(1-β)·θ t

[0081] Among them, v t The weights are obtained by training the entire dataset once. Since the weights are unstable and have low reliability in the early stages, the β is 0.9 in the early stages, while the β is 0.999 when the weights are stable in the later stages.

[0082] For constructing the pseudo-label loss, JS divergence is used for calculation. JS divergence is based on KL divergence, which measures the difference between two distributions. JS divergence is a "symmetric KL divergence" proposed to address the asymmetry problem of KL divergence. It avoids the problem that KL divergence is meaningless when the two distributions are very different and completely unrelated. Its calculation method is as follows:

[0083]

[0084] Considering that the teacher model's predictions are more stable and reliable, the necessity for aligning the teacher model with the student model should be reduced. Therefore, the unequal JS loss is proposed:

[0085]

[0086] Ultimately, the loss of the entire model should consist of two parts: supervised learning loss and semi-supervised learning loss.

[0087] Loss = Loss sup +Loss semi

[0088] The supervised learning loss can be expressed as:

[0089]

[0090] Here, x and y represent the model's predicted value and the true label value corresponding to the input video, respectively, and the similarity between the two results is calculated using cross-entropy loss.

[0091] This invention proposes a video behavior recognition framework based on semi-supervised learning. For the video recognition model, a local feature learning module is introduced to overcome the spatial bias loss problem in Transformer computation, thereby optimizing Transformer training. A classifier module incorporating sequence pooling is introduced, which performs pooling operations on the entire sequence of data to better extract key information for final prediction. For the semi-supervised learning framework, the student model is input with a set of randomly erased video frames, while the teacher model is input with a set of randomly cropped video frames. The teacher model's weights are represented by the exponential average of the student model's weights, resulting in greater stability and accuracy. The pseudo-labels generated by the teacher model are used for comparison with the student model's predictions. Here, JS divergence is introduced to avoid gradient vanishing during calculation. Ultimately, the entire framework includes both semi-supervised and supervised learning components, effectively reducing reliance on labeled data while maintaining training reliability through supervised learning.

[0092] According to the disclosure of this invention, the recognition performance and generalization ability of video behavior recognition models can be improved. In addition, since a semi-supervised learning training method is introduced, the cost of preliminary preparation of video behavior recognition data can be reduced, which is conducive to the promotion and practical application deployment of the model. Furthermore, due to the guidance of the teacher model, the problem of model convergence difficulty and low recognition accuracy in unsupervised learning can be solved.

[0093] The video behavior recognition model of this invention can effectively identify the behavior of people in a video, and further processing can be performed based on the model's predictions of the behavior, such as classroom behavior management or alerts for dangerous behaviors of elderly people and children at home. In a specific embodiment of this invention, the model's results for recognizing the behavior of people in the video refer to... Figure 4 and Figure 5 As shown, Figure 4 The behavior identification result is high jump. Figure 5The behavior identification result is a bicycle.

[0094] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0095] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A semi-supervised learning video behavior recognition method based on Soft-Teacher, characterized in that, Includes the following: Obtain video sample data and divide the video sample data into labeled data and unlabeled data; Labeled and unlabeled data are input into the trained video behavior recognition model to obtain the final classification result of the video behavior category; The video behavior recognition model includes: the model to be trained and the exponential average exponential model of the model to be trained; The model to be trained is defined as the student model, the exponential average model of the model to be trained is defined as the teacher model, and the teacher model is the sum of multiple iterative versions of the model to be trained. The student model includes: a feature extractor and a classifier; Feature extractors are used to process labeled and unlabeled data to obtain feature maps; A classifier is used to classify the feature maps obtained by the feature extractor to obtain the final classification result. The final classification results include: vectors used for supervised learning and vectors used for semi-supervised learning; The feature extractor includes: a local feature learning module and multiple interconnected multi-head attention computation modules; The local feature learning module consists of three parts. The first part includes: The first part includes 3D convolution, batch normalization, and activation functions; the second part includes: The third part includes: depthwise convolution, batch normalization, and activation functions; 3D convolution and batch normalization; Labeled and unlabeled data are separated by the size in the first part. The three-dimensional convolution maps the feature map to a high-dimensional feature space, and then adds non-linear information to the feature through batch normalization and activation functions; The feature map processed in the first part then goes through the second part. Single-channel processing using depthwise convolution, batch normalization, and activation functions yields a feature map after single-channel feature extraction. The feature map obtained after single-channel feature extraction in the second part of the processing is then processed in the third part... The three-dimensional convolution and batch normalization are used, where the convolution operation is used to map the feature map after single-channel feature extraction to a low-dimensional space to extract key features, and finally obtain a feature map containing local feature information. The feature map containing local feature information is input into multiple sequentially connected multi-head attention computing modules to obtain the spatiotemporal feature map; The classifier includes: a sequence pooling module and a multilayer perceptron module; The weights of the current spatiotemporal feature map are obtained through the sequence pooling module, and the weights of the current spatiotemporal feature map are multiplied by the current spatiotemporal feature map to obtain a weighted spatiotemporal feature map; The weighted spatiotemporal feature map is input into the multilayer perceptron module to obtain the final classification result.

2. The semi-supervised learning video behavior recognition method based on Soft-Teacher according to claim 1, characterized in that, After inputting unlabeled data into the teacher model, pseudo-labels are output. The pseudo-labels are then compared with the vectors used for semi-supervised learning to obtain a trained video behavior recognition model.

Citation Information

Patent Citations

  • System and method for training machine learning models with teacher and student frameworks

    CN118279638A