Method, device and equipment for generating training samples of video scene classification model
By extracting the features of video and image frames and generating training samples, it solves the problem of subjective influence in manually determining video scene classification and achieves more accurate and efficient video scene classification.
Patent Information
- Application Number
- CN202210116155.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-28
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-01-28
AI Technical Summary
In the existing technology, manual determination of the scene to which a video belongs is affected by subjective consciousness, resulting in inaccurate scene classification results and low efficiency.
By obtaining continuous image frames of the video, video features and image scene features are extracted, and training samples are generated, which are used to train the video scene classification model to achieve automated scene classification.
It improves the accuracy of scene classification results, reduces manual intervention, and improves the efficiency of video scene classification.
Smart Images

Figure CN114461853B
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, device and equipment for generating training samples of a video scene classification model. Background Art
[0002] After users upload videos, they can be placed in different partitions based on the scenes they belong to.
[0003] In the related art, after obtaining the video uploaded by the user, the video is manually reviewed to determine whether the video meets the specifications of the video delivery platform, and the scene to which the video belongs is determined based on the specific content of the video, and the video is then delivered to the appropriate scene partition.
[0004] However, in the above-mentioned related technologies, the scene to which the video belongs is determined manually, which is affected by human subjective consciousness and the scene classification result is inaccurate. Summary of the invention
[0005] The embodiment of the present application provides a method, device and apparatus for generating training samples of a video scene classification model, which can improve the accuracy of scene classification results and improve the efficiency of video scene classification. The technical solution is as follows.
[0006] According to one aspect of an embodiment of the present application, a method for generating training samples of a video scene classification model is provided, the method comprising the following steps:
[0007] Acquire a sample video, where the sample video includes a plurality of continuous sample image frames;
[0008] Performing video feature extraction on each of the sample image frames to obtain video features corresponding to each of the sample image frames, wherein the video features are used to describe features included in the sample image frames and change features between the sample image frames and associated sample image frames; wherein the associated sample image frames refer to image frames in the sample video that have an associated relationship with the sample image frames;
[0009] Extracting scene features from each of the sample image frames to obtain image scene features corresponding to each of the sample image frames; wherein the image scene features are used to describe the scene to which the sample image frame belongs;
[0010] According to the video features corresponding to each of the sample image frames, and the image scene features corresponding to each of the sample image frames, training samples corresponding to the sample videos are generated; wherein the training samples are used to train a video scene classification model, and the video scene classification model is used to identify the scene to which the video belongs.
[0011] According to one aspect of an embodiment of the present application, a method for classifying video scenes is provided, the method comprising the following steps:
[0012] Acquire a video to be processed, wherein the video includes a plurality of continuous image frames;
[0013] Performing video feature extraction on each of the image frames to obtain video features corresponding to each of the image frames, wherein the video features are used to describe features contained in the image frame and change features between the image frame and associated image frames; wherein the associated image frame refers to an image frame that has an associated relationship with the image frame in the video;
[0014] Extracting scene features from each of the image frames to obtain image scene features corresponding to each of the image frames; wherein the image scene features are used to describe the scene to which the image frame belongs;
[0015] The scene to which the video belongs is determined according to the video features corresponding to each of the image frames and the image scene features corresponding to each of the image frames.
[0016] According to one aspect of an embodiment of the present application, a training sample generation device for a video scene classification model is provided, the device comprising the following modules:
[0017] A sample acquisition module, used to acquire a sample video, wherein the sample video includes a plurality of continuous sample image frames;
[0018] A video extraction module is used to extract video features from each of the sample image frames to obtain video features corresponding to each of the sample image frames, wherein the video features are used to describe features included in the sample image frames and change features between the sample image frames and associated sample image frames; wherein the associated sample image frames refer to image frames in the sample video that have an associated relationship with the sample image frames;
[0019] A scene extraction module, used to extract scene features from each of the sample image frames to obtain image scene features corresponding to each of the sample image frames; wherein the image scene features are used to describe the scene to which the sample image frame belongs;
[0020] A sample generation module is used to generate training samples corresponding to the sample video according to the video features corresponding to each of the sample image frames and the image scene features corresponding to each of the sample image frames; wherein the training samples are used to train a video scene classification model, and the video scene classification model is used to identify the scene to which the video belongs.
[0021] According to one aspect of an embodiment of the present application, a video scene classification device is provided, the device comprising the following modules:
[0022] A video acquisition module, used to acquire a video to be processed, wherein the video includes a plurality of continuous image frames;
[0023] A video processing module, used to extract video features from each of the image frames to obtain video features corresponding to each of the image frames, wherein the video features are used to describe features contained in the image frame and change features between the image frame and associated image frames; wherein the associated image frame refers to an image frame that has an associated relationship with the image frame in the video;
[0024] An image processing module, used to extract scene features from each of the image frames to obtain image scene features corresponding to each of the image frames; wherein the image scene features are used to describe the scene to which the image frame belongs;
[0025] The scene determination module is used to determine the scene to which the video belongs according to the video features corresponding to each of the image frames and the image scene features corresponding to each of the image frames.
[0026] According to one aspect of an embodiment of the present application, an embodiment of the present application provides a computer device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the training sample generation method of the above-mentioned video scene classification model, or to implement the above-mentioned video scene classification method.
[0027] According to one aspect of an embodiment of the present application, an embodiment of the present application provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the training sample generation method of the above-mentioned video scene classification model, or to implement the above-mentioned video scene classification method.
[0028] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the training sample generation method of the video scene classification model, or implements the classification method of the video scene.
[0029] The technical solution provided in the embodiments of the present application can bring the following beneficial effects:
[0030] Training samples for a video scene classification model are generated through the video features corresponding to each sample image frame and the image scene features corresponding to each sample image frame. The video scene classification model is used to identify the scene to which the video belongs, thereby providing an automated scene classification mode for the video, improving the accuracy of the scene classification results, avoiding the influence of artificial subjective consciousness on the video scene classification, reducing artificial constraints on the scene classification, and improving the efficiency of the video scene classification. Moreover, based on the association between the sample image frames in the sample video, video features are extracted from the sample image frames to obtain the video features corresponding to the sample image frames, and scene features are extracted from the sample image frames to obtain the image scene features corresponding to the sample image frames. The image scene features are combined with the video features to generate training samples for the video scene classification model, so that the video scene classification model can learn video features in units of sample videos and image scene features in units of individual sample image frames during the training process, thereby improving the accuracy of the video scene classification model. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0032] Figure 1 is a schematic diagram of a training system for a video scene classification model provided by an embodiment of the present application;
[0033] Figure 2 A schematic diagram of a training system for a video scene classification model is exemplarily shown;
[0034] Figure 3 is a schematic diagram of a video scene classification system provided by an embodiment of the present application;
[0035] Figure 4 A schematic diagram of a video scene classification system is exemplarily shown;
[0036] Figure 5 It is a flowchart of a method for generating training samples of a video scene classification model provided by an embodiment of the present application;
[0037] Figure 6 A schematic diagram exemplarily shows a method for obtaining input data;
[0038] Figure 7A schematic diagram exemplarily shows a method for obtaining scene classification labels;
[0039] Figure 8 A schematic diagram exemplarily shows another method of obtaining scene classification labels;
[0040] Fig. 9 A schematic diagram showing an exemplary training process of a video scene recognition model;
[0041] Fig.10 A schematic diagram showing an exemplary training process of an image scene recognition model;
[0042] Fig.11 is a flowchart of a method for generating training samples for a video scene classification model provided by another embodiment of the present application;
[0043] Fig.12 is a flow chart of a method for classifying video scenes provided by an embodiment of the present application;
[0044] Fig.13 A schematic diagram showing a main scene and a secondary scene of a video is exemplified;
[0045] Fig.14 A schematic diagram of a video scene classification system is exemplarily shown;
[0046] Fig.15 It is a block diagram of a training sample generating device for a video scene classification model provided by one embodiment of the present application;
[0047] Fig.16 is a block diagram of a training sample generating device for a video scene classification model provided by another embodiment of the present application;
[0048] Fig.17 is a block diagram of a video scene classification device provided by an embodiment of the present application;
[0049] Fig.18 is a block diagram of a video scene classification device provided by another embodiment of the present application;
[0050] Fig.19 It is a structural block diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0052] The training sample generation method of the video scene classification model and the video scene classification method in this application involve the following technologies:
[0053] 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.
[0054] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0055] Computer vision technology (CV) is a science that studies how to make machines "see". To put it more specifically, it refers to the use of cameras and computers to replace human eyes to identify, track and measure targets, and further perform image processing to make computer processing into images that are more suitable for human eye observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR (Optical Character Recognition), video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D (3-dimension) technology, virtual reality, augmented reality, simultaneous positioning and mapping, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.
[0056] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning.
[0057] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, etc. I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0058] The solution provided in the embodiments of the present application involves technologies such as machine learning of artificial intelligence. Below, the technical solution of the present application is introduced and explained in conjunction with several embodiments.
[0059] Please refer to Figure 1 , which shows a schematic diagram of a training system for a video scene classification model provided by an embodiment of the present application. The training system for the video scene classification model may include: a first device 10 and a second device 20.
[0060] The first device 10 is used to provide data required for model training. Optionally, the first device 10 is any device with data collection and data upload functions, such as a mobile phone, a tablet computer, a game console, an e-book reader, a multimedia playback device, a wearable device, a PC (Personal Computer), an intelligent voice interaction device, a smart home appliance, a vehicle terminal, a client backend server and other electronic devices, which are not limited in the present embodiment of the application.
[0061] The second device 20 is used for training the model. Optionally, the second device 20 may be a server, a computer device, a PC or other electronic device, which is not limited in the present embodiment of the application. The server may be a single server, a server cluster consisting of multiple servers, or a cloud computing service center.
[0062] The first device 10 and the second device 20 perform data transmission via a network.
[0063] Optionally, in the embodiment of the present application, the above model refers to a video scene classification model. The video scene classification model is used to identify the scene to which the video belongs. It should be noted that in the embodiment of the present application, the scene can be an actual scene, such as a classroom, an office, a study, etc.; or, the scene can also be a virtual scene, such as a virtual environment, a virtual battlefield, a virtual restaurant, etc.
[0064] For example, Figure 2As shown, the first device 10 screens candidate sample videos from a video database, determines the candidate sample videos whose playback times are greater than a threshold value as sample videos, and provides the sample videos to the second device 20. The sample video includes multiple continuous sample image frames. Correspondingly, after acquiring the sample video, the second device 20 extracts video features from each sample image frame based on the association relationship between the multiple sample image frames in the sample video, and obtains video features corresponding to each sample image frame. The video features are used to describe the features contained in the sample image frame, as well as the change features between the sample image frame and the associated sample image frame; the associated sample image frame refers to an image frame that has an association relationship with the sample image frame in the sample video. Moreover, after acquiring the above-mentioned sample video, the second device 20 extracts scene features from each sample image frame in the sample video, and obtains image scene features corresponding to each sample image frame. The image scene features are used to describe the scene to which the sample image frame belongs. Afterwards, the video features corresponding to the sample image frames and the image scene features corresponding to the sample image frames are spliced to obtain the spliced features corresponding to the sample image frames, and the spliced features corresponding to each sample image frame constitute the input data of the sample video for the video scene classification model. Moreover, after obtaining the above-mentioned video features and the above-mentioned image scene features, the second device 20 determines the first scene label of the sample video based on the video features corresponding to each sample image frame, and the first scene label is used to indicate the candidate scene to which the sample video belongs; based on the image scene features corresponding to each sample image frame, the second scene label is determined to indicate the scene to which the sample image frame belongs; and then, based on the first scene label and the second scene label corresponding to each sample image frame, the scene classification label of the sample video is determined. Afterwards, a training sample is composed of the input data corresponding to a sample video and the scene classification label, and the training sample is sampled to train the video scene classification model.
[0065] Optionally, the first device 10 and the second device 20 may be the same device or different devices, which is not limited in the embodiment of the present application.
[0066] One thing that needs to be explained is that the above Figure 2 The introduction is only exemplary and explanatory. In an exemplary embodiment, the functions of the first device 10 and the second device 20 can be flexibly set and adjusted, and the embodiments of the present application are not limited to this.
[0067] Please refer to Figure 3 , which shows a schematic diagram of a video scene classification system provided by an embodiment of the present application. The video scene classification system may include: a terminal 30 and a server 40.
[0068] The terminal 30 includes but is not limited to electronic devices such as mobile phones, tablet computers, game consoles, e-book readers, multimedia playback devices, wearable devices, PCs, intelligent voice interaction devices, smart home appliances, and vehicle-mounted terminals. The terminal 30 may include a client of an application. Optionally, the application may be any application with a video playback function. Among them, the application may be an application that needs to be downloaded and installed, or it may be an application that can be used immediately after clicking, which is not limited in the embodiments of the present application.
[0069] The server 40 is used to provide background services for the terminal 30. The server 40 can be a single server, or a server cluster consisting of multiple servers, or a cloud computing service center. Optionally, the server 40 can be a background server of the client of the above application. In an exemplary embodiment, the server 40 provides background services for multiple terminals 30.
[0070] The terminal 30 and the server 40 communicate with each other via a network.
[0071] Optionally, in the embodiment of the present application, the server 40 provides a video scene classification function for the terminal 30. For example, Figure 4 As shown, after the terminal 30 obtains the video uploaded by the user, it sends the video to the server 40. Further, the server 40 processes the video through the video scene classification model, obtains the scene to which the video belongs, and sends the scene to which the video belongs to the terminal 30. Afterwards, the terminal 30 determines the partition to which the video belongs according to the scene to which the video belongs. Among them, the above-mentioned video scene classification model includes a video feature extraction section, an image feature extraction section, a feature stitching section and a scene determination section. Optionally, when the server 40 processes the video using the video scene classification model, based on the video feature extraction section, the video features corresponding to each image frame in the video are obtained; based on the image feature extraction section, the image scene features corresponding to each image frame in the video are obtained; based on the feature stitching section, the video features and the image scene features are stitched to obtain the stitched scene features corresponding to each image frame; based on the scene determination section, the scene to which the video belongs is determined according to the stitched scene features corresponding to each image frame.
[0072] Optionally, the server 40 and Figure 1 The second device 20 in the embodiment may be the same device, which is not limited in the embodiment of the present application.
[0073] One thing that needs to be explained is that the above Figure 4 The introduction is only exemplary and explanatory. In the exemplary embodiment, the functions of the terminal 30 and the server 40 can be flexibly set and adjusted, and the embodiments of the present application are not limited to this.
[0074] Please refer to Figure 5 , which shows a flow chart of a method for generating training samples of a video scene classification model provided by an embodiment of the present application. The method can be applied to Figure 1 The second device 20 of the training system of the video scene classification model shown in the figure, such as the execution subject of each step can be the second device 20 (hereinafter referred to as "computer device"). The method may include at least one of the following steps (501-504):
[0075] Step 501, obtaining a sample video.
[0076] A sample video refers to a video used to generate a training sample. Optionally, one sample video corresponds to one training sample. The sample video includes a plurality of continuous sample image frames. In an embodiment of the present application, the computer device obtains a sample video before generating a training sample for a video scene classification model.
[0077] Optionally, the sample video may be any video; or, the sample video may be a video that meets the screening condition. The screening condition includes but is not limited to at least one of the following: the number of times played is greater than a first threshold value, the click rate is greater than a second threshold value, the video has a scene tag, and the total playing time is greater than a third threshold value, etc., which is not limited in the embodiment of the present application.
[0078] Step 502 : extract video features from each sample image frame to obtain video features corresponding to each sample image frame.
[0079] In the embodiment of the present application, after acquiring the sample video, the computer device extracts video features from each sample image frame in the sample video to obtain video features corresponding to each sample image frame. The video features are used to describe the features contained in the sample image frame and the change features between the sample image frame and the associated sample image frame; the associated sample image frame refers to an image frame that has an associated relationship with the sample image frame in the sample video.
[0080] Optionally, the basis for determining the above association relationship includes but is not limited to at least one of the following: playback order, image similarity, entity information, etc.
[0081] In a possible implementation, the association relationship is determined in the above-mentioned playback order. Optionally, after obtaining the above-mentioned sample video, the computer device obtains the playback order of each sample image frame in the sample video, and determines the sample image frames with adjacent playback orders as sample image frames with an association relationship. The sample image frames with adjacent playback orders may be a fixed number of sample image frames; or, the sample image frames with adjacent playback orders may be sample image frames within a fixed duration, and the fixed duration may be determined based on the total playback duration of the sample video.
[0082] In another possible implementation, the association relationship is determined by the above-mentioned image similarity. Optionally, after acquiring the above-mentioned sample video, the computer device acquires the image similarity between the sample image frame and other image frames, and determines the sample image frames whose image similarity is less than the first threshold as sample image frames with an association relationship. Of course, in an exemplary embodiment, sample image frames whose image similarity is less than the second threshold and greater than the third threshold can also be determined as sample image frames with an association relationship, so that the sample image frames with an association relationship are similar image frames, and there are certain differences between each sample image frame to ensure the reliability of video feature extraction. Among them, the above-mentioned other sample image frames refer to image frames other than the sample image frames in the sample video.
[0083] In another possible implementation, the association relationship is determined by the entity information. Optionally, after acquiring the sample video, the computer device acquires the entity information contained in each sample image frame, and determines the sample image frames containing the same entity information as sample image frames with an association relationship, so that in the process of video feature extraction, based on the association relationship of multiple sample image frames in the sample video, a relatively complete entity motion trajectory can be obtained, thereby improving the reliability of video feature extraction.
[0084] Optionally, the features included in the sample image frame can be understood as basic features included in the sample image frame. Exemplarily, the basic features include but are not limited to at least one of the following: texture features, edge features, pixel features, etc., which are not limited in the present embodiment.
[0085] Optionally, the above-mentioned sample image frames may be all sample image frames in a sample video, or may be part of the sample image frames in a sample video, which is not limited in this embodiment of the present application.
[0086] Step 503: extract scene features from each sample image frame to obtain image scene features corresponding to each sample image frame.
[0087] In the embodiment of the present application, after acquiring the sample video, the computer device extracts image features from each sample image frame in the sample video to obtain image scene features corresponding to each sample image frame, wherein the image scene features are used to describe the scene to which the sample image frame belongs.
[0088] Optionally, the above-mentioned sample image frames may be all sample image frames in a sample video, or may be part of the sample image frames in a sample video.
[0089] In a possible implementation, the above-mentioned sample image frames are all sample image frames in the sample video. Optionally, after acquiring the above-mentioned sample video, the computer device performs frame processing on the sample video to obtain all sample image frames contained in the sample video, and then performs scene feature extraction on each sample image frame in all the sample image frames to obtain image scene features corresponding to each sample image frame. It should be noted that, in this case, the above-mentioned sample image frames used in the video feature extraction are all sample image frames in the sample video.
[0090] In another possible implementation, each of the sample image frames is a partial sample image frame in a sample video. Optionally, after acquiring the sample video, the computer device performs frame processing on the sample video to obtain all the sample image frames contained in the sample video, and then samples all the sample image frames to obtain partial sample image frames, and extracts scene features from each of the sample image frames in the partial sample image frames to obtain image scene features corresponding to each sample image frame. It should be noted that, in this case, each of the sample image frames used in the video feature extraction is a partial sample image frame in the sample video.
[0091] Optionally, in an embodiment of the present application, the above-mentioned image scene features include features of sample image frames for each scene.
[0092] It should be noted that the embodiment of the present application does not limit the execution order of the above step 502 and the above step 503. For example, the computer device may execute step 502 and step 503 at the same time; or, the computer device may execute step 502 first, and then execute step 503; or, the computer device may execute step 503 first, and then execute step 502.
[0093] Step 504: Generate training samples corresponding to the sample videos according to the video features corresponding to the sample image frames and the image scene features corresponding to the sample image frames.
[0094] In the embodiment of the present application, after acquiring the above video features and the above image scene features, the computer device generates training samples corresponding to the sample video according to the video features corresponding to each sample image frame and the image scene features corresponding to each sample image frame. The training samples are used to train the video scene classification model, and the video scene classification model is used to identify the scene to which the video belongs.
[0095] The detailed description of how to generate training samples is given below and will not be repeated here.
[0096] To summarize, in the technical solution provided in the embodiment of the present application, training samples for a video scene classification model are generated through the video features corresponding to each sample image frame and the image scene features corresponding to each sample image frame, and the video scene classification model is used to identify the scene to which the video belongs, thereby providing an automated scene classification mode for the video, improving the accuracy of the scene classification results, avoiding the influence of artificial subjective consciousness on the video scene classification, reducing artificial constraints on scene classification, and improving the efficiency of video scene classification; moreover, based on the association between the sample image frames in the sample video, video features are extracted from the sample image frames to obtain the video features corresponding to the sample image frames, and scene features are extracted from the sample image frames to obtain the image scene features corresponding to the sample image frames, and the image scene features are combined with the video features to generate training samples for the video scene classification model, so that the video scene classification model can learn video features in units of sample videos and image scene features in units of individual sample image frames during the training process, thereby improving the accuracy of the video scene classification model.
[0097] Next, the generation method of the above training samples is introduced.
[0098] Optionally, the training sample includes the input data of the sample video for the video scene classification model. In an exemplary embodiment, after acquiring the video features, the computer device splices the video features corresponding to the sample image frames and the image scene features corresponding to the sample image frames to obtain the spliced scene features corresponding to the sample image frames. The input data includes the spliced scene features corresponding to each sample image frame. Optionally, for the target sample image frame in each sample image frame, the video features corresponding to the target sample image frame and the image scene features corresponding to the target sample image frame are spliced to obtain the spliced scene features corresponding to the target sample image frame.
[0099] For example, Figure 6 As shown, the acquisition of the above input data is fully introduced. Assuming that the sample video includes n consecutive sample image frames, after obtaining the video features 61 corresponding to each sample image frame and the image scene features 62 corresponding to each sample image frame, the video features corresponding to the sample image frame and the image scene features corresponding to the sample image frame are spliced to obtain the spliced scene features corresponding to the sample image frame, and then the spliced scene features corresponding to each sample image frame form the input data 63 of the sample video for the video scene classification model. Among them, the above n is an integer greater than 1.
[0100] Optionally, the training sample includes a scene classification label of the sample video for the video scene classification model, and the scene classification label is used to indicate the scene to which the sample video belongs. In an exemplary embodiment, step 504 includes at least one of the following steps:
[0101] 1. Determine the first scene label of the sample video according to the video features corresponding to each sample image frame.
[0102] In the embodiment of the present application, after acquiring the above video features, the computer device determines the first scene label of the sample video according to the video features corresponding to each sample image frame, wherein the first scene label is used to indicate the candidate scene to which the sample video belongs.
[0103] Optionally, in the embodiment of the present application, after acquiring the above video features, the computer device determines the scene features of the sample video according to the video features corresponding to each sample image frame; further, based on the scene features of the sample video, the first scene label of the sample video is determined. The scene features of the sample video are used to describe the scene to which the sample video belongs.
[0104] Optionally, the first scene tag includes one or more scene tags, which is not limited in the embodiment of the present application.
[0105] 2. According to the image scene features respectively corresponding to at least one sample image frame, obtain a second scene label respectively corresponding to at least one sample image frame.
[0106] In an embodiment of the present application, after obtaining the above-mentioned image scene features, the computer device obtains the second scene tag corresponding to at least one sample image frame according to the image scene features corresponding to at least one sample image frame. The second scene tag is used to indicate the scene to which the sample image frame belongs. Optionally, one sample image frame corresponds to one scene, that is, one second scene tag includes one scene tag.
[0107] Optionally, the at least one sample image frame may be all sample image frames in the sample video, or may be part of the sample image frames in the sample video.
[0108] In a possible implementation, the at least one sample image frame is all sample image frames in the sample video. Optionally, after acquiring the image scene features, the computer device acquires features of the sample image frame for each scene from the image scene features corresponding to the sample image frame, and acquires the probability that the sample image frame belongs to each scene, and then determines the scene features of the sample image frame based on the features of the sample image frame for each scene and the probability that the sample image frame belongs to each scene, and determines the second scene label corresponding to the sample image frame based on the scene features of the sample image frame.
[0109] In another possible implementation, since the scene changes between sample image frames that are adjacent in the playback order in the sample video are small, in order to reduce the amount of calculation of the computer device, the above-mentioned at least one sample image frame is a partial sample image frame in the sample video. Optionally, after obtaining the above-mentioned image scene features, the computer device samples multiple sample image frames in the sample video according to the sampling time to obtain at least one sampled sample image frame. Among them, the sampling time can be flexibly set and adjusted according to actual conditions, and the embodiments of the present application are not limited to this. Afterwards, the computer device obtains the features of the sampled sample image frames for each scene from the image scene features corresponding to the sampled sample image frames, and obtains the probability that the sampled sample image frames belong to each scene, and then determines the scene features of the sampled sample image frames according to the features of the sampled sample image frames for each scene and the probability that the sampled sample image frames belong to each scene, and determines the second scene label corresponding to the sampled sample image frame based on the scene features of the sampled sample image frames.
[0110] Optionally, when acquiring the scene features of the sampled image frames, the computer device selects at least one feature of the target scene whose probability satisfies the first condition from the features of the sampled image frames for each scene based on the probability that the sampled image frames belong to each scene. Further, the features of each target scene are fused to obtain the scene features of the sampled image frames.
[0111] Optionally, the first condition is that the probability is greater than or equal to the first target value; or, the first condition is that the probability is ranked high.
[0112] In a possible implementation, the first condition is that the probability is greater than or equal to the first target value. Optionally, after obtaining the probability that the sampled sample image frame belongs to each scene, the computer device compares the probability that the sampled sample image frame belongs to each scene with the first target value. If the probability that the sampled sample image frame belongs to a certain scene is greater than or equal to the first target value, the scene is determined to be the target scene; if the probability that the sampled sample image frame belongs to a certain scene is less than the first target value, the scene is determined not to be the target scene.
[0113] In another possible implementation, the first condition is that the probability ranking is high. Optionally, after obtaining the probability that the sampled sample image frame belongs to each scene, the computer device sorts the scenes based on the probability of the sampled sample image frame belonging to each scene from high to low, and then determines the top m scenes as the target scene. Wherein, m is a positive integer.
[0114] Optionally, the fusion method for the features of each target scene may be average fusion or weighted average fusion.
[0115] In a possible implementation, the fusion method for the features of each target scene is average fusion. Optionally, after acquiring the features of each target scene, the computer device averages the features of each target scene to obtain the scene features of the sample image frame.
[0116] In another possible implementation, the fusion method for the features of each target scene is weighted average fusion. Optionally, after acquiring the features of each target scene, the computer device acquires the weights corresponding to each target scene, and then performs weighted average processing on the features of each target scene based on the weights corresponding to each target scene, so as to obtain the scene features of the sample image frame. Optionally, the weight of the target scene is positively correlated with the probability that the sample image frame belongs to the target scene.
[0117] 3. Determine a scene classification label of the sample video based on the first scene label and the second scene label corresponding to at least one sample image frame.
[0118] In an embodiment of the present application, after obtaining the first scene label and the second scene label, the computer device determines the scene classification label of the sample video based on the first scene label and the second scene label corresponding to at least one sample image frame. Optionally, the computer device determines the scene classification label of the sample video based on the intersection between the first scene label and the second scene label corresponding to at least one sample image frame.
[0119] Optionally, the above-mentioned first scene label includes multiple scene labels. In an embodiment of the present application, when obtaining the above-mentioned scene classification label, the computer device determines at least one candidate classification label of the sample video according to the intersection between the first scene label and the second scene label corresponding to at least one sample image frame; further, the importance of each candidate classification label in each second scene label is obtained. Afterwards, the computer device determines the candidate classification label whose importance meets the second condition as the main classification label; and determines the other classification labels in at least one candidate classification label except the main classification label as secondary classification labels. Among them, the above-mentioned scene classification labels include the above-mentioned main classification labels and the above-mentioned secondary classification labels.
[0120] Optionally, the basis for determining the above-mentioned importance includes but is not limited to at least one of the following: number of occurrences, frequency of occurrence, etc. Exemplarily, after obtaining the above-mentioned candidate classification labels, the computer device uses the second scene labels corresponding to each sample image frame as a label set, obtains the number of occurrences of each candidate classification label in the label set, and then determines the importance of each candidate classification label, wherein the above-mentioned importance is positively correlated with the above-mentioned number of occurrences; or, after obtaining the above-mentioned candidate classification labels, the computer device uses the second scene labels corresponding to each sample image frame as a label set, obtains the frequency of occurrence of each candidate classification label in the label set, and then determines the importance of each candidate classification label, wherein the above-mentioned importance is positively correlated with the above-mentioned frequency of occurrence.
[0121] Optionally, the second condition may be that the importance is greater than or equal to the second target value; or, the second condition may be that the importance is ranked high.
[0122] In a possible implementation, the second condition is that the importance is greater than or equal to the second target value. Optionally, after obtaining the importance of each candidate classification label, the computer device compares the importance with the second target value. If the importance of a candidate classification label is greater than or equal to the second target value, the candidate classification label is determined to be a primary classification label; if the importance of a candidate classification label is less than the second target value, the candidate classification label is determined to be a secondary classification label.
[0123] In another possible implementation, the second condition is that the importance is ranked first. Optionally, after obtaining the importance of each candidate classification label, the computer device ranks each candidate classification label based on the order of importance from high to low, and then determines the top k candidate classification labels as the main classification labels, and the other classification labels as the secondary classification labels. Wherein, the above k is a positive integer.
[0124] For example, Figure 7As shown, the acquisition of the above-mentioned scene classification labels is introduced. After acquiring the first scene label 71 and the second scene label 72 corresponding to at least one sample image frame, the intersection between the first scene label 71 and the second scene label 72 corresponding to at least one sample image frame is acquired to determine at least one candidate classification label 73 of the sample video, and then according to the importance of each candidate classification label 73 in the second scene label 72 corresponding to at least one sample image frame, the most important candidate classification label 73 is determined as the main classification label 74, and the other candidate classification labels in the above-mentioned at least one candidate classification label 73 except the main classification label 74 are determined as secondary classification labels 75. Among them, the scene classification labels of the sample video include the main classification label 74 and the secondary classification label 75.
[0125] It should be noted that the above description of the method for obtaining scene classification labels is only exemplary and explanatory. In an exemplary embodiment, other trained models can be sampled to obtain the above scene classification labels.
[0126] Optionally, the computer device uses a video scene recognition model to obtain the first scene label, and uses an image scene recognition model to obtain the second scene label. Figure 8 As shown, after obtaining the above sample video, the computer device uses the video scene recognition model 81 and the image scene recognition model 82 to process the sample video. In the video scene recognition model 81, the sample image frames in the sample video are processed based on the video feature extraction module to obtain the video features corresponding to each sample image frame; the video features corresponding to each sample image frame are processed based on the video feature processing module to obtain the scene features of the sample video; the scene features of the sample video are processed based on the scene determination module to output the first scene label of the sample video. In the image scene recognition model 82, the sample video is sampled and processed based on the image sampling module to obtain at least one sample sample image frame; the sample sample image frame is processed based on the image feature extraction module to obtain the image scene features corresponding to the sample sample image frame; the image scene features corresponding to the sample sample image frame are processed based on the image feature processing module to obtain the scene features of the sample sample image frame; the scene features of the sample sample image frame are processed based on the scene determination module to output the second scene label corresponding to the sample sample image frame. Afterwards, the computer device determines the scene classification label of the sample video based on the first scene label and the second scene label corresponding to at least one sample image frame through steps such as intersection acquisition and importance judgment.
[0127] In addition, the training process of the above video scene recognition model is as follows Fig. 9As shown, a plurality of video samples 91 and scene labels 92 corresponding to each video sample 91 are obtained. Among them, the scene label 92 includes the main scene label and the secondary scene label of the video sample 91. Afterwards, the video sample 91 is input into the video scene recognition model to obtain the video scene recognition result 93 output by the video scene recognition model. Among them, the video scene recognition result 93 is used to indicate the scene to which the video sample belongs and the probability of belonging to the scene. Optionally, the video scene recognition result 93 includes a main scene and a secondary scene, and the probability of the main scene is greater than or equal to a certain value, and the probability of the secondary scene is less than the value. Further, according to the video scene recognition results 93 of the plurality of video samples 91 and the scene labels 92 corresponding to the plurality of video samples 91, the recall rate and accuracy of the video scene recognition model for the main scene label, and the accuracy of the video scene recognition model for the secondary scene label are determined, and based on the recall rate and accuracy of the video scene recognition model for the main scene label, and the accuracy of the video scene recognition model for the secondary scene label, the parameters of the video scene recognition model are adjusted.
[0128] In addition, the training process of the above image scene recognition model is as follows Fig.10 As shown, a plurality of candidate tags in a scene tag library 101 are semantically merged to obtain at least one scene tag 102, and at least one image frame sample 103 corresponding to each scene tag 102 is obtained by using a web crawler technique. Afterwards, the image frame sample 103 is input into an image scene recognition model to obtain an image scene recognition result 104 output by the image scene recognition model. Among them, the image scene recognition result 104 is used to indicate the scene to which the image frame sample belongs. Afterwards, according to the image scene recognition results 104 corresponding to the plurality of image frame samples 103, and the scene tags 102 corresponding to the plurality of image frame samples 103, the loss of the image scene recognition model is determined, and the parameters of the image scene recognition model are adjusted based on the loss. Optionally, when obtaining the above-mentioned image frame samples, for the target scene tag in at least one scene tag, the target scene tag is translated into a plurality of different languages, and the plurality of different languages are used to search respectively to obtain a plurality of image frames with a high search ranking as the above-mentioned image frame samples. Exemplarily, the comparison of the semantics of the candidate tags before and after merging is shown in Table 1 below:
[0129] Table 1 Comparison of candidate labels before and after semantic merging
[0130] Before the merger After the merger Street, city road, sidewalk street Multi-function hall, conference hall Conference Hall Sky, skyline Sky Studio, live broadcast room Studio Gardens, Garden Architecture garden
[0131] Please refer to Fig.11 , which shows a flow chart of a method for generating training samples of a video scene classification model provided by another embodiment of the present application. The method can be applied to Figure 1The second device 20 of the training system of the video scene classification model shown in the figure, such as the execution subject of each step can be the second device 20 (hereinafter referred to as "computer device"). The method may include at least one of the following steps (1101-1106):
[0132] Step 1101, obtaining a sample video.
[0133] Step 1102 , extracting video features from each sample image frame to obtain video features corresponding to each sample image frame.
[0134] Step 1103 , extracting scene features from each sample image frame to obtain image scene features corresponding to each sample image frame.
[0135] Step 1104 , generating training samples corresponding to the sample videos according to the video features corresponding to the sample image frames and the image scene features corresponding to the sample image frames.
[0136] The above steps 1101-1104 and Figure 5 Steps 501-504 in the embodiment are the same, see Figure 5 The embodiments are not described in detail here.
[0137] Step 1105 , inputting the input data in the training sample into the video scene classification model, and obtaining the scene classification result for the sample video output by the video scene classification model.
[0138] In an embodiment of the present application, after obtaining the above-mentioned training samples, the computer device inputs the input data in the training samples into the video scene classification model to obtain the scene classification result for the sample video output by the video scene classification model.
[0139] Optionally, the scene classification result includes at least one scene category to which the sample video belongs, and the probability that the sample video belongs to each scene category, wherein the scene with the highest probability can be called the main scene, and the other scenes except the main scene can be called the secondary scenes.
[0140] Step 1106 , based on the scene classification results of each sample video and the scene classification labels in the training samples corresponding to each sample video, parameters of the video scene classification model are adjusted.
[0141] In an embodiment of the present application, after obtaining the above-mentioned scene classification results, the computer device adjusts the parameters of the video scene classification model based on the scene classification results of each sample video and the scene classification labels in the training samples corresponding to each sample video, and continues to input the training samples into the video scene classification model after the parameter adjustment to continue the parameter adjustment until the training of the video scene classification model is completed.
[0142] Optionally, the scene classification result includes at least one scene category to which the sample video belongs, and the probability that the sample video belongs to each scene category; the scene classification label includes a main classification label and a secondary classification label. In an embodiment of the present application, after obtaining the scene classification result, the computer device sorts each scene category according to the probability of the sample video belonging to each scene category from large to small. Afterwards, the scene category ranked first is determined as the main scene of the sample video; and, other scenes other than the main scene in at least one scene category are determined as secondary scenes. Further, based on the main scene, secondary scene, main classification label and secondary classification label of each sample video, the computer device determines the recall rate and accuracy of the video scene classification model for the main classification label, and the accuracy rate of the video scene classification model for the secondary classification label, and adjusts the parameters of the video scene classification model according to the recall rate and accuracy rate of the video scene classification model for the main classification label, and the accuracy rate of the video scene classification model for the secondary classification label.
[0143] To sum up, in the technical solution provided in the embodiments of the present application, a video scene classification model is trained through training samples, and the video scene classification model is used to identify the scene to which the video belongs, thereby providing an automatic scene classification mode for the video, and the training samples are obtained based on video features and image scene features, so that the video scene classification model can learn video features in units of sample videos and learn image scene features in units of separate sample image frames during the training process, thereby improving the accuracy of the video scene classification model.
[0144] Please refer to Fig.12 , which shows a flow chart of a method for classifying video scenes provided by an embodiment of the present application. The method can be applied to Figure 3 The server 40 of the video scene classification system shown in the figure, such as the execution subject of each step can be the server 40 (hereinafter referred to as "computer device"). The method may include at least one of the following steps (1201-1204):
[0145] Step 1201, obtaining the video to be processed.
[0146] The video to be processed is a video that has not been scene-classified. Optionally, the video is a video uploaded by a user account. In an embodiment of the present application, before the computer device performs scene classification on the video, the video to be processed is obtained. The video includes multiple continuous image frames.
[0147] Step 1202: extract video features from each image frame to obtain video features corresponding to each image frame.
[0148] In an embodiment of the present application, after acquiring the above-mentioned video, the computer device extracts video features for each image frame in the video to obtain video features corresponding to each image frame. Among them, the video features are used to describe the features contained in the image frame, as well as the change features between the image frame and the associated image frame; the associated image frame refers to an image frame that has an associated relationship with the image frame in the video. Optionally, the features contained in the above-mentioned image frame can be understood as the basic features contained in the image frame. Exemplarily, the basic features include but are not limited to at least one of the following: texture features, edge features, and pixel features, etc., which are not limited in the embodiment of the present application.
[0149] Optionally, the basis for determining the above association relationship includes but is not limited to at least one of the following: playback order, image similarity, entity information, etc.
[0150] In a possible implementation, the association relationship is determined in the above-mentioned playback order. Optionally, after acquiring the above-mentioned video, the computer device acquires the playback order of each image frame in the video, and determines the image frames with adjacent playback orders as image frames with an association relationship. The image frames with adjacent playback orders may be a fixed number of image frames; or the image frames with adjacent playback orders may be image frames within a fixed duration, and the fixed duration may be determined based on the total playback duration of the video.
[0151] In another possible implementation, the association relationship is determined by the above-mentioned image similarity. Optionally, after acquiring the above-mentioned video, the computer device acquires the image similarity between the image frame and other image frames, and determines the image frames whose image similarity is less than the first threshold as image frames with an association relationship. Of course, in an exemplary embodiment, image frames whose image similarity is less than the second threshold and greater than the third threshold can also be determined as image frames with an association relationship, so that image frames with an association relationship are similar image frames, and there are certain differences between each image frame to ensure the reliability of video feature extraction. Among them, the above-mentioned other image frames refer to image frames other than the image frame in the video.
[0152] In another possible implementation, the association relationship is determined by the entity information. Optionally, after acquiring the video, the computer device acquires the entity information contained in each image frame, and determines the image frames containing the same entity information as image frames with an association relationship, so that in the process of video feature extraction, based on the association relationship of multiple image frames in the video, a relatively complete entity motion trajectory can be obtained, thereby improving the reliability of video feature extraction.
[0153] Step 1203 , extracting scene features from each image frame to obtain image scene features corresponding to each image frame.
[0154] In the embodiment of the present application, after acquiring the above video, the computer device extracts scene features from each image frame in the video to obtain image scene features corresponding to each image frame, wherein the image scene features are used to describe the scene to which the image frame belongs.
[0155] Optionally, the above-mentioned image frames may be all image frames in the video, or may be part of the image frames in the video.
[0156] In a possible implementation, the above-mentioned image frames are all the image frames in the video. Optionally, after acquiring the above-mentioned video, the computer device performs frame processing on the video to obtain all the image frames contained in the video, and then performs scene feature extraction on each image frame in all the image frames to obtain image scene features corresponding to each image frame. It should be noted that, in this case, the image frames used in video feature extraction are all the image frames in the video.
[0157] In another possible implementation, each of the above-mentioned image frames is a partial image frame in a video. Optionally, after acquiring the above-mentioned video, the computer device performs frame processing on the video to obtain all the image frames contained in the video, and then samples all the image frames to obtain partial image frames, and extracts scene features from each of the image frames in the partial image frames to obtain image scene features corresponding to each image frame. It should be noted that, in this case, each of the image frames used in the above-mentioned video feature extraction is a partial image frame in the video.
[0158] Optionally, in an embodiment of the present application, the above-mentioned image scene features include features of the image frame for each scene.
[0159] Step 1204 , determining the scene to which the video belongs based on the video features corresponding to each image frame and the image scene features corresponding to each image frame.
[0160] In an embodiment of the present application, after acquiring the above-mentioned video features and the above-mentioned image scene features, the computer device determines the scene to which the video belongs based on the video features corresponding to each image frame and the image scene features corresponding to each image frame.
[0161] The method of determining the scene to which a video belongs is described in detail below and will not be elaborated here.
[0162] To sum up, in the technical solution provided in the embodiment of the present application, the scene to which the video belongs is determined by combining video features with image scene features, thereby improving the accuracy of the scene classification results; moreover, the scene to which the video belongs is automatically determined, thereby avoiding the influence of human subjective consciousness on video scene classification, reducing artificial constraints on scene classification, and improving the efficiency of video scene classification.
[0163] Next, a method for determining the scene to which a video belongs is introduced.
[0164] In a possible implementation, the computer device determines the scene to which the video belongs based on the stitching scene features corresponding to each image frame. In an exemplary embodiment, the computer device includes at least one of the following steps in the above step 1204:
[0165] 1. For a target image frame in each image frame, the video features corresponding to the target image frame and the image scene features corresponding to the target image frame are spliced to obtain the spliced scene features corresponding to the target image frame.
[0166] In the embodiment of the present application, after acquiring the above-mentioned video features, the computer device splices the video features corresponding to the image frames and the image scene features corresponding to the image frames to obtain the spliced scene features corresponding to the image frames. Optionally, for the target image frame in each image frame, the video features corresponding to the target image frame and the image scene features corresponding to the target image frame are spliced to obtain the spliced scene features corresponding to the target image frame.
[0167] 2. Determine the scene to which the video belongs based on the stitching scene features corresponding to each image frame.
[0168] In the embodiment of the present application, after acquiring the above-mentioned stitching scene features, the computer device determines the scene to which the video belongs based on the stitching scene features corresponding to each image frame.
[0169] Optionally, the scenes to which the video belongs include main scenes and secondary scenes. The main scenes can be understood as scenes in the video that have clear features and occupy a sufficient duration, and the secondary scenes can be understood as scenes that occupy a shorter duration, are ambiguous, and are difficult to distinguish. For example, Fig.13As shown, the video 130 includes 10 image frames. Among the 10 image frames, 7 image frames are in the dining room, and 3 image frames are in the living room. Therefore, the main scene of the video 130 is the dining room, and the secondary scene is the living room.
[0170] In another possible implementation, the computer device determines the scene to which the video belongs based on the first candidate scene and the scenes to which each image frame belongs. In an exemplary embodiment, the above step 1204 includes at least one of the following steps:
[0171] 1. Determine at least one first candidate scene to which the video belongs based on video features corresponding to each image frame.
[0172] In an embodiment of the present application, after acquiring the above-mentioned video features, the computer device determines the scene features of the video according to the video features corresponding to each image frame; further, based on the scene features of the video, determines at least one first candidate scene to which the video belongs.
[0173] 2. According to the image scene features corresponding to each image frame, the scene to which each image frame belongs is obtained respectively.
[0174] In the embodiment of the present application, after acquiring the above-mentioned image scene features, the computer device acquires the scene to which each image frame belongs according to the image scene features corresponding to each image frame.
[0175] Optionally, the above-mentioned image frames may be all image frames in the video, or may be part of the image frames in the video.
[0176] In a possible implementation, the above-mentioned image frames are all image frames in the video. Optionally, after obtaining the above-mentioned image scene features, the computer device obtains the features of the image frame for each scene from the image scene features corresponding to the image frame, and obtains the probability that the image frame belongs to each scene, and then determines the scene features of the image frame according to the features of the image frame for each scene and the probability that the image frame belongs to each scene, and determines the scene to which the image frame belongs based on the scene features of the image frame.
[0177] In another possible implementation, since the scene changes between image frames that are adjacent in the playback order in the video are small, in order to reduce the amount of calculation of the computer device, the above-mentioned image frames are partial image frames in the video. Optionally, after obtaining the above-mentioned image scene features, the computer device samples multiple image frames in the video according to the sampling time to obtain at least one sampled image frame. Among them, the sampling time can be flexibly set and adjusted according to actual conditions, and the embodiments of the present application are not limited to this. Afterwards, the computer device obtains the features of the sampled image frame for each scene from the image scene features corresponding to the sampled image frame, and obtains the probability that the sampled image frame belongs to each scene, and then determines the scene features of the sampled image frame according to the features of the sampled image frame for each scene and the probability that the sampled image frame belongs to each scene, and determines the scene to which the sampled image frame belongs based on the scene features of the sampled image frame.
[0178] 3. Determine the scene to which the video belongs based on each first candidate scene and the scene to which each image frame belongs.
[0179] In an embodiment of the present application, after acquiring the above-mentioned first candidate scenes and the scenes to which each image frame belongs, the computer device determines the scene to which the video belongs based on each first candidate scene and the scenes to which each image frame belongs.
[0180] Optionally, the scene to which the above video belongs includes a main scene and a secondary scene. In an embodiment of the present application, the computer device determines at least one second candidate scene of the video based on the intersection between each first candidate scene and the scene to which each image frame belongs; further, the occurrence frequency of each second candidate scene in the scene to which each image frame belongs is obtained. Afterwards, the second candidate scene whose occurrence frequency meets the third condition is determined as the main scene to which the video belongs; and the other scenes in at least one second candidate scene except the main scene are determined as the secondary scenes of the video.
[0181] Optionally, the third condition may be that the occurrence frequency is greater than or equal to a third target value; or, the third condition may be that the occurrence frequency is ranked high.
[0182] In addition, in an embodiment of the present application, the above-mentioned video scene classification method can be executed by a video scene classification model. Optionally, the video scene classification model includes a video feature extraction section, an image feature extraction section, a feature stitching section and a scene determination section. Among them, the video feature extraction section is used to extract video features from each image frame respectively to obtain video features corresponding to each image frame; the image feature extraction section is used to extract scene features from each image frame in the video respectively to obtain image scene features corresponding to each image frame; the feature stitching section is used to stitch the video features corresponding to the image frame and the image scene features corresponding to the image frame to obtain stitching scene features corresponding to each image frame; the scene determination section is used to determine the scene to which the video belongs based on the stitching scene features corresponding to each image frame.
[0183] In a possible implementation, the video feature extraction module is the above Figure 8 The video feature extraction module in the video scene recognition model is the above-mentioned image feature extraction module. Figure 8 Image feature extraction module in the image scene recognition model.
[0184] In another possible implementation, the video feature extraction module and the Figure 8 The video feature extraction module in the video scene recognition model is different from the above image feature extraction module. Figure 8 The image feature extraction section in the image scene recognition model is different. It should be noted that in this case, the input data of the video scene classification model during the training process is the above sample video.
[0185] One thing that needs to be explained is that the above Fig.12 The method described in the embodiment, Figures 5 to 11 Corresponding to the method described in the embodiment, Fig.12 For details not described in detail, please refer to the above Figures 5 to 11 .
[0186] In addition, combined with reference Fig.14, a complete introduction to the video scene classification system is given. The video scene classification system includes a video upload section 141, a video storage section 142, a video processing section 143, a video scene classification model 144, a manual review section 145, a video distribution section 146, a video data recording section 147, an index creation section 148, and a video download section 149. Among them, the video upload section 141 is used to obtain videos uploaded by user accounts; the video storage section 142 is used to store metadata of videos; the video processing section 143 is used to convert videos into a unified video mode corresponding to the application; the video scene classification model is used to identify the scene to which the video belongs; the manual review section 145 is used to manually review the video, wherein the review content may include the legality of the video; the video distribution section 146 is used to determine the partition to which the video belongs based on the scene to which the video belongs; the video data recording section 147 is used to record browsing information of multiple user accounts for the video; the index establishment section 148 is used to establish an index corresponding to the video according to the content contained in the video and the scene to which the video belongs; the video download section 149 is used to determine the video download rate and the format of the downloaded video according to the current network environment when downloading the video.
[0187] Optionally, when the above-mentioned video scene classification model 144 processes the video, the video features corresponding to each image frame in the video are obtained based on the video feature extraction section; the image scene features corresponding to each image frame in the video are obtained based on the image feature extraction section; the video features and the image scene features are spliced based on the feature splicing section to obtain the spliced scene features corresponding to each image frame; based on the scene determination section, the scene to which the video belongs is determined according to the spliced scene features corresponding to each image frame.
[0188] Of course, in an exemplary embodiment, if the scene to which the video determined by the above-mentioned video scene classification model 144 belongs includes multiple scenes, in the manual review section 145, manual judgment is made on the multiple scenes to further determine the appropriate scene from the multiple scenes. Manual personnel only need to perform a selection operation and do not need to determine the appropriate scene based on the video content, thereby reducing the manual burden.
[0189] It should be noted that the various numerical values and numerical ranges involved in this application can be set to any numerical value according to actual conditions unless otherwise specified, and this application does not limit this.
[0190] It should also be noted that the introduction of the present application through the embodiments above is merely exemplary and explanatory, and new embodiments formed by arbitrarily combining the steps in the above embodiments are also within the scope of protection of the present application.
[0191] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0192] Please refer to Fig.15 , which shows a block diagram of a training sample generation device for a video scene classification model provided by an embodiment of the present application. The device has the function of implementing the training sample generation method of the above-mentioned video scene classification model, and the function can be implemented by hardware, or by hardware executing corresponding software. The device can be a computer device, and can also be set in a computer device. The device 1500 may include: a sample acquisition module 1510, a video extraction module 1520, a scene extraction module 1530 and a sample generation module 1540.
[0193] The sample acquisition module 1510 is used to acquire a sample video, where the sample video includes a plurality of continuous sample image frames.
[0194] The video extraction module 1520 is used to extract video features from each of the sample image frames to obtain video features corresponding to each of the sample image frames, wherein the video features are used to describe the features contained in the sample image frames and the change features between the sample image frames and associated sample image frames; wherein the associated sample image frames refer to image frames in the sample video that have an associated relationship with the sample image frames.
[0195] The scene extraction module 1530 is used to extract scene features from each of the sample image frames to obtain image scene features corresponding to each of the sample image frames; wherein the image scene features are used to describe the scene to which the sample image frame belongs.
[0196] The sample generation module 1540 is used to generate training samples corresponding to the sample video according to the video features corresponding to each of the sample image frames and the image scene features corresponding to each of the sample image frames; wherein the training samples are used to train a video scene classification model, and the video scene classification model is used to identify the scene to which the video belongs.
[0197] In an exemplary embodiment, the training sample includes input data of the sample video for the video scene classification model; Fig.16 As shown, the sample generation module 1540 includes: a data generation unit 1541.
[0198] The data generating unit 1541 is used to splice the video features corresponding to the target sample image frames in each of the sample image frames, and the image scene features corresponding to the target sample image frames, so as to obtain the spliced scene features corresponding to the target sample image frames; wherein the input data includes the spliced scene features corresponding to each of the sample image frames.
[0199] In an exemplary embodiment, the training sample includes a scene classification label of the sample video for the video scene classification model, and the scene classification label is used to indicate the scene to which the sample video belongs; Fig.16 As shown, the sample generation module 1540 includes: a first determination unit 1542 , a second determination unit 1543 and a label determination unit 1544 .
[0200] The first determining unit 1542 is used to determine a first scene label of the sample video according to video features corresponding to each of the sample image frames; wherein the first scene label is used to indicate a candidate scene to which the sample video belongs.
[0201] The second determining unit 1543 is used to obtain a second scene label corresponding to at least one of the sample image frames according to an image scene feature corresponding to at least one of the sample image frames; wherein the second scene label is used to indicate the scene to which the sample image frame belongs.
[0202] The label determination unit 1544 is used to determine the scene classification label of the sample video based on the first scene label and the second scene label corresponding to at least one of the sample image frames.
[0203] In an exemplary embodiment, the first determining unit 1542 is configured to determine the scene features of the sample video according to the video features corresponding to each of the sample image frames; and determine the first scene label of the sample video based on the scene features of the sample video.
[0204] In an exemplary embodiment, the second determination unit 1543 is used to sample the multiple sample image frames in the sample video according to the sampling time to obtain at least one sampled sample image frame; obtain the characteristics of the sampled sample image frame for each scene from the image scene characteristics corresponding to the sampled sample image frame; obtain the probability that the sampled sample image frame belongs to each scene; determine the scene characteristics of the sampled sample image frame according to the characteristics of the sampled sample image frame for each scene and the probability that the sampled sample image frame belongs to each scene; and determine the second scene label corresponding to the sampled sample image frame based on the scene characteristics of the sampled sample image frame.
[0205] In an exemplary embodiment, the second determination unit 1543 is used to select at least one feature of a target scene whose probability satisfies a first condition from the features of the sampled sample image frames for each scene based on the probability that the sampled sample image frames belong to each scene; and fuse the features of each of the target scenes to obtain the scene features of the sampled sample image frames.
[0206] In an exemplary embodiment, the label determination unit 1544 is used to determine the scene classification label of the sample video according to the intersection between the first scene label and the second scene label corresponding to at least one of the sample image frames.
[0207] In an exemplary embodiment, the scene classification label includes a primary classification label and a secondary classification label; the label determination unit 1544 is used to determine at least one candidate classification label of the sample video based on the intersection between the first scene label and at least one second scene label corresponding to each of the sample image frames; obtain the importance of each of the candidate classification labels in each of the second scene labels; determine the candidate classification label whose importance meets the second condition as the primary classification label; and determine other classification labels in the at least one candidate classification label except the primary classification label as the secondary classification label.
[0208] In an exemplary embodiment, if Fig.16 As shown, the device 1500 also includes: a model training module 1550.
[0209] The model training module 1550 is used to input the input data in the training sample into the video scene classification model to obtain the scene classification result for the sample video output by the video scene classification model; based on the scene classification results of each of the sample videos and the scene classification labels in the training samples corresponding to each of the sample videos, the parameters of the video scene classification model are adjusted.
[0210] In an exemplary embodiment, the scene classification result includes at least one scene category to which the sample video belongs, and the probability that the sample video belongs to each of the scene categories; the scene classification label includes a primary classification label and a secondary classification label; the model training module 1550 is used to sort each of the scene categories in descending order according to the probability that the sample video belongs to each of the scene categories; the scene category ranked first is determined as the primary scene of the sample video; and, other scenes except the primary scene in the at least one scene category are determined as secondary scenes; based on the primary scene, secondary scene, primary classification label and secondary classification label of each of the sample videos, the recall rate and accuracy of the video scene classification model for the primary classification label, and the accuracy rate of the video scene classification model for the secondary classification label are determined; according to the recall rate and accuracy rate of the video scene classification model for the primary classification label, and the accuracy rate of the video scene classification model for the secondary classification label, the parameters of the video scene classification model are adjusted.
[0211] To summarize, in the technical solution provided in the embodiment of the present application, training samples for a video scene classification model are generated through the video features corresponding to each sample image frame and the image scene features corresponding to each sample image frame, and the video scene classification model is used to identify the scene to which the video belongs, thereby providing an automated scene classification mode for the video, improving the accuracy of the scene classification results, avoiding the influence of artificial subjective consciousness on the video scene classification, reducing artificial constraints on scene classification, and improving the efficiency of video scene classification; moreover, based on the association between the sample image frames in the sample video, video features are extracted from the sample image frames to obtain the video features corresponding to the sample image frames, and scene features are extracted from the sample image frames to obtain the image scene features corresponding to the sample image frames, and the image scene features are combined with the video features to generate training samples for the video scene classification model, so that the video scene classification model can learn video features in units of sample videos and image scene features in units of individual sample image frames during the training process, thereby improving the accuracy of the video scene classification model.
[0212] Please refer to Fig.17 , which shows a block diagram of a video scene classification device provided by an embodiment of the present application. The device has the function of implementing the above-mentioned video scene classification method, and the function can be implemented by hardware, or by hardware executing corresponding software. The device can be a computer device, or it can be set in a computer device. The device 1700 may include: a video acquisition module 1710, a video processing module 1720, an image processing module 1730 and a scene determination module 1740.
[0213] The video acquisition module 1710 is used to acquire a video to be processed, where the video includes a plurality of continuous image frames.
[0214] The video processing module 1720 is used to extract video features from each of the image frames to obtain video features corresponding to each of the image frames, wherein the video features are used to describe the features contained in the image frame and the change features between the image frame and the associated image frame; wherein the associated image frame refers to an image frame that has an associated relationship with the image frame in the video.
[0215] The image processing module 1730 is used to extract scene features from each of the image frames to obtain image scene features corresponding to each of the image frames; wherein the image scene features are used to describe the scene to which the image frame belongs.
[0216] The scene determination module 1740 is used to determine the scene to which the video belongs according to the video features corresponding to each of the image frames and the image scene features corresponding to each of the image frames.
[0217] In an exemplary embodiment, if Fig.18 As shown, the scene determination module 1740 includes: a feature splicing unit 1741 and a scene determination unit 1742.
[0218] The feature stitching unit 1741 is used to stitch the video features corresponding to the target image frame in each of the image frames and the image scene features corresponding to the target image frame to obtain the stitching scene features corresponding to the target image frame.
[0219] The scene determination unit 1742 is used to determine the scene to which the video belongs based on the spliced scene features corresponding to each of the image frames.
[0220] In an exemplary embodiment, if Fig.18 As shown, the scene determination module 1740 includes: a first acquisition unit 1743 and a second acquisition unit 1744.
[0221] The first acquisition unit 1743 is configured to determine at least one first candidate scene to which the video belongs according to video features corresponding to each of the image frames.
[0222] The second acquisition unit 1744 is used to respectively acquire the scene to which each of the image frames belongs according to the image scene features corresponding to each of the image frames.
[0223] The scene determination unit 1742 is configured to determine the scene to which the video belongs based on each of the first candidate scenes and the scene to which each of the image frames belongs.
[0224] In an exemplary embodiment, the scenes to which the video belongs include main scenes and secondary scenes; the scene determination unit 1743 is used to determine at least one second candidate scene of the video based on the intersection between each of the first candidate scenes and the scenes to which each of the image frames belongs; obtain the occurrence frequency of each of the second candidate scenes in the scenes to which each of the image frames belongs; determine the second candidate scene whose occurrence frequency meets the third condition as the main scene to which the video belongs; and determine the other scenes in the at least one second candidate scene except the main scene as secondary scenes of the video.
[0225] In an exemplary embodiment, the method is performed by a video scene classification model; wherein the video scene classification model includes a video feature extraction section, an image feature extraction section, a feature stitching section and a scene determination section; the video feature extraction section is used to extract video features from each of the image frames to obtain video features corresponding to each of the image frames; the image feature extraction section is used to extract scene features from each of the image frames in the video to obtain image scene features corresponding to each of the image frames; the feature stitching section is used to stitch the video features corresponding to the image frames and the image scene features corresponding to the image frames to obtain stitched scene features corresponding to each of the image frames; the scene determination section is used to determine the scene to which the video belongs based on the stitched scene features corresponding to each of the image frames.
[0226] To sum up, in the technical solution provided in the embodiment of the present application, the scene to which the video belongs is determined by combining video features with image scene features, thereby improving the accuracy of the scene classification results; moreover, the scene to which the video belongs is automatically determined, thereby avoiding the influence of human subjective consciousness on video scene classification, reducing artificial constraints on scene classification, and improving the efficiency of video scene classification.
[0227] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0228] Please refer to Fig.19, which shows a block diagram of a computer device provided by an embodiment of the present application. The computer device can be used to implement the functions of the training sample generation method of the above-mentioned video scene classification model or the video scene classification method. Specifically:
[0229] The computer device 1900 includes a central processing unit (CPU) 1901, a system memory 1904 including a random access memory (RAM) 1902 and a read only memory (ROM) 1903, and a system bus 1905 connecting the system memory 1904 and the central processing unit 1901. The computer device 1900 also includes a basic input / output system (I / O system) 1906 for facilitating information transmission between various components in the computer, and a mass storage device 1907 for storing an operating system 1913, application programs 1914, and other program modules 1915.
[0230] The basic input / output system 1906 includes a display 1908 for displaying information and an input device 1909 such as a mouse and a keyboard for user inputting information. The display 1908 and the input device 1909 are connected to the central processing unit 1901 through an input / output controller 1910 connected to the system bus 1905. The basic input / output system 1906 may also include an input / output controller 1910 for receiving and processing inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 1910 also provides output to a display screen, a printer, or other types of output devices.
[0231] The mass storage device 1907 is connected to the central processing unit 1901 through a mass storage controller (not shown) connected to the system bus 1905. The mass storage device 1907 and its associated computer readable media provide non-volatile storage for the computer device 1900. That is, the mass storage device 1907 may include a computer readable medium (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.
[0232] Without loss of generality, computer-readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically Erasable Programmable Read Only Memory), flash memory or other solid-state storage devices, CD-ROM, DVD (Digital Video Disc) or other optical storage, cassettes, magnetic tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media are not limited to the above. The above-mentioned system memory 1904 and mass storage device 1907 can be collectively referred to as memory.
[0233] According to various embodiments of the present application, the computer device 1900 can also be connected to a remote computer on the network through a network such as the Internet. That is, the computer device 1900 can be connected to the network 1912 through the network interface unit 1911 connected to the system bus 1905, or the network interface unit 1911 can be used to connect to other types of networks or remote computer systems (not shown).
[0234] The memory also includes a computer program, which is stored in the memory and configured to be executed by one or more processors to implement the training sample generation method of the above-mentioned video scene classification model, or to implement the above-mentioned video scene classification method.
[0235] In an exemplary embodiment, a computer-readable storage medium is also provided, in which at least one instruction, at least one program, a code set or an instruction set is stored. When the at least one instruction, the at least one program, the code set or the instruction set is executed by a processor, the training sample generation method of the above-mentioned video scene classification model is implemented, or the classification method of the above-mentioned video scene is implemented.
[0236] Optionally, the computer-readable storage medium may include: ROM (Read Only Memory), RAM (Random Access Memory), SSD (Solid State Drives) or an optical disk, etc. Among them, the random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).
[0237] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the training sample generation method of the video scene classification model or the classification method of the video scene.
[0238] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application are not limited to this.
[0239] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for generating training samples for a video scene classification model, characterized in that: The method comprises: Acquire a sample video, where the sample video includes a plurality of continuous sample image frames; Performing video feature extraction on each of the sample image frames to obtain video features corresponding to each of the sample image frames, wherein the video features are used to describe features included in the sample image frames and change features between the sample image frames and associated sample image frames; wherein the associated sample image frames refer to image frames in the sample video that have an associated relationship with the sample image frames; Extracting scene features from each of the sample image frames to obtain image scene features corresponding to each of the sample image frames; wherein the image scene features are used to describe the scene to which the sample image frame belongs; According to the video features corresponding to each of the sample image frames, and the image scene features corresponding to each of the sample image frames, training samples corresponding to the sample videos are generated; wherein the training samples are used to train a video scene classification model, and the video scene classification model is used to identify the scene to which the video belongs.
2. The method according to claim 1, characterized in that: The training sample includes input data of the sample video for the video scene classification model; The video features corresponding to each of the sample image frames, and the image scene features corresponding to each of the sample image frames, include: For a target sample image frame in each of the sample image frames, splicing the video features corresponding to the target sample image frame and the image scene features corresponding to the target sample image frame to obtain a spliced scene feature corresponding to the target sample image frame; The input data includes stitching scene features corresponding to each of the sample image frames.
3. The method according to claim 1, characterized in that: The training sample includes a scene classification label of the sample video for the video scene classification model, wherein the scene classification label is used to indicate the scene to which the sample video belongs; The video features corresponding to each of the sample image frames, and the image scene features corresponding to each of the sample image frames, include: Determine a first scene label of the sample video according to the video features corresponding to each of the sample image frames; wherein the first scene label is used to indicate a candidate scene to which the sample video belongs; According to the image scene feature corresponding to at least one of the sample image frames, respectively, obtaining a second scene label corresponding to at least one of the sample image frames; wherein the second scene label is used to indicate the scene to which the sample image frame belongs; Based on the first scene label and the second scene label corresponding to at least one of the sample image frames, a scene classification label of the sample video is determined.
4. The method according to claim 3, characterized in that The determining the first scene label of the sample video according to the video features respectively corresponding to the sample image frames includes: Determining scene features of the sample video according to video features corresponding to each of the sample image frames; Based on the scene features of the sample video, a first scene label of the sample video is determined.
5. The method according to claim 3, characterized in that: The acquiring, according to the image scene feature respectively corresponding to at least one of the sample image frames, a second scene label respectively corresponding to at least one of the sample image frames comprises: Sampling a plurality of the sample image frames in the sample video according to a sampling time to obtain at least one sampled sample image frame; Acquire the features of the sampled image frames for each scene from the image scene features corresponding to the sampled image frames; Obtaining the probability that the sample image frame belongs to each scene; Determining scene features of the sample image frames according to features of the sample image frames for each scene and probabilities that the sample image frames belong to each scene; Based on the scene feature of the sample image frame, a second scene label corresponding to the sample image frame is determined.
6. The method according to claim 5, characterized in that The step of determining the scene features of the sample image frames according to the features of the sample image frames for each scene and the probability that the sample image frames belong to each scene includes: Based on the probability that the sampled sample image frames belong to each scene, selecting at least one feature of the target scene whose probability satisfies the first condition from the features of the sampled sample image frames for each scene; The features of each of the target scenes are fused to obtain the scene features of the sample image frames.
7. The method according to claim 3, characterized in that The determining of the scene classification label of the sample video based on the first scene label and the second scene label corresponding to at least one of the sample image frames includes: The scene classification label of the sample video is determined according to the intersection between the first scene label and the second scene label corresponding to at least one of the sample image frames.
8. The method according to claim 7, characterized in that The scene classification labels include primary classification labels and secondary classification labels; Determining the scene classification label of the sample video according to the intersection between the first scene label and the second scene label corresponding to at least one of the sample image frames includes: Determine at least one candidate classification label of the sample video according to an intersection between the first scene label and a second scene label respectively corresponding to at least one of the sample image frames; Obtaining the importance of each of the candidate classification labels in each of the second scene labels; The candidate classification label whose importance satisfies the second condition is determined as the main classification label; and the other classification labels among the at least one candidate classification label except the main classification label are determined as the secondary classification labels.
9. The method according to any one of claims 1 to 8, characterized in that: After generating the training samples corresponding to the sample videos according to the video features corresponding to the sample image frames and the image scene features corresponding to the sample image frames, the method further includes: Inputting the input data in the training sample into the video scene classification model to obtain a scene classification result for the sample video output by the video scene classification model; Based on the scene classification results of each of the sample videos and the scene classification labels in the training samples corresponding to each of the sample videos, parameters of the video scene classification model are adjusted.
10. The method according to claim 9, characterized in that The scene classification result includes at least one scene category to which the sample video belongs, and the probability that the sample video belongs to each of the scene categories; the scene classification label includes a primary classification label and a secondary classification label; The step of adjusting parameters of the video scene classification model based on the scene classification results of each of the sample videos and the scene classification labels in the training samples corresponding to each of the sample videos comprises: Sorting each of the scene categories according to the probability of the sample video belonging to each of the scene categories from large to small; Determine the scene category ranked first as the main scene of the sample video; and determine the other scenes in the at least one scene category except the main scene as secondary scenes; Based on the main scene, the secondary scene, the main classification label and the secondary classification label of each of the sample videos, determining the recall rate and accuracy rate of the video scene classification model for the main classification label, and the accuracy rate of the video scene classification model for the secondary classification label; Parameters of the video scene classification model are adjusted according to the recall rate and accuracy of the video scene classification model for the main classification labels, and the accuracy of the video scene classification model for the secondary classification labels.
11. A method for classifying video scenes, characterized in that: The method comprises: Acquire a video to be processed, wherein the video includes a plurality of continuous image frames; Performing video feature extraction on each of the image frames to obtain video features corresponding to each of the image frames, wherein the video features are used to describe features contained in the image frame and change features between the image frame and associated image frames; wherein the associated image frame refers to an image frame that has an associated relationship with the image frame in the video; Extracting scene features from each of the image frames to obtain image scene features corresponding to each of the image frames; wherein the image scene features are used to describe the scene to which the image frame belongs; The scene to which the video belongs is determined according to the video features corresponding to each of the image frames and the image scene features corresponding to each of the image frames.
12. The method according to claim 11, characterized in that Determining the scene to which the video belongs according to the video features corresponding to each of the image frames and the image scene features corresponding to each of the image frames includes: For a target image frame in each of the image frames, splicing the video features corresponding to the target image frame and the image scene features corresponding to the target image frame to obtain a spliced scene feature corresponding to the target image frame; The scene to which the video belongs is determined based on the stitching scene features respectively corresponding to the image frames.
13. The method according to claim 11, characterized in that Determining the scene to which the video belongs according to the video features corresponding to each of the image frames and the image scene features corresponding to each of the image frames includes: Determining at least one first candidate scene to which the video belongs according to video features corresponding to each of the image frames; According to the image scene features respectively corresponding to the image frames, respectively obtain the scenes to which the image frames belong; The scene to which the video belongs is determined based on each of the first candidate scenes and the scenes to which each of the image frames belongs.
14. The method according to claim 13, characterized in that The scenes to which the video belongs include main scenes and secondary scenes; The determining the scene to which the video belongs based on each of the first candidate scenes and the scene to which each of the image frames belongs includes: Determine at least one second candidate scene of the video according to the intersections between the first candidate scenes and the scenes to which the image frames belong respectively; Obtaining the occurrence frequency of each of the second candidate scenes in the scene to which each of the image frames belongs; The second candidate scene whose occurrence frequency meets the third condition is determined as the main scene to which the video belongs; and other scenes except the main scene in the at least one second candidate scene are determined as secondary scenes of the video.
15. The method according to any one of claims 11 to 14, characterized in that The method is performed by a video scene classification model; wherein the video scene classification model includes a video feature extraction module, an image feature extraction module, a feature splicing module and a scene determination module; The video feature extraction section is used to extract video features from each of the image frames to obtain video features corresponding to each of the image frames; The image feature extraction section is used to extract scene features from each of the image frames in the video to obtain image scene features corresponding to each of the image frames; The feature stitching section is used to stitch the video features corresponding to the image frames and the image scene features corresponding to the image frames to obtain the stitching scene features corresponding to each of the image frames; The scene determination section is used to determine the scene to which the video belongs based on the spliced scene features corresponding to each of the image frames.
16. A training sample generation device for a video scene classification model, characterized in that: The device comprises: A sample acquisition module, used to acquire a sample video, wherein the sample video includes a plurality of continuous sample image frames; A video extraction module is used to extract video features from each of the sample image frames to obtain video features corresponding to each of the sample image frames, wherein the video features are used to describe features included in the sample image frames and change features between the sample image frames and associated sample image frames; wherein the associated sample image frames refer to image frames in the sample video that have an associated relationship with the sample image frames; A scene extraction module, used to extract scene features from each of the sample image frames to obtain image scene features corresponding to each of the sample image frames; wherein the image scene features are used to describe the scene to which the sample image frame belongs; A sample generation module is used to generate training samples corresponding to the sample video according to the video features corresponding to each of the sample image frames and the image scene features corresponding to each of the sample image frames; wherein the training samples are used to train a video scene classification model, and the video scene classification model is used to identify the scene to which the video belongs.
17. A video scene classification device, characterized in that: The device comprises: A video acquisition module, used to acquire a video to be processed, wherein the video includes a plurality of continuous image frames; A video processing module, used to extract video features from each of the image frames to obtain video features corresponding to each of the image frames, wherein the video features are used to describe features contained in the image frame and change features between the image frame and associated image frames; wherein the associated image frame refers to an image frame that has an associated relationship with the image frame in the video; An image processing module, used to extract scene features from each of the image frames to obtain image scene features corresponding to each of the image frames; wherein the image scene features are used to describe the scene to which the image frame belongs; The scene determination module is used to determine the scene to which the video belongs according to the video features corresponding to each of the image frames and the image scene features corresponding to each of the image frames.
18. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the training sample generation method of the video scene classification model as described in any one of claims 1 to 10, or to implement the video scene classification method as described in any one of claims 11 to 15.
19. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the training sample generation method of the video scene classification model as described in any one of claims 1 to 10, or to implement the video scene classification method as described in any one of claims 11 to 15.
20. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. The processor reads and executes the computer instructions from the computer-readable storage medium to implement the training sample generation method for the video scene classification model as described in any one of claims 1 to 10, or implements the video scene classification method as described in any one of claims 11 to 15.
