Language-guided video target anaphora segmentation method
By designing a language-embedded visual encoder and information exchange module in video target reference segmentation, early cross-modal interaction and fine-grained feature optimization are achieved, combined with a semantic-guided feature fusion module, to solve the problem of video target reference segmentation in complex scenes. It solves the problem of accurate segmentation and improves the segmentation ability of the model.
Patent Information
- Application Number
- CN202410662040.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-09-17
AI Technical Summary
The video target referent segmentation task is based on understanding the video content and language description. It is difficult to accurately locate and segment the referent target at the pixel level in complex scenes. Existing methods only perform cross-modal interaction after feature encoding, which limits in-depth interaction. , and fine-grained semantic cues are difficult to accurately infer from a single frame image.
Design language-embedded visual encoders to achieve early cross-modal interaction and extract joint features in the visual feature encoding stage; build information exchange and feature refinement modules for multi-path information exchange and fine-grained optimization; use semantic-guided feature fusion in the decoding stage module, which utilizes high-level semantic information to aggregate target-level semantic information.
Through early cross-modal interaction and fine-grained feature optimization, the model's referent target segmentation accuracy in complex scenes is improved, it can effectively capture fine-grained semantic clues, and enhance the ability of visual feature maps to represent referent targets.
Smart Images

Figure CN118658091A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video object referent segmentation, and in particular to a language-guided video object referent segmentation method. Background Art
[0002] Referring video object segmentation is a challenging problem, which is academically called RVOS (Referring Video Object Segmentation). Referring video object segmentation is different from semi-supervised video object segmentation (VOS). It is more challenging than semi-supervised video object segmentation task because the referring object in the video clip lacks the annotation mask of the first frame: it requires accurate positioning of the referring object based on the understanding of the video content and language description, and performs fine-grained segmentation at the pixel level. This task has a wide range of applications in language-based video editing, video question answering, and action localization in video surveillance. As a cross-task in the field of computer vision and natural language processing, it has attracted widespread attention from scholars.
[0003] Previous methods mainly focused on the cross-modal alignment of vision and language, extracting unimodal features from video and language descriptions independently in the feature encoding stage. Then, in the decoding stage, multi-head self-attention and cross-modal attention are used to simulate the interaction within and between modalities to learn the multimodal context of visual and language consistency. The above methods focus on fusing visual and language features at the decoding end, significantly improving the performance of RVOS. However, these methods only allow cross-modal interactions after feature encoding, which limits the deep interaction between different modalities. In addition, the fine-grained semantic clues related to the referent target in the video cannot usually be accurately inferred from independent single-frame images. Summary of the invention
[0004] In view of the above problems, the present invention is proposed to provide a language-guided video object referent segmentation method that overcomes the above problems or at least partially solves the above problems.
[0005] According to one aspect of the present invention, a language-guided video object referent segmentation method is provided, the segmentation method comprising:
[0006] In the visual feature encoding stage, a language-embedded visual encoder is designed to densely embed language features into visual features, realize early cross-modal interaction of visual language, and extract joint features containing rich language and visual information;
[0007] Build an information exchange and feature refinement module to capture fine-grained semantic clues and improve the model's ability to accurately segment referent objects in complex scenes by performing multi-path information exchange and fine-grained feature optimization between different frames;
[0008] In the decoding stage, a semantically guided feature fusion module is proposed, which uses high-level semantic information to guide the fusion of multi-level joint features and aggregates the semantic information at the target level.
[0009] Optionally, in the visual feature encoding stage, a language-embedded visual encoder is designed to densely embed language features into visual features, realize early cross-modal interaction of visual language, and extract joint features containing rich language and visual information, specifically including:
[0010] The visual encoding network consists of four transformer blocks. Each transformer block is mainly composed of multi-head self-attention MHSA, normalization layer LN and multi-layer perceptron MLP, which are expressed as follows:
[0011]
[0012]
[0013] in, Represents the feature map of the i-th transformerblock input, N and D represent the size and channel dimension of the feature map respectively;
[0014] For input language expression S represents the length of the language expression. A pre-trained deep language model is used to extract the language features of each word from the input language expression, which is expressed as
[0015] By pooling the features of each word, we get the sentence-level language features, which are expressed as
[0016] The input video clip is represented as Where T, C, H and W represent the number of frames, channel dimension, height and width of the video frame respectively;
[0017] Split each video frame into non-overlapping patches, represented as Where w represents the size of each patch;
[0018] The patch is flattened and input into the linear mapping function to obtain the patch embedding, which is expressed as D represents the dimension of patch embedding;
[0019] The patch embedding is input into the transformer block for encoding, and the output visual features are represented as Where l represents the lth transformerblock.
[0020] Optionally, the visual feature encoding stage specifically includes:
[0021] Get the target video to be analyzed;
[0022] The language embedding visual encoder is used to embed language features into visual features to generate multi-level joint features.
[0023] Optionally, the step of constructing an information exchange and feature refinement module specifically includes:
[0024] Multi-path information exchange and fine-grained feature optimization are performed between different feature channels of different frames to capture fine-grained semantic clues.
[0025] Optionally, the step of proposing a semantically guided feature fusion module in the decoding stage specifically includes:
[0026] Using semantic information as a guide, multi-level joint features are integrated to aggregate semantic information at the target level;
[0027] Use convolutional computation to generate a segmentation mask sequence for the query features;
[0028] Through upsampling, the predicted mask size is adjusted to be consistent with the input frame;
[0029] Select the predicted mask sequence that best matches the language description.
[0030] Optionally, the segmentation method further includes:
[0031] Data preprocessing;
[0032] Use a sliding window approach to sample video clips from the video for training;
[0033] Perform model training.
[0034] Optionally, the data preprocessing specifically includes:
[0035] Select the smallest version of Video SwinTransformer and Hugging Face
[0036] RoBERTa-base as visual encoder and language encoder;
[0037] Use the Video SwinTransformer model pre-trained on the Kinetics-400 dataset as the visual encoder and initialize it with the official pre-trained weights;
[0038] Use the RoBERTa-base model as the language encoder and initialize it with the official pre-trained weights;
[0039] For the A2D-sentences and JHMDB-sentence datasets, the length of the video segment is set to T = 6, the short side size of each frame image is set to 360, and the long side size is set to 576;
[0040] For the Refer-YouTube-VOS dataset, the length of the video segment is set to T = 6;
[0041] Set AdamW as the optimizer and weight decay to 0.0001;
[0042] Perform gradient clipping with a maximum gradient norm of 0.1;
[0043] Set the learning rate of Transformer to 0.0001 and the learning rate of visual encoder to 0.0005;
[0044] On the A2D-sentences and JHMDB-sentence datasets, set the batch size to 2 and the epochs to 50;
[0045] On the Refer-YouTube-VOS dataset, the batch size is set to 1 and the training epochs is set to 30.
[0046] Optionally, the model training specifically includes:
[0047] Use the preprocessed data and sampled video clips to train the model;
[0048] The AdamW optimizer is used for gradient updates during training;
[0049] Optimize using the set learning rate and weight decay;
[0050] Gradient clipping is performed to control the gradient norm;
[0051] Train for 50 epochs on the A2D-sentences and JHMDB-sentence datasets;
[0052] Train for 30 epochs on the Refer-YouTube-VOS dataset;
[0053] The training is performed end-to-end without any segmentation-related pre-training.
[0054] The present invention provides a language-guided video target referent segmentation method, the segmentation method comprising: in the visual feature encoding stage, designing a language-embedded visual encoder to densely embed language features into visual features, realizing early cross-modal interaction of visual language, and extracting joint features containing rich language and visual information; constructing an information exchange and feature refinement module, through multi-path information exchange and fine-grained feature optimization between different frames, capturing fine-grained semantic clues to enhance the model's ability to accurately segment referent targets in complex scenes; in the decoding stage, a semantically guided feature fusion module is proposed, which uses high-level semantic information to guide the fusion of multi-level joint features, and aggregates the semantic information at the target level. Using high-level semantic information as a guide, multi-level joint features are fused from top to bottom, effectively aggregating the semantic information at the target level.
[0055] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0057] Figure 1 A flow chart of a language-guided video object reference segmentation method provided by an embodiment of the present invention;
[0058] Figure 2 It is the overall framework diagram of the model of the present invention;
[0059] Figure 3 Schematic diagram of cross-frame information interaction and feature refinement module;
[0060] Figure 4 Schematic diagram of multi-scale feature fusion model;
[0061] Figure 5 Schematic diagram of the semantically guided feature fusion unit. DETAILED DESCRIPTION
[0062] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0063] The terms "comprises" and "having" and any variations thereof in the description embodiments, claims and drawings of the present invention are intended to cover non-exclusive inclusions, for example, including a series of steps or units.
[0064] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0065] like Figure 1 As shown, the present invention proposes a language-guided video object referent segmentation method, which mainly includes the following four parts:
[0066] First, a visual encoder for language embedding;
[0067] Second, cross-frame information exchange and feature refinement;
[0068] Third, Dynamic maskhead.
[0069] Target video to be segmented;
[0070] The language embedding visual encoder is used to embed language features into visual features to generate multi-level joint features;
[0071] Multi-path information exchange and fine-grained feature optimization are performed between different feature channels of different frames to capture fine-grained semantic clues;
[0072] The feature fusion module uses semantic information as a guide to fuse multi-level joint features and aggregate semantic information at the target level;
[0073] Generate a segmentation mask sequence for the query feature through convolution calculation;
[0074] Through upsampling, the predicted mask size is adjusted to be consistent with the input frame;
[0075] Select the one among the predicted mask sequences that best matches the language description.
[0076] The overall framework of the method proposed in the present invention is as follows Figure 2 shown.
[0077] Visual Encoder for Language Embedding Based on Video and language query As input, the language features are embedded into the visual features through language-guided visual attention to generate multi-level joint features. The cross-frame information exchange and feature optimization module performs information exchange and feature optimization between different channels in different frames to mine fine-grained semantic information to identify the referent target. The semantic-guided feature fusion module uses high-level semantic information as a guide to fuse multi-level joint features from top to bottom to obtain a visual representation of the target level. Dynamic mask head is used to perform mask prediction for entity sequences.
[0078] The input video clip is represented as Where T, C, H, and W represent the number of frames, channel dimension, height, and width of the video frame, respectively.
[0079] First, each video frame is split into non-overlapping patches, represented as Where w represents the size of each patch.
[0080] Then the patch is flattened and input into the linear mapping function to obtain the patch embedding, which is expressed as D represents the dimension of the patch embedding. The patch embedding is then input into the transformer block for encoding, and the output visual features are represented as Where l represents the lth transformer block.
[0081] In order to achieve early deep interaction between vision and language, the present invention designs a cross-modal fusion unit to fuse the visual features output by the previous transformer block with the language features and use them as the input of the next one.
[0082] Specifically, the extracted language features are first added with a one-dimensional positional encoding, and at the same time, a 1*1 convolution is used to encode the visual features. Processing is performed to ensure that the two dimensions are consistent.
[0083] Then, the input is sent to the cross-modal fusion unit for cross-modal fusion, and the fused visual features As the input of the next block, in the same way, after four stages of processing, pyramid features of four scales are obtained, which are represented as and These features contain rich visual and language information. The present invention proposes a cross-frame information exchange module, which realizes information exchange between adjacent frames by offsetting some channels on the time axis, and performs feature refinement on other channels to aggregate fine-grained semantic clues related to the target.
[0084] like Figure 3 As shown, the joint features output by the Lth layer As an example, the proposed information exchange module is described in detail. Specifically, for the feature of the tth frame First, a 1*1 convolution is used to expand the channel dimension and divide it into three feature groups, represented as Then the first group feature is selected to perform channel-level feature interaction with adjacent frames, as shown below:
[0085]
[0086] Concat[·] represents concatenation; CBR represents an interaction unit consisting of a 1*1 convolution layer, a BN layer, and a ReLU activation function. The feature interaction between different feature groups between adjacent frames is carried out in an iterative manner. After T times of iterative processing, the feature interaction between adjacent frames and the propagation of fine-grained semantic information can be realized on the time axis.
[0087] In the feature refinement phase, the second feature group of each frame is concatenated in the channel dimension and a modulation vector is generated through a lightweight convolutional network, which is expressed as follows:
[0088]
[0089] in It consists of an average pooling layer, 1*1 convolution, BN layer, ReLU activation function and Softmax. α will be used to modulate the third feature group, as shown below:
[0090]
[0091] Where ⊙ represents elementwise product. Through Channel-wise Modulation, features are refined from different feature channels to obtain fine-grained semantic clues.
[0092] Output semantically rich memory features through transformer encoder It contains high-level semantic information. We design a semantically guided multi-scale feature fusion module, such as Figure 4 As shown in Figure 1, information of a specific scale is selectively aggregated through semantic guidance to improve feature representation capabilities. In the fusion process of each layer, a semantically guided attention module is used to fuse the memory features with multi-level joint features. Taking the visual features of the lth layer as an example, it is represented as The memory feature is represented by F m ∈R T×H×W×C .
[0093] First, use the conversion function to The dimension is transformed to the same as F m are consistent and expressed as:
[0094]
[0095] Among them, W l T Represents the transformation matrix, which is implemented by 1*1 convolution in the experiment. Then two linear functions are used to convert They are transformed into:
[0096]
[0097] The same F m After linear function transformation:
[0098]
[0099] Among them, W l K , W l v and W m Q Represents a learnable parameter. Finally, a multi-head attention module is used to interact between the two features, expressed as:
[0100]
[0101] The memory feature can effectively filter and aggregate semantically related information at each level in the attention mechanism, thereby enhancing the representation ability of the feature.
[0102] In the same way on features of other scales, updated multi-level features are obtained, expressed as and Then, the standard FPN is used to perform top-down upsampling and summation to obtain a semantically rich feature map, which is expressed as in
[0103] After obtaining the target-level query feature F q and frame-level feature maps Finally, a Dynamic maskhead was designed to utilize F q and Make mask predictions.
[0104] First, a two-layer MLP is used to process the query features and generate a set of dynamic convolution kernels. in
[0105] Then, a sequence of segmentation masks is generated for the query feature by convolving each dynamic kernel with its corresponding feature of each frame.
[0106] Finally, through upsampling, the predicted mask size is adjusted to be consistent with the input frame, as shown below:
[0107]
[0108] Dynamic mask head predicts N q There are 3 masks, but only one matches the target described in the language. You need to select the one that best matches the language description from the predicted mask sequence.
[0109] The series of predictions in each frame is represented as The ground-truth sequence is represented as Where N i Represents the annotation sequence marked in the video clip. Then, find the best prediction as the positive sample by minimizing the matching error. The loss function is defined as follows:
[0110]
[0111] Among them, the first Ensure that the predicted mask sequence is aligned with the ground-truth sequence. This term is defined as a combination of the DICE and FCOAL loss functions, expressed as follows:
[0112]
[0113] Among them, λ d and λ f represents the hyperparameters, and these two losses are normalized according to the number of instances in the batch. Represents the cross entropy loss, which is used to supervise the prediction of the reference sequence and is expressed as follows:
[0114]
[0115] Among them, λ r Represents a hyperparameter.
[0116] The model is trained end-to-end on the datasets A2D-sentence, JHMDB-sentence, and Refer-YouTube-VOS. A sliding window is used to sample video clips from the video for training. For A2D-sentences and JHMDB-sentence, the length of the video clip is set to T=6, and the short side size of each frame is set to 360 and the long side size is 576. For Refer-YouTube-VOS, the length of the video clip is set to T=6. During training, we use AdamW as the optimizer and the weight decay is set to 0.0001.
[0117] Gradient clipping is performed with a maximum gradient norm of 0.1. The learning rate of the transformer is 0.0001, and the learning rate of the visual encoder is 0.0005. The batch size is set to 2 and the epochs are set to 50 on the A2D-sentences and JHMDB-sentence datasets. The batch size is set to 1 and the training epochs are set to 30 on Refer-YouTube-VOS. The experimental results show that the present invention can effectively achieve instance segmentation in the context of Chinese referential expression.
[0118] Ablation experiments were conducted on A2D-Sentencs data to evaluate the component modules and robustness of this invention. The experimental results show that the visual language joint encoding module we proposed can achieve early cross-modal alignment of visual language and can effectively enhance the representation ability of visual feature maps for referential targets.
[0119] The present invention first uses a visual encoding network composed of four transformer blocks to extract visual features. The visual features output by each transformer block are early fused with language features, with the aim of densely embedding language features into visual features and effectively simulating multiple contexts. The present invention has been tested on a data set and the effectiveness of the method has been verified.
[0120] Beneficial effects: Cross-modal information interaction and feature optimization are achieved at different stages, thereby extracting joint features containing rich language and visual information, and improving the model's ability to segment and refer to targets in complex scenarios.
[0121] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A language-guided video object referent segmentation method, characterized in that: The segmentation method comprises: In the visual feature encoding stage, a language-embedded visual encoder is designed to densely embed language features into visual features, realize early cross-modal interaction of visual language, and extract joint features containing rich language and visual information; Build an information exchange and feature refinement module to capture fine-grained semantic clues and improve the model's ability to accurately segment referent objects in complex scenes by performing multi-path information exchange and fine-grained feature optimization between different frames; In the decoding stage, a semantically guided feature fusion module is proposed, which uses high-level semantic information to guide the fusion of multi-level joint features and aggregates the semantic information at the target level.
2. The method for video object referent segmentation guided by language according to claim 1, characterized in that: In the visual feature encoding stage, a language-embedded visual encoder is designed to densely embed language features into visual features, realize early cross-modal interaction of visual language, and extract joint features containing rich language and visual information. Specifically, the following are included: The visual encoding network consists of four transformer blocks. Each transformer block is mainly composed of multi-head self-attention MHSA, normalization layer LN and multi-layer perceptron MLP, which are expressed as follows: in, represents the feature map of the i-th transformer block input, N and D represent the size and channel dimension of the feature map respectively; For input language expression S represents the length of the language expression. A pre-trained deep language model is used to extract the language features of each word from the input language expression, which is expressed as By pooling the features of each word, we get the sentence-level language features, which are expressed as The input video clip is represented as Where T, C, H and W represent the number of frames, channel dimension, height and width of the video frame respectively; Split each video frame into non-overlapping patches, represented as Where w represents the size of each patch; The patch is flattened and input into the linear mapping function to obtain the patch embedding, which is expressed as D represents the dimension of patch embedding; The patch embedding is input into the transformer block for encoding, and the output visual features are represented as Where l represents the lth transformer block.
3. The method for video object referent segmentation guided by language according to claim 1, characterized in that: The visual feature encoding stage specifically includes: Get the target video to be analyzed; The language embedding visual encoder is used to embed language features into visual features to generate multi-level joint features.
4. The method for video object referent segmentation guided by language according to claim 1, characterized in that: The construction of an information exchange and feature refinement module specifically includes: Multi-path information exchange and fine-grained feature optimization are performed between different feature channels of different frames to capture fine-grained semantic clues.
5. The method for video object referent segmentation guided by language according to claim 1, characterized in that: The proposed semantically guided feature fusion module in the decoding stage specifically includes: Using semantic information as a guide, multi-level joint features are integrated to aggregate semantic information at the target level; Use convolutional computation to generate a segmentation mask sequence for the query features; Through upsampling, the predicted mask size is adjusted to be consistent with the input frame; Select the predicted mask sequence that best matches the language description.
6. The method for video object referent segmentation guided by language according to claim 1, characterized in that: The segmentation method further comprises: Data preprocessing; Use a sliding window approach to sample video clips from the video for training; Perform model training.
7. The method for language-guided video object referent segmentation according to claim 6, characterized in that: The data preprocessing specifically includes: Select the smallest version of Video Swin Transformer and Hugging Face RoBERTa-base as visual encoder and language encoder; Use the Video Swin Transformer model pre-trained on the Kinetics-400 dataset as the visual encoder and initialize it with the official pre-trained weights; Use the RoBERTa-base model as the language encoder and initialize it with the official pre-trained weights; For the A2D-sentences and JHMDB-sentence datasets, the length of the video segment is set to T = 6, the short side size of each frame image is set to 360, and the long side size is set to 576; For the Refer-YouTube-VOS dataset, the length of the video segment is set to T = 6; Set AdamW as the optimizer and weight decay to 0.0001; Perform gradient clipping with a maximum gradient norm of 0.1; Set the learning rate of Transformer to 0.0001 and the learning rate of visual encoder to 0.0005; On the A2D-sentences and JHMDB-sentence datasets, set the batch size to 2 and the epochs to 50; On the Refer-YouTube-VOS dataset, the batch size is set to 1 and the training epochs is set to 30.
8. The method for language-guided video object referent segmentation according to claim 6, characterized in that: The model training specifically includes: Use the above preprocessed data and sampled video clips to train the model; The AdamW optimizer is used for gradient updates during training; Optimize using the set learning rate and weight decay; Gradient clipping is performed to control the gradient norm; Train for 50 epochs on the A2D-sentences and JHMDB-sentence datasets; Train for 30 epochs on the Refer-YouTube-VOS dataset; The training is performed end-to-end without any segmentation-related pre-training.
Citation Information
Patent Citations
Anaphora video target segmentation method, device and equipment and readable storage medium
CN116612416A
Text anaphora video object segmentation method based on reference analysis and perception enhancement
CN117079177A
Anaphora image segmentation model training and segmentation method, system, equipment and medium
CN117315249A
Cited By
Unsupervised audio-visual segmentation method and system and electronic equipment
CN119559971A
Reference video object segmentation method based on semantic consistency and motion perception
CN120526350A
A reference video object segmentation method based on semantic consistency and motion perception
CN120526350B
Long video target inference segmentation method based on context mark prompt
CN120707859A
Long video target reasoning segmentation method based on context label prompt
CN120707859B
