Cross-modal video retrieval method, device and electronic device

By extracting the implicit features and vocabulary features of video and text, combined with the interactive learning of the dual encoder model, the problem that the dual encoder model is difficult to capture fine-grained semantic information is solved, and the accuracy and ability of video retrieval is improved.

CN118227831BActive Publication Date: 2024-11-05INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410644212.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2024-11-05
Estimated Expiration
2044-05-23

AI Technical Summary

Technical Problem

The dual encoder model is difficult to capture fine-grained semantic information, affecting the video retrieval accuracy.

Method used

Extract the implicit features and vocabulary features of the query text. By combining the feature extraction model with implicit features and vocabulary features, the trained model can accurately determine the search video matching the content of the query text.

Benefits of technology

The accuracy and ability of cross-modal video retrieval is improved. Through interactive learning in the vocabulary feature training and joint training stages, the interaction between implicit features and vocabulary features is promoted, and the ability to capture semantic information is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118227831B_ABST
    Figure CN118227831B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of video retrieval, and provides a cross-modal video retrieval method, device and electronic device. The method comprises: extracting implicit features and vocabulary features of a query text; obtaining implicit features and vocabulary features of each candidate video based on a feature extraction model; determining the retrieval video corresponding to the query text based on the similarity between the implicit features of the query text and the implicit features of each candidate video and the similarity between the vocabulary features of the query text and the vocabulary features of each candidate video; in the vocabulary feature training phase of the feature extraction model, minimizing the difference between the vocabulary features of a sample video and the vocabulary features of a sample description text is taken as a training target, and in the joint training phase, the similarity between the implicit features of the sample video and the implicit features of the sample description text is taken as a soft label, and minimizing the difference between a student prediction result and the soft label is taken as a training target. The present invention can improve the cross-modal video retrieval capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video retrieval technology, and in particular to a cross-modal video retrieval method, device and electronic equipment. Background Art

[0002] Cross-modal video retrieval refers to the task of retrieving video content using query text (usually natural language description). In this task, the system needs to understand the semantic content of the text query and match it with the visual content in the video data to find the most relevant videos to the text description.

[0003] At present, most of them are based on the dual encoder model to extract the video features of the candidate video and the text features of the query text respectively, and determine whether the candidate video is the retrieval video corresponding to the query text based on the extracted video features and text features. However, the dual encoder model is difficult to capture fine-grained semantic information, which in turn affects the accuracy of video retrieval. Summary of the invention

[0004] The present invention provides a cross-modal video retrieval method, device and electronic equipment to solve the defects in the prior art.

[0005] The present invention provides a cross-modal video retrieval method, comprising:

[0006] Extract implicit features and vocabulary features of query text;

[0007] Inputting each candidate video and a description text of each candidate video into a feature extraction model, and obtaining implicit features of each candidate video and vocabulary features of each candidate video output by the feature extraction model;

[0008] Based on the similarity between the implicit features of the query text and the implicit features of each candidate video, and the similarity between the vocabulary features of the query text and the vocabulary features of each candidate video, determining the retrieval video corresponding to the query text from each candidate video;

[0009] The feature extraction model is trained based on a sample video and a sample description text of the sample video. The training stage of the feature extraction model includes a vocabulary feature training stage and a joint training stage. The vocabulary feature training stage takes minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text as a training goal. The joint training stage takes the similarity between the implicit features of the sample video and the implicit features of the sample description text as soft labels, and minimizes the difference between the student prediction result and the soft label as a training goal. The student prediction result refers to the similarity between the vocabulary features of the sample video and the vocabulary features of the sample description text.

[0010] According to a cross-modal video retrieval method provided by the present invention, the feature extraction model is obtained after parameter iteration of an initial model, and the initial model includes a basic video encoder, a basic text encoder, and a vocabulary mapping module;

[0011] The vocabulary feature training phase includes the following training steps:

[0012] Based on the basic video encoder, extracting sample video basic features from the sample video;

[0013] Based on the basic text encoder, extracting sample text basic features from the sample description text;

[0014] Based on the vocabulary mapping module, the sample video basic features and the sample text basic features are respectively mapped to the vocabulary space to obtain the vocabulary features of the sample video and the vocabulary features of the sample description text;

[0015] The parameter iteration of the vocabulary feature training phase is performed with the training goal of minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text.

[0016] According to a cross-modal video retrieval method provided by the present invention, the parameter iteration of the vocabulary feature training phase is performed with minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text as the training goal, including:

[0017] Freeze the parameters of the basic text encoder and the vocabulary mapping module, and update the parameters of the basic video encoder by minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text as a training goal;

[0018] After updating the parameters of the basic video encoder, the sample description text is masked, and the masked sample description text is input into the basic text encoder to obtain a sample mask feature, and the sample mask feature is decoded to obtain a sample prediction text;

[0019] Based on the difference between the sample description text and the sample prediction text, and the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text, the parameters of the basic video encoder and the basic text encoder are updated.

[0020] According to a cross-modal video retrieval method provided by the present invention, extracting sample video basic features from the sample video based on the basic video encoder includes:

[0021] Sampling the sample video to obtain a video frame sequence;

[0022] The video frame sequence is input into the basic video encoder to obtain the sample video basic features.

[0023] According to a cross-modal video retrieval method provided by the present invention, the basic video encoder includes a video implicit encoder and a video vocabulary encoder, and the basic text encoder includes a text implicit encoder and a text vocabulary encoder;

[0024] The joint training stage includes the following training steps:

[0025] Based on the video implicit encoder, extracting implicit features of the sample video from basic features of the sample video;

[0026] Based on the video vocabulary encoder, extracting vocabulary features of the sample video from basic features of the sample video;

[0027] Based on the text implicit encoder, the implicit features of the sample description text are extracted from the basic features of the sample text;

[0028] Based on the text vocabulary encoder, extracting vocabulary features of the sample description text from the basic features of the sample text;

[0029] Determining the student prediction result based on the similarity between the vocabulary features of the sample video and the vocabulary features of the sample description text;

[0030] The parameter iteration of the joint training stage is performed with the training goal of minimizing the difference between the student prediction result and the soft label.

[0031] According to a cross-modal video retrieval method provided by the present invention, based on the similarity between the implicit features of the query text and the implicit features of each candidate video, and the similarity between the vocabulary features of the query text and the vocabulary features of each candidate video, determining the retrieval video corresponding to the query text from each candidate video includes:

[0032] Determining an implicit feature similarity score of each candidate video based on the similarity between the implicit feature of the query text and the implicit feature of each candidate video;

[0033] The similarity between the vocabulary features of the query text and the vocabulary features of each candidate video is used to determine the vocabulary feature similarity score of each candidate video;

[0034] Determine a similarity score for each candidate video based on the implicit feature similarity score of each candidate video and the vocabulary feature similarity score of each candidate video;

[0035] Based on the similarity scores of the candidate videos, a retrieval video corresponding to the query text is determined from the candidate videos.

[0036] According to a cross-modal video retrieval method provided by the present invention, the implicit features of each candidate video include video implicit features and text implicit features of each candidate video;

[0037] The step of determining the implicit feature similarity score of each candidate video based on the similarity between the implicit feature of the query text and the implicit feature of each candidate video comprises:

[0038] Determining a video implicit feature score for each candidate video based on the similarity between the implicit features of the query text and the video implicit features of each candidate video;

[0039] Determining a text implicit feature score for each candidate video based on the similarity between the implicit features of the query text and the text implicit features of each candidate video;

[0040] Based on the video implicit feature score of each candidate video and the text implicit feature score of each candidate video, the implicit feature similarity score of each candidate video is determined.

[0041] According to a cross-modal video retrieval method provided by the present invention, the vocabulary features of each candidate video include video vocabulary features and text vocabulary features of each candidate video;

[0042] The similarity between the vocabulary features of the query text and the vocabulary features of each candidate video, and determining the vocabulary feature similarity score of each candidate video, include:

[0043] Determining a video vocabulary feature score for each candidate video based on the similarity between the vocabulary feature of the query text and the video vocabulary feature of each candidate video;

[0044] Determining a text vocabulary feature score for each candidate video based on the similarity between the vocabulary feature of the query text and the text vocabulary feature of each candidate video;

[0045] Based on the video vocabulary feature score of each candidate video and the text vocabulary feature score of each candidate video, the vocabulary feature similarity score of each candidate video is determined.

[0046] The present invention also provides a cross-modal video retrieval device, comprising:

[0047] A first extraction unit, used for extracting implicit features and vocabulary features of the query text;

[0048] A second extraction unit, used to input each candidate video and a description text of each candidate video into a feature extraction model, and obtain implicit features of each candidate video and vocabulary features of each candidate video output by the feature extraction model;

[0049] A video retrieval unit, configured to determine a retrieval video corresponding to the query text from among the candidate videos based on the similarity between the implicit features of the query text and the implicit features of the candidate videos, and the similarity between the vocabulary features of the query text and the vocabulary features of the candidate videos;

[0050] The feature extraction model is trained based on a sample video and a sample description text of the sample video. The training stage of the feature extraction model includes a vocabulary feature training stage and a joint training stage. The vocabulary feature training stage takes minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text as a training goal. The joint training stage takes the similarity between the implicit features of the sample video and the implicit features of the sample description text as soft labels, and minimizes the difference between the student prediction result and the soft label as a training goal. The student prediction result refers to the similarity between the vocabulary features of the sample video and the vocabulary features of the sample description text.

[0051] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the cross-modal video retrieval method as described above is implemented.

[0052] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the cross-modal video retrieval method as described above is implemented.

[0053] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the cross-modal video retrieval methods described above.

[0054] The cross-modal video retrieval method, device and electronic device provided by the present invention extract implicit features for characterizing coarse-grained semantic information and vocabulary features for fine-grained semantic information based on a feature extraction model, so that the implicit features and vocabulary features can be combined to further accurately determine the retrieval video that matches the query text content, thereby improving the cross-modal video retrieval capability. In addition, the vocabulary feature training stage takes minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text as the training goal, so that the trained feature extraction model can accurately extract the vocabulary features. The joint training stage takes the similarity between the implicit features of the sample video and the implicit features of the sample description text as the soft label, and minimizes the difference between the student prediction results and the soft label as the training goal, promoting interactive learning between vocabulary features and implicit features, thereby enabling the trained feature extraction model to accurately extract implicit features. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0056] Figure 1 It is a flowchart of the cross-modal video retrieval method provided by the present invention;

[0057] Figure 2 It is a structural schematic diagram of the feature extraction model provided by the present invention corresponding to the initial model;

[0058] Figure 3 is a schematic structural diagram of a cross-modal video retrieval device provided by the present invention;

[0059] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.

[0061] Text-based cross-modal video retrieval refers to the task of using query text (usually natural language description) to retrieve video content. Among them, text-based cross-modal video retrieval methods mainly include:

[0062] (a) Retrieval methods based on visual content:

[0063] This method focuses on the visual content of the video, using image processing and computer vision techniques to extract features (such as color, texture, shape, objects, actions, etc.) from the video and match them with the visual information mentioned in the query text.

[0064] (b) Text-based retrieval methods:

[0065] This method focuses on parsing textual information in videos, such as subtitles, text in scenes, or video metadata, and compares this textual information with the user's query text to determine relevant video clips.

[0066] (c) Semantic-based retrieval method:

[0067] The approach uses natural language processing and machine learning techniques to understand the semantic information in queries and video content, including mapping text and video content into the same semantic space and using deep learning models (such as convolutional neural networks and recurrent neural networks) to extract high-level semantic features.

[0068] Currently, most methods use a dual encoder model to extract the video features of candidate videos and the text features of query texts, and determine whether the candidate video is the retrieval video corresponding to the query text based on the extracted video features and text features. However, the dual encoder model compresses the entire video or text into a vector in the latent space, and cross-modal interaction and alignment are completely based on this coarse-grained global representation. Therefore, it is difficult to capture fine-grained semantic concepts such as objects and actions, which in turn affects the accuracy of video retrieval.

[0069] To this end, the present invention provides a cross-modal video retrieval method. Figure 1 is a flow chart of the cross-modal video retrieval method provided by the present invention, such as Figure 1 As shown, the method comprises the following steps:

[0070] Step 110: Extract implicit features and vocabulary features of the query text.

[0071] Here, the query text can be understood as the text used to retrieve videos, and the content described in the retrieved videos is related to the content described in the query text. Implicit features can be understood as the text representation of the query text, which is used to describe the semantic information of the query text, that is, implicit features are used to describe the semantic information of the query text in a coarse-grained global manner. Vocabulary features can be understood as features such as encoding or word frequency statistics of each word in the query text, that is, vocabulary features are used to capture the semantic information of the query text in a fine-grained local manner.

[0072] Step 120: input each candidate video and the description text of each candidate video into the feature extraction model to obtain the implicit features of each candidate video and the vocabulary features of each candidate video output by the feature extraction model; the feature extraction model is trained based on the sample video and the sample description text of the sample video, and the training stage of the feature extraction model includes a vocabulary feature training stage and a joint training stage. The vocabulary feature training stage takes minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text as the training goal, and the joint training stage takes the similarity between the implicit features of the sample video and the implicit features of the sample description text as the soft label, and minimizes the difference between the student prediction result and the soft label as the training goal, and the student prediction result refers to the similarity between the vocabulary features of the sample video and the vocabulary features of the sample description text.

[0073] Specifically, the candidate video can be understood as a video that needs to be matched with the query text, and there may be one or more videos in the candidate video that match the content of the query text. Optionally, the candidate video can be a video stored in a video library or a video specified by a user, which is not specifically limited in the embodiment of the present invention.

[0074] The description text of the candidate video can be understood as a text description of the content of the candidate video. The description text of the candidate video can include the title, introduction, tags, keywords, etc. of the candidate video.

[0075] After determining the candidate videos and the description texts of the candidate videos, each candidate video and the description texts of each candidate video are input into the feature extraction model to obtain the implicit features and vocabulary features of each candidate video output by the feature extraction model. The implicit features of each candidate video are used to coarsely and globally describe the semantic information of the candidate video, and the vocabulary features of each candidate video are used to capture the semantic information of the candidate video in a fine-grained manner. Among them, the implicit features of each candidate video may include the implicit features at the video level and the implicit features at the sentence level of each candidate video, and the vocabulary features of each candidate video may include the vocabulary features at the video level and the vocabulary features at the sentence level of each candidate video, the implicit features at the video level and the vocabulary features at the video level are extracted from the corresponding candidate video, and the implicit features at the sentence level and the vocabulary features at the sentence level are extracted from the description texts of the corresponding candidate videos.

[0076] In addition, the training phase of the feature extraction model includes two phases: a vocabulary feature training phase and a joint training phase. The vocabulary feature training phase takes minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text as the training goal, thereby minimizing the distance between the vocabulary features of the sample video and the vocabulary features of the matching sample description text, and maximizing the distance between the vocabulary features of the sample video and the vocabulary features of the unmatched sample description text.

[0077] In addition, considering that the vocabulary features need to be additionally aligned with the fine-grained semantics of the video or text, the learning difficulty is relatively high. In this embodiment of the present invention, knowledge distillation is used to achieve knowledge transfer from implicit features to vocabulary features, that is, knowledge transfer is achieved through a joint training stage, as follows:

[0078] In the joint training phase, the similarity between the implicit features of the sample video and the implicit features of the sample description text is used as the soft label, and the training goal is to minimize the difference between the student prediction results and the soft label to promote the learning of vocabulary features. Among them, the student prediction results refer to the similarity between the vocabulary features of the sample video and the vocabulary features of the sample description text.

[0079] Step 130: Determine the retrieval video corresponding to the query text from the candidate videos based on the similarity between the implicit features of the query text and the implicit features of each candidate video, and the similarity between the vocabulary features of the query text and the vocabulary features of each candidate video.

[0080] Specifically, the retrieved videos can be understood as candidate videos that match the query text content. The similarity between the implicit features of the query text and the implicit features of each candidate video is used to characterize the matching degree between the query text and each candidate video from a global perspective. The higher the matching degree, the higher the matching degree between the query text and the corresponding candidate video's overall semantic content. The similarity between the vocabulary features of the query text and the vocabulary features of each candidate video is used to characterize the matching degree between the query text and each candidate video from a local perspective. The higher the matching degree, the higher the matching degree between the query text and the corresponding candidate video's fine-grained semantic content.

[0081] Optionally, the similarity between the implicit features of the query text and the implicit features of each candidate video, as well as the similarity between the vocabulary features of the query text and the vocabulary features of each candidate video can be weighted to obtain a comprehensive similarity, and the candidate videos with a comprehensive similarity greater than a threshold are used as retrieval videos.

[0082] The cross-modal video retrieval method provided by the embodiment of the present invention extracts implicit features for characterizing coarse-grained semantic information and vocabulary features for fine-grained semantic information based on a feature extraction model, so that the implicit features and vocabulary features can be combined to further accurately determine the retrieval video that matches the query text content, thereby improving the cross-modal video retrieval capability. In addition, the vocabulary feature training stage takes minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text as the training goal, so that the trained feature extraction model can accurately extract the vocabulary features. The joint training stage takes the similarity between the implicit features of the sample video and the implicit features of the sample description text as the soft label, and minimizes the difference between the student prediction results and the soft label as the training goal, promoting interactive learning between vocabulary features and implicit features, thereby enabling the trained feature extraction model to accurately extract implicit features.

[0083] Based on the above embodiment, the feature extraction model is obtained after performing parameter iteration on the initial model. Figure 2 It is a structural diagram of the feature extraction model provided by the present invention corresponding to the initial model, such as Figure 2 As shown, the initial model includes a basic video encoder, a basic text encoder, and a vocabulary mapping module;

[0084] The vocabulary feature training phase includes the following training steps:

[0085] Based on the basic video encoder, extract the basic features of the sample video from the sample video;

[0086] Based on the basic text encoder, extract the basic features of the sample text from the sample description text;

[0087] Based on the vocabulary mapping module, the basic features of the sample video and the basic features of the sample text are mapped to the vocabulary space respectively, so as to obtain the vocabulary features of the sample video and the vocabulary features of the sample description text;

[0088] The parameter iteration of the vocabulary feature training phase is performed with the training goal of minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text.

[0089] Specifically, the basic video encoder can be constructed based on the video encoder in the Transformer architecture, and the basic text encoder can be constructed based on the pre-trained language model BERT, that is, the parameters of the basic text encoder are determined after initialization of the parameters of BERT.

[0090] The sample video is input into the basic video encoder to obtain the basic features of the sample video. The basic features of the sample video here can be understood as the local features of all spatial positions of different frames of the sample video. The sample description text is input into the basic text encoder to obtain the basic features of the sample text. The basic features of the sample text here can be understood as the local features of all words in the sample description text.

[0091] After obtaining the sample video basic features and the sample text basic features, the sample video basic features and the sample text basic features are input into the vocabulary mapping module, and the vocabulary mapping module maps the sample video basic features and the sample text basic features to the shared vocabulary space, and then uses the pooling operation to aggregate the mapped sample video basic features and sample text basic features to obtain the video-level vocabulary features (i.e., the vocabulary features of the sample video) and the sentence-level vocabulary features (i.e., the vocabulary features of the sample description text) respectively. Among them, the dimension of the vocabulary space can be W, and each dimension corresponds to a word in the vocabulary of the pre-trained language model BERT. Optionally, the masked language recovery head of BERT can be used as the vocabulary mapping module.

[0092] Next, the parameter iteration of the vocabulary feature training phase is performed with the training goal of minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text. The specific parameter iteration process is as follows:

[0093] Freeze the parameters of the basic text encoder and the vocabulary mapping module, and update the parameters of the basic video encoder with the training goal of minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text;

[0094] After updating the parameters of the basic video encoder, the sample description text is masked, and the masked sample description text is input into the basic text encoder to obtain the sample mask feature, and the sample mask feature is decoded to obtain the sample prediction text;

[0095] Based on the difference between the sample description text and the sample prediction text, and the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text, the parameters of the basic video encoder and the basic text encoder are updated.

[0096] Since the BERT model is pre-trained through the masked text recovery task, it can map the text into the vocabulary space and make the dimension related to the text semantics have a larger activation value, while the dimension irrelevant to the semantics has a smaller activation value. In order to make the vocabulary features at the video level also have the same properties, in the first stage of the vocabulary feature training phase, the parameters of the basic text encoder and the vocabulary mapping module are frozen, and the training goal is to minimize the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text, and update the parameters of the basic video encoder, including:

[0097] By optimizing the sample video-sample description text comparison learning loss, the distance between the vocabulary features of the sample video and the vocabulary features of the corresponding matching sample description text is reduced, while the distance with the vocabulary features of the unmatched sample description text is increased. Each training batch can contain sample video-sample description text pairs, The current batch The vocabulary features of sample videos, The current batch The vocabulary features of sample description text sentences, sample video-sample description text contrast learning loss function as follows:

[0098]

[0099] in, represents the hyperparameter, Indicates the number of The vocabulary features of sample videos, Indicates the number of The vocabulary features of samples describing text sentences, Indicates the number of The vocabulary features of samples describing text sentences, Indicates the number of sample video-sample description text pairs.

[0100] However, freezing the parameters of the text encoder and vocabulary mapping module will limit the semantic alignment between the two modalities of video and text to a certain extent. Therefore, in the second stage of model training in the vocabulary feature training phase, all model parameters including the basic video encoder and the basic text encoder are updated. However, in order to maintain the semantic mapping ability of the BERT model to the text, an additional masked language recovery task is added at this stage, that is, masking some words in the sample description text, and by optimizing the cross-entropy loss function, the model is encouraged to recover the masked words according to the context. After the above two stages of training, the vocabulary mapping module can map the features extracted by the video encoder and the text encoder to vocabulary features related to the video or text semantics. Among them, the cross-entropy loss function is determined based on the difference between the sample description text and the sample prediction text.

[0101] Based on any of the above embodiments, based on the basic video encoder, extracting sample video basic features from the sample video includes:

[0102] Sampling a video frame sequence from a sample video;

[0103] The video frame sequence is input into the basic video encoder to obtain the basic features of the sample video.

[0104] As an optional embodiment, a video sample with a length of A sequence of video frames , and input the sampled video frame sequence into the basic video encoder to extract the basic features of the sample video.

[0105] Based on any of the above embodiments, the basic video encoder includes a video implicit encoder and a video vocabulary encoder, and the basic text encoder includes a text implicit encoder and a text vocabulary encoder;

[0106] The joint training phase includes the following training steps:

[0107] Based on the video implicit encoder, the implicit features of the sample video are extracted from the basic features of the sample video;

[0108] Based on the video vocabulary encoder, the vocabulary features of the sample video are extracted from the basic features of the sample video;

[0109] Based on the text implicit encoder, the implicit features of the sample description text are extracted from the basic features of the sample text;

[0110] Based on the text vocabulary encoder, the vocabulary features of the sample description text are extracted from the basic features of the sample text;

[0111] Determine the student prediction result based on the similarity between the vocabulary features of the sample video and the vocabulary features of the sample description text;

[0112] The training objective is to minimize the difference between the student prediction results and the soft labels, and the parameter iteration of the joint training phase is performed.

[0113] Specifically, considering that vocabulary features can effectively extract fine-grained semantic information, implicit features are better at extracting global information of videos and texts. In order to combine the advantages of both and avoid the extra parameters and computational complexity caused by training the model for extracting vocabulary features and the model for extracting implicit features separately, we designed Figure 2 The initial model structure shown.

[0114] Specifically, in addition to the basic video encoder and the basic text encoder, the initial model also has a video implicit encoder, a video vocabulary encoder, a text implicit encoder, and a text vocabulary encoder. The basic features of the sample video extracted by the basic video encoder are respectively sent to the video vocabulary encoder and the video implicit encoder to extract the vocabulary features and implicit features of the sample video. The basic features of the sample text extracted by the basic text encoder are respectively sent to the text vocabulary encoder and the text implicit encoder to extract the vocabulary features and implicit features of the sample description text. In this way, the shallow structure of the model is shared, which effectively promotes the knowledge sharing and transfer between the two features.

[0115] In addition, since implicit features can be well optimized through sample video-sample description text comparative learning, while vocabulary features need to be additionally aligned with the fine-grained semantics of sample videos or sample description texts, the learning difficulty is relatively high. In this regard, the embodiment of the present invention uses knowledge distillation to achieve knowledge transfer from implicit features to vocabulary features.

[0116] Specifically, the student prediction results are determined based on the similarity between the vocabulary features of the sample video and the vocabulary features of the sample description text; with minimizing the difference between the student prediction results and the soft labels as the training goal, parameter iteration is performed in the joint training phase to promote the learning of vocabulary features.

[0117] Based on any of the above embodiments, based on the similarity between the implicit features of the query text and the implicit features of each candidate video, and the similarity between the vocabulary features of the query text and the vocabulary features of each candidate video, determining the retrieval video corresponding to the query text from each candidate video includes:

[0118] Determining an implicit feature similarity score of each candidate video based on the similarity between the implicit features of the query text and the implicit features of each candidate video;

[0119] The similarity between the vocabulary features of the query text and the vocabulary features of each candidate video is determined to determine the vocabulary feature similarity score of each candidate video;

[0120] Determine a similarity score for each candidate video based on the implicit feature similarity score of each candidate video and the vocabulary feature similarity score of each candidate video;

[0121] Based on the similarity scores of the candidate videos, the retrieval video corresponding to the query text is determined from the candidate videos.

[0122] Specifically, the implicit feature similarity score of each candidate video is used to characterize the degree of content matching between each candidate video and the query text at the global semantic level. The higher the matching degree, the higher the corresponding implicit feature similarity score.

[0123] The vocabulary feature similarity score of each candidate video is used to characterize the degree of content matching between each candidate video and the query text at the local semantic level. The higher the matching degree, the higher the corresponding vocabulary feature similarity score.

[0124] As an optional embodiment, the implicit feature similarity score and the vocabulary feature similarity score may be weightedly added to obtain the similarity score of each candidate video, and the candidate video with a similarity score greater than a threshold may be used as the retrieval video corresponding to the query text.

[0125] Optionally, the similarity in the above embodiment may be represented by the distance between features, such as cosine distance.

[0126] Based on any of the above embodiments, the implicit features of each candidate video include video implicit features and text implicit features of each candidate video;

[0127] Based on the similarity between the implicit features of the query text and the implicit features of each candidate video, the implicit feature similarity score of each candidate video is determined, including:

[0128] Determine the video implicit feature score of each candidate video based on the similarity between the implicit features of the query text and the video implicit features of each candidate video;

[0129] Determining the text implicit feature score of each candidate video based on the similarity between the implicit feature of the query text and the text implicit feature of each candidate video;

[0130] Based on the video implicit feature score of each candidate video and the text implicit feature score of each candidate video, the implicit feature similarity score of each candidate video is determined.

[0131] Specifically, the video implicit feature similarity score of each candidate video is used to characterize the degree of content matching between each candidate video and the query text at the global semantic level. The higher the matching degree, the higher the corresponding video implicit feature similarity score.

[0132] The text implicit feature similarity score of each candidate video is used to characterize the degree of content matching between the description text of each candidate video and the query text at the global semantic level. The higher the matching degree, the higher the corresponding text implicit feature similarity score.

[0133] As an optional embodiment, the implicit feature scores of the video and the implicit feature scores of the text may be weighted and added to obtain the implicit feature similarity scores of the candidate videos.

[0134] Based on any of the above embodiments, the vocabulary features of each candidate video include video vocabulary features and text vocabulary features of each candidate video;

[0135] The similarity between the vocabulary features of the query text and the vocabulary features of each candidate video is determined to determine the vocabulary feature similarity score of each candidate video, including:

[0136] Determine the video vocabulary feature score of each candidate video based on the similarity between the vocabulary feature of the query text and the video vocabulary feature of each candidate video;

[0137] Determine the text vocabulary feature score of each candidate video based on the similarity between the vocabulary feature of the query text and the text vocabulary feature of each candidate video;

[0138] Based on the video vocabulary feature score of each candidate video and the text vocabulary feature score of each candidate video, the vocabulary feature similarity score of each candidate video is determined.

[0139] Specifically, the video vocabulary feature similarity score of each candidate video is used to characterize the degree of content matching between each candidate video and the query text at the local semantic level. The higher the matching degree, the higher the corresponding video vocabulary feature similarity score.

[0140] The text vocabulary feature similarity score of each candidate video is used to characterize the degree of content matching between the description text of each candidate video and the query text at the local semantic level. The higher the matching degree, the higher the corresponding text vocabulary feature similarity score.

[0141] As an optional embodiment, the video vocabulary feature score and the text vocabulary feature score may be weighted and added to obtain the vocabulary feature similarity score of each candidate video.

[0142] The cross-modal video retrieval method based on joint learning of implicit features and vocabulary features provided by the embodiment of the present invention has achieved significant advantages in retrieval performance on cross-modal video retrieval datasets MSRVTT (Microsoft Research Video toText) and MSVD (Microsoft Research Video Description) compared with traditional video retrieval methods. Among them, Table 1 is a performance comparison list of the present invention and traditional methods on MSRVTT and MSVD datasets. The Top-1 recall rate refers to the ability of the model to find relevant items in the highest ranking position in a given task, the Top-5 recall rate refers to the situation where the model finds relevant items in the top five ranking positions, and the Top-10 recall rate refers to the situation where the model finds relevant items in the top ten ranking positions. As shown in Table 1, the recall rate corresponding to the method provided by the present invention is higher than the recall rate corresponding to the traditional method, that is, the present invention has a higher cross-modal retrieval capability than the traditional method.

[0143] Table 1

[0144]

[0145] The cross-modal video retrieval device provided by the present invention is described below. The cross-modal video retrieval device described below and the cross-modal video retrieval method described above can be referenced to each other.

[0146] Based on any of the above embodiments, Figure 3 is a schematic diagram of the structure of the cross-modal video retrieval device provided by the present invention, such as Figure 3 As shown, the device comprises:

[0147] A first extraction unit 310, used to extract implicit features and vocabulary features of the query text;

[0148] The second extraction unit 320 is used to input each candidate video and the description text of each candidate video into the feature extraction model to obtain the implicit features of each candidate video and the vocabulary features of each candidate video output by the feature extraction model;

[0149] The video retrieval unit 330 is used to determine the retrieval video corresponding to the query text from each candidate video based on the similarity between the implicit features of the query text and the implicit features of each candidate video, and the similarity between the vocabulary features of the query text and the vocabulary features of each candidate video;

[0150] The feature extraction model is trained based on sample videos and sample description texts of the sample videos. The training stages of the feature extraction model include a vocabulary feature training stage and a joint training stage. The vocabulary feature training stage takes minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text as the training goal. The joint training stage takes the similarity between the implicit features of the sample video and the implicit features of the sample description text as soft labels, and minimizes the difference between the student prediction results and the soft labels as the training goal. The student prediction results refer to the similarity between the vocabulary features of the sample video and the vocabulary features of the sample description text.

[0151] Figure 4 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 4 As shown, the electronic device may include: a processor 410, a memory 420, a communications interface 430 and a communication bus 440, wherein the processor 410, the memory 420 and the communications interface 430 communicate with each other via the communications bus 440. The processor 410 may call the logic instructions in the memory 420 to execute a cross-modal video retrieval method, which includes: extracting implicit features and vocabulary features of a query text; inputting each candidate video and the description text of each candidate video into a feature extraction model to obtain the implicit features of each candidate video and the vocabulary features of each candidate video output by the feature extraction model; based on the similarity between the implicit features of the query text and the implicit features of each candidate video, and the similarity between the vocabulary features of the query text and the vocabulary features of each candidate video, determining the retrieval video corresponding to the query text from each candidate video; the feature extraction model is based on the sample This video and the sample description text of the sample video are obtained through training. The training stage of the feature extraction model includes a vocabulary feature training stage and a joint training stage. The vocabulary feature training stage takes minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text as a training goal. The joint training stage takes the similarity between the implicit features of the sample video and the implicit features of the sample description text as soft labels, and minimizes the difference between the student prediction results and the soft labels as a training goal. The student prediction results refer to the similarity between the vocabulary features of the sample video and the vocabulary features of the sample description text.

[0152] In addition, the logic instructions in the above-mentioned memory 420 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0153] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, and when the program instructions are executed by a computer, the computer can execute the cross-modal video retrieval method provided by the above-mentioned methods, the method comprising: extracting implicit features and vocabulary features of a query text; inputting each candidate video and a description text of each candidate video into a feature extraction model to obtain implicit features of each candidate video and vocabulary features of each candidate video output by the feature extraction model; based on the similarity between the implicit features of the query text and the implicit features of each candidate video, and the similarity between the vocabulary features of the query text and the vocabulary features of each candidate video Similarity, determine the retrieval video corresponding to the query text from each candidate video; the feature extraction model is trained based on the sample video and the sample description text of the sample video, and the training stage of the feature extraction model includes a vocabulary feature training stage and a joint training stage. The vocabulary feature training stage takes minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text as a training goal, and the joint training stage takes the similarity between the implicit features of the sample video and the implicit features of the sample description text as soft labels, and minimizes the difference between the student prediction result and the soft label as a training goal. The student prediction result refers to the similarity between the vocabulary features of the sample video and the vocabulary features of the sample description text.

[0154] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the above-mentioned cross-modal video retrieval method, the method comprising: extracting implicit features and vocabulary features of a query text; inputting each candidate video and a description text of each candidate video into a feature extraction model to obtain implicit features of each candidate video and vocabulary features of each candidate video output by the feature extraction model; based on the similarity between the implicit features of the query text and the implicit features of each candidate video, and the similarity between the vocabulary features of the query text and the vocabulary features of each candidate video, determining from each candidate video the query text corresponding to the query text; corresponding retrieval video; the feature extraction model is trained based on the sample video and the sample description text of the sample video, the training stage of the feature extraction model includes a vocabulary feature training stage and a joint training stage, the vocabulary feature training stage takes minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text as a training goal, the joint training stage takes the similarity between the implicit features of the sample video and the implicit features of the sample description text as soft labels, and minimizes the difference between the student prediction result and the soft label as a training goal, the student prediction result refers to the similarity between the vocabulary features of the sample video and the vocabulary features of the sample description text.

[0155] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0156] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0157] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A cross-modal video retrieval method, characterized in that: include: Extract implicit features and vocabulary features of query text; Inputting each candidate video and a description text of each candidate video into a feature extraction model, and obtaining implicit features of each candidate video and vocabulary features of each candidate video output by the feature extraction model; Based on the similarity between the implicit features of the query text and the implicit features of each candidate video, and the similarity between the vocabulary features of the query text and the vocabulary features of each candidate video, determining the retrieval video corresponding to the query text from each candidate video; The feature extraction model is trained based on a sample video and a sample description text of the sample video. The training phase of the feature extraction model includes a vocabulary feature training phase and a joint training phase. The vocabulary feature training phase takes minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text as a training goal. The joint training phase takes the similarity between the implicit features of the sample video and the implicit features of the sample description text as soft labels, and minimizes the difference between the student prediction result and the soft label as a training goal. The student prediction result refers to the similarity between the vocabulary features of the sample video and the vocabulary features of the sample description text. The feature extraction model is obtained after performing parameter iteration on the initial model, wherein the initial model includes a basic video encoder, a basic text encoder and a vocabulary mapping module; The vocabulary feature training phase includes the following training steps: Based on the basic video encoder, extracting sample video basic features from the sample video; Based on the basic text encoder, extracting sample text basic features from the sample description text; Based on the vocabulary mapping module, the sample video basic features and the sample text basic features are respectively mapped to the vocabulary space to obtain the vocabulary features of the sample video and the vocabulary features of the sample description text; The parameter iteration of the vocabulary feature training phase is performed with the training goal of minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text.

2. The cross-modal video retrieval method according to claim 1, characterized in that: The step of performing parameter iteration in the vocabulary feature training phase with minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text as the training goal includes: Freeze the parameters of the basic text encoder and the vocabulary mapping module, and update the parameters of the basic video encoder by minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text as a training goal; After updating the parameters of the basic video encoder, the sample description text is masked, and the masked sample description text is input into the basic text encoder to obtain a sample mask feature, and the sample mask feature is decoded to obtain a sample prediction text; Based on the difference between the sample description text and the sample prediction text, and the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text, the parameters of the basic video encoder and the basic text encoder are updated.

3. The cross-modal video retrieval method according to claim 1, characterized in that: The extracting sample video basic features from the sample video based on the basic video encoder includes: Sampling the sample video to obtain a video frame sequence; The video frame sequence is input into the basic video encoder to obtain the sample video basic features.

4. The cross-modal video retrieval method according to claim 1, characterized in that: The basic video encoder includes a video implicit encoder and a video vocabulary encoder, and the basic text encoder includes a text implicit encoder and a text vocabulary encoder; The joint training stage includes the following training steps: Based on the video implicit encoder, extracting implicit features of the sample video from basic features of the sample video; Based on the video vocabulary encoder, extracting vocabulary features of the sample video from basic features of the sample video; Based on the text implicit encoder, the implicit features of the sample description text are extracted from the basic features of the sample text; Based on the text vocabulary encoder, extracting vocabulary features of the sample description text from the basic features of the sample text; Determining the student prediction result based on the similarity between the vocabulary features of the sample video and the vocabulary features of the sample description text; The parameter iteration of the joint training stage is performed with the training goal of minimizing the difference between the student prediction result and the soft label.

5. The cross-modal video retrieval method according to any one of claims 1 to 4, characterized in that: The determining of the retrieval video corresponding to the query text from each candidate video based on the similarity between the implicit features of the query text and the implicit features of each candidate video, and the similarity between the vocabulary features of the query text and the vocabulary features of each candidate video, comprises: Determining an implicit feature similarity score of each candidate video based on the similarity between the implicit feature of the query text and the implicit feature of each candidate video; The similarity between the vocabulary features of the query text and the vocabulary features of each candidate video is used to determine the vocabulary feature similarity score of each candidate video; Determine a similarity score for each candidate video based on the implicit feature similarity score of each candidate video and the vocabulary feature similarity score of each candidate video; Based on the similarity scores of the candidate videos, a retrieval video corresponding to the query text is determined from the candidate videos.

6. The cross-modal video retrieval method according to claim 5, characterized in that: The implicit features of each candidate video include video implicit features and text implicit features of each candidate video; The step of determining the implicit feature similarity score of each candidate video based on the similarity between the implicit feature of the query text and the implicit feature of each candidate video comprises: Determining a video implicit feature score for each candidate video based on the similarity between the implicit features of the query text and the video implicit features of each candidate video; Determining a text implicit feature score for each candidate video based on the similarity between the implicit features of the query text and the text implicit features of each candidate video; Based on the video implicit feature score of each candidate video and the text implicit feature score of each candidate video, the implicit feature similarity score of each candidate video is determined.

7. The cross-modal video retrieval method according to claim 5, characterized in that: The vocabulary features of each candidate video include video vocabulary features and text vocabulary features of each candidate video; The similarity between the vocabulary features of the query text and the vocabulary features of each candidate video, and determining the vocabulary feature similarity score of each candidate video, include: Determining a video vocabulary feature score for each candidate video based on the similarity between the vocabulary feature of the query text and the video vocabulary feature of each candidate video; Determining a text vocabulary feature score for each candidate video based on the similarity between the vocabulary feature of the query text and the text vocabulary feature of each candidate video; Based on the video vocabulary feature score of each candidate video and the text vocabulary feature score of each candidate video, the vocabulary feature similarity score of each candidate video is determined.

8. A cross-modal video retrieval device, characterized in that: include: A first extraction unit, used for extracting implicit features and vocabulary features of the query text; A second extraction unit, used to input each candidate video and a description text of each candidate video into a feature extraction model, and obtain implicit features of each candidate video and vocabulary features of each candidate video output by the feature extraction model; A video retrieval unit, configured to determine a retrieval video corresponding to the query text from among the candidate videos based on the similarity between the implicit features of the query text and the implicit features of the candidate videos, and the similarity between the vocabulary features of the query text and the vocabulary features of the candidate videos; The feature extraction model is trained based on a sample video and a sample description text of the sample video. The training phase of the feature extraction model includes a vocabulary feature training phase and a joint training phase. The vocabulary feature training phase takes minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text as a training goal. The joint training phase takes the similarity between the implicit features of the sample video and the implicit features of the sample description text as soft labels, and minimizes the difference between the student prediction result and the soft label as a training goal. The student prediction result refers to the similarity between the vocabulary features of the sample video and the vocabulary features of the sample description text. The feature extraction model is obtained after performing parameter iteration on the initial model, wherein the initial model includes a basic video encoder, a basic text encoder and a vocabulary mapping module; The vocabulary feature training phase includes the following training steps: Based on the basic video encoder, extracting sample video basic features from the sample video; Based on the basic text encoder, extracting sample text basic features from the sample description text; Based on the vocabulary mapping module, the sample video basic features and the sample text basic features are respectively mapped to the vocabulary space to obtain the vocabulary features of the sample video and the vocabulary features of the sample description text; The parameter iteration of the vocabulary feature training phase is performed with the training goal of minimizing the difference between the vocabulary features of the sample video and the vocabulary features of the sample description text.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the cross-modal video retrieval method according to any one of claims 1 to 7 is implemented.