Visual media file retrieval method, device, electronic device and storage medium
By separating the image front background and splicing feature vectors, and using multi-classifiers for classification, the interference problem between foreground elements and background elements in image classification is solved, the classification accuracy and retrieval accuracy are improved, and the recognition process is accelerated through parallel calculations.
Patent Information
- Application Number
- CN202210256115.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-15
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2042-03-15
AI Technical Summary
The prior art is difficult to effectively reduce the interference between foreground elements and background elements in image classification, resulting in low classification accuracy and retrieval accuracy.
By separating the images and videos in the visual media file library for the front background, extracting and splicing feature vector data respectively, and classifying the spliced vector data using a multi-classifier to reduce interference from the front background elements.
It effectively improves the accuracy of image classification and retrieval accuracy, and at the same time, the recognition process of multi-classifiers is accelerated through distributed parallel computing, and the retrieval efficiency is improved.
Smart Images

Figure CN114611614B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to data processing technology, and more specifically, to a method, device, electronic device and storage medium for retrieving visual media files. Background Art
[0002] Visual media file retrieval refers to finding files in the known image and video multimedia file library that have similar elements to the image to be retrieved through image comparison. The essence of this technology is image classification. Many traditional image classification algorithms use global similarity as the classification criterion, but this cannot meet some practical situations. Sometimes when users search for images, their purpose is to find other images that contain a certain element in the original image, rather than to find images that are globally similar to the image. In this case, images of the same category refer to those that have similar elements. The element is usually in the foreground of the image, but its location is uncertain. In addition to the similar elements, other parts of the image are often quite different.
[0003] The target elements in the original image that users are concerned about often only occupy a local area of the image, and other elements in the non-target area of the image will interfere with the classification algorithm to a certain extent. Figure 1 Take the two images in the middle as an example. Both images are classified as "having smiling elements". However, from the perspective of the whole image, the two images are not similar. The background of the left image has the sun, clouds, and mountains, while the background of the right image has the moon, clouds, and trees. Due to the interference of these factors, traditional algorithms may not be able to correctly classify them.
[0004] To address this problem, many algorithms assign different weights to different pixels in the image when calculating similarity, but they still use the entire image as input for matching, so they still cannot avoid interference from non-target areas. Summary of the invention
[0005] The technical problem to be solved by the present application is to provide a method and device for retrieving visual media files that can reduce the mutual interference between foreground elements and background elements in an image, as well as an electronic device and storage medium for implementing the method, in view of the above-mentioned defects of the prior art.
[0006] In order to solve the technical problem, the present application proposes a method for retrieving a visual media file in the first aspect, the method comprising:
[0007] S1. Separating the foreground and background of images and videos in an existing visualization media file library, extracting feature vectors respectively and then splicing them, and using the spliced vector data set to train multiple classifiers, wherein the visualization media file library has pre-set category labels for each element;
[0008] S2. Separate the foreground and background of the image to be retrieved, extract feature vectors from them respectively and then splice them together, use the multi-classifier trained in step S1 to classify the spliced vector data, determine the category of the image to be retrieved, and return all images and videos in the visual media file library that correspond to the category.
[0009] According to an embodiment of the first aspect of the present application, the step S1 further comprises:
[0010] S11, performing foreground and background separation on the images and videos in the visualization media file library to obtain a media file foreground library and a media file background library;
[0011] S12, extracting a plurality of key frame images from each foreground video in the media file foreground library, performing dimensionality reduction processing on a set consisting of all foreground images in the media file foreground library and key frame images of all foreground videos to obtain a first dimensionality reduction factor matrix set, and vectorizing the tensors after the dimensionality reduction processing to obtain a foreground vector data set;
[0012] S13, extracting a plurality of key frame images for each background video in the media file background library, performing the same dimensionality reduction process as step S12 on a set of all background images in the media file background library and key frame images of all background videos to obtain a second dimensionality reduction factor matrix set, and vectorizing the tensor after the dimensionality reduction process to obtain a background vector data set;
[0013] S14, sequentially splicing the vectors in the foreground vector dataset and the background vector dataset to obtain a spliced vector dataset;
[0014] S15. Use the concatenated vector dataset to train multiple classifiers.
[0015] According to an embodiment of the first aspect of the present application, step S2 further includes:
[0016] S21, performing foreground and background separation on the image to be retrieved to obtain a foreground image and a background image;
[0017] S22, using the first dimension reduction factor matrix set obtained in step S12 to perform dimension reduction processing on the foreground image of the image to be retrieved, and vectorizing the tensor after the dimension reduction processing to obtain a foreground vector;
[0018] S23, using the second dimension reduction factor matrix set obtained in step S13 to perform dimension reduction processing on the background image of the image to be retrieved, and vectorizing the tensor after the dimension reduction processing to obtain a background vector;
[0019] S24, splicing the foreground vector and the background vector to obtain a spliced vector;
[0020] S25. Classify the spliced vector using the multi-classifier trained in step S15, and return all images and videos corresponding to the category of the spliced vector.
[0021] According to an embodiment of the first aspect of the present application, the MPCA algorithm is used to perform dimensionality reduction processing in step S12 and step S13.
[0022] According to an embodiment of the first aspect of the present application, the method uses an RPCA algorithm to perform foreground and background separation.
[0023] According to one embodiment of the first aspect of the present application, the method uses the spliced vector data set to train a one-versus-one multi-classifier to obtain multiple binary classifiers in step S15, and uses the multiple binary classifiers trained in step S15 to classify the spliced vector in step S25.
[0024] According to an embodiment of the first aspect of the present application, the step S25 further includes: distributing the classification calculation tasks of the multiple binary classifiers to multiple computing nodes to calculate the classification results in a distributed parallel computing manner.
[0025] In order to solve the technical problem, the present application proposes a visual media file retrieval device in a second aspect, comprising:
[0026] A training module is used to separate the foreground and background of images and videos in an existing visualization media file library, extract feature vectors respectively and then splice them, and use the spliced vector data set to train multiple classifiers, wherein the visualization media file library has pre-set category labels for each element;
[0027] The search module is used to separate the foreground and background of the image to be retrieved, extract feature vectors respectively and then splice them, classify the spliced vector data using the multi-classifier trained by the training module, determine the category of the image to be retrieved, and return all images and videos corresponding to the category in the visual media file library.
[0028] To solve the technical problem, the present application proposes an electronic device in a third aspect, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the aforementioned visual media file retrieval method is executed.
[0029] In order to solve the technical problem, the present application proposes a computer-readable storage medium in a fourth aspect, which stores a computer program. When the computer program is executed by a processor, the aforementioned visual media file retrieval method is implemented.
[0030] The visual media file retrieval method and device implemented in the present application, as well as the electronic device and storage medium implementing the method, have the following beneficial effects: the visual media file retrieval method and device according to the embodiment of the present application separates the foreground and background, processes them into two segments of vector data respectively, and then splices them together, and then classifies the spliced vector data, thereby reducing the interference between the foreground and background elements, thereby effectively improving the accuracy of classification, thereby improving the accuracy of retrieval. At the same time, the visual media file retrieval method and device according to the further embodiment of the present application uses multi-node distributed parallel computing when calculating the classification, thereby reducing the time for multiple classifiers to identify the category of the image to be retrieved, and further improving the retrieval efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The present application will be further described below with reference to the accompanying drawings and embodiments, in which:
[0032] Figure 1 It is a schematic diagram of the traditional algorithm for image classification;
[0033] Figure 2 It is a schematic diagram of the principle of image classification of this application;
[0034] Figure 3 is a flow chart of a method for retrieving a visual media file according to an embodiment of the present application;
[0035] Figure 4 yes Figure 3 A flowchart of a further specific embodiment of step S1;
[0036] Figure 5 yes Figure 3 A flowchart of a further specific embodiment of step S2;
[0037] Figure 6 is a logic block diagram of a visual media file retrieval device according to an embodiment of the present application;
[0038] Figure 7 It is a logic block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. In addition, the embodiments in the present application and the features in the embodiments may be combined with each other in the absence of conflict.
[0040] This application proposes a method for retrieval of visual media files, using a preprocessing step of foreground-background separation. Figure 1 In the two figures shown in FIG. 1 , the present application separates the foreground smiling face element and the background image, such as Figure 2 As shown, the two segments are processed separately and then spliced together, and then the spliced vector data is classified, thereby reducing the mutual interference between the foreground elements and the background elements in the image, which can effectively improve the accuracy of classification and thus improve the accuracy of the retrieval results.
[0041] To facilitate understanding of the following description, this application first gives the following explanation:
[0042] 1) It is assumed that all images and videos processed by this application have a uniform resolution.
[0043] 2) The symbol Image is used to represent an image. For a grayscale image, its essence is a two-dimensional matrix; for a color RGB image, its essence is a three-order tensor.
[0044] 3) The symbol Video is used to represent video. For grayscale video, its essence is a third-order tensor; for color video, its essence is a fourth-order tensor.
[0045] 4) The symbol D is used to represent the order of the tensor. For grayscale images, its order is D=2; for color images, its order is D=3; each frame of a grayscale video is a grayscale image (D=2); each frame of a color video is a color image (D=3).
[0046] 5) Foreground and background separation of image Image refers to generating a foreground image Image_F and a background image Image_B from image Image, wherein the resolutions of Image_F and Image_B are consistent with the original Image, Image_F mainly contains the foreground part of image Image, and Image_B mainly contains the background part of image Image.
[0047] 6) Foreground and background separation of video Video refers to generating a foreground video Video_F and a background video Video_B from video Video, wherein the resolutions of Video_F and Video_B are consistent with the original Video, Video_F mainly contains the foreground part of video Video, and Video_B mainly contains the background part of video Video.
[0048] 7) RPCA (Robust principal component analysis) is an existing method for foreground and background separation of image and video data. For a tensor X, the RPCA algorithm decomposes it into X = B + S + Ns, where B is a low-rank tensor, S is a sparse tensor, and Ns is the noise part. If X describes an image / video, then B is the background part and S is the foreground part. For an introduction to RPCA, please refer to the following literature:
[0049] Goldfarb D,Qin Z. "Robust Low-Rank Tensor Recovery: Models andAlgorithms," in SIAM Journal on Matrix Analysis and Applications, 2014, 35(1): 225-253.
[0050] 8) MPCA (Multilinear principal component analysis) is an existing method for dimensionality reduction of tensor data. D A D-order tensor {X1,X2,…X m}, the MPCA algorithm will calculate D factor matrices {U1,U2,…U D}, whose sizes are R1×I1, R2×I2, …R D ×I D , and finally through Y i =X i ×1U1×2U2…× D U D Get the reduced dimensional tensor {Y1,Y2,…Y m}(The dimensions are R1×R2×…×R D ). Among them, × k Represents the modal product of a tensor and a matrix. For an introduction to MPCA, refer to the following literature:
[0051] H.Lu,KNPlataniotis and ANVenetsanopoulos,"MPCA:MultilinearPrincipal Component Analysis of Tensor Objects,"in IEEE Transactions onNeural Networks,2008,19(1):18-39.
[0052] 9) One-vs-one SVMs for multi-classification algorithm: Suppose there are N categories C1, C2, …C N , for any two categories C i and C j Train to obtain the binary SVM classifier SVMBinaryClassifier i,j , then a total of N(N-1) / 2 binary SVM classifiers can be obtained. When determining the category of a new sample, all the binary SVM classifiers obtained through the above training are used to determine its category, and the category that receives the most votes is taken as the final category of the sample.
[0053] Figure 3 A flowchart of a visual media file retrieval method 100 according to an embodiment of the present application is shown. The visual media file retrieval method 100 is based on a visual media file library MediaLib = {Image1, Image2, ..., Image n ,Video1,Video2,…,Video m} and the category labels of each element (a total of N categories) have been pre-set as a prerequisite, including the following steps:
[0054] Step S1, separate the foreground and background of images and videos in the existing visualization media file library, extract feature vectors respectively and then splice them, and use the spliced vector data set to train multiple classifiers.
[0055] Step S2, separate the foreground and background of the image to be retrieved, extract feature vectors respectively and then splice them, use the multi-classifier trained in step S1 to classify the spliced vector data, determine the category of the image to be retrieved, and return all images and videos corresponding to the category in the visual media file library.
[0056] According to further specific embodiments of the present application, see Figure 4 As shown, the above step S1 further includes:
[0057] In step S101, a suitable algorithm (such as RPCA) is used to separate the foreground and background of the images and videos in the visualization media file library MediaLib, thereby obtaining a media file foreground library MediaLib_F = {Image_F1, Image_F2, ..., Image_F n ,Video_F1,Video_F2,…,Video_F m} and media file background library MediaLib_B = {Image_B1, Image_B2, ..., Image_B n ,Video_B1,Video_B2,…,Video_B m}, and then process them separately.
[0058] Then in step S102, for each foreground video Video_F in the media file foreground library MediaLib_F obtained in step S101, k (k=1,2,…,m) extract all t(k) key frames and get {Video_F_Frame k,1 ,Video_F_Frame k,2 ,…,Video_F_Frame k,t(k)}, where each frame Video_F_Frame k,i All are images.
[0059] In step S103, all foreground images and key frame images of all foreground videos in the media file foreground library MediaLib_F are combined into a set {Image_F1, Image_F2, ..., Image_F n ,Video_F_Frame 1,1 ,Video_F_Frame 1,2 ,…,Video_F_Frame 1,t(1) ,…,Video_F_Frame m,1 ,Video_F_Frame m,2 ,…,Video_F_Frame m,t(m)}.
[0060] In step S104, the MPCA algorithm is used to perform dimensionality reduction processing on the above set to obtain a first dimensionality reduction factor matrix set U_F1, U_F2, ..., U_F D .
[0061] In step S105, the tensor after the dimension reduction process is vectorized to obtain a foreground vector data set Vectors_F = {Image_F_Vec1, Image_F_Vec2, ..., Image_F_Vec n ,Video_F_Frame_Vec 1,1 ,Video_F_Frame_Vec 1,2 ,…,Video_F_Frame_Vec 1,t(1) , …, Video_F_Frame_Vec m,1,Video_F_Frame_Vec m,2 ,…,Video_F_Frame_Vec m,t(m)}.
[0062] At the same time, the method performs the same processing as the above steps S102-S105 on the media file background library MediaLib_B obtained in step S101, specifically as follows:
[0063] In step S106, for each background video Video_B in the media file background library MediaLib_B obtained in step S101 k (k=1,2,…,m) extract all t(k) key frames and get {Video_B_Frame k,1 ,Video_B_Frame k,2 ,…,Video_B_Frame k,t(k)}, where each frame Video_B_Frame k,i All are images.
[0064] In step S107, all background images and key frame images of all background videos in the media file background library MediaLib_B are combined into a set {Image_B1, Image_B2, ..., Image_B n ,Video_B_Frame 1,1 ,Video_B_Frame 1,2 ,…,Video_B_Frame 1,t(1) ,…,Video_B_Frame m,1 ,Video_B_Frame m,2 ,…,Video_B_Frame m,t(m)}.
[0065] In step S108, the MPCA algorithm is used to perform dimensionality reduction processing on the above set to obtain a second dimensionality reduction factor matrix set U_B1, U_B2, ..., U_B D .
[0066] In step S109, the tensor after the dimensionality reduction process is vectorized to obtain a background vector data set Vectors_B = {Image_B_Vec1, Image_B_Vec2, ..., Image_B_Vec n ,Video_B_Frame_Vec 1,1 ,Video_B_Frame_Vec 1,2 ,…,Video_B_Frame_Vec 1,t(1), …, Video_B_Frame_Vec m,1 ,Video_B_Frame_Vec m,2 ,…,Video_B_Frame_Vec m,t(m)}.
[0067] Then, in step S110, the vectors in the foreground vector dataset Vectors_F and the background vector dataset Vectors_B are sequentially concatenated to obtain a concatenated vector dataset, i.e., Vectors = {Image_Vec1, Image_Vec2, ..., Image_Vec n ,Video_Frame_Vec 1,1 ,Video_Frame_Vec 1,2 ,…,Video_Frame_Vec 1,t(1) ,…,Video_Frame_Vec m,1 ,Video_Frame_Vec m,2 ,…,Video_Frame_Vec m,t(m)}, where Image_Vec i Image_F_Vec i and Image_B_Vec i spliced together (i=1,2,…n); Video_Frame_Vec k,j Video_F_Frame_Vec k,j and Video_B_Frame_Vec k,j Stitched together.
[0068] Finally, in step S111, the concatenated vector dataset Vectors is used to train the one-versus-one multi-classifier of the multi-classification SVM algorithm to obtain N(N-1) / 2 binary classifiers {SVMBinaryClassifier i,j |1≤i≤N,1≤j <i}。
[0069] According to further specific embodiments of the present application, see Figure 5 As shown, step S2 of the aforementioned method 100 further includes:
[0070] In step S201, a suitable algorithm (such as RPCA) is used to separate the foreground and background of the image to be retrieved ImgX, so as to obtain a foreground image ImgX_F and a background image ImgX_B, which are then processed separately.
[0071] In step S202, a first dimension reduction factor matrix set U_F1, U_F2, ..., U_FD Perform dimensionality reduction on the foreground image ImgX_F, i.e., Y_F = ImgX_F × 1U_F1 × 2U_F2…× D U_F D .
[0072] In step S203, vectorize the tensor after dimensionality reduction to obtain the foreground vector ImgX_F_Vec.
[0073] In step S204, use the second set of dimensionality reduction factor matrices U_B1, U_B2,…, U_B D Perform dimensionality reduction on the background image ImgX_B, i.e., Y_B = ImgX_B × 1U_B1 × 2U_B2…× D U_B D .
[0074] In step S205, vectorize the tensor after dimensionality reduction to obtain the background vector ImgX_B_Vec.
[0075] In step S206, concatenate the foreground vector ImgX_F_Vec and the background vector ImgX_B_Vec to obtain the concatenated vector ImgX_Vec.
[0076] In step S207, use the multi-classifier {SVMBinaryClassifier i,j |1 ≤ i ≤ N, 1 ≤ j < i} trained in the aforementioned step S111 to classify the concatenated vector ImgX_Vec. In a specific embodiment, since it is necessary to calculate the classification results of N(N - 1) / 2 binary classifiers SVMBinaryClassifier i,j for ImgX_Vec, and different classifiers are independent of each other, in an environment with multiple computing nodes, the classification calculation tasks of multiple binary classifiers can be distributed to multiple computing nodes to calculate the classification results in a distributed parallel computing manner, thereby shortening the classification time and improving the retrieval efficiency.
[0077] Finally, in step S208, return all the images and videos corresponding to the class attribution of the concatenated vector ImgX_Vec.
[0078] When classifying images, the retrieval method 100 of the visual media file according to the above embodiments of the present application uses the one-versus-one multi-classifier of the multi-class SVM algorithm, but the present application is not limited thereto. In different embodiments of the present application, other classification algorithms such as neural networks and decision trees can be implemented.
[0079] Based on the above-mentioned visual media file retrieval method of the present application, the present application also proposes a visual media file retrieval device. Figure 6 FIG. 2 shows a logical structure diagram of a visual media file retrieval device 200 according to an embodiment of the present application. Figure 6 As shown, the retrieval device for the visual media file includes a training module 21 and a search module 22. The training module 21 is used to separate the foreground and background of the images and videos in the aforementioned existing visual media file library, extract feature vectors respectively and then splice them, and use the spliced vector data set to train multiple classifiers. Among them, the visual media file library has pre-set the category label of each element. The search module 22 is used to separate the foreground and background of the image to be retrieved, extract feature vectors respectively and then splice them, use the multiple classifiers trained by the training module 21 to classify the spliced vector data, determine the category of the image to be retrieved, and return all images and videos in the visual media file library that correspond to the category. For the specific implementation of the training module 21 and the search module 22, please refer to the specific description of steps S1 and S2 of the aforementioned visual media file retrieval method 100, which will not be repeated here.
[0080] Based on the above-mentioned visual media file retrieval method of the present application, the present application also proposes an electronic device 300. Figure 7 As shown, the electronic device 300 includes a processor 31 and a memory 32, and the processor 31 and the memory 32 are in communication connection. The memory 32 stores a computer program, and when the computer program is executed by the processor 31, the processor 31 implements the visual media file retrieval method of the aforementioned embodiment of the present application.
[0081] The present application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the visual media file retrieval method of the aforementioned embodiment of the present application.
[0082] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for retrieving a visual media file, characterized in that: The method comprises: S1. Separating the foreground and background of images and videos in an existing visualization media file library, extracting feature vectors respectively and then splicing them, and using the spliced vector data set to train multiple classifiers, wherein the visualization media file library has pre-set category labels for each element; S2, separating the foreground and background of the image to be retrieved, extracting feature vectors respectively and then splicing them, classifying the spliced vector data using the multi-classifier trained in step S1, determining the category of the image to be retrieved, and returning all images and videos corresponding to the category in the visual media file library; Wherein, the step S1 further comprises: S11, performing foreground and background separation on the images and videos in the visualization media file library to obtain a media file foreground library and a media file background library; S12, extracting a plurality of key frame images from each foreground video in the media file foreground library, performing dimensionality reduction processing on a set consisting of all foreground images in the media file foreground library and key frame images of all foreground videos to obtain a first dimensionality reduction factor matrix set, and vectorizing the tensors after the dimensionality reduction processing to obtain a foreground vector data set; S13, extracting a plurality of key frame images for each background video in the media file background library, performing the same dimensionality reduction process as step S12 on a set of all background images in the media file background library and key frame images of all background videos to obtain a second dimensionality reduction factor matrix set, and vectorizing the tensor after the dimensionality reduction process to obtain a background vector data set; S14, sequentially splicing the vectors in the foreground vector dataset and the background vector dataset to obtain a spliced vector dataset; S15, using the concatenated vector data set to train multiple classifiers; The step S2 further comprises: S21, performing foreground and background separation on the image to be retrieved to obtain a foreground image and a background image; S22, using the first dimension reduction factor matrix set obtained in step S12 to perform dimension reduction processing on the foreground image of the image to be retrieved, and vectorizing the tensor after the dimension reduction processing to obtain a foreground vector; S23, using the second dimension reduction factor matrix set obtained in step S13 to perform dimension reduction processing on the background image of the image to be retrieved, and vectorizing the tensor after the dimension reduction processing to obtain a background vector; S24, splicing the foreground vector and the background vector to obtain a spliced vector; S25 , using the multi-classifier trained in step S15 to classify the spliced vector, and returning all images and videos corresponding to the category attribution of the spliced vector.
2. The visual media file retrieval method according to claim 1, characterized in that: In step S12 and step S13, the MPCA algorithm is used to perform dimensionality reduction processing.
3. The visual media file retrieval method according to claim 1, characterized in that: The method adopts RPCA algorithm to perform foreground and background separation.
4. The visual media file retrieval method according to claim 1, characterized in that: In step S15, the method uses the concatenated vector data set to train a one-versus-one multi-classifier to obtain multiple binary classifiers, and in step S25, uses the multiple binary classifiers trained in step S15 to classify the concatenated vectors.
5. The method for retrieving visual media files according to claim 4, characterized in that: The step S25 further includes: distributing the classification calculation tasks of the multiple binary classifiers to multiple computing nodes to calculate the classification results in a distributed parallel computing manner.
6. A visual media file retrieval device, characterized in that: include: A training module is used to separate the foreground and background of images and videos in an existing visualization media file library, extract feature vectors respectively and then splice them, and use the spliced vector data set to train multiple classifiers, wherein the visualization media file library has pre-set category labels for each element; A search module is used to separate the foreground and background of the image to be retrieved, extract feature vectors respectively and then splice them, classify the spliced vector data using the multi-classifier trained by the training module, determine the category of the image to be retrieved, and return all images and videos corresponding to the category in the visual media file library; Wherein, the training module is further used for: Perform foreground and background separation on the images and videos in the visualization media file library to obtain a media file foreground library and a media file background library; Extract multiple key frame images from each foreground video in the media file foreground library, perform dimensionality reduction processing on a set consisting of all foreground images in the media file foreground library and key frame images of all foreground videos to obtain a first dimensionality reduction factor matrix set, and vectorize the tensor after dimensionality reduction processing to obtain a foreground vector data set; Extract multiple key frame images from each background video in the media file background library, perform the same dimensionality reduction processing on the set consisting of all background images and key frame images of all background videos in the media file background library as the set consisting of all foreground images and key frame images of all foreground videos, obtain a second dimensionality reduction factor matrix set, and vectorize the tensor after the dimensionality reduction processing to obtain a background vector data set; Sequentially concatenate the vectors in the foreground vector dataset and the background vector dataset to obtain a concatenated vector dataset; Use the concatenated vector dataset to train multiple classifiers; The search module is further used for: Separate the foreground and background of the image to be retrieved to obtain the foreground image and the background image; Using the first dimension reduction factor matrix set obtained by the training module to perform dimension reduction processing on the foreground image of the image to be retrieved, and vectorizing the tensor after the dimension reduction processing to obtain a foreground vector; The second dimension reduction factor matrix set obtained by the training module is used to perform dimension reduction processing on the background image of the image to be retrieved, and the tensor after the dimension reduction processing is vectorized to obtain a background vector; Splicing the foreground vector and the background vector to obtain a spliced vector; The multi-classifier trained by the training module is used to classify the spliced vector, and all images and videos corresponding to the category attribution of the spliced vector are returned.
7. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method for retrieving a visual media file according to any one of claims 1 to 5 is executed.
8. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the method for retrieving a visual media file according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Vehicle image segmentation method in complex traffic scene based on joint angular point pooling
CN110246141A
A method for detecting a mineral separation effect based on foreground and background separation and association
CN112733853A