Video recognition method and device
By obtaining and comparing feature vectors of videos to be identified and clustered reference videos, the problem of low video recognition accuracy is solved and the accuracy of video recognition is improved.
Patent Information
- Application Number
- CN202210618307.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-01
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-06-01
AI Technical Summary
In existing video recognition methods, the accuracy of video recognition is low because the characteristics of viewing users cannot accurately represent the similarity of video content.
By obtaining the similarity of the feature vectors of the video to be identified and the feature vectors of the reference video collection that meets the clustering conditions, it is judged whether the video to be identified belongs to the target type. The clustered reference video set is more focused on a certain video type and improves recognition accuracy. Spend.
It improves the accuracy of judging whether the video to be identified is a video of the target type, reduces misjudgments, and enhances the accuracy of video recognition.
Smart Images

Figure CN114926771B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a video recognition method and device. Background Art
[0002] In the scenario of video applications, it is often necessary to push videos to users based on the video categories that users like. Usually, it is necessary to take multiple videos that meet the standards as samples, extract their viewing user features, and compare them with the viewing user features of the video to be identified to determine whether the video to be identified meets the user's preferences. However, since the viewing user features represent the user's viewing behavior, similar viewing user features do not mean similar video content. This judgment method will result in many misjudgments, resulting in a reduced accuracy rate of video recognition. Summary of the invention
[0003] The embodiments of the present disclosure at least provide a video recognition method and device.
[0004] In a first aspect, an embodiment of the present disclosure provides a video recognition method, including:
[0005] Get the video to be identified;
[0006] Obtaining a first feature vector of the video to be identified; the first feature vector includes attribute characteristics of a user group viewing the video to be identified;
[0007] Obtaining second feature vectors respectively corresponding to a plurality of first reference videos in a first reference video set; the first reference video is a video of a target type; the first reference video set includes a plurality of first reference videos in at least one clustering category that meets a clustering condition, wherein the clustering category meets the clustering condition means that: the number of first reference videos included in the clustering category is greater than a preset number, and the similarity between the second feature vectors of the respective first reference videos in the clustering category is greater than a set threshold;
[0008] Based on the target similarity between the second feature vector of each first reference video in the first reference video set and the first feature vector, it is determined whether the video to be identified belongs to the target type of video.
[0009] In an optional implementation manner, the first reference video set is determined according to the following steps:
[0010] Obtain second feature vectors of a plurality of first reference videos of the target type;
[0011] Based on the second feature vector, the first reference videos are clustered to obtain a first reference video set that is successfully clustered, wherein the first reference video set includes multiple first reference videos in at least one clustering category that meets the clustering condition, wherein the clustering category meets the clustering condition if: the number of first reference videos included in the clustering category is greater than a preset number, and the similarity between the second feature vectors of each first reference video in the clustering category is greater than a set threshold.
[0012] In an optional implementation, the target density clustering model is trained according to the following steps:
[0013] Obtaining third feature vectors of multiple second reference videos of the target type and fourth feature vectors of multiple training video samples;
[0014] Inputting the third feature vectors into density clustering models configured with different model parameters respectively, to obtain a second reference video set that is successfully clustered under different model parameters;
[0015] For any of the second reference video sets, based on the target similarity between the third feature vector corresponding to each second reference video in the second reference video set and the fourth feature vector corresponding to the training video sample, determining a test result of the training video sample; the test result indicates whether the training video sample belongs to the target type of video;
[0016] Based on the test results of each training video sample under different model parameters and their corresponding type labels, the target model parameters corresponding to the density clustering model are determined, and the density clustering model configured with the target model parameters is used as the trained target density clustering model.
[0017] In an optional implementation manner, the first feature vector is a feature vector of the video to be identified when the target display amount is reached; the target display amount is determined by the following steps:
[0018] Obtaining a fifth feature vector of a third reference video of the target type when the video reaches a plurality of different display amounts;
[0019] Determine a target similarity between the fifth feature vectors respectively corresponding to the third reference video when the third reference video reaches a preset display amount among the multiple different display amounts and when the third reference video reaches other display amounts among the multiple different display amounts except the preset display amount;
[0020] Taking the fifth eigenvector corresponding to the gentle critical point indicated by the change trend of the target similarity as the target eigenvector;
[0021] The display amount corresponding to the target feature vector is used as the target display amount.
[0022] In an optional implementation, determining the target similarity includes:
[0023] Determine the cosine similarity and Euclidean distance similarity between the fifth eigenvectors corresponding to the third reference video when the third reference video reaches a preset display amount among the multiple different display amounts and when the third reference video reaches other display amounts among the multiple different display amounts except the preset display amount;
[0024] Determine the display amounts corresponding to the gentle critical points indicated by the change trends of the Euclidean distance similarity and the cosine similarity respectively;
[0025] The similarity with the lowest display amount corresponding to the gentle critical point in the Euclidean distance similarity and the cosine similarity is used as the target similarity.
[0026] In an optional implementation, determining whether the video to be identified belongs to the target type of video based on the target similarity between the second feature vector of each first reference video in the first reference video set and the first feature vector, includes:
[0027] Determine whether there is a target similarity greater than a preset threshold among the obtained target similarities;
[0028] If so, it is determined that the video to be identified belongs to the target type.
[0029] In a second aspect, the present disclosure also provides a video recognition device, including:
[0030] A first acquisition module is used to acquire a video to be identified; and acquire a first feature vector of the video to be identified; the first feature vector includes attribute characteristics of a user group viewing the video to be identified;
[0031] A second acquisition module is used to acquire second feature vectors respectively corresponding to a plurality of first reference videos in a first reference video set; the first reference video is a video of a target type; the first reference video set includes a plurality of first reference videos in at least one clustering category that meets a clustering condition, wherein the clustering category meets the clustering condition means that: the number of first reference videos included in the clustering category is greater than a preset number, and the similarity between the second feature vectors of the respective first reference videos in the clustering category is greater than a set threshold;
[0032] The first determination module is used to determine whether the video to be identified belongs to the target type of video based on the target similarity between the second feature vector of each first reference video in the first reference video set and the first feature vector.
[0033] In an optional implementation manner, the device further includes a second determining module, configured to:
[0034] Obtain second feature vectors of a plurality of first reference videos of the target type;
[0035] The second feature vector is input into a pre-trained target density clustering model to obtain a first reference video set that is successfully clustered; the target density clustering model is determined from density clustering models configured with different model parameters based on multiple second reference videos of the target type and multiple training video samples carrying type labels.
[0036] In an optional implementation, the device further includes a training module, which is used to:
[0037] Obtaining third feature vectors of multiple second reference videos of the target type and fourth feature vectors of multiple training video samples;
[0038] Inputting the third feature vectors into density clustering models configured with different model parameters respectively, to obtain a second reference video set that is successfully clustered under different model parameters;
[0039] For any of the second reference video sets, based on the target similarity between the third feature vector corresponding to each second reference video in the second reference video set and the fourth feature vector corresponding to the training video sample, determining a test result of the training video sample; the test result indicates whether the training video sample belongs to the target type of video;
[0040] Based on the test results of each training video sample under different model parameters and their corresponding type labels, the target model parameters corresponding to the density clustering model are determined, and the density clustering model configured with the target model parameters is used as the trained target density clustering model.
[0041] In an optional implementation manner, the first feature vector is a feature vector of the video to be identified when the target display amount is reached;
[0042] The device further includes a third determining module, configured to:
[0043] Obtaining a fifth feature vector of a third reference video of the target type when the video reaches a plurality of different display amounts;
[0044] Determine a target similarity between the fifth feature vectors respectively corresponding to the third reference video when the third reference video reaches a preset display amount among the multiple different display amounts and when the third reference video reaches other display amounts among the multiple different display amounts except the preset display amount;
[0045] Taking the fifth eigenvector corresponding to the gentle critical point indicated by the change trend of the target similarity as the target eigenvector;
[0046] The display amount corresponding to the target feature vector is used as the target display amount.
[0047] In an optional implementation manner, when determining the target similarity, the third determination module is used to:
[0048] Determine the cosine similarity and Euclidean distance similarity between the fifth eigenvectors corresponding to the third reference video when the third reference video reaches a preset display amount among the multiple different display amounts and when the third reference video reaches other display amounts among the multiple different display amounts except the preset display amount;
[0049] Determine the display amounts corresponding to the gentle critical points indicated by the change trends of the Euclidean distance similarity and the cosine similarity respectively;
[0050] The similarity with the lowest display amount corresponding to the gentle critical point in the Euclidean distance similarity and the cosine similarity is used as the target similarity.
[0051] In an optional implementation manner, the first determining module is specifically configured to:
[0052] Determine whether there is a target similarity greater than a preset threshold among the obtained target similarities;
[0053] If so, it is determined that the video to be identified belongs to the target type.
[0054] In a third aspect, an embodiment of the present disclosure further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned first aspect, or any possible implementation of the first aspect are performed.
[0055] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are executed.
[0056] The video recognition method and device provided by the embodiments of the present disclosure obtain a video to be recognized; obtain a first feature vector of the video to be recognized; the first feature vector contains the attribute characteristics of the user group viewing the video to be recognized; obtain second feature vectors corresponding to multiple first reference videos in a first reference video set; the first reference video is a target type of video; the first reference video set includes multiple first reference videos in at least one clustering category that meets the clustering condition, wherein the clustering category meets the clustering condition means that: the number of first reference videos included in the clustering category is greater than a preset number, and the similarity between the second feature vectors of each first reference video in the clustering category is greater than a set threshold; based on the target similarity between the second feature vector of each first reference video in the first reference video set and the first feature vector, determine whether the video to be recognized belongs to the target type of video. The disclosed embodiment uses the first reference video that meets the clustering conditions as a sample, compares the corresponding second feature vector with the first feature vector corresponding to the video to be identified, obtains the target similarity, and determines whether the video to be identified belongs to the target type of video based on the target similarity. Since the viewing user group corresponding to the first reference video in the clustered first reference video set is more focused on videos of a certain clustering type and is more specific about their favorite video types, the first reference video is more likely to be consistent with the target type of video, thereby improving the accuracy of determining whether the video to be identified is the target type of video.
[0057] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0059] Figure 1 A flow chart of a video recognition method provided by an embodiment of the present disclosure is shown;
[0060] Figure 2 A schematic diagram showing a change curve of cosine similarity provided by an embodiment of the present disclosure;
[0061] Figure 3A schematic diagram showing a variation curve of the Euclidean distance similarity provided by an embodiment of the present disclosure;
[0062] Figure 4 A flowchart showing a specific method for training a target density clustering model in the video recognition method provided by an embodiment of the present disclosure;
[0063] Figure 5 A flowchart of another video recognition method provided by an embodiment of the present disclosure is shown;
[0064] Figure 6 A schematic diagram of a video recognition device provided by an embodiment of the present disclosure is shown;
[0065] Figure 7 A schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0067] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0068] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.
[0069] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0070] In order to solve the technical problem of low video recognition accuracy in the prior art, the present disclosure provides a video recognition method and device, which takes a first reference video that meets the clustering conditions as a sample, compares its corresponding second feature vector with the first feature vector corresponding to the video to be identified, obtains the target similarity, and judges whether the video to be identified belongs to the target type of video according to the target similarity. Since the viewing user group corresponding to the first reference video in the clustered first reference video set is more specific in the favorite video type, the first reference video is more likely to be consistent with the target type of video, thereby improving the accuracy of judging whether the video to be identified is the target type of video.
[0071] To facilitate understanding of this embodiment, a video recognition method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the video recognition method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities, and the computer device includes, for example, a terminal device or a server or other processing device. In some possible implementations, the video recognition method can be implemented by a processor calling a computer-readable instruction stored in a memory.
[0072] See also Figure 1 FIG. 1 is a flowchart of a video recognition method provided by an embodiment of the present disclosure, wherein the method includes steps S101 to S104, wherein:
[0073] S101: Obtain a video to be identified.
[0074] Among them, the above-mentioned video to be identified may be a short video, a long video, etc., and may carry a type label. The embodiment of the present disclosure can determine whether the type of the video to be identified is consistent with the type label. The type of the video may refer to the type of content contained in the video, such as popular science type, film and television type, song type, general life type, etc.
[0075] S102, obtaining a first feature vector of the video to be identified; the first feature vector includes attribute characteristics of a user group viewing the video to be identified.
[0076] The above-mentioned video can be put on the video platform for users to watch. Every time the video is watched by a new user, the display volume of the video can be increased. The video also corresponds to a feature vector. Since the video content itself is too complex, it is difficult to represent it using a feature vector. The viewing users of a certain type of video are relatively fixed. The attribute characteristics of the video viewing user group can be used to replace the content characteristics of the video. The attribute characteristics of the viewing user group can be used to represent the video. The attribute characteristics of the viewing user group can represent the characteristics of the individual users or groups who watch the video, such as viewing history characteristics, user group portrait characteristics, etc.
[0077] Here, as described above regarding personal information, the methods of obtaining and using the attribute characteristics of the above-mentioned viewing user groups should be based on relevant laws and regulations and should inform users of the types, scope of use, usage scenarios, etc. of the personal information involved in this disclosure in an appropriate manner and obtain users' authorization.
[0078] In the embodiment of the present disclosure, the feature vector of the video to be identified may be referred to as a first feature vector.
[0079] The above-mentioned first feature vector can be the first feature vector of the video to be identified when it reaches the target display volume. Since the above-mentioned first feature vector contains the attribute characteristics of the viewing user group corresponding to the video to be identified, after the display volume increases, the corresponding viewing users also change, and the newly added viewing users are of different types. Therefore, the first feature vector corresponding to the viewing user group will also change. However, after the display volume increases to a certain extent, the user group watching the video to be identified gradually tends to be stable, and the change of the first feature vector will also tend to be fixed. When the change of the first feature vector tends to be fixed, it can more accurately reflect the audience users of the video to be identified.
[0080] The target display amount is the display amount corresponding to when the first eigenvector tends to be fixed.
[0081] Specifically, you can determine the target impression volume by following the steps below:
[0082] Obtaining a fifth feature vector of a third reference video of the target type when the video reaches a plurality of different display amounts;
[0083] Determine a target similarity between the fifth feature vectors respectively corresponding to the third reference video when the third reference video reaches a preset display amount among the multiple different display amounts and when the third reference video reaches other display amounts among the multiple different display amounts except the preset display amount;
[0084] Taking the fifth eigenvector corresponding to the gentle critical point indicated by the change trend of the target similarity as the target eigenvector;
[0085] The display amount corresponding to the target feature vector is used as the target display amount.
[0086] In order to determine the display amount when the area of the feature vector is fixed, the fifth feature vector of the third reference video of the target type can be obtained when it reaches multiple different display amounts, wherein the content type of the third reference video can be the same as the content type of the first reference video, so that the feature vectors corresponding to the reference videos with the same content type are more similar.
[0087] Afterwards, the fifth eigenvector when the preset display amount is reached in the third reference video can be determined first. The preset display amount can be one of the above-mentioned multiple different display amounts. Exemplarily, it can be the display amount with the lowest value. For example, if multiple display amounts include 50, 100, 150, 200 and other display amounts, 50 can be taken as the preset display amount.
[0088] The above target similarity can reflect the changing trend of the feature vector. When the target similarity tends to be stable, the changing trend of the feature vector also tends to be stable. The changing trend of the target similarity can be represented by a change curve. The flat critical point of the change curve can be determined, and the corresponding display amount is used as the target display amount.
[0089] There are many types of similarities between feature vectors, such as Euclidean distance similarity, cosine similarity, Jaccard similarity coefficient, Pearson correlation coefficient, etc. The target display amounts corresponding to feature vectors under different types of similarities may be different. In order to identify the video to be identified as soon as possible, the similarity with the lowest target display amount can be selected as the target similarity.
[0090] See also Figure 2 and Figure 3 ,in, Figure 2 A schematic diagram of a cosine similarity variation curve provided in an embodiment of the present disclosure, Figure 3 A schematic diagram of a variation curve of the Euclidean distance similarity provided by an embodiment of the present disclosure. Figure 2 As shown, when the content type of the third reference video is a small life video, the cosine similarity is basically stable after the display volume reaches 300, and the Euclidean distance similarity is basically stable after the display volume reaches 6000. In this case, cosine similarity can be selected as the target similarity.
[0091] S103, obtaining second feature vectors respectively corresponding to multiple first reference videos in a first reference video set; the first reference video is a target type of video; the first reference video set includes multiple first reference videos in at least one clustering category that meets the clustering condition, wherein the clustering category meets the clustering condition means: the number of first reference videos included in the clustering category is greater than a preset number, and the similarity between the second feature vectors of each first reference video in the clustering category is greater than a set threshold.
[0092] Among them, the above-mentioned first reference video set is obtained by clustering multiple first reference videos. The first reference videos in the first reference video set meet the clustering conditions, and the first reference videos that fail to be clustered successfully, that is, do not meet the clustering conditions, do not exist in the first reference video set.
[0093] The above-mentioned multiple first reference videos can be videos of the target type, and their content type can be the same as the type label carried by the video to be identified, which is used to determine whether the type label of the video to be identified is correct. However, since the above-mentioned feature vector comes from the viewing behavior of the user group, it cannot directly represent the content and quality of the video. If the first feature vector of the video to be identified is similar to the second feature vector of the first reference video, there is a possibility that the video to be identified is not a video of the target type. If the second feature vectors corresponding to all the first reference videos are directly used for video identification, misjudgment may occur.
[0094] Therefore, multiple first reference videos can be clustered, and videos corresponding to high-density areas in the feature vector space can be obtained by density clustering the feature vectors. The videos corresponding to the high-density areas, that is, the videos that meet the clustering conditions, are used as the first reference video set. After research, it is found that user groups who watch videos that meet the clustering conditions are usually more interested in this type of video and have a more vertical interest preference for videos. That is, the user groups corresponding to this type of feature vector usually watch videos that are likely to belong to the target type, while the user groups corresponding to the feature vectors in the low-density areas like a wider range of video types, which is not conducive to video recognition. Therefore, using videos that meet the clustering conditions as the first reference video set and using the second feature vector corresponding to the first reference video set for video recognition can improve the accuracy of video recognition.
[0095] Exemplarily, each second feature vector can be placed in a vector space to determine the similarity between each second feature vector, wherein the similarity between the second feature vectors can be the Euclidean distance between the two feature vectors. If the Euclidean distance between the two second feature vectors is less than a preset distance, that is, the similarity between the two feature vectors is greater than a set threshold, then the two second feature vectors can be neighbors of each other. If the number of neighbors of a second feature vector is greater than a preset number, then the second feature vector and its neighbors can be regarded as feature vectors under a clustering type, and the area of the vector space where the feature vector under the clustering type is located is the above-mentioned high-density area. In this way, the second reference vector whose number of neighbors is less than or equal to the preset number does not meet the clustering condition, and its corresponding first reference video can be eliminated from the above-mentioned multiple first reference videos, and the first reference video corresponding to the second feature vector that meets the clustering condition constitutes the first reference video set.
[0096] In a specific implementation process, the second feature vectors of multiple first reference videos of the target type can be obtained first, and then the second feature vectors corresponding to the multiple first reference videos are input into a pre-trained target density clustering model, and the target density clustering model is calculated to obtain a set of first reference videos whose output is successfully clustered. The target density clustering model can be determined from density clustering models configured with different model parameters based on multiple second reference videos of the target type and multiple training video samples carrying type labels.
[0097] See also Figure 4 FIG. 1 is a flowchart of a specific method for training a target density clustering model in a video recognition method provided by an embodiment of the present disclosure, which specifically includes:
[0098] S401, obtaining third feature vectors of multiple second reference videos of the target type and fourth feature vectors of multiple training video samples.
[0099] The second reference video may correspond to the first reference video, the training video sample may correspond to the video to be identified, and the third feature vector and the fourth feature vector may be feature vectors of the corresponding videos when the target display amount is reached.
[0100] S402: Input the third feature vectors into density clustering models configured with different model parameters respectively to obtain a second reference video set that is successfully clustered under different model parameters.
[0101] By inputting the third eigenvector into a density clustering model configured with different model parameters, a second reference video set of successful clustering output by the model under different model parameters can be obtained. The above model parameters may include the maximum Euclidean distance for determining whether the eigenvectors are neighbors, and the minimum number of eigenvectors for determining whether eigenvectors that are neighbors of each other can form a clustering type.
[0102] By testing density clustering models with different configurations of maximum Euclidean distance and minimum number of eigenvectors, the model parameters with the highest accuracy can be determined.
[0103] S403. For any of the second reference video sets, determine a test result of the training video sample based on the target similarity between the third feature vector corresponding to each second reference video in the second reference video set and the fourth feature vector corresponding to the training video sample; the test result indicates whether the training video sample belongs to the target type of video.
[0104] In this step, by using the second reference video sets obtained under different model parameters to identify the training video samples, the reliability of each second reference video set can be verified, and then the model parameters with higher accuracy can be selected.
[0105] S404: Based on the test results of each training video sample under different model parameters and their corresponding type labels, determine the target model parameters corresponding to the density clustering model, and use the density clustering model configured with the target model parameters as the trained target density clustering model.
[0106] In this step, the test results of each training video sample under different model parameters can be verified through the pre-configured type labels, and the model parameters with the highest recognition accuracy of the training video samples under each model parameter can be selected as the target model parameters, and the density clustering model configured with the target model parameters can be used as the trained target density clustering model.
[0107] S104: Determine whether the to-be-identified video belongs to the target type of video based on the target similarity between the second feature vector of each first reference video in the first reference video set and the first feature vector.
[0108] In this step, it can be determined whether there is a target similarity greater than a preset threshold among the obtained target similarities. If so, it means that the user group that likes the video to be identified also likes the first reference video corresponding to the target similarity. It can be determined that the above video to be identified belongs to the target type, that is, the video to be identified is a high-quality video.
[0109] The video recognition method provided by the embodiment of the present disclosure includes: obtaining a video to be recognized; obtaining a first feature vector of the video to be recognized; the first feature vector includes the attribute characteristics of the user group viewing the video to be recognized; obtaining second feature vectors corresponding to multiple first reference videos in a first reference video set; the first reference video is a target type of video; the first reference video set includes multiple first reference videos in at least one clustering category that meets the clustering condition, wherein the clustering category meets the clustering condition means that: the number of first reference videos included in the clustering category is greater than a preset number, and the similarity between the second feature vectors of each first reference video in the clustering category is greater than a set threshold; based on the target similarity between the second feature vector of each first reference video in the first reference video set and the first feature vector, determine whether the video to be recognized belongs to the target type of video. The disclosed embodiment uses the first reference video that meets the clustering conditions as a sample, compares the corresponding second feature vector with the first feature vector corresponding to the video to be identified, obtains the target similarity, and determines whether the video to be identified belongs to the target type of video based on the target similarity. Since the viewing users corresponding to the first reference videos in the clustered first reference video set are more specific in their favorite video types, the first reference video is more likely to be consistent with the target type of video, thereby improving the accuracy of determining whether the video to be identified is the target type of video.
[0110] See also Figure 5 As shown, it is a flowchart of another video recognition method provided by an embodiment of the present disclosure. First, a video to be recognized whose type label is a target type can be obtained. Then, when the display amount of the video to be recognized reaches the target display amount, a feature vector of the video to be recognized is obtained, and the feature vector includes viewing user features. After that, a feature vector of a reference video obtained by clustering by a clustering model can be obtained, and then the target similarity between the feature vector and the obtained feature vector of the video to be recognized is calculated. Finally, based on the determined target similarity, the video to be recognized is judged to be a video of the target type. Among them, the clustering model can be regularly updated and trained according to the clustering results and their corresponding type labels to improve the accuracy of the clustering model.
[0111] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0112] Based on the same inventive concept, a video recognition device corresponding to the video recognition method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned video recognition method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0113] Reference Figure 6 FIG. 1 is a schematic diagram of a video recognition device provided by an embodiment of the present disclosure, wherein the device includes:
[0114] The first acquisition module 610 is used to acquire a video to be identified; and acquire a first feature vector of the video to be identified; the first feature vector includes attribute characteristics of a user group viewing the video to be identified;
[0115] The second acquisition module 620 is used to obtain second feature vectors respectively corresponding to multiple first reference videos in the first reference video set; the first reference video is a video of the target type; the first reference video set includes multiple first reference videos in at least one clustering category that meets the clustering condition, wherein the clustering category meets the clustering condition means that: the number of first reference videos included in the clustering category is greater than a preset number, and the similarity between the second feature vectors of each first reference video in the clustering category is greater than a set threshold;
[0116] The first determination module 630 is configured to determine whether the video to be identified belongs to the target type of video based on the target similarity between the second feature vector of each first reference video in the first reference video set and the first feature vector.
[0117] In an optional implementation manner, the device further includes a second determining module 640, configured to:
[0118] Obtain second feature vectors of a plurality of first reference videos of the target type;
[0119] The second feature vector is input into a pre-trained target density clustering model to obtain a first reference video set that is successfully clustered; the target density clustering model is determined from density clustering models configured with different model parameters based on multiple second reference videos of the target type and multiple training video samples carrying type labels.
[0120] In an optional implementation, the device further includes a training module 650, which is used to:
[0121] Obtaining third feature vectors of multiple second reference videos of the target type and fourth feature vectors of multiple training video samples;
[0122] Inputting the third feature vectors into density clustering models configured with different model parameters respectively, to obtain a second reference video set that is successfully clustered under different model parameters;
[0123] For any of the second reference video sets, based on the target similarity between the third feature vector corresponding to each second reference video in the second reference video set and the fourth feature vector corresponding to the training video sample, determining a test result of the training video sample; the test result indicates whether the training video sample belongs to the target type of video;
[0124] Based on the test results of each training video sample under different model parameters and their corresponding type labels, the target model parameters corresponding to the density clustering model are determined, and the density clustering model configured with the target model parameters is used as the trained target density clustering model.
[0125] In an optional implementation manner, the first feature vector is a feature vector of the video to be identified when the target display amount is reached;
[0126] The apparatus further includes a third determining module 660, configured to:
[0127] Obtaining a fifth feature vector of a third reference video of the target type when the video reaches a plurality of different display amounts;
[0128] Determine a target similarity between the fifth feature vectors respectively corresponding to the third reference video when the third reference video reaches a preset display amount among the multiple different display amounts and when the third reference video reaches other display amounts among the multiple different display amounts except the preset display amount;
[0129] Taking the fifth eigenvector corresponding to the gentle critical point indicated by the change trend of the target similarity as the target eigenvector;
[0130] The display amount corresponding to the target feature vector is used as the target display amount.
[0131] In an optional implementation, when determining the target similarity, the third determination module 660 is used to:
[0132] Determine the cosine similarity and Euclidean distance similarity between the fifth eigenvectors corresponding to the third reference video when the third reference video reaches a preset display amount among the multiple different display amounts and when the third reference video reaches other display amounts among the multiple different display amounts except the preset display amount;
[0133] Determine the display amounts corresponding to the gentle critical points indicated by the change trends of the Euclidean distance similarity and the cosine similarity respectively;
[0134] The similarity with the lowest display amount corresponding to the gentle critical point in the Euclidean distance similarity and the cosine similarity is used as the target similarity.
[0135] In an optional implementation manner, the first determining module 630 is specifically configured to:
[0136] Determine whether there is a target similarity greater than a preset threshold among the obtained target similarities;
[0137] If so, it is determined that the video to be identified belongs to the target type.
[0138] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0139] Corresponds to Figure 1 The video recognition method in the present disclosure also provides an electronic device 700, such as Figure 7 FIG. 7 is a schematic diagram of the structure of an electronic device 700 provided in an embodiment of the present disclosure, including:
[0140] Processor 71, memory 72, and bus 73; memory 72 is used to store execution instructions, including internal memory 721 and external memory 722; the internal memory 721 is also called internal memory, which is used to temporarily store the operation data in the processor 71 and the data exchanged with the external memory 722 such as a hard disk. The processor 71 exchanges data with the external memory 722 through the internal memory 721. When the electronic device 700 is running, the processor 71 communicates with the memory 72 through the bus 73, so that the processor 71 executes the following instructions:
[0141] Get the video to be identified;
[0142] Obtaining a first feature vector of the video to be identified; the first feature vector includes attribute characteristics of a user group viewing the video to be identified;
[0143] Obtaining second feature vectors respectively corresponding to a plurality of first reference videos in a first reference video set; the first reference video is a video of a target type; the first reference video set includes a plurality of first reference videos in at least one clustering category that meets a clustering condition, wherein the clustering category meets the clustering condition means that: the number of first reference videos included in the clustering category is greater than a preset number, and the similarity between the second feature vectors of the respective first reference videos in the clustering category is greater than a set threshold;
[0144] Based on the target similarity between the second feature vector of each first reference video in the first reference video set and the first feature vector, it is determined whether the video to be identified belongs to the target type of video.
[0145] In an optional implementation manner, the processor 71 is further configured to execute:
[0146] Obtain second feature vectors of a plurality of first reference videos of the target type;
[0147] Based on the second feature vector, the first reference videos are clustered to obtain a first reference video set that is successfully clustered, wherein the first reference video set includes multiple first reference videos in at least one clustering category that meets the clustering condition, wherein the clustering category meets the clustering condition if: the number of first reference videos included in the clustering category is greater than a preset number, and the similarity between the second feature vectors of each first reference video in the clustering category is greater than a set threshold.
[0148] In an optional implementation manner, the processor 71 is further configured to execute:
[0149] Obtaining third feature vectors of multiple second reference videos of the target type and fourth feature vectors of multiple training video samples;
[0150] Inputting the third feature vectors into density clustering models configured with different model parameters respectively, to obtain a second reference video set that is successfully clustered under different model parameters;
[0151] For any of the second reference video sets, based on the target similarity between the third feature vector corresponding to each second reference video in the second reference video set and the fourth feature vector corresponding to the training video sample, determining a test result of the training video sample; the test result indicates whether the training video sample belongs to the target type of video;
[0152] Based on the test results of each training video sample under different model parameters and their corresponding type labels, the target model parameters corresponding to the density clustering model are determined, and the density clustering model configured with the target model parameters is used as the trained target density clustering model.
[0153] In an optional implementation manner, in the instruction executed by the processor 71, the first feature vector is a feature vector of the video to be identified when the target display amount is reached; and the target display amount is determined by the following steps:
[0154] Obtaining a fifth feature vector of a third reference video of the target type when the video reaches a plurality of different display amounts;
[0155] Determine a target similarity between the fifth feature vectors respectively corresponding to the third reference video when the third reference video reaches a preset display amount among the multiple different display amounts and when the third reference video reaches other display amounts among the multiple different display amounts except the preset display amount;
[0156] Taking the fifth eigenvector corresponding to the gentle critical point indicated by the change trend of the target similarity as the target eigenvector;
[0157] The display amount corresponding to the target feature vector is used as the target display amount.
[0158] In an optional implementation manner, the instructions executed by the processor 71, determining the target similarity, includes:
[0159] Determine the cosine similarity and Euclidean distance similarity between the fifth eigenvectors corresponding to the third reference video when the third reference video reaches a preset display amount among the multiple different display amounts and when the third reference video reaches other display amounts among the multiple different display amounts except the preset display amount;
[0160] Determine the display amounts corresponding to the gentle critical points indicated by the change trends of the Euclidean distance similarity and the cosine similarity respectively;
[0161] The similarity with the lowest display amount corresponding to the gentle critical point in the Euclidean distance similarity and the cosine similarity is used as the target similarity.
[0162] In an optional implementation, in the instructions executed by the processor 71, determining whether the video to be identified belongs to the target type of video based on the target similarity between the second feature vector of each first reference video in the first reference video set and the first feature vector, includes:
[0163] Determine whether there is a target similarity greater than a preset threshold among the obtained target similarities;
[0164] If so, it is determined that the video to be identified belongs to the target type.
[0165] The present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the video recognition method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0166] The embodiments of the present disclosure also provide a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the video recognition method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0167] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0168] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0169] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0170] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0171] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0172] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A video recognition method, characterized in that: include: Get the video to be identified; Obtaining a first feature vector of the video to be identified; The first feature vector includes attribute features of the user group viewing the video to be identified; Obtaining second feature vectors respectively corresponding to a plurality of first reference videos in a first reference video set; wherein the second feature vector includes attribute features of a user group watching the first reference video, and the first reference video is a target type of video; the first reference video set includes a plurality of first reference videos in at least one clustering category that meets a clustering condition, wherein the clustering category meets the clustering condition means that: the number of first reference videos included in the clustering category is greater than a preset number, and the similarity between the second feature vectors of the respective first reference videos in the clustering category is greater than a set threshold; Based on the target similarity between the second feature vector of each first reference video in the first reference video set and the first feature vector, it is determined whether the video to be identified belongs to the target type of video.
2. The method according to claim 1, characterized in that The first reference video set is determined according to the following steps: Obtain second feature vectors of a plurality of first reference videos of the target type; The second feature vector is input into a pre-trained target density clustering model to obtain a first reference video set that is successfully clustered; the target density clustering model is determined from density clustering models configured with different model parameters based on multiple second reference videos of the target type and multiple training video samples carrying type labels.
3. The method according to claim 2, characterized in that The target density clustering model is trained according to the following steps: Obtaining third feature vectors of multiple second reference videos of the target type and fourth feature vectors of multiple training video samples; Inputting the third feature vectors into density clustering models configured with different model parameters respectively, to obtain a second reference video set that is successfully clustered under different model parameters; For any of the second reference video sets, based on the target similarity between the third feature vector corresponding to each second reference video in the second reference video set and the fourth feature vector corresponding to the training video sample, determining a test result of the training video sample; the test result indicates whether the training video sample belongs to the target type of video; Based on the test results of each training video sample under different model parameters and their corresponding type labels, the target model parameters corresponding to the density clustering model are determined, and the density clustering model configured with the target model parameters is used as the trained target density clustering model.
4. The method according to claim 1, characterized in that The first feature vector is a feature vector of the video to be identified when the target display amount is reached; The target impression volume is determined by the following steps: Obtaining a fifth feature vector of a third reference video of the target type when the video reaches a plurality of different display amounts; Determine a target similarity between the fifth feature vectors respectively corresponding to the third reference video when the third reference video reaches a preset display amount among the multiple different display amounts and when the third reference video reaches other display amounts among the multiple different display amounts except the preset display amount; Taking the fifth eigenvector corresponding to the gentle critical point indicated by the change trend of the target similarity as the target eigenvector; The display amount corresponding to the target feature vector is used as the target display amount.
5. The method according to claim 4, characterized in that Determining the target similarity includes: Determine the cosine similarity and the Euclidean distance similarity between the fifth eigenvectors corresponding to the third reference video when the third reference video reaches a preset display amount among the multiple different display amounts and when the third reference video reaches other display amounts among the multiple different display amounts except the preset display amount; Determine the display amounts corresponding to the gentle critical points indicated by the change trends of the Euclidean distance similarity and the cosine similarity respectively; The similarity with the lowest display amount corresponding to the gentle critical point in the Euclidean distance similarity and the cosine similarity is used as the target similarity.
6. The method according to claim 1, characterized in that The determining whether the to-be-identified video belongs to the target type of video based on the target similarity between the second feature vector of each first reference video in the first reference video set and the first feature vector, comprises: Determine whether there is a target similarity greater than a preset threshold among the obtained target similarities; If so, it is determined that the video to be identified belongs to the target type.
7. A video recognition device, characterized in that: include: The first acquisition module is used to acquire a video to be identified; and acquire a first feature vector of the video to be identified; The first feature vector includes attribute features of the user group viewing the video to be identified; A second acquisition module is used to acquire second feature vectors respectively corresponding to a plurality of first reference videos in a first reference video set; wherein the second feature vector includes attribute characteristics of a user group watching the first reference video, and the first reference video is a target type of video; the first reference video set includes a plurality of first reference videos in at least one clustering category that meets a clustering condition, wherein the clustering category meets the clustering condition means that: the number of first reference videos included in the clustering category is greater than a preset number, and the similarity between the second feature vectors of the respective first reference videos in the clustering category is greater than a set threshold; The first determination module is used to determine whether the video to be identified belongs to the target type of video based on the target similarity between the second feature vector of each first reference video in the first reference video set and the first feature vector.
8. The device according to claim 7, characterized in that The device also includes a second determining module, configured to: Obtain second feature vectors of a plurality of first reference videos of the target type; The second feature vector is input into a pre-trained target density clustering model to obtain a first reference video set that is successfully clustered; the target density clustering model is determined from density clustering models configured with different model parameters based on multiple second reference videos of the target type and multiple training video samples carrying type labels.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the video recognition method as described in any one of claims 1 to 6 are performed.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the video recognition method according to any one of claims 1 to 6 are executed.
