Unsupervised cross-modal video retrieval method and device assisted by multimodal large model

Through the unsupervised cross-modal video retrieval method assisted by multi-modal large models, the difference evaluation and pre-training model are used to automatically generate and filter annotations, which solves the problem of manual annotation dependence and achieves efficient cross-modal video retrieval model training. and applications.

CN118427396BActive Publication Date: 2024-09-03HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410893508.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-09-03
Estimated Expiration
2044-07-03

AI Technical Summary

Technical Problem

Existing cross-modal video retrieval methods rely on a large amount of manually annotated training data, which makes data set collection difficult and limits the application of the technology in actual scenarios.

Method used

An unsupervised cross-modal video retrieval method assisted by a multi-modal large model is used to automatically generate text annotations through representative video frame sampling based on difference evaluation and a pre-trained multi-modal text annotation large model, combined with pre-trained cross-modal text The image matching model filters out noisy annotations, reducing reliance on manual annotations and improving model training efficiency.

Benefits of technology

It realizes unsupervised training of cross-modal video retrieval models, improves the accuracy and reliability of retrieval, reduces the amount of calculation and manual annotation costs, and improves model training efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118427396B
    Figure CN118427396B
Patent Text Reader

Abstract

The present application provides a multimodal large model-assisted unsupervised cross-modal video retrieval method and device. In one example of the present application, the method includes: for any video in the training set, a representative video frame sampling method based on difference evaluation is used to sample the video frames of the video to obtain representative frames of the video, and a pre-trained multimodal text annotation large model is used to generate corresponding text annotations; based on the correlation between the representative frames and the corresponding text annotations, the text annotations that do not meet the correlation requirements are filtered; based on the filtered text annotations, the text description information of the video is determined to obtain video-text description information pairs; based on the video-text description information pairs corresponding to each video in the training set, the cross-modal video retrieval model is trained. This method can reduce the dependence of cross-modal video retrieval model training on manual annotations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of text-video cross-modal retrieval, and in particular to an unsupervised cross-modal video retrieval method and device assisted by a multi-modal large model. Background Art

[0002] With the rise of social media and video sharing platforms, short video software has attracted a large number of users, who upload and share a large amount of video content. With the development of short video software, people's demand for searching videos related to their interests is growing. Therefore, the cross-modal retrieval task of text to video has received a lot of attention from the academic community.

[0003] Text video retrieval calculates the relevance of natural language queries given by users with video content, and retrieves corresponding semantically related videos from a large video library.

[0004] In recent years, cross-modal video retrieval methods based on deep learning have made significant progress. However, the current mainstream methods rely heavily on a large amount of manually annotated training data. Given the limited manpower costs, it is usually difficult to collect a large-scale and high-quality video-text pair dataset, which to some extent limits the application of cross-modal retrieval technology in practical scenarios. Summary of the invention

[0005] In view of this, the present application provides an unsupervised cross-modal video retrieval method and device assisted by a multi-modal large model.

[0006] Specifically, the present application is implemented through the following technical solutions:

[0007] According to a first aspect of an embodiment of the present application, a multimodal large model-assisted unsupervised cross-modal video retrieval method is provided, comprising:

[0008] For any video in the training set, a representative video frame sampling method based on difference evaluation is used to sample the video frames to obtain a representative frame of the video;

[0009] Based on the representative frames of the video, the corresponding text annotations are generated using a pre-trained multimodal text annotation model;

[0010] Using the pre-trained cross-modal text-image matching model, the correlation between the representative frame and the corresponding text annotation is determined, and based on the correlation between the representative frame and the corresponding text annotation, the text annotation that does not meet the correlation requirement is filtered out;

[0011] Determine the text description information of the video based on the filtered text annotations to obtain a video-text description information pair;

[0012] The cross-modal video retrieval model is trained according to the video-text description information pairs corresponding to each video in the training set to obtain a trained cross-modal video retrieval model; wherein the trained cross-modal video retrieval model is used to perform cross-modal video retrieval tasks.

[0013] According to a second aspect of an embodiment of the present application, a multimodal large model-assisted unsupervised cross-modal video retrieval method is provided, comprising:

[0014] Obtain target text information for video retrieval;

[0015] Using the trained cross-modal video retrieval model to extract text features from the target text information, to obtain text feature information of the target text information; wherein the trained cross-modal video retrieval model is trained using the method provided in the first aspect;

[0016] Based on the text feature information of the target text information and the video features of the candidate video, a target video matching the target text information is determined; wherein the video features of the candidate video are obtained by extracting the video features of the candidate video using the trained cross-modal video retrieval model.

[0017] According to a third aspect of an embodiment of the present application, a multimodal large model-assisted unsupervised cross-modal video retrieval device is provided, comprising:

[0018] A sampling unit, configured to sample video frames of any video in a training set by using a representative video frame sampling method based on difference evaluation to obtain a representative frame of the video;

[0019] A generation unit, used to generate corresponding text annotations based on representative frames of the video using a pre-trained multimodal text annotation model;

[0020] A filtering unit, used to determine the correlation between the representative frame and the corresponding text annotation by using the pre-trained cross-modal text image matching model, and filter the text annotation that does not meet the correlation requirement according to the correlation between the representative frame and the corresponding text annotation;

[0021] A determination unit, configured to determine text description information of the video based on the filtered text annotations, and obtain a video-text description information pair;

[0022] A training unit is used to train a cross-modal video retrieval model based on the video-text description information pairs corresponding to each video in a training set to obtain a trained cross-modal video retrieval model; wherein the trained cross-modal video retrieval model is used to perform a cross-modal video retrieval task.

[0023] According to a fourth aspect of an embodiment of the present application, there is provided an electronic device, including a processor and a memory, wherein:

[0024] Memory, used to store computer programs;

[0025] The processor is used to implement the method provided in the first aspect when executing the program stored in the memory.

[0026] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, wherein a computer program is stored in the computer program product, and when the computer program is executed by a processor, the method provided in the first aspect is implemented.

[0027] The multimodal large model-assisted unsupervised cross-modal video retrieval method of the embodiment of the present application, for any video in the training set, uses a representative video frame sampling method based on difference evaluation to sample the video frames of the video to obtain a representative frame of the video, and based on the representative frame of the video, uses a pre-trained multimodal text annotation large model to generate corresponding text annotations. By introducing the pre-trained multimodal text annotation large model, automatic generation of text annotations is achieved, reducing dependence on manual annotations, and by designing a representative video frame sampling based on difference evaluation, representative frames in each video are selected to extract key information from the video, avoiding frequent calls to the pre-trained multimodal text annotation large model, reducing the call cost and greatly reducing the amount of calculation; for the generated text annotations , a pre-trained cross-modal text-image matching model is used to filter the noise in machine annotation to improve the accuracy of machine annotation and reduce errors in annotation information. Then, based on the filtered text annotation, the text description information of the video is determined to obtain video-text description information pairs, and the cross-modal video retrieval model is trained based on the video-text description information pairs corresponding to each video in the training set to obtain a trained cross-modal video retrieval model. The trained cross-modal video retrieval model is used to perform cross-modal video retrieval tasks, which can improve the accuracy and reliability of cross-modal retrieval. Since the training samples used in the training process of the cross-modal video retrieval model do not need to be manually labeled, the unsupervised training of the cross-modal video retrieval model is realized, which improves the model training efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 A schematic diagram of a flow chart of an unsupervised cross-modal video retrieval method assisted by a pre-trained multi-modal large model as an exemplary embodiment of the present application;

[0029] Figure 2 A schematic diagram of a data preparation stage for unsupervised cross-modal video retrieval based on a pre-trained multi-modal large model is shown as an exemplary embodiment of the present application;

[0030] Figure 3A schematic diagram of a training model stage of unsupervised cross-modal video retrieval based on a pre-trained multi-modal large model is shown as an exemplary embodiment of the present application;

[0031] Figure 4 A schematic diagram of the structure of an unsupervised cross-modal video retrieval device assisted by a pre-trained multi-modal large model is shown as an exemplary embodiment of the present application;

[0032] Figure 5 The figure is a schematic diagram of the hardware structure of an electronic device shown as an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application, some technical terms involved in the embodiments of the present application are briefly explained below.

[0034] 1. Pre-trained multimodal large model: The pre-trained multimodal large model is a model architecture based on deep learning, which is designed to process data of multiple modalities (such as images, text, audio, etc.) and realize cross-modal tasks. It combines technologies in fields such as computer vision, natural language processing, and audio processing to establish associations and semantic understanding between multimodal data. In the pre-training stage, a shared modal representation space is learned through the joint encoding of multimodal input data, so that features between different modalities can be effectively converted and aligned in this space.

[0035] 2. Unsupervised learning: Unsupervised learning is a learning paradigm in the field of deep learning. Unlike supervised learning and reinforcement learning, it does not rely on manually labeled training data or external reward signals for training. The goal of unsupervised learning is to discover structures, patterns, or associations in data from unlabeled data.

[0036] 3. Cross-modal video retrieval: Cross-modal video retrieval aims to retrieve video data associated with text query content. This task combines the techniques of text information retrieval and video content analysis, allowing users to find and obtain video clips associated with their query content through text descriptions or keywords. In text video retrieval, the text query can be a phrase, sentence, or a natural language description that expresses the user's needs for the required video content. The system needs to semantically understand and represent these text queries in order to match and calculate similarity with video data.

[0037] In order to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application are further described in detail below with reference to the accompanying drawings.

[0038] See also Figure 1, is a flow chart of an unsupervised cross-modal video retrieval method assisted by a pre-trained multi-modal large model provided in an embodiment of the present application, such as Figure 1 As shown, the unsupervised cross-modal video retrieval method assisted by a pre-trained multimodal large model may include the following steps:

[0039] Step S100: For any video in the training set, a representative video frame sampling method based on difference evaluation is used to perform video frame sampling on the video to obtain a representative frame of the video.

[0040] Step S110: Generate corresponding text annotations based on representative frames of the video using a pre-trained multimodal text annotation model.

[0041] In the embodiments of the present application, considering that the pre-trained multimodal large model has a strong generation capability and can automatically generate text annotations for visual content, in order to reduce the dependence of cross-modal video retrieval model training on manual work, a pre-trained multimodal large model can be introduced to generate training data in cross-modal video retrieval model training.

[0042] In addition, considering that videos usually include more video frames, there is a certain redundancy in the content between frames, and calling large models in large quantities will bring huge computational overhead. In order to reduce the cost of frequently calling large models, it is not necessary to automatically generate text annotations for all video frames. Instead, a representative video frame sampling method based on difference evaluation is used to select highly representative frames (which can be called representative frames) from the video frames.

[0043] Accordingly, for any video in the training set, the representative video frame sampling method based on difference evaluation can be used to perform video frame sampling on the video to obtain a representative frame of the video.

[0044] For example, the videos in the training set may come from mainstream video websites.

[0045] Exemplarily, a clustering method may be used to implement the difference evaluation of video frames, and feature clustering may be used to screen out different cluster centers, ie, representative frames, from the feature space, so as to obtain more representative video frames.

[0046] In an embodiment of the present application, for the sampled representative frames, a pre-trained multimodal large model (which may be referred to as a pre-trained multimodal text annotation large model) may be used to generate corresponding text annotations.

[0047] Step S120: using the pre-trained cross-modal text image matching model, determine the correlation between the representative frame and the corresponding text annotation, and filter the text annotation that does not meet the correlation requirement based on the correlation between the representative frame and the corresponding text annotation.

[0048] In the embodiment of the present application, it is considered that the pre-trained multimodal large model is difficult to stably output high-quality labels (i.e., the above-mentioned text annotations), which usually contain noise, and the presence of noise in the training data will inevitably affect the model performance during the training process of the cross-modal video retrieval model. Therefore, it is necessary to evaluate the quality of the generated text annotations and filter out samples with significantly lower quality.

[0049] For example, since the generated text annotations are derived from video frames, the correlation between the generated text annotations and the corresponding video frames can be used as a quality assessment standard for the text. The higher the correlation between the text annotations and the video frames, the higher the quality of the generated text annotations; otherwise, the lower the quality.

[0050] Exemplarily, a pre-trained multimodal large model for evaluating the quality of text annotation (which may be referred to as a pre-trained cross-modal text-image matching model or a pre-trained multimodal text-image matching large model) may be used to evaluate the quality of text annotation.

[0051] Among them, the pre-trained cross-modal text-image matching model refers to a model that is trained using a large number (hundreds of millions or even more) of matching texts and images. Through training, the model learns to encode images and texts into a unified vector space and has strong alignment capabilities for images and texts.

[0052] Exemplarily, the pre-trained cross-modal text-image matching model may include a CLIP (Contrastive Language-Image Pretraining) model.

[0053] In an embodiment of the present application, when text annotations corresponding to representative frames in video frames are generated in the above manner, a pre-trained cross-modal text image matching model can be used to determine the correlation between the representative frame and the corresponding text annotation, and based on the correlation between the representative frame and the corresponding text annotation, the text annotations that do not meet the correlation requirements can be filtered.

[0054] Step S130: Determine the text description information of the video based on the filtered text annotations to obtain a video-text description information pair.

[0055] In the embodiment of the present application, the text description information of the video can be generated based on the filtered text annotations obtained in the above manner, thereby obtaining a video-text description information pair.

[0056] Exemplarily, for any video in the training set, a video-text description information pair can be generated in the above manner, and training data for training a cross-modal video retrieval model can be obtained based on the obtained video-text description information pair.

[0057] Step S140: train the cross-modal video retrieval model according to the video-text description information pairs corresponding to each video in the training set to obtain a trained cross-modal video retrieval model; wherein the trained cross-modal video retrieval model is used to perform the cross-modal video retrieval task.

[0058] In an embodiment of the present application, a video-text description information pair corresponding to each video in a training set can be generated in the above manner, and a cross-modal video retrieval model can be trained based on the video-text description information pairs corresponding to each video in the training set to obtain a trained cross-modal video retrieval model.

[0059] Exemplarily, the trained cross-modal video retrieval model is used to perform a cross-modal video retrieval task.

[0060] It can be seen that in Figure 1 In the method flow shown, for any video in the training set, a representative video frame sampling method based on difference evaluation is used to sample the video frames of the video to obtain a representative frame of the video, and based on the representative frame of the video, a pre-trained multimodal text annotation large model is used to generate the corresponding text annotation. By introducing the pre-trained multimodal text annotation large model, the automatic generation of text annotations is realized, and the dependence on manual annotations is reduced. The unsupervised training of the cross-modal video retrieval model can be realized, and by designing a representative video frame sampling based on difference evaluation, the representative frames in each video are selected to extract the key information in the video, thereby avoiding frequent calls to the pre-trained multimodal text annotation large model, reducing the call cost and greatly reducing the amount of calculation. For the generated text annotations, A pre-trained cross-modal text-image matching model is used to filter out noise in machine annotation to improve the accuracy of machine annotation and reduce errors in annotation information. Then, based on the filtered text annotation, the text description information of the video is determined to obtain video-text description information pairs. The cross-modal video retrieval model is trained based on the video-text description information pairs corresponding to each video in the training set to obtain a trained cross-modal video retrieval model. The trained cross-modal video retrieval model is used to perform cross-modal video retrieval tasks, which can improve the accuracy and reliability of cross-modal retrieval. Since the training samples used in the training process of the cross-modal video retrieval model do not need to be manually labeled, unsupervised training of the cross-modal video retrieval model is realized, thereby improving the model training efficiency.

[0061] In some embodiments, the above-mentioned representative video frame sampling method based on difference evaluation to perform video frame sampling on the video may include:

[0062] Extract visual features of each video frame in the video respectively to obtain visual features of each video frame;

[0063] According to the visual features of each video frame, a video frame with the largest visual feature amplitude is selected as the first clustering center;

[0064] Selecting video frames that are farthest from existing cluster centers in sequence as new cluster centers until the number of selected cluster centers reaches a first number;

[0065] Each cluster center is determined as the representative frame of the video.

[0066] Exemplarily, in order to determine the representative frame, visual features of each video frame in the video may be extracted to obtain visual features of each video frame.

[0067] For example, given a video containing N (N ≥ 2) frames, the visual features of each video frame in the video can be extracted, and the final features are recorded as .

[0068] For example, the CLIP pre-trained model developed by OpenAI (such as the above-mentioned pre-trained cross-modal text image matching model) can be used to extract visual features from video frames. Each frame in the video can be converted into a k-dimensional feature vector (k is a positive integer), and the final video feature is represented as a matrix with a dimension of (k×N).

[0069] Exemplarily, the extracted visual features may be clustered to identify key frames (ie, the representative frames mentioned above) in the video.

[0070] Exemplarily, the visual feature amplitude of each video frame can be determined based on the visual features of each video frame and the L2 norm of the visual features of each video frame, and the video frame with the largest visual feature amplitude is selected as the first cluster center, and the video frames farthest from the existing cluster centers are selected in sequence as new cluster centers, until the number of selected cluster centers reaches a first number (the specific value can be set according to actual needs), and then each cluster center can be determined as a representative frame of the video.

[0071] Since the new cluster center selected each time is the video frame farthest from the existing cluster center, the difference between the selected representative frames is guaranteed, and finally multiple video frames that can better represent the video content are obtained.

[0072] It should be noted that in the embodiments of the present application, in the process of clustering the visual features of each video frame in the video to identify the representative frame, it is not limited to the above-mentioned clustering method, and clustering algorithms such as K-medoids (K center point clustering algorithm) algorithm or K-means (K means clustering algorithm) algorithm can also be used. The specific implementation will not be repeated here.

[0073] Compared with the implementation method of the K-means algorithm which defines the average value of each point in the cluster as the cluster center, the clustering method provided in the embodiment of the present application defines the center point in the cluster as the actual data point in the cluster, which has better interpretability.

[0074] Compared with the K-medoids algorithm, the clustering method provided in the embodiment of the present application reduces the randomness in the selection of initial cluster centers, which helps to accelerate the convergence of the algorithm.

[0075] In some embodiments, the above-mentioned generation of corresponding text annotations based on the representative frame of the video using a pre-trained multimodal text annotation model may include:

[0076] For any representative frame, the representative frame and the prompt word corresponding to the representative frame are input into the pre-trained multimodal text annotation model to generate the corresponding text annotation.

[0077] Exemplarily, in order to realize the automatic generation of text annotations, a multimodal large model for automatically generating text annotations (i.e., the above-mentioned pre-trained multimodal text annotation large model) can be pre-trained, and the pre-trained multimodal text annotation large model can be used to automatically generate text annotations for representative frames.

[0078] Exemplarily, in order to improve the efficiency of text annotation, for each representative frame, a prompt word can be designed for the representative frame (used to prompt the pre-trained multimodal text annotation large model to perform text annotation on the representative frame), and the prompt word and the representative frame are input into the pre-trained multimodal text annotation large model to obtain the corresponding text annotation.

[0079] In some embodiments, the above-mentioned use of the pre-trained cross-modal text image matching model to determine the correlation between the representative frame and the corresponding text annotation, and filtering the text annotation that does not meet the correlation requirement based on the correlation between the representative frame and the corresponding text annotation, may include:

[0080] For any video, input each representative frame in the video and the text annotations corresponding to the representative frames into the pre-trained cross-modal text image matching model to determine the correlation between each representative frame in the video and the corresponding text annotations;

[0081] Based on the correlation between each representative frame in the video and the corresponding text annotation, retain the text annotations in the second number of representative frames and corresponding text annotations with the top correlation ranking, and delete the remaining text annotations. Exemplarily, in order to improve the sample quality, for any video, when the text annotations corresponding to each representative frame in the video are generated in the above manner, a pre-trained cross-modal text image matching model can be used to determine the correlation between each representative frame in the video and the corresponding text annotation, and based on the correlation between each representative frame in the video and the corresponding text annotation, retain the text annotations in the second number (the specific value can be set according to actual needs) of representative frames and corresponding text annotations with the top correlation ranking, and delete the remaining text annotations, that is, retain the text annotations in the representative frames and corresponding text annotations with the topK correlation (K is the second number).

[0082] In some embodiments, the training of the cross-modal video retrieval model based on the video-text description information pairs corresponding to each video in the training set may include:

[0083] For any video-text description information pair in the training set, use the pre-trained cross-modal similarity evaluation model to determine the similarity score between the video and the text description information in the video-text description information pair;

[0084] Determining a training weight of the video-text description information pair according to the similarity score; wherein the training weight of the video-text description information pair is positively correlated with the similarity score;

[0085] The cross-modal video retrieval model is trained based on the video-text description information pairs corresponding to each video and the training weights of the video-text description information pairs corresponding to each video.

[0086] For example, considering that the training samples are generated by a pre-trained multimodal text annotation model, even if some low-quality samples have been removed by sample filtering, there may still be some noise in the remaining samples. Therefore, in order to reduce the impact of noise in the samples, different weights can be adjusted for each sample pair during the optimization training process.

[0087] For example, a large cross-modal model (which may be referred to as a pre-trained cross-modal similarity evaluation model) may be trained to measure the similarity between video and text description information.

[0088] For any video-text description information pair in the training set, the pre-trained cross-modal similarity evaluation model is used to determine the similarity score between the video and the text description information in the video-text description information pair, and the training weight of the video-text description information pair is determined based on the similarity score.

[0089] When the training weights of each video-text description information pair are determined in the above manner, the cross-modal video retrieval model can be trained based on the video-text description information pairs corresponding to each video and the training weights of the video-text description information pairs corresponding to each video.

[0090] Among them, in the cross-modal video retrieval model training process, for any batch of training data, the training losses of each video-text description information pair in the batch of training data can be weighted averaged according to the training weights of each video-text description information pair in the batch of training data determined in the above manner to obtain the training loss corresponding to the batch of training data. The specific implementation can be explained in conjunction with specific examples below.

[0091] In some embodiments, the cross-modal video retrieval model includes a text encoder, a video encoder, and a sequence Transformer module;

[0092] The above-mentioned training of the cross-modal video retrieval model based on the video-text description information pairs corresponding to each video in the training set may include:

[0093] For any video-text description information pair in any batch of training data, respectively, use a text encoder to perform text feature extraction on the text description information in the video-text description information pair to obtain a text feature representation corresponding to the text description information, and use a video encoder to perform video feature extraction on the downsampled video corresponding to the video in the video-text description information pair, and use a sequence Transformer module to process the video feature extraction results to obtain a video feature representation;

[0094] Determining a first type of loss based on a first similarity between a video feature representation of the video in the video-text description information pair and a text feature representation of the text description information in the video-text description information pair, and a second similarity between the video feature representation and the text feature representation of the text description information in other video-text description information pairs in the same batch of training data; and

[0095] Determine a second type of loss based on a first similarity between a video feature representation of the video in the video-text description information pair and a text feature representation of the text description information in the video-text description information pair, and a third similarity between the text feature representation and video feature representations of videos in other video-text description information pairs in the same batch of training data;

[0096] The training loss of the batch of training data is determined according to the first type of loss and the second type of loss corresponding to each video-text description information pair in the batch of training data.

[0097] Exemplarily, the cross-modal retrieval model may include a video encoder for extracting features from a video, and a text encoder for extracting features from a text.

[0098] In addition, considering that the information contained in videos is much more than that contained in texts, in order to better mine the rich information contained in videos, the sequence Transformer (seqTransformer) module can be introduced to effectively capture the contextual temporal dependencies in the sequence using its self-attention mechanism and multi-head attention mechanism.

[0099] Correspondingly, for any video-text description information pair in any batch of training data, the text encoder can be used to extract text features from the text description information in the video-text description information pair to obtain the text feature representation corresponding to the text description information, and the video encoder can be used to extract video features from the downsampled video corresponding to the video in the video-text description information pair, and the sequence Transformer module can be used to process the video feature extraction results to obtain the video feature representation.

[0100] For example, in order to optimize the training effect of the cross-modal retrieval model, during the training process, it is necessary to consider the loss of video retrieval text and the loss of text retrieval video separately.

[0101] Accordingly, when the video feature representation and the text feature representation are obtained in the above manner, for any video-text description information pair in any batch of training data, on the one hand, the loss of video retrieval text (which may be referred to as a first type of loss) can be determined based on the similarity between the video feature representation of the video in the video-text description information pair and the text feature representation of the text description information in the video-text description information pair (which may be referred to as a first similarity), and the similarity between the video feature representation and the text feature representation of the text description information in other video-text description information pairs in the same batch of training data (which may be referred to as a second similarity).

[0102] For example, for any video-text description information pair, the first type of loss can be determined based on the ratio of the natural index of the first similarity corresponding to the video-text description information pair and the sum of the natural indexes of the second similarities corresponding to the video-text description information pair. The specific implementation can be explained in conjunction with specific examples below.

[0103] Where exp(*) is the natural exponential of “*”.

[0104] On the other hand, the loss of text retrieval video (which may be called the second type loss) may be determined based on the similarity between the video feature representation of the video in the video-text description information pair and the text feature representation of the text description information in the video-text description information pair (i.e., the first similarity mentioned above), and the similarity between the text feature representation and the video feature representation of videos in other video-text description information pairs in the same batch of training data (which may be called the third similarity).

[0105] For example, for any video-text description information pair, the first type of loss can be determined based on the ratio of the natural index of the first similarity corresponding to the video-text description information pair and the sum of the natural indexes of the third similarities corresponding to the video-text description information pair. The specific implementation can be explained in conjunction with specific examples below.

[0106] When the first type of loss and the second type of loss corresponding to each video-text description information pair in the same batch of training data are determined in the above manner, the training loss of the batch of training data can be determined based on the first type of loss and the second type of loss corresponding to each video-text description information pair in the same batch of training data.

[0107] For example, the weighted average of the first type of loss corresponding to each video-text description information pair in the same batch of training data (the weighting coefficient of each video-text description information pair may be the training weight determined in the above manner) and the weighted average of the second type of loss may be determined respectively, and the sum of the weighted average of the first type of loss and the weighted average of the second type of loss may be determined as the training loss for the batch of training data. The specific implementation thereof may be described below in conjunction with specific examples.

[0108] In some embodiments, the similarity between the video feature representation of the video and the text feature representation of the text description information is determined by:

[0109] For any video frame in the video, searching for a word whose feature is most similar to that of the video frame based on the feature of the video frame, and determining the fourth similarity between the word and the video frame as the similarity corresponding to the video frame; and

[0110] For any word in the text description information, searching for a video frame whose feature is most similar to the feature of the word according to the feature of the word, and determining the fifth similarity between the video frame and the word as the similarity corresponding to the word;

[0111] The similarity between the video feature representation of the video and the text feature representation of the text description information is determined based on the fourth similarity corresponding to each video frame in the video and the fifth similarity corresponding to each word in the text description information.

[0112] Exemplarily, in order to more accurately determine the similarity between the video and the text, the similarity between the video and the text may be determined based on the fine-grained similarity between video frames in the video and sentence words in the text.

[0113] Exemplarily, for any video frame in the video, based on the features of the video frame, a word whose features are most similar to the features of the video frame is searched, and the similarity between the word and the video frame (which can be called the fourth similarity) is determined as the similarity corresponding to the video frame.

[0114] Exemplarily, for any video frame in the video, the similarity between the features of the video frame and the features of each word in the text description information can be calculated respectively, the word whose features have the highest similarity with the features of the video frame can be determined, and the similarity between the features of the word and the features of the video frame can be determined as the similarity corresponding to the video frame (i.e., the fourth similarity).

[0115] Similarly, for any word in the text description information, the video frame whose features are most similar to those of the word can be searched based on the features of the word, and the similarity between the video frame and the word (which can be called the fifth similarity) can be determined as the similarity corresponding to the word.

[0116] Exemplarily, for any word in the text description information, the similarity between the features of the word and the features of each video frame in the video can be calculated respectively, and the video frame whose features have the highest similarity with the features of the word can be determined, and the similarity between the features of the video frame and the features of the word can be determined as the similarity corresponding to the word (i.e., the fifth similarity).

[0117] Furthermore, the similarity between the video feature representation of the video and the text feature representation of the text description information may be determined based on the fourth similarity corresponding to each video frame in the video and the fifth similarity corresponding to each word in the text description information.

[0118] For example, based on the sum of the fourth similarities corresponding to each video frame in the video and the sum of the fifth similarities corresponding to each word in the text description information, the sum of the two can be determined as the similarity between the video feature representation of the video and the text feature representation of the text description information. The specific implementation can be explained in conjunction with specific examples below.

[0119] The embodiment of the present application also provides an unsupervised cross-modal video retrieval method assisted by a multi-modal large model. The unsupervised cross-modal video retrieval method assisted by a multi-modal large model may include the following steps:

[0120] Step T100: Obtain target text information for video retrieval.

[0121] In the embodiment of the present application, the target text information may be text information input by a user for video retrieval.

[0122] Step T110: Use the trained cross-modal video retrieval model to extract text features of the target text information to obtain text feature information of the target text information.

[0123] Exemplarily, the training method of the cross-modal video retrieval model can refer to the relevant description in the above embodiment.

[0124] In an embodiment of the present application, for the acquired target text information, a trained cross-modal video retrieval model can be used to extract text features of the target text information to obtain text feature information of the target text information.

[0125] For example, the text encoder in the cross-modal video retrieval model can be used to extract text features from the target text information.

[0126] Step T120: determine a target video that matches the target text information based on the text feature information of the target text information and the video features of the candidate video; wherein the video features of the candidate video are obtained by extracting the video features of the candidate video using a trained cross-modal video retrieval model.

[0127] In the embodiment of the present application, when the text feature information of the target text information is obtained, the target video matching the target text information can be determined based on the text feature information and the video features of the candidate videos.

[0128] For example, based on the similarity between the text feature information of the target text information and the video features of the candidate videos, a certain number (which can be called the third number, and the specific value can be set according to actual needs) of candidate videos with the top similarity rankings, that is, candidate videos with the topM (M is the third number) similarities, can be taken as target videos.

[0129] Exemplarily, the candidate video may be a video in a video library for searching, such as a video in a video library of a video website.

[0130] Exemplarily, the video features of the candidate videos can be obtained by extracting the video features of the candidate videos using a trained cross-modal video retrieval model.

[0131] For example, the video encoder and sequence Transformer module pair in the cross-modal video retrieval model can be used to extract video features from candidate videos to obtain video feature information of the candidate videos.

[0132] In order to enable those skilled in the art to better understand the technical solutions provided in the embodiments of the present application, the technical solutions provided in the embodiments of the present application are described below with reference to specific examples.

[0133] In this embodiment, considering that it is very difficult to perform text annotation for large-scale data sets, and the pre-trained multimodal large model has a strong generation capability and can automatically generate text annotations for visual content, therefore, in order to reduce the dependence of cross-modal video retrieval model training on manual labor, a pre-trained multimodal large model can be introduced for the generation of training data in cross-modal video retrieval model training.

[0134] However, there are the following problems in using pre-trained multimodal large models to generate text annotations: first, calling large models in large quantities will bring huge computational overhead; second, it is difficult for large models to stably output high-quality text annotations (which can be called pseudo labels), and the quality of samples varies.

[0135] In view of the above problems, the embodiment of the present application proposes an unsupervised cross-modal video retrieval framework based on a pre-trained multimodal large model. The framework includes two parts: a data preparation stage and a model training stage; wherein:

[0136] 1) Data preparation stage: Figure 2 As shown in the figure, at this stage, a representative video frame sampling module based on difference evaluation (corresponding to the clustering module in the figure) is designed to obtain the more representative frames of each video (i.e., the above-mentioned representative frames), and a pre-trained multimodal text annotation large model (such as the LLaVa model) is used to provide machine annotation information for the video. Finally, a large-scale pre-trained model (corresponding to the filtering module in the figure) is used to filter the noise in the machine annotation, thereby obtaining video-text data with better quality (i.e., the above-mentioned video-text description information pairs).

[0137] 2) Model training stage: Use native videos and filtered machine annotation information, and optimize the comparative learning loss function to train the cross-modal video retrieval model.

[0138] For example, considering that the training samples are generated by a pre-trained multimodal large model, even if some low-quality samples have been removed by sample filtering, there may still be some noise in the retained samples. To this end, noise-robust similarity learning is proposed. Considering the quality of samples based on contrast loss, it is necessary to adjust different weights for each sample pair during the optimization training process to reduce the impact of noise in the samples.

[0139] Through the above two stages, the unsupervised cross-modal retrieval task based on the pre-trained multimodal large model is achieved.

[0140] The following describes the relevant implementation details of the unsupervised cross-modal video retrieval framework based on the pre-trained multimodal large model.

[0141] 1. Representative video frame sampling module based on difference evaluation

[0142] Although the pre-trained multimodal large model has strong generation capabilities, the cost of each call is not low. In addition, since videos usually include more video frames, there is also a certain redundancy in the content between frames. In order to reduce the cost of frequent calls to the large model, it is not necessary to automatically generate text annotations for all video frames. Instead, a representative video frame sampling method based on difference evaluation is proposed to select highly representative frames (i.e., representative frames) from the initial video frames of the video, and automatically generate text annotations for the representative frames through the pre-trained multimodal text annotation large model.

[0143] Exemplarily, a clustering-based approach may be used to implement the difference assessment of video frames, and a feature clustering approach may be used to screen out different cluster centers, ie, representative frames, from the feature space, so as to obtain more representative video frames.

[0144] For example, for a given video containing N (N ≥ 2) frames, the visual features of each video frame in the video can be extracted, and the final features are recorded as .

[0145] For example, the CLIP pre-trained model developed by OpenAI can be used to extract visual features from video frames. Each frame in the video can be converted into a k-dimensional feature vector (k is a positive integer), and the final video feature is represented as a matrix with a dimension of (k×N).

[0146] Exemplarily, when visual features of each video frame are extracted, these visual features may be clustered so as to identify representative frames in the video.

[0147] For the specific clustering algorithm, the k-medoids algorithm can be used considering its simplicity and effectiveness. The K-medoids algorithm divides the data into k clusters by minimizing the sum of the distances between all data points in the cluster and the center of the cluster. The center of a specific cluster is defined as the actual data point whose average distance to all points in the cluster is the smallest. The traditional K-means algorithm defines the center as the average value between the points in the cluster. In contrast, the center of the K-medoids algorithm has better interpretability.

[0148] In order to further optimize the clustering process, KKZ (Katz-Murphy-Khachiyan) can be used as the initialization method of the cluster center.

[0149] That is, a data point with the largest L2 norm (i.e., the video frame with the largest visual feature amplitude) can be selected as the first cluster center, and then the data points (i.e., video frames) farthest from the existing cluster centers are selected as new cluster centers in turn, until the number of selected cluster centers reaches the first number. This strategy not only reduces the randomness of the K-medoids algorithm in the selection of the initial cluster centers, but also helps to accelerate the convergence of the algorithm.

[0150] Through video clustering sampling, we finally get multiple frames of images that can well represent the video content, and output them as representative frames of the video. ,in is the number of cluster centers specified in the K-medoids clustering algorithm. Subsequently, the pre-trained multimodal text annotation model can be used to generate text annotations for each representative frame.

[0151] 2. Generation module based on pre-trained multimodal large model

[0152] For example, given a video , through the above processing, the representative frame of the video can be obtained , and sent to the pre-trained multimodal text annotation model (such as LLaVa) with the prompt words.

[0153] Exemplarily, each representative frame may be input into LLaVa to obtain corresponding text annotations, so that for any video, text annotations corresponding to each representative frame in the video may be obtained.

[0154] For example, for a video, text description information corresponding to the entire video can be obtained based on text annotations corresponding to each representative frame in the video.

[0155] Exemplarily, in order to improve the efficiency of text annotation, for each representative frame, a prompt word can be designed for the representative frame, and the prompt word and the representative frame are input into LLaVa together to obtain the corresponding text annotation.

[0156] Through the above method, the text annotations corresponding to each representative frame in the video can be obtained .

[0157] 3. Data filtering module based on large-scale pre-trained models

[0158] For example, when the text annotations Q corresponding to each representative frame in the video are obtained by pre-training the multimodal text annotation model, considering that the text description generated by the pre-trained multimodal text annotation model will contain noise, and the existence of noise in the training data will inevitably affect the training of the cross-modal video retrieval model. Therefore, the quality of the generated text annotations can be evaluated, and the text annotations of the representative frames with obviously lower quality can be filtered out.

[0159] For example, since the generated text annotations are derived from video frames, the correlation between the generated text annotations and the corresponding video frames can be used as a quality assessment standard for the text. The higher the correlation between the text annotations and the video frames, the higher the quality of the generated text annotations; otherwise, the lower the quality.

[0160] Exemplarily, a pre-trained cross-modal text-image matching model (such as a CLIP model) may be used to calculate the relevance between text and video frames.

[0161] For example, for a given video, the corresponding text annotation and original video frame , the relevance scores of the two can be calculated through a large-scale pre-trained model, and the topK texts with higher scores can be retained according to the relevance scores to obtain the filtered text data :

[0162]

[0163] Among them, CLIP means using the CLIP model to calculate the relevance score between the video frame and the generated text description, and topK means taking the top K ranked texts as the filtering results.

[0164] 4. Multimodal Encoding Module

[0165] In order to verify the effectiveness of the generated text information, a cross-modal video retrieval model is proposed, which is trained on the generated text information and video pairs.

[0166] As shown in Figure 3, the cross-modal video retrieval model consists of a video encoder and a text encoder, and introduces the SeqTransformer (sequence transformer) module on the video side, using its self-attention mechanism and multi-head attention mechanism to effectively capture the contextual dependencies in the sequence, and finally calculate the similarity between the two modalities. In this way, unsupervised cross-modal retrieval can be achieved.

[0167] Exemplarily, in order to obtain a video feature representation, frames can be extracted from the video. For example, the video frames are downsampled (such as uniformly sampled) to obtain a downsampled video (including multiple sampled frames), and the downsampled video is passed through a video encoder to obtain a series of features.

[0168] For example, a video encoder may adopt ViT-B / 32 with 12 layers and an image block size of 32.

[0169] Given a video, we can uniformly sample m frames of the video to get the downsampled video , reducing the computational complexity of the video encoder.

[0170] The video is input to the image encoder of the cross-modal video retrieval model to obtain the corresponding video features .

[0171] The video feature consists of m frame feature sequences, and the feature dimension of the frame is d.

[0172] The encoded visual features can be expressed as:

[0173]

[0174] Among them, CLIP represents the video encoder of the cross-modal video retrieval model.

[0175] In addition, since the information contained in the video is much more than that contained in the text, in order to better mine the rich information contained in the video, seqTransformer can be introduced to effectively capture the contextual temporal dependencies in the sequence by using its self-attention mechanism and multi-head attention mechanism. The final video feature representation is:

[0176]

[0177] For text representation, given a text query with word length p , the text encoder in the cross-modal video retrieval model can be used to generate text feature representations.

[0178] For example, the text encoder is a standard Transformer architecture.

[0179] For example, a text encoder can be a 12-layer model with dimension 512 and 8 attention heads.

[0180] For the text information processed by the text encoder, the [EOS] of the last layer of Transformer can be used as the text feature.

[0181] For text , got .

[0182] Among them, the text feature consists of p word feature sequences, and the word feature dimension is d.

[0183] Exemplarily, the encoded text features can be expressed as:

[0184]

[0185] Among them, CLIP represents the text encoder of the cross-modal video retrieval model.

[0186] 5. Noise-Robust Similarity Learning Module

[0187] For example, for video and query text similarity learning, semantically related videos and query texts can be made as close as possible in the feature space (ie, the similarity is relatively high), whereas irrelevant videos and texts can be made as far apart as possible in the feature space.

[0188] Therefore, contrast loss can be used to optimize the features of text and video.

[0189] In addition, since the training samples are generated by a pre-trained multimodal text annotation model, even if some low-quality samples have been removed by sample filtering, there may still be some noise in the retained samples. To this end, the embodiment of the present application proposes noise-robust similarity learning, which considers the quality of the samples on the basis of contrast loss, and adjusts the weights of each sample pair differently during the optimization training process, thereby reducing the impact of noise in the samples.

[0190] For example, a pre-trained cross-modal similarity evaluation model (corresponding to Figure 3 The matrix learning module in is used to measure the similarity between each video-text (i.e., the above text description information) pair, and the obtained similarity score is used as the weight.

[0191] Illustratively, sample pairs with higher similarity scores will be given greater weights during the training process, while sample pairs with lower similarity scores will be given smaller weights.

[0192] For example, given a batch of B (B ≥ 2) video-text pairs, we need to optimize the loss of video retrieval text at the same time and the loss of text retrieval videos , therefore, the loss function of the model is as follows:

[0193]

[0194]

[0195]

[0196] Among them, for a video-text pair, is the first similarity between the video feature representation of the video in the video-text pair and the text feature representation of the text in the video-text pair, is the second similarity between the video feature representation of the video in the video-text pair and the text feature representation of the text description information in other video-text pairs in the same batch of training data; is the third similarity between the text feature representation and the video feature representation of the videos in other video-text pairs in the same batch of training data; is the first type loss for the video-text pair, is the second type of loss for the video-text pair.

[0197] The similarity score between the video and the text in the video-text pair determined by using a pre-trained cross-modal similarity evaluation model is used as the training weight of the video-text pair (ie, the weight coefficient of the weighted average). is the temperature factor. Sim represents the video-text similarity.

[0198] The fine-grained similarity between video frames and sentence words is used, and the calculation formula is as follows:

[0199]

[0200] Among them, this formula is a fine-grained matching formula between text and video. Video feature representation representing the video, Represents the characteristics of a single frame, Represents sentence-level text feature representation, Represents word-level features. The first max() means searching for the word with the highest similarity to all frames, and the second max() means searching for the frame with the highest similarity to all words, which reflects fine-grained matching.

[0201] in, To determine the fourth similarity corresponding to a video frame, To determine the fifth similarity corresponding to a word in the text. is the sum of the fourth similarities corresponding to each video frame in the video, is the sum of the fifth similarities corresponding to the words in the text. Finally, the similarities of the two are added together, which also takes into account the optimization of video retrieval text and text retrieval video.

[0202] The method provided by the present application is described above. The device provided by the present application is described below:

[0203] See also Figure 4 , is a schematic diagram of the structure of a multimodal large model-assisted unsupervised cross-modal video retrieval device provided in an embodiment of the present application, such as Figure 4 As shown, the multimodal large model-assisted unsupervised cross-modal video retrieval device may include:

[0204] The sampling unit 410 is used to sample video frames of any video in the training set by using a representative video frame sampling method based on difference evaluation to obtain a representative frame of the video;

[0205] A generating unit 420, configured to generate corresponding text annotations based on representative frames of the video using a pre-trained multimodal text annotation large model;

[0206] A filtering unit 430 is used to determine the correlation between the representative frame and the corresponding text annotation using the pre-trained cross-modal text image matching model, and filter the text annotation that does not meet the correlation requirement based on the correlation between the representative frame and the corresponding text annotation;

[0207] A determination unit 440 is used to determine the text description information of the video according to the filtered text annotations to obtain a video-text description information pair;

[0208] The training unit 450 is used to train the cross-modal video retrieval model according to the video-text description information pairs corresponding to each video in the training set to obtain a trained cross-modal video retrieval model; wherein the trained cross-modal video retrieval model is used to perform cross-modal video retrieval tasks.

[0209] In some embodiments, the sampling unit 410 performs video frame sampling on the video using a representative video frame sampling method based on difference evaluation, including:

[0210] Extract visual features of each video frame in the video respectively to obtain visual features of each video frame;

[0211] According to the visual features of each video frame, a video frame with the largest visual feature amplitude is selected as the first clustering center;

[0212] Selecting video frames that are farthest from existing cluster centers in sequence as new cluster centers until the number of selected cluster centers reaches a first number;

[0213] Each cluster center is determined as the representative frame of the video.

[0214] In some embodiments, the generating unit 420 generates corresponding text annotations based on the representative frame of the video using a pre-trained multimodal text annotation model, including:

[0215] For any representative frame, the representative frame and the prompt word corresponding to the representative frame are input into the pre-trained multimodal text annotation large model to generate corresponding text annotations; wherein the prompt word is used to prompt the pre-trained multimodal text annotation large model to perform text annotation on the representative frame.

[0216] In some embodiments, the filtering unit 430 uses a pre-trained cross-modal text image matching model to determine the correlation between the representative frame and the corresponding text annotation, and filters the text annotation that does not meet the correlation requirement according to the correlation between the representative frame and the corresponding text annotation, including:

[0217] For any video, input each representative frame in the video and the text annotations corresponding to the representative frames into the pre-trained cross-modal text image matching model to determine the correlation between each representative frame in the video and the corresponding text annotations;

[0218] According to the relevance between each representative frame in the video and the corresponding text annotation, a second number of representative frames and corresponding text annotations with top relevance rankings are retained, and the remaining text annotations are deleted.

[0219] In some embodiments, the training unit 450 trains the cross-modal video retrieval model according to the video-text description information pairs corresponding to each video in the training set, including:

[0220] For any video-text description information pair in the training set, use the pre-trained cross-modal similarity evaluation model to determine the similarity score between the video and the text description information in the video-text description information pair;

[0221] Determining a training weight of the video-text description information pair according to the similarity score; wherein the training weight of the video-text description information pair is positively correlated with the similarity score;

[0222] The cross-modal video retrieval model is trained based on the video-text description information pairs corresponding to each video and the training weights of the video-text description information pairs corresponding to each video.

[0223] In some embodiments, the cross-modal video retrieval model includes a text encoder, a video encoder, and a sequence Transformer module;

[0224] The training unit 450 trains the cross-modal video retrieval model according to the video-text description information pairs corresponding to each video in the training set, including:

[0225] For any video-text description information pair in any batch of training data, respectively use the text encoder to perform text feature extraction on the text description information in the video-text description information pair to obtain a text feature representation corresponding to the text description information, and use the video encoder to perform video feature extraction on the downsampled video corresponding to the video in the video-text description information pair, and use the sequence Transformer module to process the video feature extraction result to obtain a video feature representation;

[0226] Determining a first type of loss based on a first similarity between a video feature representation of the video in the video-text description information pair and a text feature representation of the text description information in the video-text description information pair, and a second similarity between the video feature representation and the text feature representation of the text description information in other video-text description information pairs in the same batch of training data; and

[0227] Determine a second type of loss based on a first similarity between a video feature representation of the video in the video-text description information pair and a text feature representation of the text description information in the video-text description information pair, and a third similarity between the text feature representation and video feature representations of videos in other video-text description information pairs in the same batch of training data;

[0228] The training loss of the batch of training data is determined according to the first type of loss and the second type of loss corresponding to each video-text description information pair in the batch of training data.

[0229] In some embodiments, the similarity between the video feature representation of the video and the text feature representation of the text description information is determined by:

[0230] For any video frame in the video, searching for a word whose feature is most similar to that of the video frame based on the feature of the video frame, and determining the fourth similarity between the word and the video frame as the similarity corresponding to the video frame; and

[0231] For any word in the text description information, searching for a video frame whose feature is most similar to the feature of the word according to the feature of the word, and determining the fifth similarity between the video frame and the word as the similarity corresponding to the word;

[0232] The similarity between the video feature representation of the video and the text feature representation of the text description information is determined based on the fourth similarity corresponding to each video frame in the video and the fifth similarity corresponding to each word in the text description information.

[0233] The embodiment of the present application further provides an unsupervised cross-modal video retrieval device assisted by a multi-modal large model, and the unsupervised cross-modal video retrieval device assisted by a multi-modal large model may include:

[0234] An acquisition unit, used for acquiring target text information for video retrieval;

[0235] A feature extraction unit, used to extract text features of the target text information using a trained cross-modal video retrieval model to obtain text feature information of the target text information;

[0236] Exemplarily, the trained cross-modal video retrieval model can be trained using the method described in the above method embodiment;

[0237] The search unit is used to determine a target video matching the target text information based on the text feature information of the target text information and the video features of the candidate video; wherein the video features of the candidate video are obtained by extracting the video features of the candidate video using the trained cross-modal video retrieval model.

[0238] An embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory is used to store computer programs; the processor is used to implement the unsupervised cross-modal video retrieval method assisted by a multimodal large model described above when executing the program stored in the memory.

[0239] See also Figure 5 , is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. The electronic device may include a processor 501 and a memory 502 storing machine executable instructions. The processor 501 and the memory 502 may communicate via a system bus 503. In addition, by reading and executing the machine executable instructions corresponding to the unsupervised cross-modal video retrieval logic assisted by the multimodal large model in the memory 502, the processor 501 may execute the unsupervised cross-modal video retrieval method assisted by the multimodal large model described above.

[0240] The memory 502 mentioned herein may be any electronic, magnetic, optical or other physical storage device that may contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium may be: RAM (RadomAccess Memory, random access memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as optical disk, DVD, etc.), or similar storage medium, or a combination thereof.

[0241] In some embodiments, a machine-readable storage medium is also provided. Figure 5The memory 502 in the machine-readable storage medium stores machine executable instructions, and when the machine executable instructions are executed by the processor, the unsupervised cross-modal video retrieval method assisted by the multimodal large model described above is implemented. For example, the machine-readable storage medium can be a ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.

[0242] An embodiment of the present application also provides a computer program product, which stores a computer program, and when a processor executes the computer program, it prompts the processor to execute the multimodal large model-assisted unsupervised cross-modal video retrieval method described above.

Claims

1. A multimodal large model-assisted unsupervised cross-modal video retrieval method, characterized in that: include: For any video in the training set, a representative video frame sampling method based on difference evaluation is used to sample the video frames to obtain a representative frame of the video; Based on the representative frames of the video, the corresponding text annotations are generated using a pre-trained multimodal text annotation model; Using the pre-trained cross-modal text-image matching model, the correlation between the representative frame and the corresponding text annotation is determined, and based on the correlation between the representative frame and the corresponding text annotation, the text annotation that does not meet the correlation requirement is filtered out; Determine the text description information of the video based on the filtered text annotations to obtain a video-text description information pair; The cross-modal video retrieval model is trained according to the video-text description information pairs corresponding to each video in the training set to obtain a trained cross-modal video retrieval model; wherein the trained cross-modal video retrieval model is used to perform cross-modal video retrieval tasks.

2. The method according to claim 1, characterized in that The method of sampling video frames of the video by using a representative video frame sampling method based on difference evaluation includes: Extract visual features of each video frame in the video respectively to obtain visual features of each video frame; According to the visual features of each video frame, a video frame with the largest visual feature amplitude is selected as the first clustering center; Selecting video frames that are farthest from existing cluster centers in sequence as new cluster centers until the number of selected cluster centers reaches a first number; Each cluster center is determined as the representative frame of the video.

3. The method according to claim 1, characterized in that The method of generating corresponding text annotations based on the representative frames of the video using a pre-trained multimodal text annotation model includes: For any representative frame, the representative frame and the prompt word corresponding to the representative frame are input into the pre-trained multimodal text annotation large model to generate corresponding text annotations; wherein the prompt word is used to prompt the pre-trained multimodal text annotation large model to perform text annotation on the representative frame.

4. The method according to claim 1, characterized in that: The method of using the pre-trained cross-modal text image matching model to determine the correlation between the representative frame and the corresponding text annotation, and filtering the text annotation that does not meet the correlation requirement according to the correlation between the representative frame and the corresponding text annotation, includes: For any video, input each representative frame in the video and the text annotations corresponding to the representative frames into the pre-trained cross-modal text image matching model to determine the correlation between each representative frame in the video and the corresponding text annotations; According to the relevance between each representative frame in the video and the corresponding text annotation, a second number of representative frames and corresponding text annotations with top relevance rankings are retained, and the remaining text annotations are deleted.

5. The method according to claim 1, characterized in that The cross-modal video retrieval model is trained based on the video-text description information pairs corresponding to each video in the training set, including: For any video-text description information pair in the training set, use the pre-trained cross-modal similarity evaluation model to determine the similarity score between the video and the text description information in the video-text description information pair; Determining a training weight of the video-text description information pair according to the similarity score; wherein the training weight of the video-text description information pair is positively correlated with the similarity score; The cross-modal video retrieval model is trained based on the video-text description information pairs corresponding to each video and the training weights of the video-text description information pairs corresponding to each video.

6. The method according to claim 1, characterized in that The cross-modal video retrieval model includes a text encoder, a video encoder and a sequence Transformer module; The cross-modal video retrieval model is trained based on the video-text description information pairs corresponding to each video in the training set, including: For any video-text description information pair in any batch of training data, respectively use the text encoder to perform text feature extraction on the text description information in the video-text description information pair to obtain a text feature representation corresponding to the text description information, and use the video encoder to perform video feature extraction on the downsampled video corresponding to the video in the video-text description information pair, and use the sequence Transformer module to process the video feature extraction result to obtain a video feature representation; Determining a first type of loss based on a first similarity between a video feature representation of the video in the video-text description information pair and a text feature representation of the text description information in the video-text description information pair, and a second similarity between the video feature representation and the text feature representation of the text description information in other video-text description information pairs in the same batch of training data; and Determine a second type of loss based on a first similarity between a video feature representation of the video in the video-text description information pair and a text feature representation of the text description information in the video-text description information pair, and a third similarity between the text feature representation and video feature representations of videos in other video-text description information pairs in the same batch of training data; The training loss of the batch of training data is determined according to the first type of loss and the second type of loss corresponding to each video-text description information pair in the batch of training data.

7. The method according to claim 6, characterized in that The similarity between the video feature representation of the video and the text feature representation of the text description information is determined as follows: For any video frame in the video, searching for a word whose feature is most similar to that of the video frame based on the feature of the video frame, and determining the fourth similarity between the word and the video frame as the similarity corresponding to the video frame; and For any word in the text description information, searching for a video frame whose feature is most similar to the feature of the word according to the feature of the word, and determining the fifth similarity between the video frame and the word as the similarity corresponding to the word; The similarity between the video feature representation of the video and the text feature representation of the text description information is determined based on the fourth similarity corresponding to each video frame in the video and the fifth similarity corresponding to each word in the text description information.

8. A multimodal large model-assisted unsupervised cross-modal video retrieval method, characterized in that: include: Obtain target text information for video retrieval; Using a trained cross-modal video retrieval model to extract text features from the target text information, to obtain text feature information of the target text information; wherein the trained cross-modal video retrieval model is trained using the method described in any one of claims 1 to 7; Based on the text feature information of the target text information and the video features of the candidate video, a target video matching the target text information is determined; wherein the video features of the candidate video are obtained by extracting the video features of the candidate video using the trained cross-modal video retrieval model.

9. A multimodal large model-assisted unsupervised cross-modal video retrieval device, characterized in that: include: A sampling unit, for sampling video frames of any video in the training set by using a representative video frame sampling method based on difference evaluation to obtain a representative frame of the video; A generation unit, used to generate corresponding text annotations based on representative frames of the video using a pre-trained multimodal text annotation model; A filtering unit, used to determine the correlation between the representative frame and the corresponding text annotation by using the pre-trained cross-modal text image matching model, and filter the text annotation that does not meet the correlation requirement according to the correlation between the representative frame and the corresponding text annotation; A determination unit, configured to determine text description information of the video based on the filtered text annotations, and obtain a video-text description information pair; A training unit is used to train a cross-modal video retrieval model based on the video-text description information pairs corresponding to each video in a training set to obtain a trained cross-modal video retrieval model; wherein the trained cross-modal video retrieval model is used to perform cross-modal video retrieval tasks.

10. An electronic device, characterized in that: comprising a processor and a memory, wherein: Memory, used to store computer programs; A processor, for implementing the method described in any one of claims 1 to 7 or 8 when executing a program stored in a memory.

11. A computer program product, characterized in that The computer program product stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 or 8 is implemented.

Citation Information

Cited By

  • Teaching video reconstruction method and system based on intelligent agent

    CN119271844A