Training processing method of video search model and video search processing method and device
By using the preset semantic recognition model to generate video description labels and features, combined with searching text features, and automatically adjusting the video search model parameters, the problems of high cost and low accuracy in the prior art are solved, and the training efficiency and accuracy of the video search model are improved.
Patent Information
- Application Number
- CN202411485964.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-03-14
AI Technical Summary
The training data of existing video retrieval models requires manual annotation, resulting in high labor costs, errors in labeling, omissions or inconsistent interpretation, which affects the effectiveness and accuracy of the model.
By acquiring multiple sample videos, generating video description tags using preset semantic recognition models, extracting video features and description text features, generating video fusion features, and storing them in the video feature library. Then, based on the search text features and video feature library, the target video is determined, and the matching degree is calculated, and the model parameters are adjusted to obtain the trained video search model.
It improves the acquisition efficiency and reliability of training sample data, improves the training efficiency and model accuracy of video retrieval models, and reduces the dependence and error risks of manual labeling.
Smart Images

Figure CN119622025A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer application technology, and in particular to a video search model training processing method, a video search processing method and a device. Background Art
[0002] In the current digital media field, users often need to find specific video clips, such as a plot clip in a movie, a video clip of an explanation in an educational video, or an important video clip in a news report, etc. However, considering the huge amount of video content, it is usually difficult for users to directly and quickly find the required video clips.
[0003] In the related art, a video retrieval model is constructed, and the video retrieval model matches the search text proposed by the user with the video clip, thereby realizing video retrieval. These matching processes rely heavily on their training data. At present, training a video retrieval model usually requires a large amount of training data such as video clips annotated with descriptive text, and the video retrieval model "learns" the association between the video clip and the descriptive text.
[0004] However, the training data of the above video retrieval model needs to be manually annotated, for example, the correspondence between the descriptive texts of each video clip needs to be manually annotated, which has a high labor cost. In addition, errors, omissions or inconsistent interpretations may occur during the manual annotation process, which will affect the reliability of the training data, thereby reducing the effectiveness of the video retrieval model and resulting in a low accuracy rate of the retrieval model. Summary of the invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a video search model training processing method, a video search processing method and a device.
[0006] The disclosed embodiment provides a training and processing method for a video search model, comprising the following steps: obtaining a plurality of sample videos, inputting each of the sample videos into a preset semantic recognition model to obtain a sample video description label corresponding to each of the sample videos; extracting video features of each of the sample videos, and determining sample description text features of each of the sample video description labels; generating video fusion features based on the video features and the corresponding sample description text features, and storing the video fusion features in a preset video feature library; obtaining sample retrieval text, extracting sample retrieval text features of the sample retrieval text according to a preset initial video retrieval model, and determining a target sample video corresponding to the sample retrieval text features through the preset initial video retrieval model according to the sample retrieval text features and the preset video feature library; calculating the degree of match between the target sample video and the sample retrieval text, and adjusting the model parameters of the initial video retrieval model according to the degree of match to obtain a trained video retrieval model.
[0007] Optionally, adjusting the model parameters of the initial video retrieval model according to the matching degree to obtain the trained video retrieval model includes: determining whether the matching degree is greater than a preset matching degree threshold; when it is not greater than the preset matching degree threshold, adjusting the model parameters of the initial video retrieval model until the adjusted matching degree is less than or equal to the preset matching degree threshold, thereby obtaining the trained video retrieval model.
[0008] Optionally, the obtaining of multiple sample videos includes: obtaining a video to be retrieved; dividing the video to be retrieved according to a preset number of split frames to obtain multiple video segments, and determining the multiple video segments as the multiple sample videos.
[0009] Optionally, determining a target sample video corresponding to the sample retrieval text feature according to the sample retrieval text feature and the preset video feature library through the preset initial video retrieval model includes: determining the first feature similarity between the sample retrieval text feature and each video fusion feature in the preset video feature library according to the preset initial video retrieval model; and determining the sample video corresponding to the highest first feature similarity as the target sample video.
[0010] The disclosed embodiment also provides a video search processing method, comprising the following steps: in response to obtaining a video retrieval instruction carrying a video retrieval text, inputting the video retrieval text into a pre-trained video search model; determining a target video matching the video retrieval text through the video search model according to a preset video feature library, wherein the video search model is obtained according to the aforementioned video search model training processing method.
[0011] Optionally, determining a target video matching the video retrieval text through the video search model according to a preset video feature library includes: extracting retrieval text features corresponding to the video retrieval text through the video search model; determining a second feature similarity between the retrieval text features and each video fusion feature stored in the preset video feature library through the video search model, and determining a video corresponding to the highest second feature similarity as the target video.
[0012] The disclosed embodiment also provides a training and processing device for a video search model, comprising: a first acquisition module, used to acquire multiple sample videos, and input each of the sample videos into a preset semantic recognition model to acquire a sample video description label corresponding to each of the sample videos; a first determination module, used to extract the video features of each of the sample videos, and determine the sample description text features of each of the sample video description labels; a generation module, used to generate a video fusion feature based on the video features and the corresponding sample description text features; a storage module, used to store the video fusion feature in a preset video feature library; a second acquisition module, used to acquire a sample retrieval text; a second determination module, used to extract the sample retrieval text features of the sample retrieval text according to a preset initial video retrieval model, and determine the target sample video corresponding to the sample retrieval text features through the preset initial video retrieval model according to the sample retrieval text features and the preset video feature library; a training processing module, used to calculate the matching degree between the target sample video and the sample retrieval text, and adjust the model parameters of the initial video retrieval model according to the matching degree to obtain a trained video retrieval model.
[0013] The disclosed embodiment also provides a video search processing device, which includes: an output module, used to respond to obtaining a video retrieval instruction carrying a video retrieval text, and input the video retrieval text into a pre-trained video search model; a third determination module, used to determine a target video matching the video retrieval text according to a preset video feature library through the video search model, wherein the video search model is obtained according to the aforementioned video search model training processing method.
[0014] An embodiment of the present disclosure also provides an electronic device, which includes: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement a training processing method for a video search model or a video search processing method as provided in an embodiment of the present disclosure.
[0015] The embodiments of the present disclosure also provide a computer-readable storage medium, which stores a computer program, and the computer program is used to execute the video search model training processing method or the video search processing method provided by the embodiments of the present disclosure.
[0016] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0017] Acquire multiple sample videos, input each sample video into a preset semantic recognition model to obtain a sample video description label corresponding to each sample video, extract the video features of each sample video, and determine the sample description text features of each sample video description label, and then generate video fusion features according to the video features and the corresponding sample description text features, store the video fusion features in a preset video feature library, acquire sample retrieval text, extract sample retrieval text features of the sample retrieval text according to a preset initial video retrieval model, determine the target sample video corresponding to the sample retrieval text features according to the sample retrieval text features and the preset video feature library through the preset initial video retrieval model, calculate the matching degree of the target sample video and the sample retrieval text, and adjust the model parameters of the initial video retrieval model according to the matching degree to obtain the trained video retrieval model. In this technical solution, on the basis of ensuring the reliability of the training sample data set, the acquisition efficiency of the training sample data set is improved, thereby improving the training efficiency and model accuracy of the video retrieval model.
[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0020] Figure 1 A flowchart of a video search processing method provided by an embodiment of the present disclosure;
[0021] Figure 2 A flowchart of another video search processing method provided by an embodiment of the present disclosure;
[0022] Figure 3 A schematic diagram of the structure of a video search processing device provided by an embodiment of the present disclosure;
[0023] Figure 4A schematic diagram of the structure of another video search processing device provided by an embodiment of the present disclosure;
[0024] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0026] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0027] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0028] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0029] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0030] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0031] In order to solve the above problems, the embodiments of the present disclosure provide a training method for a video search model, which is introduced below in conjunction with specific embodiments.
[0032] Figure 1The present invention provides a flow chart of a video search model training process provided by an embodiment of the present invention. The method can be performed by a video search model training process device, wherein the device can be implemented by software and / or hardware and can generally be integrated in an electronic device. Figure 1 As shown, the method includes:
[0033] Step 101, obtain multiple sample videos, and input each sample video into a preset semantic recognition model to obtain a sample video description label corresponding to each sample video.
[0034] In one embodiment of the present disclosure, a video to be retrieved may be obtained, the video to be retrieved may be segmented according to a preset split frame number to obtain a plurality of video segments, and the plurality of video segments may be determined to be a plurality of sample videos, wherein the preset split frame number may be calibrated according to scene requirements;
[0035] In one embodiment of the present disclosure, a video to be retrieved may be obtained, semantic recognition may be performed on each frame of the video to be retrieved, multiple continuous video frames for speech recognition may be divided into a video segment, and each divided video segment may be used as a sample video.
[0036] In one embodiment of the present disclosure, a video obtained from a preset platform may be directly used as a sample video. For example, if the preset platform provides a short video, the short video may be directly used as a sample video.
[0037] After obtaining a plurality of sample videos, each sample video is input into a preset semantic recognition model to obtain a sample video description label corresponding to each sample video.
[0038] In one embodiment of the present disclosure, instead of relying on manual labeling of each sample video, each sample video is input into a preset semantic recognition model to obtain a sample video description tag corresponding to each video, wherein the preset semantic recognition model can identify the semantic information of each video to generate corresponding description information, and generate a sample video description tag based on the description information. For example, the description information can be directly used as a video description tag. For another example, keywords in the description information can be extracted, and corresponding video description tags can be generated based on the keywords.
[0039] It can be understood that in the embodiment of the present disclosure, based on the preset semantic recognition model that has been trained, the sample video description label corresponding to each sample video is obtained, so that the sample video description labels of multiple sample videos can be obtained in a short time, and because the training sample data of the training sample data set have a high degree of consistency and accuracy (because they are all obtained by the same preset semantic recognition model), the training effect can be guaranteed. In this way, there is no need to rely on a large amount of manpower to manually annotate sample videos, which saves costs and obtains a sufficient amount of training sample data. At the same time, since all training sample data are generated by the preset semantic recognition model, errors and deviations that may occur in the manual annotation process are avoided. In this way, the efficiency and accuracy of video retrieval can be further improved to meet the needs of users for video retrieval in real life.
[0040] The preset semantic recognition model may include a preset natural language generation model and / or a preset video image description model. In some possible examples, each sample video may be input into the preset natural language generation model to obtain text description information corresponding to each sample video, that is, to identify the semantic information of each video, etc. The semantic recognition object includes video lines, etc.; and / or,
[0041] Each sample video is input into a preset video image description model to obtain video description information corresponding to each sample video. That is, in this example, the video frame content is mainly identified, and then the text description information is determined, and / or the video description information is a sample video description label corresponding to each video.
[0042] Step 102: extract video features of each sample video, and determine sample description text features of each sample video description tag.
[0043] Among them, video features may include at least multiple types of picture features, audio features, subtitle features, video evaluation features, etc. In this embodiment, the video features of each sample video are extracted. For example, a convolutional neural network for obtaining each type of video features can be pre-trained, and each sample video is input into the convolutional neural network corresponding to each type of video features to obtain the corresponding video features.
[0044] In an embodiment of the present disclosure, sample description text features of each sample video description label are also extracted. Similarly, in this embodiment, a convolutional neural network for obtaining text features can also be pre-trained, and each sample video description label is input into the corresponding convolutional neural network to obtain the corresponding sample description text features.
[0045] Step 103: Generate video fusion features according to the video features and the corresponding sample description text features, and store the video fusion features in a preset video feature library.
[0046] In one embodiment of the present disclosure, a video fusion feature is generated according to video features and corresponding sample description text features, and the video fusion feature is stored in a preset video feature library, that is, the video fusion feature of each sample video is stored in the preset video feature library.
[0047] Among them, in different application scenarios, the methods of generating video fusion features according to video features and corresponding sample description text features are different, as shown in the following examples:
[0048] In some possible embodiments, video features and corresponding sample description text features are directly concatenated to generate video fusion features.
[0049] In some possible embodiments, weights are pre-set for video features or corresponding sample description text features, a first product value of the video features and the corresponding weights, a second product value of the sample description text features and the corresponding weights are calculated, and the sum of the first product value and the second product value is calculated to obtain video fusion features.
[0050] Step 104, obtain the sample retrieval text, extract the sample retrieval text features of the sample retrieval text according to the preset initial video retrieval model, and determine the target sample video corresponding to the sample retrieval text features according to the sample retrieval text features and the preset video feature library through the preset initial video retrieval model.
[0051] In one embodiment of the present disclosure, a sample retrieval text is obtained, sample retrieval text features of the sample retrieval text are extracted according to a preset initial video retrieval model, and a target sample video corresponding to the sample retrieval text features is determined according to the sample retrieval text features and a preset video feature library through the preset initial video retrieval model.
[0052] Among them, the first feature similarity between the sample retrieval text feature and each video fusion feature in the preset video feature library is determined according to the preset initial video retrieval model, and the sample video corresponding to the highest first feature similarity is determined as the target sample video.
[0053] Step 105, calculating the matching degree between the target sample video and the sample retrieval text, and adjusting the model parameters of the initial video retrieval model according to the matching degree to obtain a trained video retrieval model.
[0054] After determining the target sample video, the matching degree between the target sample video and the sample retrieval text is calculated. The method of calculating the matching degree is different in different application scenarios. In some possible embodiments, the sample video features of the target sample video and the sample text features of the sample retrieval text can be extracted, and the cosine distance between the sample video features and the sample retrieval text features can be calculated, and the cosine distance is determined as the matching degree.
[0055] In some possible embodiments, standard sample videos that match the sample retrieval text may also be pre-marked. After obtaining the target sample video, the video matching degree between the target sample video and the standard sample video is directly calculated, and the video matching degree is determined as the matching degree between the target sample video and the sample retrieval text.
[0056] After obtaining the matching degree between the target sample video and the sample retrieval text, the model parameters of the initial video retrieval model are adjusted according to the matching degree to obtain a trained video retrieval model.
[0057] In this embodiment, it is determined whether the matching degree is greater than a preset matching degree threshold. When it is not greater than the preset matching degree threshold, the model parameters of the initial video retrieval model are adjusted until the adjusted matching degree is less than or equal to the preset matching degree threshold, and the trained video retrieval model is obtained.
[0058] In some possible embodiments, a video retrieval model can also be trained in combination with multiple sample retrieval texts. In this embodiment, multiple sample video retrieval texts are obtained, and each sample video retrieval text is input into a pre-constructed initial video retrieval model. The first matching degree between each sample video retrieval text and each video fusion feature is calculated by the initial video retrieval model, and the sample video that successfully matches each sample video retrieval text is determined and output through the first matching degree. For example, the relevant sample videos can be sorted in descending order according to the first matching degree, and the sample video that is in the first place or the first preset number of samples is determined as the target sample video that has successfully matched.
[0059] Furthermore, in order to determine the accuracy of the initial video retrieval model, the second matching degree of each sample video retrieval text and the corresponding sample video is calculated, and the model parameters of the initial video retrieval model are updated according to the second matching degree to obtain a trained video retrieval model.
[0060] It should be noted that in different application scenarios, the methods for updating the model parameters of the initial video retrieval model according to the second matching degree are different, and examples are as follows:
[0061] In some possible embodiments, if there is only one sample video that successfully matches a sample retrieval text, it is determined whether the second matching degree of each sample video retrieval text is greater than a first preset matching degree threshold; if it is not greater than the first preset matching degree threshold, the model parameters of the initial video retrieval model are adjusted until the multiple second matching degrees corresponding to the multiple sample video retrieval texts are all less than or equal to the first preset matching degree threshold.
[0062] In this embodiment, if there are multiple sample videos that successfully match a sample retrieval text, the third matching degree of each sample retrieval text and its corresponding multiple sample video clips is calculated, and the multiple third matching degrees corresponding to each sample retrieval text are averaged to obtain the matching degree mean, and it is determined whether the matching degree mean is greater than the third preset matching degree threshold. If it is not greater than the third preset matching degree threshold, the model parameters of the initial video retrieval model are adjusted until the multiple matching degree means corresponding to the multiple sample video retrieval texts are less than or equal to the third preset matching degree threshold.
[0063] In some possible embodiments, if there is only one sample video that successfully matches a sample retrieval text, the number of video clips of the sample video whose second matching degree is greater than the second preset matching degree threshold within the preset duration can be identified to determine whether the number of videos is greater than the preset number threshold, or the number ratio of the number of videos to the total number of sample video texts can be determined. If the number of videos is not greater than the preset number threshold, the model parameters of the initial video retrieval model are adjusted until the number of sample videos whose second matching degree is greater than the second preset matching degree threshold within the preset duration is greater than the preset number threshold. Alternatively, if the number ratio is not greater than the preset number ratio threshold, the model parameters of the initial video retrieval model are adjusted until the number ratio within the preset duration is greater than the preset number ratio and the corresponding preset ratio threshold.
[0064] In summary, the training and processing method of the video search model of the embodiment of the present disclosure obtains multiple sample videos, inputs each sample video into a preset semantic recognition model to obtain a sample video description label corresponding to each sample video, extracts the video features of each sample video, and determines the sample description text features of each sample video description label, and then generates a video fusion feature based on the video features and the corresponding sample description text features, stores the video fusion features in a preset video feature library, obtains a sample retrieval text, extracts the sample retrieval text features of the sample retrieval text according to a preset initial video retrieval model, determines the target sample video corresponding to the sample retrieval text features according to the sample retrieval text features and the preset video feature library through the preset initial video retrieval model, calculates the matching degree of the target sample video and the sample retrieval text, and adjusts the model parameters of the initial video retrieval model according to the matching degree to obtain a trained video retrieval model. In this technical solution, on the basis of ensuring the reliability of the training sample data set, the acquisition efficiency of the training sample data set is improved, thereby improving the training efficiency and model accuracy of the video retrieval model.
[0065] After obtaining the successfully trained video retrieval model, video retrieval processing is also performed based on the video retrieval model. Figure 2 Flow chart of a video search processing method according to an embodiment of the present disclosure. Figure 2 As shown, the method includes:
[0066] Step 201, in response to obtaining a video retrieval instruction carrying a video retrieval text, input the video retrieval text into a pre-trained video search model.
[0067] Step 202: Determine a target video that matches the video retrieval text through a video search model according to a preset video feature library.
[0068] The video search model in this embodiment is obtained according to the training processing method of the aforementioned video search model.
[0069] In one embodiment of the present disclosure, a retrieval text feature corresponding to a video retrieval text is extracted through a video search model, and the second feature similarity between the retrieval text feature and each video fusion feature stored in a preset video feature library is determined through the video search model, and the video corresponding to the highest second feature similarity is determined as the target video.
[0070] In other possible execution processes, the video retrieval model can also meet the needs of other scenarios. For example, in some possible embodiments, in response to a video recommendation request from a target client, the video recommendation request can be obtained after detecting that a user is executing a preset recommendation event. Then, multiple historical video retrieval texts of the target client can be obtained, and a preferred video retrieval text of the target client can be generated based on the multiple historical video retrieval texts. For example, semantic recognition can be performed based on the historical retrieval texts to determine the retrieval text information with the highest frequency of occurrence as the corresponding signal video retrieval text, etc., or semantic recognition can be performed on multiple historical retrieval texts based on a pre-trained convolutional model to determine the preferred video retrieval text. After obtaining the preferred video retrieval text, the preferred video retrieval text is input into the video retrieval model to obtain a recommended video clip output by the video retrieval model, and then the recommended video clip is sent to the target client to achieve active recommendation of the video clip.
[0071] In other possible embodiments, multiple historical viewing videos of the target client within a recent preset time period can also be obtained, and a favorite viewing video retrieval text of the target client can be generated based on the multiple historical viewing videos. For example, multiple historical viewing video clips can be identified based on a pre-trained convolutional neural network model to obtain the favorite viewing video retrieval text, and the favorite video retrieval text can be input into the video retrieval model to obtain the recommended video clip output by the video retrieval model, and the recommended video clip can be sent to the target client.
[0072] For example, in some possible embodiments, an audit video retrieval text may be obtained, which may include some illegal video description information, and the audit video retrieval text may be input into a video retrieval model to obtain illegal video clips output by the video retrieval model, and then, a preset violation processing operation may be performed on the illegal video clips, such as directly deleting the illegal video clips.
[0073] Therefore, the video retrieval model obtained through the above training can be set in a video retrieval application to meet the retrieval needs of video clips in various scenarios, etc.
[0074] In summary, the video search processing method of the embodiment of the present disclosure, in response to obtaining a video search instruction carrying a video search text, inputs the video search text into a pre-trained video search model, and then determines the target video matching the video search text according to a preset video feature library through the video search model. In this technical solution, the acquisition efficiency and reliability of the training sample data set of the video retrieval model are high, which ensures the accuracy of querying the target video matching the video search text based on the pre-trained video retrieval model.
[0075] In order to implement the above embodiment, the present disclosure also proposes a training and processing device for a video search model. Figure 3 FIG. 1 is a structural diagram of a training processing device for a video search model according to an embodiment of the present disclosure. Figure 3 As shown, the device includes: a first acquisition module 310, a first determination module 320, a generation module 330, a storage module 340, a second acquisition module 350, a second determination module 360 and a training processing module 370, wherein:
[0076] A first acquisition module 310 is used to acquire multiple sample videos and input each sample video into a preset semantic recognition model to acquire a sample video description label corresponding to each sample video;
[0077] A first determination module 320, configured to extract video features of each sample video and determine sample description text features of each sample video description tag;
[0078] A generating module 330, configured to generate a video fusion feature according to the video feature and the corresponding sample description text feature;
[0079] The storage module 340 is used to store the video fusion features in a preset video feature library;
[0080] The second acquisition module 350 is used to acquire sample search text;
[0081] A second determination module 360 is used to extract sample retrieval text features of the sample retrieval text according to a preset initial video retrieval model, and determine a target sample video corresponding to the sample retrieval text features according to the sample retrieval text features and a preset video feature library through the preset initial video retrieval model;
[0082] The training processing module 370 is used to calculate the matching degree between the target sample video and the sample retrieval text, and adjust the model parameters of the initial video retrieval model according to the matching degree to obtain a trained video retrieval model.
[0083] The video search model training processing device provided in the embodiments of the present disclosure can execute the video search model training processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0084] In order to implement the above embodiment, the present disclosure also proposes a video search processing device.
[0085] Figure 4 The structure diagram of a video search processing device provided by an embodiment of the present disclosure is shown in FIG. 1 , which can be implemented by software and / or hardware and can generally be integrated in an electronic device. Figure 4 As shown, the device includes: an output module 410 and a third determination module 420, wherein:
[0086] An output module 410 is used to input the video retrieval text into a pre-trained video search model in response to obtaining a video retrieval instruction carrying the video retrieval text;
[0087] The third determination module 420 is used to determine the target video matching the video retrieval text through a video search model according to a preset video feature library, wherein the video search model is obtained according to the aforementioned video search model training processing method.
[0088] The video search processing device provided in the embodiments of the present disclosure can execute the video search processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0089] In order to implement the above embodiments, the present disclosure also proposes a computer program product, including a computer program / instruction, which, when executed by a processor, implements the training processing method of the video search model in the above embodiments, or the video search processing method.
[0090] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure.
[0091] The following specific reference Figure 5, which shows a schematic diagram of the structure of an electronic device 500 suitable for implementing the embodiment of the present disclosure. The electronic device 500 in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0092] like Figure 5 As shown, the electronic device 500 may include a processor (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a memory 508 to a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processor 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0093] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0094] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the memory 508, or installed from the ROM 502. When the computer program is executed by the processor 501, the training processing method of the video search model of the embodiment of the present disclosure is executed, or the above-mentioned functions defined in the video search processing method are executed.
[0095] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0096] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0097] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0098] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0099] Acquire multiple sample videos, input each sample video into a preset semantic recognition model to obtain a sample video description label corresponding to each sample video, extract the video features of each sample video, and determine the sample description text features of each sample video description label, and then generate video fusion features based on the video features and the corresponding sample description text features, store the video fusion features in a preset video feature library, acquire sample retrieval text, extract sample retrieval text features of the sample retrieval text according to a preset initial video retrieval model, determine the target sample video corresponding to the sample retrieval text features according to the sample retrieval text features and the preset video feature library through the preset initial video retrieval model, calculate the matching degree of the target sample video and the sample retrieval text, and adjust the model parameters of the initial video retrieval model according to the matching degree to obtain a trained video retrieval model. In this technical solution, on the basis of ensuring the reliability of the training sample data set, the efficiency of acquiring the training sample data set is improved, thereby improving the training efficiency and model accuracy of the video retrieval model. Or,
[0100] In response to obtaining a video retrieval instruction carrying a video retrieval text, the video retrieval text is input into a pre-trained video search model, and then, the target video matching the video retrieval text is determined by the video search model according to a preset video feature library. In this technical solution, the acquisition efficiency and reliability of the training sample data set of the video retrieval model are high, which ensures the accuracy of querying the target video matching the video retrieval text based on the pre-trained video retrieval model.
[0101] The electronic device may be written in one or more programming languages or a combination thereof to write computer program code for performing the operations of the present disclosure, including but not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0102] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0103] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, constitute a limitation on the unit itself.
[0104] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0105] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0106] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0107] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0108] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A training method for a video search model, characterized in that: The following steps are involved: Acquire multiple sample videos, and input each of the sample videos into a preset semantic recognition model to obtain a sample video description label corresponding to each of the sample videos; Extracting video features of each sample video, and determining sample description text features of each sample video description tag; Generating a video fusion feature according to the video feature and the corresponding sample description text feature, and storing the video fusion feature in a preset video feature library; Acquire a sample retrieval text, extract a sample retrieval text feature of the sample retrieval text according to a preset initial video retrieval model, and determine a target sample video corresponding to the sample retrieval text feature through the preset initial video retrieval model according to the sample retrieval text feature and the preset video feature library; The matching degree between the target sample video and the sample retrieval text is calculated, and the model parameters of the initial video retrieval model are adjusted according to the matching degree to obtain a trained video retrieval model.
2. The method according to claim 1, characterized in that The step of adjusting the model parameters of the initial video retrieval model according to the matching degree to obtain the trained video retrieval model includes: Determining whether the matching degree is greater than a preset matching degree threshold; When the degree of matching is not greater than the preset matching threshold, the model parameters of the initial video retrieval model are adjusted until the adjusted degree of matching is less than or equal to the preset matching threshold, and the trained video retrieval model is obtained.
3. The method according to claim 1, characterized in that The obtaining of multiple sample videos comprises: Get the video to be retrieved; The video to be retrieved is divided according to a preset number of split frames to obtain a plurality of video segments, and the plurality of video segments are determined to be the plurality of sample videos.
4. The method according to claim 2 or 3, characterized in that The step of determining a target sample video corresponding to the sample retrieval text feature according to the sample retrieval text feature and the preset video feature library by using the preset initial video retrieval model includes: Determine, according to the preset initial video retrieval model, a first feature similarity between the sample retrieval text feature and each video fusion feature in the preset video feature library; The sample video corresponding to the highest first feature similarity is determined as the target sample video.
5. A video search processing method, characterized in that: The following steps are involved: In response to obtaining a video retrieval instruction carrying a video retrieval text, inputting the video retrieval text into a pre-trained video search model; The target video matching the video retrieval text is determined by the video search model according to a preset video feature library, wherein the video search model is obtained according to the training processing method of the video search model described in any one of claims 1-5.
6. The method according to claim 5, characterized in that The step of determining a target video matching the video retrieval text by using the video search model according to a preset video feature library includes: Extracting the search text features corresponding to the video search text through the video search model; The video search model is used to determine the second feature similarity between the retrieval text feature and each video fusion feature stored in the preset video feature library, and the video corresponding to the highest second feature similarity is determined as the target video.
7. A training and processing device for a video search model, characterized in that: include: A first acquisition module is used to acquire multiple sample videos, and input each of the sample videos into a preset semantic recognition model to acquire a sample video description tag corresponding to each of the sample videos; A first determination module is used to extract video features of each sample video and determine sample description text features of each sample video description tag; A generating module, used for generating video fusion features according to the video features and corresponding sample description text features; A storage module, used for storing the video fusion features in a preset video feature library; The second acquisition module is used to acquire sample search text; A second determination module is used to extract sample retrieval text features of the sample retrieval text according to a preset initial video retrieval model, and determine a target sample video corresponding to the sample retrieval text features according to the sample retrieval text features and the preset video feature library through the preset initial video retrieval model; The training processing module is used to calculate the matching degree between the target sample video and the sample retrieval text, and adjust the model parameters of the initial video retrieval model according to the matching degree to obtain a trained video retrieval model.
8. A video search processing device, characterized in that: include: An output module, configured to, in response to obtaining a video retrieval instruction carrying a video retrieval text, input the video retrieval text into a pre-trained video search model; A third determination module is used to determine a target video matching the video retrieval text through the video search model according to a preset video feature library, wherein the video search model is obtained according to the training processing method of the video search model described in any one of claims 1-5.
9. An electronic device, characterized in that: The electronic device comprises: A processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the training processing method of the video search model described in any one of claims 1-4, or the video search processing method described in claim 5 or 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is used to execute the training processing method of the video search model described in any one of claims 1 to 4, or the video search processing method described in claim 5 or 6.
Citation Information
Cited By
Method and device for training expression recognition model and electronic equipment
CN121686543A