Retrieval feature extraction method and device, video retrieval system, terminal and medium
By extracting and fusing multi-modal features of video, images, text and audio, it solves the problem of insufficient single-modal information in traditional video retrieval systems, improves the recall rate and accuracy of video retrieval, and achieves a more comprehensive expression of video content. and search results.
Patent Information
- Application Number
- CN202410551703.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-07
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-05-07
AI Technical Summary
Traditional video retrieval systems rely on single modal information, which cannot fully capture the richness of video content, and fail to effectively integrate multi-modal information, resulting in limited recall and precision, and it is difficult for existing feature extraction methods to fully express the semantics of videos. information.
Extract multi-modal features, including video, image, text and audio features. Through global average pooling and regularization processing, different modal features are fused to generate retrieval features, and multi-modal information is used for video retrieval.
It improves the recall rate and accuracy of video retrieval, can more comprehensively express the semantic information of videos, enhances the system's retrieval capabilities, and provides more accurate and comprehensive video retrieval services.
Smart Images

Figure CN118132802B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of artificial intelligence technology and relates to a retrieval feature extraction method and device, a video retrieval system, a terminal and a medium. Background Art
[0002] Traditional video retrieval systems mainly use single visual or auditory modality information for video retrieval. However, due to the diversity of video content, relying solely on single modality information often cannot fully capture the richness of video content, which will lead to limited recall and precision of retrieval results. In addition, traditional methods fail to effectively integrate multimodal information, which ignores the potential complementarity and correlation between different modalities. In addition, existing feature extraction methods may not be able to fully express the semantic information of the video, which will cause the system to perform poorly when processing videos that are semantically similar but have large differences in visual or auditory features. Summary of the invention
[0003] The purpose of the present application is to provide a retrieval feature extraction method and device, a video retrieval system, a terminal and a medium, which are used to improve the recall rate and accuracy in the video retrieval process.
[0004] In a first aspect, the present application provides a retrieval feature extraction method, comprising: obtaining multimodal features from a video sample, the multimodal features including video modal features, image modal features, text modal features and audio modal retrieval features; connecting the multimodal features in a preset order to obtain a multimodal feature matrix; fusing different modal features in the multimodal feature matrix to obtain a fused feature matrix; performing global average pooling and regularization on the fused feature matrix to obtain retrieval features.
[0005] In an implementation of the first aspect, acquiring multimodal features from a video sample includes:
[0006] Performing video frame segmentation, audio separation, and text transcription on the video sample, respectively constructing a frame set consisting of Y video frames, an audio set consisting of Q audio paragraphs, and a text set consisting of M transcribed sentences;
[0007] Extracting video features of the video sample to form a video feature matrix;
[0008] Extracting image features of the frame set to form a frame feature matrix;
[0009] Extracting text features of the text set to form a text feature matrix;
[0010] Extracting speech features of the audio set to form a first audio feature matrix and a second audio feature matrix generated based on the first audio feature matrix;
[0011] The video feature matrix, the frame feature matrix, the text feature matrix and the second audio feature matrix are subjected to global average pooling and regularization processing to obtain the video modality feature, the image modality feature, the text modality feature and the audio modality retrieval feature, respectively.
[0012] In an implementation of the first aspect, extracting video features of the video sample to form a video feature matrix includes:
[0013] N video feature vectors are extracted from the video sample and arranged according to a preset rule to obtain the video feature matrix; wherein N is related to the height, width and number of channels of the resolution of the video sample.
[0014] In an implementation of the first aspect, extracting image features of the frame set to form a frame feature matrix includes:
[0015] Adjusting the number Y of video frames in the frame set to match the number N of video feature vectors;
[0016] N image feature vectors are extracted from the adjusted number of frame sets, and arranged according to a preset rule to obtain the frame feature matrix.
[0017] In an implementation of the first aspect, adjusting the number Y of video frames in the frame set to match the number N of video feature vectors includes:
[0018] Determine whether the number Y of the video frames is greater than the number N of the video feature vectors;
[0019] If yes, discard the last (YN) video frames in the frame set and only keep the first N video frames;
[0020] Otherwise, the last video frame in the frame set is repeatedly spliced (NY) times, so that the number of the video frames reaches N.
[0021] In an implementation of the first aspect, extracting speech features of the audio set to form a first audio feature matrix and a second audio feature matrix generated based on the first audio feature matrix includes:
[0022] Extracting Q audio feature vectors from the audio set and arranging them according to a preset rule to obtain the first audio feature matrix;
[0023] Performing matrix multiplication and normalization on the first audio feature matrix and the video feature matrix in sequence to obtain a correlation matrix;
[0024] Performing matrix multiplication on the correlation matrix and the frame feature matrix to obtain a weight coefficient matrix;
[0025] Perform matrix multiplication on the weight coefficient matrix and the text feature matrix to obtain a text weight matrix;
[0026] Performing matrix multiplication and normalization on the first audio feature matrix and the text weight matrix in sequence to obtain an audio weight matrix;
[0027] Perform matrix multiplication on the audio weight matrix and the first audio feature matrix to obtain the second audio feature matrix.
[0028] In a second aspect, the present application provides a retrieval feature extraction device, comprising: a feature extraction module, used to obtain multimodal features from video samples, wherein the multimodal features include video modal features, image modal features, text modal features and audio modal retrieval features; a feature connection module, used to connect the multimodal features in a preset order to obtain a multimodal feature matrix; a feature fusion module, used to fuse different modal features in the multimodal feature matrix to obtain a fused feature matrix; a feature processing module, used to perform global average pooling and regularization processing on the fused feature matrix to obtain retrieval features.
[0029] In a third aspect, the present application provides a video retrieval system, comprising: a first retrieval feature extraction device, used to perform retrieval feature extraction on a first video sample according to the above-mentioned retrieval feature extraction method, and obtain a first retrieval feature and a first audio modality retrieval feature; a second retrieval feature extraction device, used to perform retrieval feature extraction on a second video sample according to the above-mentioned retrieval feature extraction method, and obtain a second retrieval feature and a second audio modality retrieval feature; a first similarity calculation module, used to perform similarity calculation on the first retrieval feature and the second retrieval feature, and obtain a first similarity value; a second similarity calculation module, used to perform similarity calculation on the first audio modality retrieval feature and the second audio modality retrieval feature, and obtain a second similarity value; an average similarity calculation module, used to average the first similarity value and the second similarity value, and obtain an average similarity value for evaluating the content similarity between the first video sample and the second video sample.
[0030] In a fourth aspect, the present application provides a retrieval feature extraction terminal, characterized in that it includes: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory, so that the terminal executes any one of the retrieval feature extraction methods described above.
[0031] In a fifth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the retrieval feature extraction methods described above.
[0032] As described above, the retrieval feature extraction method and device, video retrieval system, terminal and medium described in the present application have the following beneficial effects: being able to extract a rich set of multimodal features to more accurately express the semantic information of the video; utilizing the fusion mechanism of multimodal information such as video, audio, image and text for video retrieval, being able to effectively combine information of multiple modalities together to more comprehensively characterize the video content; being able to better utilize the complementarity and correlation between different modalities to enhance the retrieval capability of the system; being able to not only improve the efficiency of video retrieval, but also improve the quality of retrieval results, thereby providing users with more accurate and comprehensive video retrieval services. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 Shown is a schematic structural diagram of a mobile terminal described in the present application in one embodiment.
[0034] Figure 2 Shown is a flow chart of an embodiment of the retrieval feature extraction method described in this application.
[0035] Figure 3 Shown is a flow chart of another embodiment of the retrieval feature extraction method described in this application.
[0036] Figure 4 Shown is a schematic diagram of the structure of the retrieval feature extraction device described in this application in one embodiment.
[0037] Figure 5 Shown is a schematic diagram of the structure of a video retrieval system described in this application in one embodiment.
[0038] Figure 6 Shown is a schematic structural diagram of another embodiment of the video retrieval system described in this application.
[0039] Figure 7 Shown is a schematic diagram of the structure of a retrieval feature extraction terminal in one embodiment of the present application.
[0040] Component number description.
[0041] 10 Feature Extraction Module
[0042] 20 Feature Connection Module
[0043] 30 Feature Fusion Module
[0044] 40 Feature Processing Module
[0045] 100 first search feature extraction device
[0046] 200 Second search feature extraction device
[0047] 300 First similarity calculation module
[0048] 400 Second similarity calculation module
[0049] 500 Average similarity calculation module DETAILED DESCRIPTION
[0050] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0051] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0052] In addition, in this application, descriptions such as "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0053] The following embodiments of the present application provide a retrieval feature extraction method and device, a video retrieval system, a terminal and a medium for realizing accurate recall of similar videos. The corresponding application scenarios include but are not limited to an intelligent video recommendation system of an online video platform.
[0054] Specifically, online video platforms have a massive video content library, and users often need the platform to provide accurate and relevant recommendations when searching and browsing videos. In order to improve the user experience, the platform needs an efficient video retrieval system that can quickly and accurately recommend relevant videos based on the user's query and preferences.
[0055] See also Figure 1As shown, the retrieval feature extraction method provided in the embodiment of the present application can be run in a mobile terminal, a computer terminal, or similar devices. Taking running on the mobile terminal as an example, Figure 1 The hardware structure block diagram of the mobile terminal of the retrieval feature extraction method is as follows: Figure 1 Taking the mobile terminal as an example, the mobile terminal may include: a processor and a memory, wherein the processor may be a central processing unit, and the memory is used to store data. Figure 1 The mobile terminal in the figure is only used as an example and does not limit the specific structure of the mobile terminal.
[0056] Optionally, the mobile terminal may further include: a communication transmission device and an input and output device.
[0057] Optionally, the memory may be used to store computer programs, such as software programs and modules of application software, and the memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0058] Optionally, the communication transmission device can be used to receive or send data via a network, which may include a wireless network provided by a communication provider of the mobile terminal. The communication transmission device may include a NIC (Network Interface Controller) that can be connected to other network devices through a base station so as to communicate with the Internet.
[0059] The technical solutions in the embodiments of the present application will be described in detail below in conjunction with the drawings in the embodiments of the present application.
[0060] See also Figure 2 , which is a flowchart of the retrieval feature extraction method described in the present application in one embodiment.
[0061] like Figure 2 As shown, this embodiment provides a retrieval feature extraction method, including the following steps S100 to S400.
[0062] In step S100, multimodal features are obtained from a video sample, where the multimodal features include video modality features, image modality features, text modality features, and audio modality retrieval features.
[0063] In step S200, the multimodal features are connected in a preset order to obtain a multimodal feature matrix.
[0064] In step S300, different modal features in the multimodal feature matrix are fused to obtain a fused feature matrix.
[0065] In step S400, global average pooling and regularization are performed on the fused feature matrix to obtain retrieval features.
[0066] See also Figure 3 , which is a flow chart of another embodiment of the retrieval feature extraction method described in the present application.
[0067] like Figure 3 As shown, the step S100 of acquiring multimodal features from video samples includes the following steps S110 to S160.
[0068] In step S110, the video sample is subjected to video frame segmentation, audio separation and text transcription to construct a frame set consisting of Y video frames, an audio set consisting of Q audio paragraphs and a text set consisting of M transcribed sentences.
[0069] Specifically, the number Y of the video frames, the number Q of the audio segments, and the number M of the transcribed sentences are all real numbers.
[0070] In one embodiment of the present application, the video sample is segmented into video frames, separated into audio and transcribed into text, and a frame set consisting of Y video frames, an audio set consisting of Q audio paragraphs, and a text set consisting of M transcribed sentences are constructed respectively, including:
[0071] (1) Segment the video sample into equally spaced video frames to form a frame set including Y video frames.
[0072] Specifically, the video sample can be deframed at an interval of one frame per second. For example, the first frame is extracted from the first second of the video, and then the next frame is extracted every second until Y video frames are extracted. The Y video frames are sequentially assembled into a frame set and recorded as ,in Represents the video frame corresponding to the i-th second.
[0073] (2) Separate the audio in the video sample to form an audio set containing Q audio segments.
[0074] Specifically, audio processing libraries in video processing software or programming languages, such as FFmpeg and OpenCV, can be used to separate audio from video samples. In the process of separating audio, the audio track in the video sample is selected and exported as an independent audio file. For example, if there are Q independent audio segments in the video sample, and each audio segment corresponds to an independent audio file, the Q audio files can be combined into an audio set and recorded as ,in Represents the jth audio segment.
[0075] (3) Performing text recognition on each video frame in the frame set to obtain a first transcribed text; performing speech recognition on each audio segment in the audio set to obtain a second transcribed text; and merging the first transcribed text and the second transcribed text to form a text set containing M sentences.
[0076] In an embodiment of the present application, the first transcribed text can be obtained using a pre-trained PaddleOCR model. PaddleOCR is a text recognition tool based on deep learning that can achieve high-precision text detection and text recognition in different scenarios.
[0077] Specifically, the video frames in the frame set are input into the PaddleOCR model to identify the position of the text box and the corresponding text content. Furthermore, the text box can be post-processed as needed, such as removing duplicate boxes, merging adjacent boxes, etc. The processed text box and the corresponding text content are output or saved to complete the recognition of all the text in the frame set.
[0078] In an embodiment of the present application, a pre-trained Conformer model can be used to obtain the second transcribed text. Conformer is a speech recognition model that combines the advantages of Transformer and Convolutional Neural Network (CNN), and can capture the features of audio signals at different levels, thereby improving the accuracy of speech recognition.
[0079] When merging the first transcribed text and the second transcribed text, the present application can merge the two text sets into a text set containing M sentences through a simple string concatenation operation.
[0080] It should be noted that the present application is not limited to specific text recognition technology and speech recognition technology. In other words, other text recognition tools and speech recognition tools are also fully applicable to the present application.
[0081] In step S120, video features of the video sample are extracted to form a video feature matrix.
[0082] In one embodiment of the present application, extracting the video features of the video sample to form a video feature matrix includes: extracting N video feature vectors from the video sample and arranging them according to preset rules to obtain the video feature matrix; wherein N is related to the height, width and number of channels of the resolution of the video sample.
[0083] In an embodiment of the present application, the video feature matrix can be obtained using a pre-trained Conv3D model. The Conv3D model is a deep learning model for processing videos, time series or other three-dimensional data. The model extracts video feature vectors by learning spatial features and temporal features in the video.
[0084] Specifically, the shape of the video feature matrix is (N, 512), where N can represent the product of the video resolution height and width and the number of channels, that is, N = height (H) × width (W) × number of channels (C), and 512 represents the length of the video feature vector, that is, each video feature vector contains 512 elements.
[0085] It should be noted that the structure and parameters of the Conv3D model can be adjusted according to specific application requirements to ensure that the model can adapt to different application scenarios.
[0086] In step S130, image features of the frame set are extracted to form a frame feature matrix.
[0087] In one embodiment of the present application, extracting image features of the frame set to form a frame feature matrix includes: adjusting the number Y of video frames in the frame set to match the number N of video feature vectors; extracting N image feature vectors from the adjusted frame set, and arranging them according to preset rules to obtain the frame feature matrix.
[0088] Specifically, adjusting the number Y of video frames in the frame set to match the number N of video feature vectors includes: determining whether the number Y of video frames is greater than the number N of video feature vectors; if so, discarding the last (YN) video frames in the frame set and retaining only the first N video frames; otherwise, repeatedly splicing the last video frame in the frame set (NY) times so that the number of video frames reaches N.
[0089] In an embodiment of the present application, a pre-trained ViT model can be used to obtain the frame feature matrix. The ViT (Vision Transformer) model is a CV network based on the Transformer structure. The model uses the advantages of the Transformer model in processing contextual semantic information to convert the image into a "variant word vector" and then process it. The significance of this conversion is that multiple patches have spatial connections, which is similar to a "spatial semantics", thereby achieving a better processing effect.
[0090] Specifically, the shape of the frame feature matrix is (N, 512), where N can represent the product of the video resolution height and width and the number of channels, that is, N = height (H) × width (W) × number of channels (C), and 512 represents the length of the image feature vector, that is, each image feature vector contains 512 elements.
[0091] In step S140, the text features of the text set are extracted to form a text feature matrix.
[0092] In one embodiment of the present application, extracting text features of the text set to form a text feature matrix includes: extracting M text feature vectors from the text set and arranging them according to a preset rule to obtain the text feature matrix.
[0093] In an embodiment of the present application, the text feature matrix can be obtained using a pre-trained Transformer decoder model. Transformer decoder is a neural network model based on the self-attention mechanism, which consists of multiple identical decoder layers, each of which contains a self-attention mechanism and a feedforward neural network. The self-attention mechanism can weight the input transcribed sentences so that the model can better understand the contextual information. The feedforward neural network is used to perform further nonlinear transformations on the output of the self-attention mechanism.
[0094] Specifically, the shape of the text feature matrix is (M, 512), where M is the number of transcribed sentences, and 512 represents the length of the text feature vector, that is, each text feature vector contains 512 elements.
[0095] In step S150, speech features of the audio set are extracted to form a first audio feature matrix and a second audio feature matrix generated based on the first audio feature matrix.
[0096] In one embodiment of the present application, extracting speech features of the audio set to form a first audio feature matrix and a second audio feature matrix generated based on the first audio feature matrix includes the following steps S151 to S156.
[0097] In step S151, Q audio feature vectors are extracted from the audio set and arranged according to a preset rule to obtain the first audio feature matrix.
[0098] In the embodiment of the present application, the first audio feature matrix can be obtained using a pre-trained wav2vec model. The wav2vec model is a general speech feature extractor whose main function is to convert the input audio into a high-quality speech feature representation. The wav2vec model has a powerful ability to automatically learn and extract meaningful features from audio without the need for manual design and selection of features. This feature greatly improves the efficiency and accuracy of feature extraction.
[0099] Specifically, the shape of the first audio feature matrix is (Q, 512), where Q represents the number of audio segments in the audio set, and 512 represents the length of the audio feature vector, that is, each audio feature vector contains 512 elements.
[0100] In step S152, matrix multiplication and normalization are performed on the first audio feature matrix and the video feature matrix in sequence to obtain a correlation matrix.
[0101] In the embodiment of the present application, the rule of matrix multiplication is to multiply the row elements of the first audio feature matrix by the column elements of the transposed video feature matrix, and add the results to obtain the value of the corresponding position in the first audio feature matrix. Normalization refers to performing a softmax operation on the result of matrix multiplication to convert the original numerical value into a probability distribution so that the sum of all values is 1.
[0102] Specifically, the shape of the first audio feature matrix is (Q, 512), the shape of the video feature matrix is (N, 512), and the shape of the transposed video feature matrix is (512, N). After matrix multiplication and softmax operation, a correlation matrix with a shape of (Q, N) is obtained. Any element in the correlation matrix Represents the correlation between the i-th audio feature vector in the audio feature matrix and the j-th video feature vector in the video feature matrix.
[0103] In step S153, matrix multiplication is performed on the correlation matrix and the frame feature matrix to obtain a weight coefficient matrix.
[0104] In the embodiment of the present application, the rule of matrix multiplication is to multiply the row elements of the correlation matrix with the column elements of the frame feature matrix, and add the results to obtain the value of the corresponding position in the correlation matrix.
[0105] Specifically, the shape of the correlation matrix is (Q, N), and the shape of the frame feature matrix is (N, 512). After matrix multiplication, a weight coefficient matrix with a shape of (Q, 512) is obtained.
[0106] In step S154, matrix multiplication is performed on the weight coefficient matrix and the text feature matrix to obtain a text weight matrix.
[0107] In the embodiment of the present application, the rule of matrix multiplication is to multiply the row elements of the weight coefficient matrix with the column elements of the transposed text feature matrix, and add the results to obtain the value of the corresponding position in the weight coefficient matrix.
[0108] Specifically, the shape of the weight coefficient matrix is (Q, 512), the shape of the text feature matrix is (M, 512), and the shape of the transposed text feature matrix is (512, M). After matrix multiplication, a text weight matrix with a shape of (Q, M) is obtained.
[0109] In this implementation, the text weight matrix represents the result of weighting the text feature matrix using the weight coefficient matrix.
[0110] In step S155, matrix multiplication and normalization are performed on the first audio feature matrix and the text weight matrix in sequence to obtain an audio weight matrix.
[0111] In step S156, matrix multiplication is performed on the audio weight matrix and the first audio feature matrix to obtain the second audio feature matrix.
[0112] In this implementation, the second audio feature matrix represents the result of weighting the first audio feature matrix by using the audio weight matrix.
[0113] In step S160, global average pooling and regularization are performed on the video feature matrix, the frame feature matrix, the text feature matrix and the second audio feature matrix to obtain the video modality feature, the image modality feature, the text modality feature and the audio modality retrieval feature, respectively.
[0114] In the embodiment of the present application, global average pooling involves performing arithmetic averaging on the eigenvalues in each dimension of different feature matrices to generate a global eigenvector. This process can effectively reduce the dimension of the feature space while retaining key spatial information; it can significantly reduce the number of model parameters, reduce computational complexity, and improve the generalization ability of the model.
[0115] In the regularization step, the global feature vector is normalized by the L2 norm, that is, each element of the global feature vector is divided by the L2 norm of the vector to ensure that the modulus of the resulting vector is 1. Normalization helps to eliminate feature differences caused by inconsistent feature scales, thereby helping to prevent overfitting and improve the generalization ability of the model.
[0116] It should be noted that the main difference between the video modality features of the present application and the image modality features is that the former contains timing information. This is because in the process of obtaining the video modality features, the video frames are usually not segmented, but the entire video sequence is processed as a whole. As a result, the video modality features can capture dynamic information that changes over time in the video, such as the movement of objects, changes in scenes, etc. This feature is very important for understanding the content of the video, especially in scenarios where it is necessary to analyze the order of events in the video or the continuity of actions.
[0117] In this implementation, a rich set of multimodal features can be extracted to more accurately express the semantic information of the video.
[0118] In one embodiment of the present application, the step S200 of connecting the multimodal features in a preset order to obtain a multimodal feature matrix includes concatenating the audio modality retrieval feature, the video modality feature, the image modality feature and the text modality feature to obtain the multimodal feature matrix.
[0119] It should be noted that the present application does not limit the concatenation order of each modality retrieval feature. For example, the concatenation order can be audio, video, image and text, or any other reasonable order set according to actual needs, which will not be listed in detail here.
[0120] In one embodiment of the present application, the step S300 of fusing the different modal features in the multimodal feature matrix to obtain a fused feature matrix includes using a pre-trained Transformer Encoder to fuse the different modal features in the multimodal feature matrix to output a fused feature matrix.
[0121] In the fusion process, the feature vectors of each modality are integrated into a unified representation while retaining the information and structure of the original features. This fusion method helps capture the correlation and complementarity between different modalities, thereby improving the model's ability to process multimodal data.
[0122] In this implementation, the fusion mechanism of multi-modal information such as video, audio, image and text is used for video retrieval, which can effectively combine information of multiple modes, so as to more comprehensively represent the video content. It can better utilize the complementarity and correlation between different modes, so as to enhance the retrieval ability of the system. It can not only improve the efficiency of video retrieval, but also improve the quality of retrieval results, so as to provide users with more accurate and comprehensive video retrieval services.
[0123] In one embodiment of the present application, the step S400 of performing global average pooling and regularization on the fused feature matrix to obtain the retrieval feature includes: performing a global average pooling operation on the fused feature matrix, that is, calculating the arithmetic mean of the eigenvalues on each dimension in the fused feature matrix to generate a global feature vector of a fixed length; performing regularization on the global feature vector, specifically, performing L2 norm normalization, that is, dividing each element in the global feature vector by the L2 norm of the vector to ensure that the modulus length of the resulting vector is 1.
[0124] After the above processing, the retrieval feature obtained is the second modality fusion retrieval feature in the technical solution of this application.
[0125] In this implementation, the retrieval features integrate information from different modalities, reduce the feature dimension and retain key spatial information through global average pooling, while regularization helps to eliminate the difference in feature scales and improve the generalization ability of the model.
[0126] It should be noted that the principle description of global average pooling and regularization has been described in detail in the above step S160 and will not be repeated here.
[0127] The protection scope of the retrieval feature extraction method described in the embodiment of the present application is not limited to the execution order of the steps listed in the present embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present application are included in the protection scope of the present application.
[0128] like Figure 4 As shown, this embodiment provides a retrieval feature extraction device, including a feature extraction module 10, a feature connection module 20, a feature fusion module 30 and a feature processing module 40.
[0129] The feature extraction module 10 is used to obtain multimodal features from video samples, and the multimodal features include video modality features, image modality features, text modality features and audio modality retrieval features.
[0130] The feature connection module 20 is used to connect the multimodal features in a preset order to obtain a multimodal feature matrix.
[0131] The feature fusion module 30 is used to fuse the different modal features in the multimodal feature matrix to obtain a fused feature matrix.
[0132] The feature processing module 40 is used to perform global average pooling and regularization processing on the fused feature matrix to obtain retrieval features.
[0133] It should be noted that the structures and principles of the feature extraction module 10, the feature connection module 20, the feature fusion module 30 and the feature processing module 40 correspond one-to-one to the steps in the above-mentioned retrieval feature extraction method, so they are not repeated here.
[0134] The retrieval feature extraction device provided in the embodiment of the present application can implement the retrieval feature extraction method described in the present application, but the implementation device of the retrieval feature extraction method described in the present application includes but is not limited to the structure of the retrieval feature extraction device listed in the present embodiment. All structural deformations and replacements of the prior art made according to the principles of the present application are included in the protection scope of the present application.
[0135] See also Figure 5 , which is a schematic diagram of the structure of the video retrieval system described in the present application in one embodiment.
[0136] like Figure 5 As shown, this embodiment provides a video retrieval system, including a first retrieval feature extraction device 100, a second retrieval feature extraction device 200, a first similarity calculation module 300, a second similarity calculation module 400 and an average similarity calculation module 500.
[0137] The first retrieval feature extraction device 100 is used to extract retrieval features from the first video sample to obtain a first retrieval feature and a first audio modality retrieval feature.
[0138] The second retrieval feature extraction device 200 is used to extract retrieval features from the second video sample to obtain second retrieval features and second audio modality retrieval features.
[0139] The first similarity calculation module 300 is used to calculate the similarity between the first search feature and the second search feature to obtain a first similarity value.
[0140] The second similarity calculation module 400 is used to calculate the similarity between the first audio modality retrieval feature and the second audio modality retrieval feature to obtain a second similarity value.
[0141] The average similarity calculation module 500 is used to average the first similarity value and the second similarity value to obtain an average similarity value for evaluating the content similarity between the first video sample and the second video sample.
[0142] See also Figure 6 , which is a schematic diagram of the structure of the video retrieval system described in the present application in another embodiment.
[0143] In the embodiment of the present application, the cosine similarity between the first search feature and the second search feature may be calculated. Similarly, the cosine similarity between the first audio modality search feature and the second audio modality search feature may also be calculated.
[0144] The average similarity value will be used as the final similarity value. The smaller the average similarity value is, the more similar the first video sample and the second video sample are in video content; conversely, the greater the difference between the first video sample and the second video sample in video content.
[0145] The entire video retrieval system is designed to measure the similarity between the query video and the videos stored in the database, and return a list of the most similar video results to the user. This design allows the system to comprehensively consider the video information, audio information, text information, and image information in the video, thereby providing more accurate search results.
[0146] like Figure 7 As shown, this embodiment provides a retrieval feature extraction terminal, including: a memory 61 and a processor 62.
[0147] The memory 61 is used to store computer programs.
[0148] The processor 62 is used to execute the computer program stored in the memory 61, so that the terminal executes any one of the above-mentioned retrieval feature extraction methods.
[0149] In the several embodiments provided in the present application, it should be understood that the disclosed system, device or method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules / units is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules or units, which can be electrical, mechanical or other forms.
[0150] The modules / units described as separate components may or may not be physically separated, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in the various embodiments of the present application may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0151] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0152] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by the processor, the retrieval feature extraction method described in any of the above items is implemented. A person of ordinary skill in the art can understand that all or part of the steps in the method for implementing the above embodiment can be completed by instructing the processor through a program, and the program can be stored in a computer-readable storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state hard disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.
[0153] The embodiment of the present application may also provide a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer or data center to another website, computer or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0154] When the computer program product is executed by a computer, the computer executes the method described in the above method embodiment. The computer program product may be a software installation package, and when the above method is required, the computer program product may be downloaded and executed on a computer.
[0155] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0156] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A retrieval feature extraction method, characterized in that: include: Acquiring multimodal features from the video sample, wherein the multimodal features include video modality features, image modality features, text modality features, and audio modality retrieval features; Connecting the multimodal features in a preset order to obtain a multimodal feature matrix; Fusing different modal features in the multimodal feature matrix to obtain a fused feature matrix; Performing global average pooling and regularization processing on the fused feature matrix to obtain retrieval features; Obtaining multimodal features from video samples includes: Performing video frame segmentation, audio separation, and text transcription on the video sample to construct a frame set consisting of Y video frames, an audio set consisting of Q audio paragraphs, and a text set consisting of M transcribed sentences; Extracting video features of the video sample to form a video feature matrix; Extracting image features of the frame set to form a frame feature matrix; Extracting text features of the text set to form a text feature matrix; Extracting speech features of the audio set to form a first audio feature matrix and a second audio feature matrix generated based on the first audio feature matrix; Performing global average pooling and regularization processing on the video feature matrix, the frame feature matrix, the text feature matrix, and the second audio feature matrix to obtain the video modality feature, the image modality feature, the text modality feature, and the audio modality retrieval feature, respectively; Extracting speech features of the audio set to form a first audio feature matrix and a second audio feature matrix generated based on the first audio feature matrix includes: Extracting Q audio feature vectors from the audio set and arranging them according to a preset rule to obtain the first audio feature matrix; performing matrix multiplication and normalization on the first audio feature matrix and the video feature matrix in sequence to obtain a correlation matrix; Performing matrix multiplication on the correlation matrix and the frame feature matrix to obtain a weight coefficient matrix; Perform matrix multiplication on the weight coefficient matrix and the character feature matrix to obtain a character weight matrix; performing matrix multiplication and normalization on the first audio feature matrix and the text weight matrix in sequence to obtain an audio weight matrix; Perform matrix multiplication on the audio weight matrix and the first audio feature matrix to obtain the second audio feature matrix.
2. The method according to claim 1, characterized in that Extracting the video features of the video sample to form a video feature matrix includes: N video feature vectors are extracted from the video sample and arranged according to a preset rule to obtain the video feature matrix; wherein N is related to the height, width and number of channels of the resolution of the video sample.
3. The method according to claim 2, characterized in that Extracting image features of the frame set to form a frame feature matrix includes: Adjusting the number Y of video frames in the frame set to match the number N of video feature vectors; N image feature vectors are extracted from the adjusted frame set and arranged according to a preset rule to obtain the frame feature matrix.
4. The method according to claim 3, characterized in that Adjusting the number Y of video frames in the frame set to match the number N of video feature vectors includes: Determine whether the number Y of the video frames is greater than the number N of the video feature vectors; If yes, discard the last (YN) video frames in the frame set and only keep the first N video frames; Otherwise, the last video frame in the frame set is repeatedly spliced (NY) times, so that the number of the video frames reaches N.
5. A retrieval feature extraction device, characterized in that: include: A feature extraction module, configured to obtain multimodal features from video samples, wherein the multimodal features include video modality features, image modality features, text modality features, and audio modality retrieval features; A feature connection module, configured to connect the multimodal features in a preset order to obtain a multimodal feature matrix; A feature fusion module, configured to fuse the different modal features in the multimodal feature matrix to obtain a fused feature matrix; A feature processing module, configured to perform global average pooling and regularization processing on the fused feature matrix to obtain retrieval features; Obtaining multimodal features from video samples includes: Performing video frame segmentation, audio separation, and text transcription on the video sample to construct a frame set consisting of Y video frames, an audio set consisting of Q audio paragraphs, and a text set consisting of M transcribed sentences; Extracting video features of the video sample to form a video feature matrix; Extracting image features of the frame set to form a frame feature matrix; Extracting text features of the text set to form a text feature matrix; Extracting speech features of the audio set to form a first audio feature matrix and a second audio feature matrix generated based on the first audio feature matrix; Performing global average pooling and regularization processing on the video feature matrix, the frame feature matrix, the text feature matrix, and the second audio feature matrix to obtain the video modality feature, the image modality feature, the text modality feature, and the audio modality retrieval feature, respectively; Extracting speech features of the audio set to form a first audio feature matrix and a second audio feature matrix generated based on the first audio feature matrix includes: Extracting Q audio feature vectors from the audio set and arranging them according to a preset rule to obtain the first audio feature matrix; performing matrix multiplication and normalization on the first audio feature matrix and the video feature matrix in sequence to obtain a correlation matrix; Performing matrix multiplication on the correlation matrix and the frame feature matrix to obtain a weight coefficient matrix; Perform matrix multiplication on the weight coefficient matrix and the character feature matrix to obtain a character weight matrix; performing matrix multiplication and normalization on the first audio feature matrix and the text weight matrix in sequence to obtain an audio weight matrix; Perform matrix multiplication on the audio weight matrix and the first audio feature matrix to obtain the second audio feature matrix.
6. A video retrieval system, characterized in that: include: A first retrieval feature extraction device, configured to extract retrieval features from the first video sample according to the method according to any one of claims 1 to 4, to obtain a first retrieval feature and a first audio modality retrieval feature; A second retrieval feature extraction device, configured to perform retrieval feature extraction on the second video sample according to the method according to any one of claims 1 to 4, to obtain a second retrieval feature and a second audio modality retrieval feature; a first similarity calculation module, configured to calculate a similarity between the first search feature and the second search feature to obtain a first similarity value; a second similarity calculation module, configured to calculate a similarity between the first audio modality retrieval feature and the second audio modality retrieval feature to obtain a second similarity value; The average similarity calculation module is configured to average the first similarity value and the second similarity value to obtain an average similarity value for evaluating the content similarity between the first video sample and the second video sample.
7. A retrieval feature extraction terminal, characterized in that: include: processor and memory; The memory is used to store computer programs; The processor is configured to execute the computer program stored in the memory, so that the terminal executes the search feature extraction method according to any one of claims 1 to 4.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the search feature extraction method according to any one of claims 1 to 4 is implemented.
