First person behavior recognition method based on visual language model and graph convolution
Through the method based on visual language model and graph convolution, knowledge graphs are constructed and time features are integrated, which solves the complexity and ambiguity of behavior recognition in the first-person perspective, and achieves more accurate behavior recognition.
Patent Information
- Application Number
- CN202411307539.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2024-12-17
AI Technical Summary
The prior art has difficulty in identifying behaviors in the first-person perspective, especially in complex actions and diverse scenarios. Traditional methods cannot effectively capture behavior details, and the perspective limitations and environmental impacts are great.
Using a method based on visual language model and graph convolution, a knowledge graph is constructed by obtaining image group data sets and label prompt words, combining time feature fusion, and behavior recognition is performed. The specific steps include: obtaining the image group data set and label prompt words, inputting the pre-trained visual language model to obtain text and visual features, building a dual fusion knowledge graph, performing shape reshaping and timing fusion, and training graph convolution network and timing fusion model , and finally construct a first-person behavior recognition model.
It provides more accurate and stable behavior recognition results, and can effectively handle complex and fuzzy first-person perspective videos through semantic supplementation, structured features and fusion of space-time information.
Smart Images

Figure CN119152576A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing and computer vision, and relates to a first-person behavior recognition method based on a visual language model and graph convolution. Background Art
[0002] First-person action recognition is an important research direction in computer vision and machine learning. It aims to identify behaviors and activities by analyzing first-person perspective videos captured by cameras. This technology has broad potential in multiple application scenarios, such as intelligent surveillance, virtual reality (VR), augmented reality (AR), and human-computer interaction.
[0003] With the rapid development of the Internet, video data captured from the first-person perspective is becoming more and more abundant, which provides a large amount of data basis for traffic behavior recognition from the first-person perspective. However, first-person behavior recognition still faces a series of challenges. First, due to the viewing angle limitations of the camera, the actions and behaviors in the first-person video usually present different perspectives and angles, which makes it more difficult to identify the behavior from these perspectives. Secondly, in the first-person perspective, fast or complex movements may cause blur, making behavior recognition more challenging. In addition, different environments and scenarios will affect the performance of the behavior. For example, the behavior may be presented very differently in a small space and a wide space.
[0004] Traditional action recognition methods mainly rely on action features and visual features in videos. These methods are usually based on convolutional neural networks (CNN) to extract spatial features and recurrent neural networks (RNN) or long short-term memory networks (LSTM) to model time series. However, these methods have certain limitations when dealing with complex actions and diverse scenes, especially in the first-person perspective, traditional methods may not be able to effectively capture the details of the behavior. Summary of the invention
[0005] To solve the above problems, the present invention provides a first-person action recognition method based on a visual language model and graph convolution, comprising the following steps:
[0006] S1. Obtain an image group data set and its corresponding label prompt word data set; the image group data set includes multiple image groups, each image group corresponds to a label prompt word, and each image group includes 8 frames of images collected for the same target;
[0007] S2. Input the label prompt word dataset into the text editor of the pre-trained visual language model CLIP to obtain a text feature set; input the image group dataset into the visual editor of the pre-trained visual language model CLIP to obtain a visual feature set;
[0008] S3. Based on the text feature set and the visual feature set, a graph convolutional network is used to obtain a dual fusion knowledge graph;
[0009] S4. reshape the image group data set to obtain a first reshaped data set, and input the first reshaped data set into a visual editor to obtain a reshaped visual feature;
[0010] S5. reshape the reshaped visual feature to obtain a second reshaped visual feature, and input the second reshaped visual feature into a temporal fusion model to obtain a temporal visual feature;
[0011] S6. Fuse the temporal visual features with the dual fusion knowledge graph to obtain the recognition result, calculate the loss back propagation based on the recognition result to train the graph convolutional network, the temporal fusion model and the visual editor of the visual language model CLIP;
[0012] S7. Use the text editor and visual editor of the visual language model CLIP, as well as the trained graph convolutional network and temporal fusion model to build a first-person action recognition model; use the first-person action recognition model for recognition.
[0013] Furthermore, step S3 specifically includes:
[0014] S31. Based on the text feature set represents the c=1,2,…,C-th type of text features, where C represents the number of categories; each type of text feature is taken as a node, and the cosine similarity between each two nodes is calculated as an edge, thereby constructing a text knowledge subgraph G t ;
[0015] S32. Using text feature set z t With the visual feature set z v Repeated matching and merging are performed to obtain a merged visual feature set. Each type of merged visual feature in the merged visual feature set is taken as a node, and the cosine similarity between each two nodes is calculated as an edge to construct a merged visual knowledge subgraph G. vt ;in represents the c-th visual feature group;
[0016] S33. The text knowledge subgraph G t and merge visual knowledge subgraph G vt Send them into different graph convolutional networks to obtain text knowledge graph and visual knowledge graph; fuse the text knowledge graph and visual knowledge graph to obtain a dual fusion knowledge graph.
[0017] Further, in step S32, the text feature set z t Including C types of text features, each type of text feature The size of is 1×d; the visual feature set zv It includes C types of visual feature groups, each visual feature group includes m visual features, and the size of each visual feature is 1×d; C represents the number of categories, d represents the feature dimension, K=C×m, and m represents the number of sampling frames; each visual feature group is merged with the text features of its corresponding category, and finally K merged visual features of size 1×d are obtained to form a merged visual feature set.
[0018] Furthermore, the ResNet50 network is used as the skeleton network of the visual language model CLIP.
[0019] Furthermore, the shape of the image group data set is (number of sampling samples, number of sampling frames, number of channels, width, height); the image group data set is reshaped to obtain a first reshaped data set, and the shape of the first reshaped data set is (number of sampling samples × number of sampling frames, number of channels, width, height); the first reshaped data is input into the visual editor to obtain a reshaped visual feature, and the shape of the reshaped visual feature is (number of sampling samples × number of sampling frames, feature dimension); the reshaped visual feature is reshaped to obtain a second reshaped visual feature, and the shape of the second reshaped visual feature is (number of sampling samples, number of sampling frames, feature dimension).
[0020] Furthermore, the temporal fusion model includes 6 ResidualAttentionBlocks, each of which includes a multi-head attention layer, layer normalization, and a multi-layer perceptron.
[0021] Beneficial effects of the present invention:
[0022] The present invention provides a first-person action recognition method based on a visual language model and graph convolution. The method is mainly carried out from three aspects: visual language model, knowledge graph and time feature fusion. First, the visual language model is used to provide semantic supplementary information for local blur or occlusion during the action process; secondly, a knowledge graph is constructed based on the features extracted by the visual language model to model the action more comprehensively; finally, the temporal and spatial information of the sample is fused using time feature fusion to capture the dynamic changes of the action. By combining the three technologies, the present invention can provide more accurate and stable action recognition results when facing complex and blurred first-person perspective videos. The visual language model supplements visual information through contextual information, the knowledge graph improves behavior understanding through structured features, and the time feature fusion ensures behavior recognition under dynamic changes. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a schematic diagram of the structure of the model of the present invention;
[0024] Figure 2 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] The present invention provides a first-person action recognition method based on visual language model and graph convolution, such as Figure 1 , Figure 2 As shown, the following steps are included:
[0027] S1. Get the image group dataset {I1, I2,…, I C} and its corresponding label prompt word dataset {X1,
[0028] X2,…,X C}; The image group data set includes multiple image groups, each image group corresponds to a label prompt word, and each image group includes 8 frames of images collected for the same target. c represents the c-th image group, X c Indicates the c-th category label prompt word. Specifically, the present invention uses 8 frames of images to obtain timing information, and can better distinguish similar action features.
[0029] S2. Input the label prompt word dataset into the text editor of the pre-trained visual language model CLIP to obtain a text feature set; input the image group dataset into the visual editor of the pre-trained visual language model CLIP to obtain a visual feature set.
[0030] Specifically, the same image group dataset is sampled multiple times to form a sampled dataset, the sampled dataset is divided into a training set and a test set in proportion, the training set is input into the visual editor of the pre-trained visual language model CLIP to obtain a corresponding feature set, the average feature of each category is calculated according to the feature set to obtain the visual feature group of each category, and the visual feature groups of all categories are combined to obtain the visual feature set in, represents the mth visual feature of the cth visual feature group. In the embodiment of the present invention, m=8.
[0031] Specifically, the visual language model CLIP understands the relationship between paired images and texts through contrastive learning, allowing the model to learn to make visual features and text features as similar as possible, and the skeleton network uses ResNet50.
[0032] S3. Based on the text feature matrix and the visual feature matrix, a graph convolutional network is used to obtain the dual fusion knowledge graph.
[0033] Specifically, step S3 includes:
[0034] S31. Based on the text feature set represents the c=1,2,…,C-th type of text features, where C represents the number of categories; each type of text feature is taken as a node, and the cosine similarity between each two nodes is calculated as an edge, thereby constructing a text knowledge subgraph G t ;
[0035] S32. Using text feature set z t With the visual feature set z v Repeated matching and merging are performed to obtain a merged visual feature set. Each type of merged visual feature in the merged visual feature set is taken as a node, and the cosine similarity between each two nodes is calculated as an edge to construct a merged visual knowledge subgraph G. vt ;in represents the c-th visual feature group;
[0036] Specifically, in step S32, the text feature set z t Including C types of text features, each type of text feature The size of is 1×d; the visual feature set z v It includes C types of visual feature groups, each of which includes m visual features, and the size of each visual feature is 1×d; wherein C represents the number of categories, d represents the feature dimension, K=C×m, and m represents the number of sampling frames; each visual feature group is merged with the text features of its corresponding category to obtain C types of merged visual feature groups, each of which includes m merged visual features, that is, K merged visual features of size 1×d are obtained to form a merged visual feature set.
[0037] S33. The text knowledge subgraph G t and merge visual knowledge subgraph G vt Send them into different graph convolutional networks to obtain text knowledge graph and visual knowledge graph; fuse the text knowledge graph and visual knowledge graph to obtain a dual fusion knowledge graph.
[0038] Specifically, the present invention uses a language graph convolutional network and a visual graph convolutional network to process the text knowledge subgraph G respectively. t and merge visual knowledge subgraph G vt ; The specific process can be expressed as:
[0039]
[0040] in, Represents the text knowledge subgraph G t The transpose of the node feature matrix, W t represents the weight matrix of the language graph convolutional network, represents the normalized adjacency matrix, A t Represents the text knowledge subgraph G t The adjacency matrix is a matrix representing the connection relationship in the graph formed according to the cosine similarity between nodes; Nt represents the identity matrix, N(·) represents the normalization function, b t represents the bias term, σ t (·) represents Tanh activation function;
[0041]
[0042] in, Represents the merged visual knowledge subgraph G vt The transpose of the node feature matrix, W vt represents the weight matrix of the visual graph convolutional network, represents the normalized adjacency matrix, A vt Represents the merged visual knowledge subgraph G vt The adjacency matrix is a matrix representing the connection relationship in the graph formed according to the cosine similarity between nodes; Nv represents the identity matrix, N(·) represents the normalization function, b vt represents the bias term, σ vt (·) denotes the Tanh activation function.
[0043] Specifically, the weight factor α is introduced to transform the text knowledge graph O t and visual knowledge graph O vt The weighted fusion obtains the dual fusion knowledge graph F, which is expressed as:
[0044] F=αO t +(1-α)O vt
[0045] S4. Reshape the image group data set to obtain a first reshaped data set, and input the first reshaped data set into a visual editor to obtain a reshaped visual feature.
[0046] S5. Reshape the reshaped visual feature to obtain a second reshaped visual feature, and input the second reshaped visual feature into a temporal fusion model to obtain a temporal visual feature.
[0047] Specifically, the shape of the image group data set is (number of sampling samples, number of sampling frames, number of channels, width, height); the image group data set is reshaped to obtain a first reshaped data set, and the shape of the first reshaped data set is (number of sampling samples × number of sampling frames, number of channels, width, height); the first reshaped data is input into the visual editor to obtain a reshaped visual feature, and the shape of the reshaped visual feature is (number of sampling samples × number of sampling frames, feature dimension); the reshaped visual feature is reshaped to obtain a second reshaped visual feature, and the shape of the second reshaped visual feature is (number of sampling samples, number of sampling frames, feature dimension). The number of sampling samples mentioned here refers to the training set size (training set data volume) formed after multiple sampling of the image group data in step S2; in this embodiment, the number of sampling frames is 8; the number of channels refers to the number of channels of an image, and the width and height refer to the width and height of an image. The number of channels, width and height of all images collected in the present invention are consistent.
[0048] Specifically, the temporal fusion model includes 6 ResidualAttentionBlocks, each of which includes a multi-head attention layer, layer normalization, and a multi-layer perceptron.
[0049] S6. Fuse the temporal visual features with the dual fusion knowledge graph to obtain the recognition result, and calculate the loss back-propagation based on the recognition result to train the graph convolutional network, temporal fusion model and visual editor.
[0050] Specifically, a learnable weight parameter s is introduced to fuse the temporal visual feature Ft with the dual fusion knowledge graph F to obtain the recognition result, that is, the category probability, which can be expressed as follows:
[0051] P=sF t +F
[0052] S7. Use a text editor, a trained graph convolutional network, a temporal fusion model, and a visual editor to build a first-person action recognition model; and use the first-person action recognition model for recognition.
[0053] In the method proposed in the present invention, the temporal information is enriched by sampling 8 frames of pictures. At the same time, the text features are integrated into the visual features before constructing the visual knowledge graph, which can be better constructed when constructing the graph (because of the guidance of semantic information). In addition, the visual encoder is trained together during the training process, which can extract features closer to the data set.
[0054] In the present invention, unless otherwise clearly stipulated and limited, the terms such as "installation", "setting", "connection", "fixation" and "rotation" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral one; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium; it can be the internal connection of two elements or the interaction relationship between two elements. Unless otherwise clearly defined, ordinary technicians in this field can understand the specific meanings of the above terms in the present invention according to the specific circumstances.
[0055] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A first-person action recognition method based on visual language model and graph convolution, characterized in that: The following steps are involved: S1. Obtain an image group data set and its corresponding label prompt word data set; the image group data set includes multiple image groups, each image group corresponds to a label prompt word, and each image group includes 8 frames of images collected for the same target; S2. Input the label prompt word dataset into the text editor of the pre-trained visual language model CLIP to obtain a text feature set; input the image group dataset into the visual editor of the pre-trained visual language model CLIP to obtain a visual feature set; S3. Based on the text feature set and the visual feature set, a graph convolutional network is used to obtain a dual fusion knowledge graph; S4. reshape the image group data set to obtain a first reshaped data set, and input the first reshaped data set into a visual editor to obtain a reshaped visual feature; S5. reshape the reshaped visual feature to obtain a second reshaped visual feature, and input the second reshaped visual feature into a temporal fusion model to obtain a temporal visual feature; S6. Fuse the temporal visual features with the dual fusion knowledge graph to obtain the recognition result, calculate the loss back propagation based on the recognition result to train the graph convolutional network, the temporal fusion model and the visual editor of the visual language model CLIP; S7. Use the text editor and visual editor of the visual language model CLIP, as well as the graph convolutional network and temporal fusion model to build a first-person action recognition model; use the first-person action recognition model for recognition.
2. According to claim 1, a first-person action recognition method based on visual language model and graph convolution is characterized in that: Step S3 specifically includes: S31. Based on the text feature set represents the c=1,2,…,C-th type of text features, where C represents the number of categories; each type of text feature is taken as a node, and the cosine similarity between each two nodes is calculated as an edge, thereby constructing a text knowledge subgraph G t ; S32. Using text feature set z t With the visual feature set z v Repeated matching and merging are performed to obtain a merged visual feature set. Each type of merged visual feature in the merged visual feature set is taken as a node, and the cosine similarity between each two nodes is calculated as an edge to construct a merged visual knowledge subgraph G. vt ;in represents the c-th visual feature group; S33. The text knowledge subgraph G t and merge visual knowledge subgraph G vt Send them into different graph convolutional networks to obtain text knowledge graph and visual knowledge graph; fuse the text knowledge graph and visual knowledge graph to obtain a dual fusion knowledge graph.
3. According to claim 2, a first-person action recognition method based on visual language model and graph convolution is characterized in that: In step S32, the text feature set z t Including C types of text features, each type of text feature The size of is 1×d; the visual feature set z v It includes C types of visual feature groups, each visual feature group includes m visual features, and the size of each visual feature is 1×d; C represents the number of categories, d represents the feature dimension, K=C×m, and m represents the number of sampling frames; each visual feature group is merged with the text features of its corresponding category, and finally K merged visual features of size 1×d are obtained to form a merged visual feature set.
4. According to claim 1, a first-person action recognition method based on visual language model and graph convolution is characterized in that: The ResNet50 network is used as the skeleton network of the visual language model CLIP.
5. According to claim 1, a first-person action recognition method based on visual language model and graph convolution is characterized in that: The shape of the image group data set is (number of sampling samples, number of sampling frames, number of channels, width, height); the image group data set is reshaped to obtain a first reshaped data set, and the shape of the first reshaped data set is (number of sampling samples × number of sampling frames, number of channels, width, height); the first reshaped data is input into the visual editor to obtain a reshaped visual feature, and the shape of the reshaped visual feature is (number of sampling samples × number of sampling frames, feature dimension); the reshaped visual feature is reshaped to obtain a second reshaped visual feature, and the shape of the second reshaped visual feature is (number of sampling samples, number of sampling frames, feature dimension).
6. The first-person action recognition method based on visual language model and graph convolution according to claim 1, characterized in that: The temporal fusion model includes 6 ResidualAttentionBlocks, each of which includes a multi-head attention layer, layer normalization, and a multi-layer perceptron.
