Video tag generation method and device, electronic equipment, storage medium and product

By extracting image features and text features from videos, and using chain-of-thinking reasoning to generate video tag sequences, the problem of low accuracy of video tags in the existing technology is solved, the accuracy and efficiency of tags are improved, and operating costs are reduced.

CN118733829APending Publication Date: 2024-10-01TENCENT DIGITAL TIANJIN
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310319759.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-29
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing video tag recognition technology directly predicts the image content of each frame of the video, resulting in low tag accuracy. Especially when the video is long and contains a lot of content, the accuracy is further reduced.

Method used

By performing image feature extraction and text recognition on multi-frame images of the video to be identified, and combining the thinking chain to perform step-by-step reasoning on the video tags, multiple sub-tags are generated and summarized to form a tag sequence.

Benefits of technology

It improves the accuracy and generation efficiency of video tags. Compared with directly generating a single tag, it further improves the accuracy, enhances the interpretability of tags, and reduces the review costs of operators.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733829A_ABST
    Figure CN118733829A_ABST
Patent Text Reader

Abstract

The invention provides a video tag generation method and device, electronic equipment, a computer readable storage medium and a computer program product, and the method comprises the steps: carrying out the image feature extraction of a plurality of frames of images of a to-be-recognized video, obtaining the image features of the to-be-recognized video, carrying out the text recognition of the to-be-recognized video, and obtaining the text features of the to-be-recognized video; based on the image features and the text features, gradually reasoning a label of the to-be-identified video by adopting a thinking chain to obtain a plurality of sub-labels of the to-be-identified video; wherein the thinking chain comprises a plurality of label reasoning steps, and each label reasoning step is used for reasoning a sub-label; and summarizing the plurality of sub-tags to obtain a tag sequence of the to-be-identified video. According to the invention, the accuracy of the generated video tag can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a method, device, electronic device, computer-readable storage medium, and computer program product for generating video tags. Background Art

[0002] In the process of video tag recognition, most related technologies directly predict the unique tag for the video based on the image content of each frame in the video. However, the tag of the video is not only related to the image content of each frame in the video. Therefore, the accuracy of the video tags generated in the related technologies is low. At the same time, when the video is long and includes more content, directly predicting the unique tag for the video will further reduce the accuracy of the generated video tags. Summary of the invention

[0003] The embodiments of the present application provide a method, device, electronic device, computer-readable storage medium, and computer program product for generating video tags, which can improve the accuracy of generated video tags.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] The present application provides a method for generating a video tag, including:

[0006] Performing image feature extraction on multiple frames of the video to be identified to obtain image features of the video to be identified, and performing text recognition on the video to be identified to obtain text features of the video to be identified;

[0007] Based on the image features and the text features, a thought chain is used to gradually infer the label of the video to be identified, so as to obtain a plurality of sub-labels of the video to be identified;

[0008] The thought chain includes a plurality of label reasoning steps, and each label reasoning step is used to infer one of the sub-labels;

[0009] A plurality of the sub-tags are aggregated to obtain a tag sequence of the video to be identified.

[0010] The present application embodiment provides a device for generating a video tag, including:

[0011] A feature extraction module is used to extract image features from multiple frames of a video to be identified to obtain image features of the video to be identified, and to perform text recognition on the video to be identified to obtain text features of the video to be identified;

[0012] An inference module, used to use a chain of thought to gradually infer the label of the video to be identified based on the image features and the text features, so as to obtain a plurality of sub-labels of the video to be identified; wherein the chain of thought includes a plurality of label inference steps, and each label inference step is used to infer one of the sub-labels;

[0013] The aggregation module is used to aggregate the multiple sub-tags to obtain a tag sequence of the video to be identified.

[0014] An embodiment of the present application provides an electronic device, including:

[0015] A memory for storing computer executable instructions;

[0016] The processor is used to implement the method for generating a video tag provided in an embodiment of the present application when executing the computer executable instructions stored in the memory.

[0017] The embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions for causing a processor to execute the instructions to implement the method for generating a video tag provided in the embodiment of the present application.

[0018] The embodiment of the present application provides a computer program product, which includes computer executable instructions, which are stored in a computer-readable storage medium. A processor of an electronic device reads the computer executable instructions from the computer-readable storage medium, and the processor executes the computer executable instructions, so that the electronic device executes the method for generating a video tag provided in the embodiment of the present application.

[0019] The embodiments of the present application have the following beneficial effects:

[0020] Based on the extracted text features and image features of the video to be identified, the thought chain is used to gradually infer the label of the video to be identified, and multiple sub-labels of the video to be identified are obtained. Thus, the multiple sub-labels are summarized to obtain the label sequence of the video to be identified. In this way, the label of the video to be identified is generated by combining the image features and text features of the video to be identified. Compared with generating video labels based only on the image content of each frame image in the video, the video labels are generated based on more features of the video, which improves the accuracy of the generated video labels. At the same time, the thought chain is used to infer multiple sub-labels of the video to be identified, which improves the efficiency of generating multiple labels of the video, and further improves the accuracy of the generated video labels compared to directly generating a single label of the video. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 1 is a schematic diagram of the architecture of a system 100 for generating video tags provided in an embodiment of the present application;

[0022] Figure 2 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0023] Figure 3 It is a flowchart of a method for generating a video tag provided in an embodiment of the present application;

[0024] Figure 4 is a schematic diagram of extracting image features of multiple frames of a video to be identified to obtain image features of the video to be identified provided by an embodiment of the present application;

[0025] Figure 5 is a schematic diagram of processing an image block provided by an embodiment of the present application;

[0026] Figure 6 It is the target image feature after the image block dimensionality reduction processing provided in the embodiment of the present application;

[0027] Figure 7 It is a structural diagram of a video tag generation model provided in an embodiment of the present application;

[0028] Figure 8 It is a flowchart of the training process of the video tag generation model provided in the embodiment of the present application;

[0029] Fig. 9 It is a flowchart of the training process of the video tag generation model provided in the embodiment of the present application;

[0030] Fig.10 It is a flowchart of a method for generating a video tag provided in an embodiment of the present application;

[0031] Fig.11 It is a technical architecture diagram of a video tag generation method based on thought chain reasoning provided in an embodiment of the present application;

[0032] Fig.12 It is a structural diagram of a text generation model provided in an embodiment of the present application;

[0033] Fig.13 is a schematic diagram of a process for determining text features of a video clip provided in an embodiment of the present application;

[0034] Fig.14 It is a schematic diagram of generating the thought chain reasoning process provided by the embodiment of the present application;

[0035] Fig.15 It is a schematic diagram of constructing a video label generation model based on thought chain reasoning training data provided in an embodiment of the present application. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0037] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0038] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0040] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0041] 1) In response, it is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed may be in real time or have a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations executed are executed.

[0042] 2) Client, also known as the user end, refers to the program corresponding to the server that provides local services to users. Except for some applications that can only run locally, it is generally installed on the terminal and needs to cooperate with the server to run, that is, it requires corresponding servers and service programs in the network to provide corresponding services. In this way, specific communication connections need to be established on the client and server sides to ensure the normal operation of the application, such as virtual scene clients (such as game clients) and video clients.

[0043] 3) Chain reasoning not only outputs the final result, but also generates the inference process of the process of generating the final result at the same time. It is more intuitive in the interpretability of model output results and troubleshooting. In addition, it gives the chain reasoning ability to smaller models (below 1B scale) to improve the classification / generation ability of the model.

[0044] 4) Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0045] See also Figure 1 , Figure 1 It is an architectural diagram of a system 100 for generating video tags provided in an embodiment of the present application, for realizing application scenarios of generating video tags (for example, the application scenarios of generating video tags can be that when generating tags for videos to be identified, based on the extracted text features and image features of the videos to be identified, the tags of the videos to be identified are gradually inferred using a thinking chain to obtain multiple sub-tags of the videos to be identified and the reasoning process corresponding to each sub-tag, and then the multiple sub-tags are summarized to obtain a tag sequence of the videos to be identified, and finally the tag sequence of the videos to be identified and the reasoning process of each sub-tag in the corresponding tag sequence are output), a terminal (terminal 400 is shown as an example), and the terminal 400 is connected to the server 200 via a network 300, wherein the network 300 can be a wide area network or a local area network, or a combination of the two, and data transmission is realized using a wireless or wired link.

[0046] The terminal 400 is used to send the video to be identified to the server 200;

[0047] The server 200 is used to receive a video to be identified, and perform image feature extraction on multiple frames of the video to be identified to obtain image features of the video to be identified, and perform text recognition on the video to be identified to obtain text features of the video to be identified; based on the image features and the text features, a thinking chain is used to gradually infer the label of the video to be identified to obtain multiple sub-labels of the video to be identified; wherein the thinking chain includes multiple label inference steps, and each label inference step is used to infer a sub-label; and multiple sub-labels are summarized to obtain a label sequence of the video to be identified.

[0048] In some embodiments, the server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Deliver Network), and big data and artificial intelligence platforms. The terminal 400 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a set-top box, an intelligent voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, a portable music player, a personal digital assistant, a dedicated messaging device, a portable gaming device, an intelligent speaker, and a smart watch, but is not limited thereto. The terminal and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.

[0049] Next, an electronic device that implements the method for generating a video tag provided in an embodiment of the present application is described. Figure 2 , Figure 2 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may be a server or a terminal. Figure 1 Take the server shown in as an example, Figure 2 The electronic device shown includes: at least one processor 410, a memory 450, at least one network interface 420 and a user interface 430. The various components in the terminal 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 440 is not shown in FIG. Figure 2 Various buses are labeled as bus system 440 .

[0050] Processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0051] The user interface 430 includes one or more output devices 431 that enable display of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0052] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.

[0053] The memory 450 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.

[0054] In some embodiments, memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0055] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0056] A network communication module 452, used to reach other electronic devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB), etc.;

[0057] a presentation module 453 for enabling display of information via one or more output devices 431 (e.g., display screen, speaker, etc.) associated with the user interface 430 (e.g., a user interface for operating peripherals and displaying content and information);

[0058] The input processing module 454 is used to detect one or more user inputs or interactions from one of the one or more input devices 432 and translate the detected inputs or interactions.

[0059] In some embodiments, the device provided in the embodiments of the present application can be implemented in software. Figure 2The video tag generation device 455 stored in the memory 450 is shown, which can be software in the form of a program and a plug-in, including the following software modules: a feature extraction module 4551, an inference module 4552, and a summary module 4553. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be explained below.

[0060] In other embodiments, the device provided in the embodiments of the present application can be implemented in hardware. As an example, the video tag generation device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the video tag generation method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.

[0061] In some embodiments, the terminal or server can implement the method for generating video tags provided in the embodiments of the present application by running a computer program. For example, the computer program can be a native program or software module in the operating system; it can be a native application (APP, Application), that is, a local client, that is, a program that needs to be installed in the operating system to run, such as an instant messaging APP, a web browser APP; it can also be a small program, that is, a program that can be run only by downloading it to a browser environment; it can also be a small program that can be embedded in any APP. In short, the above-mentioned computer program can be any form of client, module or plug-in.

[0062] Based on the above description of the video tag generation system and electronic device provided by the embodiment of the present application, the following describes the video tag generation method provided by the embodiment of the present application. In actual implementation, the video tag generation method provided by the embodiment of the present application can be implemented by the terminal or the server alone, or by the terminal and the server in collaboration, so that Figure 1 The server 200 in the embodiment of the present application alone executes the method for generating video tags provided in the embodiment of the present application as an example for explanation. Figure 3 , Figure 3 is a flow chart of a method for generating a video tag provided in an embodiment of the present application. Next, Figure 3The steps shown are explained.

[0063] Step 101: The server extracts image features from multiple frames of a video to be identified to obtain image features of the video to be identified, and performs text recognition on the video to be identified to obtain text features of the video to be identified.

[0064] In actual implementation, the server receives a request to generate a video tag for a video to be identified, parses the request to generate the video tag, and thereby determines the video to be identified. Here, the video to be identified may be pre-stored locally in the terminal, or obtained by the terminal from the outside world (such as the Internet), or collected in real time by the terminal, for example, collected in real time by a camera of the terminal.

[0065] It should be noted that after the server obtains the video to be identified, it will perform image feature extraction and text recognition on the video to be identified, thereby obtaining the image features and text features of the video to be identified. Next, the process of image feature extraction and text recognition of the video to be identified after the server obtains the video to be identified will be explained respectively.

[0066] In some embodiments, the process of extracting image features from multiple frames of a video to be identified to obtain image features of the video to be identified specifically includes performing the following processing on each frame image: dividing the frame image into blocks to obtain at least two image blocks, each of which has the same size; extracting image features from the frame image based on each image block to obtain image features of the frame image; and determining image features of the video to be identified based on the image features of each frame image. For example, see Figure 4 , Figure 4 is a schematic diagram of extracting image features of multiple frames of a video to be identified to obtain image features of the video to be identified provided by an embodiment of the present application, based on Figure 4 , the dotted box 401 shows a frame image among multiple frame images of the video to be identified, so the frame image is divided into blocks to obtain six image blocks. Here, the six image blocks have the same size. Therefore, based on each image block, the frame image is subjected to image feature extraction to obtain the image features of the frame image. Furthermore, based on the image features of each frame image, the image features of the video to be identified are determined.

[0067] In actual implementation, the process of extracting image features from a frame image based on each image block to obtain the image features of the frame image may be to extract features from the pixels in each image block to obtain the pixel features of each pixel in the image block, and to perform feature splicing on the pixel features of each pixel to obtain the image features of the image block; thus, the image features of each image block are spliced ​​to obtain the image features of the frame image. For example, see Figure 5 , Figure 5is a schematic diagram of processing an image block provided in an embodiment of the present application, based on Figure 5 , the dotted box 501 shows an image block in the frame image, and there are nine pixel points AI in the image block, so that feature extraction is performed on the pixel points in each image block respectively, and pixel features of the nine pixel points AI in the image block, namely 1, 2, 3, 4, 5, 6, 7, 8, and 9, are obtained, and then the pixel features of the nine pixel points AI are feature spliced ​​to obtain the image features of the image block shown in the dotted box 502; thus, the image features of each image block are feature spliced ​​to obtain the image features of the frame image.

[0068] It should be noted that after obtaining the image features of the image blocks, the image features of the image blocks can also be flattened, that is, dimension reduction, so as to perform feature splicing on the image features of each image block after the dimension reduction process to obtain the image features of the frame image. Specifically, after obtaining the image features of the image blocks, the image features of each image block are subjected to dimension reduction process to obtain the target image features of each image block; thus, the process of performing feature splicing on the image features of each image block to obtain the image features of the frame image can be to perform feature splicing on the target image features of each image block to obtain the image features of the frame image. For example, see Figure 6 , Figure 6 is the target image feature after the image block dimensionality reduction processing provided by the embodiment of the present application. Here, continue to refer to Figure 5 ,based on Figure 5 After obtaining the image features of the image block as shown in the dotted box 502, the image features of the image block are subjected to dimensionality reduction processing to obtain Figure 6 The target image features after the dimensionality reduction processing of the image block shown in 601; thus, the target image features of each image block are spliced ​​to obtain the image features of the frame image.

[0069] In actual implementation, the process of determining the image features of the video to be identified based on the image features of each frame image can be to obtain the order of each frame image in the video to be identified, and according to the order of each frame image, perform feature splicing on the image features of each frame image to obtain the image features of the video to be identified.

[0070] In other embodiments, the process of performing text recognition on a video to be identified and obtaining text features of the video to be identified includes, specifically, segmenting the video to be identified to obtain at least two video segments, each of which has the same duration; performing speech recognition on each video segment to obtain a speech text of each video segment, and performing feature extraction on the speech text of each video segment to obtain text features of each video segment; and performing feature splicing on the text features of each video segment to obtain text features of the video to be identified. Exemplarily, by segmenting the video to be identified to obtain a plurality of video segments with a duration of 5 seconds, speech recognition is performed on each video segment to obtain a speech text of each video segment, and then feature extraction is performed on the speech text of each video segment to obtain text features of each video segment, and finally, feature splicing is performed on the text features of each video segment to obtain text features of the video to be identified.

[0071] Step 102, based on the image features and text features, the label of the video to be identified is gradually inferred using a thinking chain to obtain multiple sub-labels of the video to be identified; wherein the thinking chain includes multiple label inference steps, and each label inference step is used to infer a sub-label.

[0072] It should be noted that the multiple sub-labels of the video to be identified obtained here can be comprehensive sub-labels for the video to be identified obtained by combining the image features and text features of the video to be identified, or can be image sub-labels obtained based on the image features of the video to be identified, text sub-labels obtained based on the text features of the video to be identified, and comprehensive sub-labels for the video to be identified obtained by combining the image features and text features of the video to be identified. Next, based on the differences in the multiple sub-labels of the video to be identified obtained, the process of gradually reasoning the labels of the video to be identified based on the image features and text features using a chain of thought to obtain multiple sub-labels of the video to be identified is explained.

[0073] In some embodiments, the multiple sub-labels of the video to be identified include image sub-labels, text sub-labels and comprehensive sub-labels of the video to be identified. Based on image features and text features, the label of the video to be identified is gradually inferred using a thinking chain to obtain multiple sub-labels of the video to be identified. The process may be: using the image label inference step in the thinking chain to infer the label of the video to be identified based on image features to obtain at least one image sub-label of the video to be identified; using the text label inference step in the thinking chain to infer the label of the video to be identified based on text features to obtain at least one text sub-label of the video to be identified; using the comprehensive label inference step in the thinking chain to combine at least one image sub-label and at least one text sub-label to infer the label of the video to be identified to obtain at least one comprehensive sub-label of the video to be identified.

[0074] It should be noted that the image sub-tag here is used to indicate the label obtained based on the image content in the video to be identified, the text sub-tag is used to indicate the label obtained based on the voice content in the video to be identified, and the comprehensive sub-tag is used to indicate the label obtained by combining the image content in the video to be identified and the voice content in the video to be identified.

[0075] In other embodiments, the obtained multiple sub-labels of the video to be identified are comprehensive sub-labels of the video to be identified. Here, multiple label inference steps are connected in series, so that based on image features and text features, the label of the video to be identified is gradually inferred using a thinking chain to obtain multiple sub-labels of the video to be identified. The process can be: using the first label inference step in the thinking chain, combining image features and text features, to infer the label of the video to be identified to obtain the first label; for the mth label inference step in the thinking chain, combining image features, text features, and labels inferred by each label inference step before the mth label inference step, to infer the label of the video to be identified to obtain the mth label; wherein m is a positive integer greater than 1, and m is less than or equal to the number of multiple label inference steps; traversing m to obtain multiple sub-labels of the video to be identified. Exemplarily, when m is 5, m is traversed to obtain multiple sub-labels of the video to be identified, that is, the five label reasoning steps in the thinking chain are used respectively, and the image features and text features are combined to infer the label of the video to be identified, and the first label, the second label, the third label, the fourth label and the fifth label are obtained, that is, the five sub-labels of the video to be identified are obtained.

[0076] It should be noted that, as mentioned above, the text features of the video to be identified are obtained based on multiple video clips of the video to be identified. Therefore, the video to be identified includes multiple video clips, and each video clip forms a video clip sequence. Based on this, the multiple label inference steps included in the thinking chain can have a one-to-one correspondence with the multiple video clips included in the video to be identified, that is, each label inference step included in the thinking chain is used to infer the label of the corresponding video clip included in the video to be identified. Therefore, based on image features and text features, the thinking chain is used to gradually infer the label of the video to be identified to obtain multiple sub-labels of the video to be identified. The process can be, based on image features and text features, obtaining image features and text features corresponding to each video clip; based on the image features and text features of the nth video clip in the video clip sequence, and the image features and text features of each video clip before the nth video clip in the video clip sequence, predicting the label of the nth video clip; wherein n is a positive integer greater than 1, and n is less than or equal to the number of video clips in the video clip sequence; traversing n to obtain multiple sub-labels of the video to be identified.

[0077] In actual implementation, for the process of obtaining the image features and text features corresponding to each video clip based on image features and text features, for the image features of the video clip, as described above, after extracting the image features of multiple frames of the video to be identified, the image features of each frame of the video to be identified can be obtained, and then after the video to be identified is divided into multiple video clips, the frame images included in each video clip are determined, and then for each video clip, the image features of each frame of the video included in the video clip are spliced ​​to obtain the image features of the video clip; and for the text features of the video clip, as described above, each video clip is respectively subjected to speech recognition to obtain the speech text of each video clip, and the speech text of each video clip is respectively subjected to feature extraction to obtain the text features of each video clip. In this way, the image features and text features corresponding to each video clip are obtained. In addition, for the process of traversing n to obtain multiple sub-labels of the video to be identified, here, it is similar to the process of traversing m to obtain multiple sub-labels of the video to be identified as described above, and this embodiment of the present application will not be repeated.

[0078] Step 103: Aggregate multiple sub-tags to obtain a tag sequence of the video to be identified.

[0079] In actual implementation, the process of aggregating multiple sub-tags to obtain a label sequence of the video to be identified can be to sort the multiple sub-tags according to the order of the video content in the video to be identified corresponding to each sub-tag, such as the time order in which the corresponding video content appears in the video to be identified, to obtain the label sequence of the video to be identified. Exemplarily, when there are 5 sub-tags, namely A, C, B, E, and D, in the video to be identified, according to the order of the video content in the video to be identified corresponding to each sub-tag, the time sequence of the video content corresponding to sub-tag A appears earlier than the time sequence of the video content corresponding to sub-tag B; the time sequence of the video content corresponding to sub-tag B appears earlier than the time sequence of the video content corresponding to sub-tag C; the time sequence of the video content corresponding to sub-tag C appears earlier than the time sequence of the video content corresponding to sub-tag D; the time sequence of the video content corresponding to sub-tag D appears earlier than the time sequence of the video content corresponding to sub-tag E. In this way, according to the order of the video content in the video to be identified corresponding to each sub-tag, multiple sub-tags are sorted, and the label sequence of the video to be identified is A, B, C, D, E.

[0080] In some embodiments, when there are identical subtags in multiple subtags, the multiple subtags can also be filtered. Specifically, the process of summarizing multiple subtags to obtain the tag sequence of the video to be identified can be to filter the multiple subtags, that is, to filter out the repeated subtags in the multiple subtags to obtain multiple target subtags of the video to be identified, and then, according to the order of the video content in the video to be identified corresponding to each target subtag, such as the time order of the corresponding video content in the video to be identified, sort the multiple target subtags to obtain the tag sequence of the video to be identified. Exemplarily, when there are 5 subtags in the video to be identified, namely A, A, B, B, and C, the 5 subtags are filtered, that is, the repeated subtags in the 5 subtags, namely A and B, are filtered out to obtain multiple target subtags of the video to be identified, namely A, B, and C, so that according to the order of the video content in the video to be identified corresponding to each target subtag, the multiple target subtags are sorted to obtain the tag sequence of the video to be identified.

[0081] In some embodiments, after aggregating multiple sub-tags to obtain the label sequence of the video to be identified, the label sequence of the video to be identified can be directly output; or, the reasoning process for each sub-tag can be obtained, thereby outputting the label sequence of the video to be identified and the reasoning process of each sub-tag in the label sequence. Exemplarily, when the sub-tags in the tag sequence of the video to be identified are "financial management", "expert interview", and "finance", the tag sequence including the three sub-tags of "financial management", "expert interview", and "finance" can be directly output, or the reasoning process for each sub-tag can be obtained. Specifically, the reasoning process for the sub-tag "financial management" can be that the video to be identified mentions the method of maximizing asset returns, so the tag is "financial management"; the reasoning process for the sub-tag "expert interview" can be that the video to be identified is an interview with a financial management expert, so the tag is "expert interview"; the reasoning process for the sub-tag "finance" can be that since the video related to financial management content is a financial video, the tag is "finance", thereby outputting the tag sequence including the three sub-tags of "financial management", "expert interview", and "finance", as well as the reasoning process for the three sub-tags of "financial management", "expert interview", and "finance".

[0082] In this way, when the generated video labels are given to operators for confirmation, the operators need to carefully reconfirm which content in the video the labels are related to, which leads to high labor costs and low efficiency of video labeling. By giving the reasoning process of the corresponding label when generating each label, the operators can review the corresponding labels in combination with the reasoning process when reviewing the labels, which enhances the interpretability of the labels, greatly reduces the cost of understanding, and improves the efficiency of video labeling.

[0083] In some embodiments, a label of the video to be identified can also be generated based on the video label generation model. Figure 7 , Figure 7 is a schematic diagram of the structure of the video tag generation model provided in the embodiment of the present application, based on Figure 7 The video label generation model includes a text feature extraction layer, an image feature extraction layer, an inference layer and an output layer, so that the process of performing image feature extraction on multiple frames of the video to be identified to obtain the image features of the video to be identified, and performing text recognition on the video to be identified to obtain the text features of the video to be identified can be, through the image feature extraction layer, performing image feature extraction on multiple frames of the video to be identified to obtain the image features of the video to be identified, and through the text feature extraction layer, performing text recognition on the video to be identified to obtain the identification text corresponding to the video to be identified, and performing feature extraction on the identification text to obtain the text features of the video to be identified; and the process of gradually reasoning the label of the video to be identified based on the image features and the text features using the thinking chain to obtain multiple sub-labels of the video to be identified can be, through the inference layer, based on the image features and the text features, using the thinking chain to gradually reason the label of the video to be identified based on the image features and the text features to obtain multiple sub-labels of the video to be identified; and the process of summarizing multiple sub-labels to obtain the label sequence of the video to be identified can be, through the output layer, summarizing multiple sub-labels to obtain the label sequence of the video to be identified.

[0084] It should be noted that after aggregating multiple sub-labels through the output layer to obtain the label sequence of the video to be identified, the label sequence of the video to be identified can be output directly through the output layer, or the reasoning process for each sub-label can be obtained, thereby outputting the label sequence of the video to be identified and the reasoning process for each sub-label in the label sequence through the output layer.

[0085] In actual implementation, before generating labels for videos to be identified based on the video label generation model, the video label generation model needs to be trained. Here, the training process of the video label generation model can be implemented by the terminal or the server alone, or by the terminal and the server in collaboration. At the same time, after a plurality of sub-labels are aggregated to obtain the label sequence of the video to be identified, the label sequence of the video to be identified can be directly output; or, the reasoning process for each sub-label can be obtained, thereby outputting the label sequence of the video to be identified and the reasoning process for each sub-label in the label sequence. Therefore, the training process of the video label generation model varies according to different output results.

[0086] Next, by Figure 1Taking the server 200 in the example of independently executing the training process of the above-mentioned video label generation model, the training process of the video label generation model that directly outputs the label sequence and the training process of the video label generation model that outputs the label sequence and the reasoning process of each sub-label in the label sequence are explained respectively.

[0087] In some embodiments, for the training process of the video label generation model that directly outputs a label sequence, see Figure 8 , Figure 8 is a flowchart of the training process of the video tag generation model provided in the embodiment of the present application, combined with Figure 8 The steps shown are explained.

[0088] Step 201: The server obtains an initial video label generation model and a video sample carrying a real label sequence; wherein the real label sequence includes a plurality of real sub-labels of the video sample.

[0089] Step 202, through the image feature extraction layer, image feature extraction is performed on multiple frames of the video sample to obtain the training image features of the video sample, and through the text feature extraction layer, text recognition is performed on the video sample to obtain the training recognition text corresponding to the video sample, and feature extraction is performed on the training recognition text to obtain the training text features of the video sample.

[0090] Step 203, through the inference layer, based on the training image features and the training text features, the labels of the video samples are gradually inferred using the thought chain to obtain multiple predicted sub-labels of the video samples.

[0091] Step 204 , through the output layer, multiple predicted sub-labels are aggregated to obtain a predicted label sequence of the video sample.

[0092] Step 205, obtaining the difference between the predicted label sequence and the true label sequence, and based on the difference, updating the model parameters of the initial video label generation model to obtain the video label generation model.

[0093] In some other embodiments, the training process of the video label generation model for the output label sequence and the reasoning process for each sub-label in the label sequence is as follows: Fig. 9 , Fig. 9 is a flowchart of the training process of the video tag generation model provided in the embodiment of the present application, combined with Fig. 9 The steps shown are explained.

[0094] In step 301, the server obtains an initial video label generation model and a video sample carrying a real label sequence and multiple real reasoning processes; wherein the real label sequence includes multiple real sub-labels of the video sample, and there is a one-to-one correspondence between the real reasoning process and the real sub-label.

[0095] In actual implementation, the obtained video samples carrying the real label sequence and multiple real reasoning processes can be obtained through a trained video text generation model. Specifically, the process of obtaining the video samples carrying the real label sequence and multiple real reasoning processes can be to obtain a trained video text generation model and multiple initial video samples; wherein each initial video sample carries a real label sequence, and the real label sequence includes multiple real sub-labels; select at least one first video sample from the multiple initial video samples, and for each first video sample, construct a real reasoning process corresponding to each real sub-label of the first video sample; based on the first video sample, the real reasoning process of each real sub-label of the first video sample, and the video text generation model, generate the real reasoning process of each real sub-label of the second video sample, the second video sample is the initial video sample other than the first video sample in the multiple initial video samples; based on the multiple real sub-labels of the first video sample and the real reasoning process of each real sub-label, and the multiple real sub-labels of the second video sample and the real reasoning process of each real sub-label, construct a video sample; thereby obtaining the video sample carrying the real label sequence and multiple real reasoning processes.

[0096] In some embodiments, when the number of second video samples is multiple, after the real reasoning process of each real sub-label of the second video sample is generated based on the first video sample, the real reasoning process of each real sub-label of the first video sample, and the video text generation model, the generated real reasoning process of each real sub-label of the second video sample can also be filtered, that is, the second video sample is filtered. Specifically, after the real reasoning process of each real sub-label of the second video sample is generated based on the first video sample, the real reasoning process of each real sub-label of the first video sample, and the video text generation model, the following processing is performed on each second video sample: label prediction is performed on the second video sample through the video text generation model to obtain multiple predicted sub-labels of the second video sample; the multiple predicted sub-labels of the second video sample are compared with the second video sample. The multiple real sub-labels carried by the sample are compared to obtain a comparison result; when the comparison result represents multiple predicted sub-labels of the second video sample, which are inconsistent with the corresponding multiple real sub-labels, the real reasoning process corresponding to each real sub-label of the second video sample is deleted, and the second video sample is used as the third video sample; the third video sample is screened out from the multiple second video samples to obtain the target second video sample; thus, the process of constructing a video sample based on the multiple real sub-labels of the first video sample and the real reasoning process of each real sub-label, and the multiple real sub-labels of the second video sample and the real reasoning process of each real sub-label can be to construct a video sample based on the multiple real sub-labels of the first video sample and the real reasoning process of each real sub-label, and the multiple real sub-labels of the target second video sample and the real reasoning process of each real sub-label.

[0097] In some embodiments, for the process of generating the real reasoning process of each real sub-label of the second video sample based on the first video sample, the real reasoning process of each real sub-label of the first video sample, and the video text generation model, it can be that based on the first video sample, the real reasoning process of each real sub-label of the first video sample, and the video text generation model, multiple candidate reasoning processes corresponding to each real sub-label of the second video sample are generated; for each real sub-label of the second video sample, a target number of candidate reasoning processes are selected from the multiple candidate reasoning processes as the real reasoning process of the real sub-label. In this way, for each real sub-label, by selecting multiple reasoning processes, the diversity of reasoning understanding for the corresponding real sub-label is improved.

[0098] Step 302, through the image feature extraction layer, image feature extraction is performed on multiple frames of images of the video sample to obtain training image features of the video sample, and through the text feature extraction layer, text recognition is performed on the video sample to obtain training recognition text corresponding to the video sample, and feature extraction is performed on the training recognition text to obtain training text features of the video sample.

[0099] Step 303, through the inference layer, based on the training image features and the training text features, the labels of the video samples are gradually inferred using the thought chain to obtain multiple predicted sub-labels of the video samples.

[0100] Step 304 , through the output layer, multiple predicted sub-labels are summarized to obtain a predicted label sequence of the video sample, and the prediction reasoning process for each predicted sub-label is output.

[0101] Step 305: Obtain the difference between the predicted label sequence and the true label sequence, and determine the process difference between each reasoning process and the corresponding predicted reasoning process.

[0102] Step 306 , combining the differences and process differences, updating the model parameters of the initial video tag generation model to obtain a video tag generation model.

[0103] Next, the method for generating a video tag provided in the embodiment of the present application is further introduced. Fig.10 is a flow chart of the method for generating video tags provided by an embodiment of the present application. Here, for the video tag generation model of the output tag sequence and the reasoning process of each sub-tag in the tag sequence, the video tag generation model is run on the server as an example. Fig.10 The method for generating video tags provided in the embodiment of the present application is implemented collaboratively by the terminal and the server.

[0104] In step 401, the client obtains a video sample carrying a real label sequence and multiple real reasoning processes in response to an upload operation on a video sample; wherein the real label sequence includes multiple real sub-labels, and there is a one-to-one correspondence between the real reasoning process and the real sub-label.

[0105] In actual implementation, the client may be a client set on a terminal, and the video sample may be triggered by the user based on the human-computer interaction interface of the client, thereby triggering the upload function item in the human-computer interaction interface so that the client presents a video selection interface on the human-computer interaction interface. The user (for example, an object or an artificial intelligence program operating on the client) uploads the video sample from the terminal based on the video selection interface, so that the client obtains the uploaded video sample. Here, the video sample uploaded from the terminal may be pre-stored locally in the terminal, or may be sent by other devices connected to the terminal for communication. This is not limited to the embodiments of the present application.

[0106] Step 402: The client sends a video sample carrying a true label sequence and a plurality of true reasoning processes to the server.

[0107] In step 403, the server inputs the received video samples carrying the real label sequence and multiple real reasoning processes into the initial video label generation model.

[0108] Step 404: output a prediction label sequence including a plurality of prediction sub-labels for the video sample and a prediction reasoning process for each prediction sub-label.

[0109] Step 405, obtain the difference between the predicted label sequence and the true label sequence, and the process difference between each reasoning process and the corresponding predicted reasoning process, and update the model parameters of the initial video label generation model based on the difference and the process difference to obtain the video label generation model.

[0110] In actual implementation, the server iterates the above training process until the loss function converges to complete the training of the video label generation model.

[0111] Step 406: The server generates a prompt message indicating that the video tag generation model training is completed.

[0112] Step 407: The server sends a prompt message to the client.

[0113] Step 408: The client obtains the video to be identified in response to the upload operation on the video to be identified.

[0114] It should be noted that the video to be identified may also be sent to the client by other devices that are communicatively connected to the terminal.

[0115] Step 409 : In response to the video tag generation instruction for the video to be identified, the client sends a video tag generation request carrying the video to be identified to the server.

[0116] In actual implementation, the video tag generation instruction for the video to be identified can be sent to the client by other devices connected to the terminal communication, or it can be generated by the user based on the client's human-computer interaction interface after triggering the corresponding confirmation function item, or it can be automatically generated by the client under certain trigger conditions. This embodiment of the present application does not limit this.

[0117] In step 410, the server inputs the received video to be identified into a video tag generation model to obtain a tag sequence including multiple sub-tags for the video to be identified, and an inference process for each sub-tag.

[0118] In step 411 , the server sends a tag sequence including multiple sub-tags for the video to be identified and an inference process for each sub-tag to the client.

[0119] In step 412, the client displays a tag sequence including multiple sub-tags for the video to be identified, and a reasoning process for each sub-tag.

[0120] In actual implementation, the client can display a label sequence including multiple sub-labels for the video to be identified and the reasoning process for each sub-label in the human-computer interaction interface of the client. The label sequence for the video to be identified and the corresponding reasoning process can also be saved locally on the terminal. The label sequence for the video to be identified and the corresponding reasoning process can also be sent to other devices that are communicatively connected to the terminal.

[0121] By using the above-mentioned embodiments of the present application, based on the extracted text features and image features of the video to be identified, the thought chain is used to gradually infer the label of the video to be identified, and multiple sub-labels of the video to be identified are obtained, thereby summarizing the multiple sub-labels to obtain a label sequence of the video to be identified. In this way, the label of the video to be identified is generated in combination with the image features and text features of the video to be identified. Compared with generating video labels based only on the image content of each frame image in the video, the video labels are generated based on more features of the video, which improves the accuracy of the generated video labels. At the same time, the thought chain is used to infer multiple sub-labels of the video to be identified, which improves the efficiency of generating multiple labels of the video, and further improves the accuracy of the generated video labels compared to directly generating a single label for the video.

[0122] The following is an explanation of an exemplary application of the embodiments of the present application in a practical application scenario.

[0123] The inventors found that in the process of video tag recognition, most of the related technologies directly predict the tag results based on the model, lacking the generation of the reasoning process, resulting in poor model interpretability. When the identified video tags are given to the operator for confirmation, the operator needs to carefully reconfirm which content in the video the tags are related to, which results in high labor costs. In addition, in order to achieve better video tag recognition effects, the scale of related models is getting larger and larger, resulting in higher inference costs for related models, and when tags are updated, the newly added tags need to be retrained to achieve recognition effects for the corresponding tags in the application.

[0124] Based on this, an embodiment of the present application proposes a video label generation method based on thought chain reasoning, by pre-training a large-scale text generation model (video text generation model) on video data, and then using the large-scale label generation model to automatically construct thought chain reasoning training data (video sample) for the video label data (initial video sample), and then using the constructed thought chain reasoning training data to train a smaller-scale video label thought chain reasoning generation model (video label generation model), so that when generating labels for the video to be identified, not only can the target label be generated, but also the reasoning process of the corresponding label is given, providing more explicit explanation for the operator. In addition, through the process of thought chain reasoning, the accuracy of the model generated labels can also be improved. At the same time, using a smaller-scale video label generation model, a more ideal label generation effect can be achieved, thereby reducing the model online reasoning cost.

[0125] Next, the video tag generation method based on thought chain reasoning provided by the embodiment of the present application is described. Fig.11 , Fig.11 This is a technical architecture diagram of a video tag generation method based on thought chain reasoning provided in an embodiment of the present application. Fig.11 The video label generation method based on thought chain reasoning provided in the embodiment of the present application is implemented by the process of automatically constructing thought chain reasoning training data as shown in 1101, the process of constructing a video label generation model based on the thought chain reasoning training data as shown in 1102, and the process of generating video identification labels based on the video label generation model as shown in 1103.

[0126] For the process of automatically constructing the training data of thought chain reasoning, a text generation model is trained through large-scale video data (as samples), so that the text generation model has good video field content generation capabilities. Then, K (an integer of K>1) video samples are sampled from the video data that have been labeled, such as K=20, and a thought chain reasoning example for each video sample is constructed by manual processing (i.e., K thought chain reasoning examples, i.e., K first video samples carrying real label sequences and multiple real reasoning processes), and input into the trained text generation model. At the same time, another video sample (second video sample) that has not been manually constructed for thought chain reasoning is input into the text generation model, and the model is reasoned according to the set reasoning instructions. Here, the reasoning instructions are used to instruct the text generation model to refer to the K thought chain reasoning examples to perform step-by-step reasoning operations on the labels, thereby generating label data with the thought chain reasoning process for the video data set that has been labeled. Exemplarily, when the sub-tags of the labeled video data are "financial management", "expert interview", and "finance", the label data with the thought chain reasoning process for the sub-tag "financial management" can be that the video to be identified mentions the method of maximizing asset returns, so the label is "financial management"; the label data with the thought chain reasoning process for the sub-tag "expert interview" can be that the video to be identified is an interview with a financial expert, so the label is "expert interview"; the label data with the thought chain reasoning process for the sub-tag "finance" can be that since the video related to financial management content is a financial video, the label is "finance".

[0127] It should be noted that for text generation models, see Fig.12 , Fig.12 is a structural diagram of a text generation model provided in an embodiment of the present application, based on Fig.12 The text generation model here includes a 72-layer conversion module, in which there are 32 attention heads in the conversion module, and the hidden layer width of the fully connected network layer is 18,000, and the vector dimension is 4,096, so the overall model parameter volume is about 13 billion. In this way, a larger-scale text generation model can be obtained by deepening the number of layers, widening the hidden layer width, and increasing the vector dimension. The training process of the text generation model specifically includes three stages. The first stage is training on general text. Specifically, by inputting the previous context of the general text into the text generation model, it predicts the text of the next sentence. In this way, through the first stage, the text generation model has general text generation capabilities.

[0128] For the second stage, specifically, continue training on the video data, where the video data includes features in the image dimension and the text dimension. The video is segmented into segments, such as 5s into a segment, and then the image features and text features of the first m (m is an integer greater than 0) segments of the video are combined with the image features and text features of the (m+1)th segment to predict the text of the (m+1)th segment. It should be noted that the text features of the video segment can be constructed through ASR (automatic speech recognition). The image features of the video segment are constructed by extracting the video frame images. Specifically, see Fig.13 , Fig.13 is a schematic diagram of a process for determining text features of a video clip provided in an embodiment of the present application, based on Fig.13 , by dividing each frame image into (p*p) blocks, each image is divided into multiple image blocks, and then each image block is flattened into a one-dimensional vector (the image features of each image block are reduced in dimension), and then a deep representation is constructed for each image block through a fully connected layer (similar to text tokenization and query word vectors), that is, the features of each image block are determined, and then the image features of the video clip are determined based on the features of each image block. In this way, after the second stage of training, the text generation model has a good generation effect in the text field, that is, it is adapted to the video field.

[0129] In the third stage, the text generation model is further trained based on the video label data. Specifically, the input features of the text generation model are the image features of the video and the text features of the video (such as the title, OCR text), and the prediction target of the text generation model is the label sequence of the video. In this way, after the third stage of training, the text generation model has a good ability to generate labels for videos. However, due to its large scale, if the text generation model is directly applied to the label generation or recognition of the video, the cost is high, and it also lacks the explanatory power for the video. Based on this, the trained text generation model is used to generate the corresponding thought chain reasoning process for the labeled video data. Specifically, see Fig.14 , Fig.14 is a schematic diagram of the generation of the thought chain reasoning process provided by the embodiment of the present application, based on Fig.14, sample k videos from the labeled video data, generally k = 20, and then construct the thought chain reasoning process for the labels of these k videos, such as manually writing the thought chain reasoning process for the labels of these k videos, and then use these k videos as input samples of the text generation model, that is, the thought chain reasoning examples, and perform model reasoning according to the set reasoning instructions. Here, the reasoning instructions are used to instruct the text generation model to refer to the thought chain reasoning process of the labels of the k videos, and perform step-by-step reasoning operations on the labels of the remaining labeled video data. In this way, the text generation model actively learns the relationship between the labels of each video and the corresponding reasoning process in the k thought chain reasoning examples, and generates the corresponding thought chain reasoning process for the labels of the remaining videos in the video label training data.

[0130] In some embodiments, the training of the text generation model is completed through the above-mentioned training process, so that the output of the text generation model includes the label of the video and the reasoning process of the label. At the same time, in order to improve the accuracy of the generated thinking chain reasoning process, the generated thinking chain reasoning process can also be filtered. Specifically, the label of the video output by the text generation model is compared with the real label of the corresponding video itself. When the comparison result represents that the final label generated by the text generation model prediction is inconsistent with the label annotated with the video, the thinking chain reasoning data of the corresponding video can be deleted (that is, when the comparison result represents multiple predicted sub-labels of the second video sample, which are inconsistent with the corresponding multiple real sub-labels, the real reasoning process corresponding to each real sub-label of the second video sample is deleted). In addition, in actual implementation, in order to improve the diversity of the thought chain reasoning process and make the thought chain reasoning process more in line with the diversity of different users' reasoning and understanding of the same thing, the text generation model can also be used in the stage of generating the thought chain reasoning decoding. The top k sampling strategy is adopted. Specifically, when generating the decoding at each step, sampling is performed among the top k candidates, that is, when generating the reasoning process of each sub-label, multiple candidate reasoning processes are generated, thereby generating a variety of thought chain reasoning data (the target number of candidate reasoning processes) for the video label.

[0131] In actual implementation, through the above process, the training of the text generation model is completed, and then the trained text generation model is used to construct the corresponding thought chain reasoning training data (video samples carrying real label sequences and multiple real reasoning processes) for the video label data set (initial video samples), and then the thought chain reasoning training data is used to train a smaller-scale video label thought chain reasoning generation model (video label generation model).

[0132] For the process of building a video label generation model based on the thought chain reasoning training data, see Fig.15 , Fig.15is a schematic diagram of constructing a video tag generation model based on thought chain reasoning training data provided by an embodiment of the present application, based on Fig.15 , the number of layers of the conversion module of the video label generation model is reduced to 24 layers compared to the text generation model, the vector dimension is 1024, the fully connected layer dimension is 4096, and the model parameter amount is about 500 million. Here, the process of constructing a video label generation model based on the thinking chain reasoning training data, that is, the training process of the video label generation model is divided into four stages. The first three stages are similar to the three training stages of the text generation model mentioned above. This is not described here. As for the fourth stage, specifically, based on the difference between the labels of the video data generated in the first three stages and the reasoning process for the labels, and the real labels of the video data itself and the real reasoning process for the real labels, the video label generation model is updated. In this way, through four stages of training, the video label generation model has the function of outputting the label of the video and the corresponding reasoning process based on the image features and text features of the input video to be identified.

[0133] For the process of generating video identification labels based on the video label generation model, after completing the training of the video label generation model through the above process, when generating labels for videos to be identified in actual applications, such as when a new video is uploaded to the video platform and requires identification labels, or when an existing video needs to be reviewed and re-identified, the video label generation model is used to extract image features from multiple frames of the video to be identified, and the image features of the video to be identified are obtained. The video to be identified is also subjected to text recognition to obtain the text features of the video to be identified, and then multiple labels of the video and the reasoning process of each label are output based on the image features and text features, so that the operator can make quick decisions based on the reasoning process and check whether the labels generated by the corresponding label generation model are accurate. In this way, compared with directly generating video labels based on large-scale text generation models, the thinking chain reasoning learning ensures the accuracy of label recognition while reducing the model scale, and also improves the interpretability of the model.

[0134] By using the above-mentioned embodiments of the present application, based on the extracted text features and image features of the video to be identified, the thought chain is used to gradually infer the label of the video to be identified, and multiple sub-labels of the video to be identified are obtained, thereby summarizing the multiple sub-labels to obtain a label sequence of the video to be identified. In this way, the label of the video to be identified is generated in combination with the image features and text features of the video to be identified. Compared with generating video labels based only on the image content of each frame image in the video, the video labels are generated based on more features of the video, which improves the accuracy of the generated video labels. At the same time, the thought chain is used to infer multiple sub-labels of the video to be identified, which improves the efficiency of generating multiple labels of the video, and further improves the accuracy of the generated video labels compared to directly generating a single label for the video.

[0135] The following is a description of an exemplary structure of the video tag generation device 455 provided in the embodiment of the present application implemented as a software module. In some embodiments, for example, Figure 2 As shown, the software modules stored in the video tag generation device 455 of the memory 450 may include:

[0136] The feature extraction module 4551 is used to extract image features from multiple frames of the video to be identified to obtain image features of the video to be identified, and to perform text recognition on the video to be identified to obtain text features of the video to be identified;

[0137] The reasoning module 4552 is used to use a thought chain to gradually reason the label of the video to be identified based on the image features and the text features to obtain multiple sub-labels of the video to be identified; wherein the thought chain includes multiple label reasoning steps, and each label reasoning step is used to infer one of the sub-labels;

[0138] The summarizing module 4553 is used to summarize the multiple sub-tags to obtain the tag sequence of the video to be identified.

[0139] In some embodiments, the feature extraction module 4551 is also used to perform the following processing on each of the frame images: segment the frame image into blocks to obtain at least two image blocks, each of which has the same size; based on each of the image blocks, extract image features of the frame image to obtain image features of the frame image; based on the image features of each of the frame images, determine the image features of the video to be identified.

[0140] In some embodiments, the feature extraction module 4551 is also used to extract features from pixel points in each of the image blocks respectively to obtain pixel features of each pixel point in the image block, and to perform feature splicing on the pixel features of each pixel point to obtain image features of the image block; perform dimensionality reduction processing on the image features of each of the image blocks to obtain target image features of each of the image blocks; and perform feature splicing on the target image features of each of the image blocks to obtain image features of the frame image.

[0141] In some embodiments, the feature extraction module 4551 is also used to segment the video to be identified to obtain at least two video segments, each of which has the same duration; perform speech recognition on each of the video segments to obtain a speech text of each of the video segments, and perform feature extraction on the speech text of each of the video segments to obtain text features of each of the video segments; and perform feature splicing on the text features of each of the video segments to obtain text features of the video to be identified.

[0142] In some embodiments, the multiple label inference steps are connected in series, and the inference module 4552 is also used to use the first label inference step in the thinking chain, combined with the image features and the text features, to infer the label of the video to be identified, and obtain a first label; for the mth label inference step in the thinking chain, combined with the image features, the text features, and the labels inferred by each label inference step before the mth label inference step, the label of the video to be identified is inferred to obtain the mth label; wherein m is a positive integer greater than 1, and m is less than or equal to the number of the multiple label inference steps; the m is traversed to obtain multiple sub-labels of the video to be identified.

[0143] In some embodiments, the reasoning module 4552 is also used to adopt the image label reasoning step in the thinking chain to infer the label of the video to be identified based on the image features, and obtain at least one image sub-label of the video to be identified; adopt the text label reasoning step in the thinking chain to infer the label of the video to be identified based on the text features, and obtain at least one text sub-label of the video to be identified; adopt the comprehensive label reasoning step in the thinking chain to combine the at least one image sub-label and the at least one text sub-label to infer the label of the video to be identified, and obtain at least one comprehensive sub-label of the video to be identified.

[0144] In some embodiments, the video to be identified includes multiple video clips, each of which forms a video clip sequence, and the inference module 4552 is further used to obtain image features and text features corresponding to each of the video clips based on the image features and the text features; predict the label of the nth video clip based on the image features and text features of the nth video clip in the video clip sequence, and the image features and text features of each video clip before the nth video clip in the video clip sequence; wherein n is a positive integer greater than 1, and n is less than or equal to the number of video clips in the video clip sequence; and traverse n to obtain multiple sub-labels of the video to be identified.

[0145] In some embodiments, the device further includes an output module, which is used to obtain the reasoning process for each of the sub-tags; output the label sequence of the video to be identified, and the reasoning process of each of the sub-tags in the label sequence.

[0146] In some embodiments, the method is applied to a video label generation model, which includes a text feature extraction layer, an image feature extraction layer, an inference layer and an output layer. The feature extraction module 4551 is also used to perform image feature extraction on multiple frames of images of the video to be identified through the image feature extraction layer to obtain the image features of the video to be identified, and to perform text recognition on the video to be identified through the text feature extraction layer to obtain the identification text corresponding to the video to be identified, and to perform feature extraction on the identification text to obtain the text features of the video to be identified; the inference module 4552 is also used to use the inference layer to use a thinking chain to gradually infer the label of the video to be identified based on the image features and the text features to obtain multiple sub-labels of the video to be identified; the summary module 4553 is also used to summarize the multiple sub-labels through the output layer to obtain a label sequence of the video to be identified.

[0147] In some embodiments, the device also includes a training module, which is used to obtain an initial video label generation model and a video sample carrying a real label sequence; wherein the real label sequence includes multiple real sub-labels of the video sample; through the image feature extraction layer, image feature extraction is performed on multiple frames of images of the video sample to obtain training image features of the video sample, and through the text feature extraction layer, text recognition is performed on the video sample to obtain training recognition text corresponding to the video sample, and feature extraction is performed on the training recognition text to obtain training text features of the video sample; through the inference layer, based on the training image features and the training text features, the label of the video sample is gradually inferred using a thinking chain to obtain multiple predicted sub-labels of the video sample; through the output layer, the multiple predicted sub-labels are summarized to obtain a predicted label sequence of the video sample; the difference between the predicted label sequence and the real label sequence is obtained, and based on the difference, the model parameters of the initial video label generation model are updated to obtain a video label generation model.

[0148] In some embodiments, the device also includes an acquisition module, which is used to acquire the reasoning process for each of the sub-labels; the training module is also used to acquire an initial video label generation model, and a video sample carrying a real label sequence and multiple real reasoning processes; wherein the real reasoning process and the real sub-label have a one-to-one correspondence; the device also includes a determination module, which is used to output the predicted reasoning process for each of the predicted sub-labels through the output layer; determine the process difference between each of the reasoning processes and the corresponding predicted reasoning process; the training module is also used to update the model parameters of the initial video label generation model in combination with the difference and the process difference to obtain a video label generation model.

[0149] The embodiment of the present application provides a computer program product, which includes computer executable instructions, which are stored in a computer-readable storage medium. A processor of an electronic device reads the computer executable instructions from the computer-readable storage medium, and the processor executes the computer executable instructions, so that the electronic device executes the method for generating video tags described in the embodiment of the present application.

[0150] The embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the processor will execute the method for generating a video tag provided in the embodiment of the present application, for example, Figure 3 The method for generating video tags is shown.

[0151] In some embodiments, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disk, or a CD-ROM; or it may be various devices including one or any combination of the above memories.

[0152] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0153] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file storing other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0154] As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.

[0155] In summary, the embodiments of the present application have the following beneficial effects:

[0156] (1) The label of the video to be identified is generated by combining the image features and text features of the video to be identified. Compared with generating video labels based only on the image content of each frame in the video, the video labels are generated based on more features of the video, which improves the accuracy of the generated video labels. At the same time, the thinking chain is used to infer multiple sub-labels of the video to be identified, which improves the efficiency of generating multiple labels of the video. In addition, compared with directly generating a single label of the video, the accuracy of the generated video label is further improved.

[0157] (2) This application can improve the interpretability of the video tag recognition process. When the generated video tags are given to operators for confirmation, the operators need to carefully reconfirm which content in the video the tags are related to, which leads to high labor costs and low efficiency of video tagging. By providing the reasoning process of the corresponding tags when generating each tag, the operators can review the corresponding tags in combination with the reasoning process when reviewing the tags, thereby enhancing the interpretability of the tags, greatly reducing the cost of understanding, and improving the efficiency of video tagging. In addition, the computational cost of machine recognition tags can be reduced, providing more accurate tags for video recognition, and providing better tags for video retrieval and recommendation.

[0158] (3) Through this application, the interpretability of video label recognition can be improved, while the computational cost of video label recognition can be reduced. First, a large-scale video text generation model is pre-trained using video data, and then the video text generation model is used to automatically construct thought chain reasoning training data for the video data that has been labeled, and thought chain diversity generation is performed to enhance the thought chain reasoning label data. After the thought chain reasoning video label data is constructed, a small-scale label generation model based on thought chain reasoning is trained. When it is necessary to generate labels for videos, this smaller-scale video label generation model with thought chain reasoning capabilities is used to generate labels for each video data, and the corresponding reasoning process is also given, providing more intuitive interpretability for video platform operators, improving the efficiency of video label operation, and reducing the inference cost of the video label model.

[0159] (4) For each true sub-label, multiple reasoning processes are selected to improve the diversity of reasoning understanding for the corresponding true sub-label.

[0160] It should be noted that in the embodiments of the present application, it involves obtaining relevant data such as the video to be identified that is pre-stored locally in the terminal and collecting the video to be identified in real time through the camera of the terminal. When the embodiments of the present application are applied to specific products or technologies, it is necessary to obtain user permission or consent, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0161] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A method for generating a video tag, characterized in that: The method comprises: Performing image feature extraction on multiple frames of the video to be identified to obtain image features of the video to be identified, and performing text recognition on the video to be identified to obtain text features of the video to be identified; Based on the image features and the text features, a thought chain is used to gradually infer the label of the video to be identified, so as to obtain a plurality of sub-labels of the video to be identified; The thought chain includes a plurality of label reasoning steps, and each label reasoning step is used to infer one of the sub-labels; A plurality of the sub-tags are aggregated to obtain a tag sequence of the video to be identified.

2. The method according to claim 1, characterized in that The step of extracting image features from multiple frames of the video to be identified to obtain image features of the video to be identified includes: The following processing is performed on each of the frame images: dividing the frame image into blocks to obtain at least two image blocks, each of which has the same size; extracting image features from the frame image based on each of the image blocks to obtain image features of the frame image; Based on the image features of each of the frame images, the image features of the video to be identified are determined.

3. The method according to claim 2, characterized in that The step of extracting image features from the frame image based on each of the image blocks to obtain image features of the frame image includes: Extracting features from the pixels in each of the image blocks respectively to obtain pixel features of each pixel in the image block, and performing feature splicing on the pixel features of each of the pixel points to obtain image features of the image block; Performing dimensionality reduction processing on the image features of each of the image blocks to obtain target image features of each of the image blocks; Feature splicing is performed on the target image features of each of the image blocks to obtain the image features of the frame image.

4. The method according to claim 1, characterized in that The performing text recognition on the video to be recognized to obtain text features of the video to be recognized includes: Segmenting the video to be identified to obtain at least two video segments, each of which has the same duration; Performing speech recognition on each of the video clips to obtain a speech text of each of the video clips, and performing feature extraction on the speech text of each of the video clips to obtain a text feature of each of the video clips; The text features of each of the video clips are spliced ​​to obtain the text features of the video to be identified.

5. The method according to claim 1, characterized in that The multiple label reasoning steps are connected in series, and based on the image features and the text features, the labels of the video to be identified are gradually inferred using a thinking chain to obtain multiple sub-labels of the video to be identified, including: Using the first label reasoning step in the thought chain, combining the image features and the text features, the label of the video to be identified is inferred to obtain a first label; For the mth label inference step in the thought chain, combining the image features, the text features, and the labels inferred by the label inference steps before the mth label inference step, infer the label of the video to be identified to obtain the mth label; Wherein, m is a positive integer greater than 1, and m is less than or equal to the number of the plurality of label inference steps; The m is traversed to obtain multiple sub-tags of the video to be identified.

6. The method according to claim 1, characterized in that Based on the image features and the text features, the label of the video to be identified is gradually inferred by using a thinking chain to obtain multiple sub-labels of the video to be identified, including: Using the image label reasoning step in the thought chain, the label of the video to be identified is inferred based on the image features to obtain at least one image sub-label of the video to be identified; Using the text label reasoning step in the thought chain, the label of the video to be identified is inferred based on the text feature to obtain at least one text sub-label of the video to be identified; The comprehensive label reasoning step in the thought chain is adopted to combine the at least one image sub-label and the at least one text sub-label to reason about the label of the video to be identified, so as to obtain at least one comprehensive sub-label of the video to be identified.

7. The method according to claim 1, characterized in that The video to be identified includes a plurality of video clips, each of which forms a video clip sequence. Based on the image features and the text features, the label of the video to be identified is gradually inferred by using a thinking chain to obtain a plurality of sub-labels of the video to be identified, including: Based on the image features and the text features, acquiring image features and text features corresponding to each of the video clips; Predicting a label of the nth video segment based on image features and text features of the nth video segment in the video segment sequence and image features and text features of each video segment before the nth video segment in the video segment sequence; Wherein, n is a positive integer greater than 1, and n is less than or equal to the number of video segments in the video segment sequence; The n is traversed to obtain multiple sub-labels of the video to be identified.

8. The method according to claim 1, characterized in that After the plurality of sub-tags are aggregated to obtain the tag sequence of the video to be identified, the method further includes: Obtaining the reasoning process for each of the sub-tags; Output the label sequence of the video to be identified and the reasoning process of each sub-label in the label sequence.

9. The method according to claim 1, characterized in that The method is applied to a video tag generation model, which includes a text feature extraction layer, an image feature extraction layer, an inference layer, and an output layer. The method extracts image features from multiple frames of a video to be identified to obtain image features of the video to be identified, and performs text recognition on the video to be identified to obtain text features of the video to be identified, including: Through the image feature extraction layer, image feature extraction is performed on multiple frames of the video to be identified to obtain image features of the video to be identified, and through the text feature extraction layer, text recognition is performed on the video to be identified to obtain identification text corresponding to the video to be identified, and feature extraction is performed on the identification text to obtain text features of the video to be identified; Based on the image features and the text features, the label of the video to be identified is gradually inferred by using a thinking chain to obtain multiple sub-labels of the video to be identified, including: Through the reasoning layer, based on the image features and the text features, a thought chain is used to gradually reason the label of the video to be identified, so as to obtain a plurality of sub-labels of the video to be identified; The step of aggregating the plurality of sub-tags to obtain a tag sequence of the video to be identified includes: Through the output layer, the multiple sub-labels are summarized to obtain a label sequence of the video to be identified.

10. The method according to claim 9, characterized in that Before extracting image features from multiple frames of the video to be identified through the image feature extraction layer to obtain image features of the video to be identified, the method further includes: Acquire an initial video label generation model and a video sample carrying a real label sequence; wherein the real label sequence includes multiple real sub-labels of the video sample; By means of the image feature extraction layer, image feature extraction is performed on multiple frames of images of the video sample to obtain training image features of the video sample, and by means of the text feature extraction layer, text recognition is performed on the video sample to obtain training recognition text corresponding to the video sample, and feature extraction is performed on the training recognition text to obtain training text features of the video sample; Through the inference layer, based on the training image features and the training text features, the labels of the video samples are gradually inferred using a chain of thought to obtain a plurality of predicted sub-labels of the video samples; Aggregating the plurality of predicted sub-labels through the output layer to obtain a predicted label sequence of the video sample; The difference between the predicted label sequence and the true label sequence is obtained, and based on the difference, the model parameters of the initial video label generation model are updated to obtain the video label generation model.

11. The method according to claim 10, characterized in that After the output layer is used to aggregate the plurality of sub-tags to obtain a tag sequence of the video to be identified, the method further includes: Obtaining the reasoning process for each of the sub-tags; The obtaining of the initial video label generation model and the video samples carrying the real label sequence includes: Obtaining an initial video label generation model and video samples carrying a real label sequence and multiple real reasoning processes; wherein the real reasoning process and the real sub-label have a one-to-one correspondence; The method further comprises: Outputting the prediction reasoning process for each of the prediction sub-labels through the output layer; determining a process difference between each of the reasoning processes and a corresponding predictive reasoning process; The updating of the model parameters of the initial video tag generation model based on the difference to obtain the video tag generation model includes: In combination with the difference and the process difference, the model parameters of the initial video label generation model are updated to obtain a video label generation model.

12. A device for generating a video tag, characterized in that: The device comprises: A feature extraction module is used to extract image features from multiple frames of a video to be identified to obtain image features of the video to be identified, and to perform text recognition on the video to be identified to obtain text features of the video to be identified; An inference module, used to use a chain of thought to gradually infer the label of the video to be identified based on the image features and the text features, so as to obtain a plurality of sub-labels of the video to be identified; wherein the chain of thought includes a plurality of label inference steps, and each label inference step is used to infer one of the sub-labels; The aggregation module is used to aggregate the multiple sub-tags to obtain a tag sequence of the video to be identified.

13. An electronic device, characterized in that: include: A memory for storing computer executable instructions; The processor is configured to implement the method for generating a video tag according to any one of claims 1 to 11 when executing the computer executable instructions stored in the memory.

14. A computer-readable storage medium, characterized in that: Computer executable instructions are stored, which are used to cause a processor to execute and implement the method for generating a video tag according to any one of claims 1 to 11.

15. A computer program product comprising computer executable instructions, characterized in that: When the computer executable instructions are executed by a processor, the method for generating a video tag according to any one of claims 1 to 11 is implemented.

Citation Information

Cited By

  • Data annotation system with fast system and slow system cooperatively working

    CN119670739A

  • A data labeling system for a speed and slow system to work together

    CN119670739B