A few-shot action recognition method based on meta-learning
Through a method based on meta-learning, shallow three-dimensional convolutional neural networks and two-dimensional convolutional networks are used to extract video features, which solves the problem of recognition accuracy of video behavior recognition in small sample data and special scenarios, and achieves higher general-purpose ization ability and recognition accuracy.
Patent Information
- Application Number
- CN202110319209.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-25
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-03-25
AI Technical Summary
The existing technology is difficult to effectively use a small amount of sample data to train a video behavior recognition model. Especially in massive video data and special scenarios, it is difficult to improve the accuracy. Moreover, video behavior recognition is prone to overfitting in the time dimension and lacks generalization capabilities.
Using a method based on meta-learning, the video data set is divided into a meta-training set and a meta-test set, a shallow three-dimensional convolutional neural network is used to extract video features, and model parameters adapted to different tasks are generated through the meta-learning network, combined with second-order transformation and normalization processing, using multi-layer two-dimensional convolutional networks to extract nonlinear distance relationships for classification.
It improves the inter-task generalization ability of the video behavior recognition model and the recognition accuracy of new video behaviors, and can achieve higher recognition results with less sample data.
Smart Images

Figure CN113052073B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video behavior recognition, and in particular to a few-sample behavior recognition method based on meta-learning. Background Art
[0002] Behavior recognition technology is one of the research focuses in the field of computer vision and is widely used in urban traffic control, smart security and other fields.
[0003] With the rapid development of network technology and the large-scale installation of smart cameras, video data is growing explosively every day. Although the technical progress of deep learning in the past decade has greatly improved the accuracy of video behavior recognition, it has brought great difficulties to people to label such a large amount of video data. Not only that, it is still relatively rare to collect videos in specific fields, such as abnormal behavior scenes, dangerous behaviors in factories, etc. How to train the model with only a small amount of sample data and obtain a high accuracy rate has been a hot topic for researchers in recent years.
[0004] Meta-learning technology aims to enable computers to acquire human-like capabilities, so that they can learn general experiential knowledge from previous tasks and use it in new tasks. The training set of meta-learning technology is composed of tasks one by one, aiming to learn general knowledge. Researchers often use meta-learning technology to solve the problem of few-sample learning. Compared with static images, video behavior recognition adds a time dimension. How to extract effective features and enhance the model's generalization ability for different tasks while avoiding overfitting, that is, using deep neural networks, is a key issue that needs to be studied. Summary of the invention
[0005] In order to overcome the above problems, the present invention provides a meta-learning-based few-sample behavior recognition method which uses a shallow network and can extract video features using different parameters according to different video behavior recognition tasks and has strong generalization ability.
[0006] The technical solution adopted by the present invention to solve its technical problem is:
[0007] A few-sample behavior recognition method based on meta-learning, the method comprising the following steps:
[0008] 1) The video dataset is divided into a meta-training set and a meta-testing set. Multiple groups of support sets and query sets are extracted from the meta-training set for training the model, and multiple groups of support sets and query sets are extracted from the meta-testing set for testing the model.
[0009] 2) Use a shallow 3D convolutional neural network to extract video features of the support set and query set;
[0010] 3) constructing a meta-learning network to model the support set and generate the parameters of the shallow three-dimensional convolutional neural network in step 2);
[0011] 4) Performing second-order transformation and normalization processing on the video features extracted in step 2);
[0012] 5) The processed support set and query set video features are spliced, and a multi-layer two-dimensional convolutional neural network is used to extract the nonlinear distance relationship between the query set and support set video features to classify the training set videos.
[0013] Furthermore, in step 1), the process of dividing the video data set includes: dividing the video data set into a meta-training set D meta-train and meta-test set D meta-test , during the training process, each round starts from D meta-train Randomly select N different classes, each class has K different samples to form the support set Then from the remaining D meta-train Randomly select samples from these N classes to form a query set During the test, D meta-test Do the same operation.
[0014] Furthermore, in step 3), the process of the meta-learning network generating the shallow three-dimensional convolutional network parameters in step 2) is as follows: Input the task encoder E composed of a three-dimensional convolutional network to obtain the probability distribution of the task. The task is represented as a conditional probability distribution model to obtain the task feature vector t, as shown in equations (1) and (2):
[0015]
[0016]
[0017] Where q is the conditional probability distribution, is a normal distribution;
[0018] Then, a single-layer fully connected neural network g is used to generate the network parameters θ of the three-dimensional convolution in step 2), as shown in formula (3):
[0019] θ=g(t) (3)
[0020] The network parameters obtained in formula (3) are regularized, as shown in formula (4):
[0021]
[0022] Furthermore, in step 2), the shallow three-dimensional convolutional network f θ Using the parameters θ generated by the meta-learning network in step 3), video features are extracted and the video feature representation is calculated as:
[0023] w=f θ(x) (5)
[0024] Where x is a video clip, and x∈R C×T×H×W , w is the video feature, and w∈R C'×T'×H'×W' .
[0025] Furthermore, in step 4), the process of processing the video feature w extracted in step 2) is as follows: first, w∈R C’×T’×H’×W’ Change the dimension to w'∈R C'×M (M=T'×H'×W'), find the second-order characteristics The formula is as follows:
[0026]
[0027] Where ψ(·) is the normalization function, as follows:
[0028]
[0029] Furthermore, in step 5), the process of finding the metric relationship between the support set and the query set and classifying the query set is as follows: the video features of the support set and the query set extracted in step 4) are Splicing is performed, expressed as The concatenated features are input into a multi-layer two-dimensional convolutional network to obtain the similarity r, as shown in formula (8):
[0030]
[0031] Where r i,j Is a value from 0 to 1, indicating the support set video x i and inquiry video x j similarity;
[0032] Finally, the mean square error formula is used as the loss function, as shown in formula (9):
[0033]
[0034] The technical concept of the present invention is to solve the problem that it is difficult to label massive videos and collect videos of special scenes in today's society. The present invention uses a meta-learning training method and multi-task training. At the same time, adaptive model parameters are used for different tasks to more effectively extract video features. The extracted video features are pre-processed by second-order and normalization, and finally the video features of the support set and the query set are spliced, and a two-dimensional convolutional network is used to obtain nonlinear metric relationships.
[0035] The beneficial effects of the present invention are: good inter-task generalization ability and recognition accuracy of new video behaviors. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is the overall framework diagram of the model of the present invention.
[0037] Figure 2 This is a framework diagram of the meta-learning network in the present invention.
[0038] Figure 3 This is a flowchart of the few-shot action recognition method based on meta-learning. DETAILED DESCRIPTION
[0039] The present invention will be further described below in conjunction with the accompanying drawings.
[0040] Reference Figure 1 and Figure 2 , a few-shot action recognition method based on meta-learning, comprising the following steps:
[0041] 1) The video dataset is divided into a meta-training set and a meta-testing set. Multiple groups of support sets and query sets are extracted from the meta-training set for training the model, and multiple groups of support sets and query sets are extracted from the meta-testing set for testing the model.
[0042] Divide the video dataset into a meta-training set D meta-train and meta-test set D meta-test , during the training process, each round starts from D meta-train Randomly select N different classes, each class has K different samples to form the support set Then from the remaining D meta-train Randomly select samples from these N classes to form a query set During the test, D meta-test Do the same operation.
[0043] 2) Use a shallow 3D convolutional neural network to extract video features of the support set and query set;
[0044] 3) Construct a meta-learning network to model the support set and generate the parameters of the shallow 3D convolutional neural network in step 2); the process is as follows: Input the task encoder E composed of a convolutional network to obtain the probability distribution of the task, and express the task as a conditional probability distribution model to obtain the task feature vector t, as shown in equations (1) and (2):
[0045]
[0046]
[0047] Where q is the conditional probability distribution, is a normal distribution;
[0048] Then, the network parameters θ of the three-dimensional convolution in the single-layer fully connected neural network g are used, as shown in formula (3):
[0049] θ=g(t) (3)
[0050] The network parameters obtained in formula (3) are regularized, as shown in formula (4):
[0051]
[0052] In step 2), the shallow three-dimensional convolutional network f θ Using the parameters θ generated by the meta-learning network in step 3), video features are extracted and the video feature representation is calculated as:
[0053] w=f θ (x) (5)
[0054] Where x is a video clip, and x∈R C×T×H×W , w is the video feature, and w∈R C'×T'×H'×W' .
[0055] 4) Performing second-order transformation and normalization processing on the video features extracted in step 2);
[0056] The process of processing the video feature w extracted in step 2) is as follows: First, w∈R C’×T’×H’×W’ Change the dimension to w'∈R C’×M (M=T'×H'×W'), find the second-order characteristics The formula is as follows:
[0057]
[0058] Where ψ(·) is the normalization function, which is as follows:
[0059]
[0060] 5) The processed support set and query set video features are spliced, and a multi-layer two-dimensional convolutional neural network is used to extract the nonlinear distance relationship between the query set and support set video features to classify the training set videos.
[0061] The video features of the support set and query set extracted in step 3) Splicing is performed, expressed as The concatenated features are input into a multi-layer two-dimensional convolutional network to obtain the similarity r, as shown in formula (8):
[0062]
[0063] Where r i,j Is a value from 0 to 1, indicating the support set video x i and inquiry video x j similarity;
[0064] Finally, the mean square error formula is used as the loss function, as shown in formula (9):
[0065]
[0066] The contents described in the embodiments of this specification are merely enumerations of implementation forms of the inventive concept and are for illustrative purposes only. The protection scope of the present invention should not be considered to be limited to the specific forms described in this embodiment, and the protection scope of the present invention also extends to equivalent technical means that can be thought of by ordinary technicians in this field based on the inventive concept.
Claims
1. A few-sample behavior recognition method based on meta-learning, characterized in that: The method comprises the following steps: 1) The video dataset is divided into a meta-training set and a meta-testing set. Multiple groups of support sets and query sets are extracted from the meta-training set for training the model, and multiple groups of support sets and query sets are extracted from the meta-testing set for testing the model. 2) Use a shallow 3D convolutional neural network to extract video features of the support set and query set; 3) constructing a meta-learning network to model the support set and generate the parameters of the shallow three-dimensional convolutional neural network in step 2); 4) Performing second-order transformation and normalization processing on the video features extracted in step 2); 5) The processed support set and query set video features are spliced, and a multi-layer two-dimensional convolutional neural network is used to extract the nonlinear distance relationship between the query set and support set video features to classify the training set videos; In step 1), the video data set division process includes: dividing the video data set into a meta-training set D meta-train and meta-test set D meta-test , during the training process, each round starts from D meta-train Randomly select N different classes, each class has K different samples to form the support set Then from the remaining D meta-train Randomly select samples from these N classes to form a query set During the test, D meta-test Do the same operation; In step 3), the process of the meta-learning network generating the shallow three-dimensional convolutional network parameters in step 2) is as follows: Input the task encoder E composed of a three-dimensional convolutional network to obtain the probability distribution of the task. The task is represented as a conditional probability distribution model to obtain the task feature vector t, as shown in equations (1) and (2): Where q is the conditional probability distribution, is a normal distribution; Then, a single-layer fully connected neural network g is used to generate the network parameters θ of the three-dimensional convolution in step 2), as shown in formula (3): θ=g(t) (3) The network parameters obtained in formula (3) are regularized as shown in formula (4): In step 2), the shallow three-dimensional convolutional network f θ Using the parameters θ generated by the meta-learning network in step 3), video features are extracted and the video feature representation is calculated as: w=f θ (x) (5) Where x is a video clip, and x∈R C×T×H×W , w is the video feature, and w∈R C'×T'×H'×W' .
2. The method for few-sample behavior recognition based on meta-learning according to claim 1, characterized in that: In step 4), the process of processing the video feature w extracted in step 2) is as follows: first, w∈R C′×T′×H′×W′ Change the dimension to w'∈R C'×M (M=T'×H'×W'), find the second-order characteristics The formula is as follows: Where ψ(·) is the normalization function, as follows:
3. The method for few-sample behavior recognition based on meta-learning according to claim 2, characterized in that: In step 5), the process of finding the metric relationship between the support set and the query set and classifying the query set is as follows: the video features of the support set and the query set extracted in step 4) are Splicing is performed, expressed as The concatenated features are input into a multi-layer two-dimensional convolutional network to obtain the similarity r, as shown in formula (8): Where r i,j Is a value from 0 to 1, indicating the support set video x i and inquiry video x j similarity; Finally, the mean square error formula is used as the loss function, as shown in formula (9):
