Video review model training method, video review method and related device

Through the cascading two-level sub-model structure, the problem of distinguishing video audit models in live broadcast scenarios is solved, and the accuracy of identifying illegal content and the audit accuracy of live broadcast scenarios are improved.

CN112818888BActive Publication Date: 2024-09-06GUANGZHOU BAIGUOYUAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110181850.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-09
Publication Date
2024-09-06
Estimated Expiration
2041-02-09

AI Technical Summary

Technical Problem

Existing video review models have difficulty distinguishing positive and negative samples in live broadcast scenarios, resulting in low review accuracy and high false alarm rates. Especially when image quality is poor and visual features are similar, illegal content cannot be accurately identified.

Method used

A cascaded two-level sub-model structure is adopted. The first-level sub-model predicts the preliminary score of the image and decides whether to further train the second-level sub-model based on the classification loss rate. The second-level sub-model specializes in learning difficult samples to improve the discrimination ability.

Benefits of technology

It improves the video review model's ability to accurately identify illegal content, reduces the false alarm rate, and enhances the detection accuracy of illegal images in live broadcast scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112818888B
    Figure CN112818888B
Patent Text Reader

Abstract

The embodiment of the present invention discloses a video audit model training method, a video audit method and related devices, the video audit model training method includes: obtaining a first sample image and a classification label of the first sample image; initializing a video audit model, the video audit model includes a first-level sub-model and a second-level sub-model; using the first sample image to train the first-level sub-model and calculating the classification loss rate of the first-level sub-model for classifying the first sample image according to the classification label; when the classification loss rate is greater than a preset value, using the first sample image to train the second-level sub-model. Since the first sample image with a classification loss rate greater than the preset value is a difficult sample image that is difficult to distinguish between positive and negative samples, the difficult sample image can be used to train the second-level sub-model, so that the second-level sub-model learns the ability to distinguish between difficult samples. Finally, the entire video audit model can accurately distinguish between positive and negative samples, can accurately determine the presence of illegal images in the video, and improve the accuracy of video submission for review.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of video review technology, and in particular to a video review model training method, a video review method and related devices. Background Art

[0002] With the explosive growth of mobile Internet and the implementation of the Cybersecurity Law, content platform operators are facing more severe tests. On the one hand, malicious users are increasing, and on the other hand, supervision of illegal content in videos is strengthened. Video content review can help companies screen illegal images, videos, texts and other content on the platform. Through video content review, illegal content can be filtered out and deleted, thereby building a green and safe network environment for users.

[0003] With the application of machine learning technology, the existing technology usually reviews videos through trained video review models. However, live broadcast scenes are complex and particular. On the one hand, the live broadcast scenes are complex and changeable, and there are multiple objects; on the other hand, the live broadcast screenshots are affected by light, camera equipment, etc., and there are problems such as poor image quality and blur; furthermore, there are visual features such as mobile phones, walkie-talkies, and microphones in the live broadcast scene that are similar to the perspective features of illegal objects, resulting in low accuracy of videos sent for manual review; finally, in the real online data scenario, the ratio of positive samples to negative samples is too different. The above aspects ultimately cause FP (false positive) problems when using video review models to review videos. The video review model cannot accurately distinguish between negative samples and positive samples, and the accuracy of video review is low. Summary of the invention

[0004] Embodiments of the present invention provide a video review model training method, a video review method, an apparatus, an electronic device and a storage medium to solve the problem in the prior art that the video review model has difficulty in distinguishing between positive samples and negative samples, resulting in low review accuracy.

[0005] In a first aspect, an embodiment of the present invention provides a video review model training method, comprising:

[0006] Acquire a first sample image and a classification label of the first sample image;

[0007] Initializing a video audit model, wherein the video audit model includes a primary sub-model and a secondary sub-model;

[0008] Using the first sample image to train the first-level sub-model and calculating the classification loss rate of the first-level sub-model for classifying the first sample image according to the classification label;

[0009] When the classification loss rate is greater than a preset value, the first sample image is used to train the secondary sub-model.

[0010] In a second aspect, an embodiment of the present invention provides a video review method, including:

[0011] Obtain video images from the video to be reviewed;

[0012] Input the video image into a pre-trained video audit model to obtain a score of the video image being an illegal image, wherein the video audit model includes a primary sub-model and a secondary sub-model, the primary sub-model is used to predict a first score of the video image being an illegal image, and output the first score when the first score is less than a preset value, and the secondary sub-model is used to predict a second score of the video image being an illegal image when the first score is greater than a preset value, and output the second score;

[0013] When the score is greater than a preset threshold, reviewing the video to be reviewed;

[0014] Among them, the video review model is trained by the video review model training method described in the first aspect.

[0015] In a third aspect, an embodiment of the present invention provides a video review model training device, comprising:

[0016] A sample acquisition module, used to acquire a first sample image and a classification label of the first sample image;

[0017] A model initialization module, used to initialize a video audit model, wherein the video audit model includes a primary sub-model and a secondary sub-model;

[0018] A first-level sub-model training module, used to train the first-level sub-model using the first sample image and calculate the classification loss rate of the first-level sub-model for classifying the first sample image according to the classification label;

[0019] The secondary sub-model training module is used to train the secondary sub-model using the first sample image when the classification loss rate is greater than a preset value.

[0020] In a fourth aspect, an embodiment of the present invention provides a video review device, including:

[0021] A video image acquisition module, used to acquire video images from the video to be reviewed;

[0022] A model prediction module, used for inputting the video image into a pre-trained video audit model to obtain a score of the video image being an illegal image, wherein the video audit model includes a primary sub-model and a secondary sub-model, the primary sub-model is used for predicting a first score of the video image being an illegal image, and outputting the first score when the first score is less than a preset value, and the secondary sub-model is used for predicting a second score of the video image being an illegal image when the first score is greater than a preset value, and outputting the second score;

[0023] An audit module, used for auditing the video to be audited when the score is greater than a preset threshold;

[0024] Among them, the video review model is trained by the video review model training method described in the first aspect.

[0025] In a fifth aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising:

[0026] one or more processors;

[0027] a storage device for storing one or more programs,

[0028] When the one or more programs are executed by the one or more processors, the one or more processors implement the video review model training method described in the first aspect of the present invention, and / or the video review method described in the second aspect.

[0029] In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the video review model training method described in the first aspect of the present invention, and / or the video review method described in the second aspect.

[0030] The video review model of the embodiment of the present invention includes a first-level sub-model and a second-level sub-model. After the video review model is initialized, the first-level sub-model is trained with a first sample image and the classification loss rate of the first-level sub-model for classifying the first sample image is calculated according to the classification label. When the classification loss rate is greater than a preset value, the first sample image is used to train the second-level sub-model. The embodiment of the present invention adopts a cascaded two-level sub-model, and the classification loss rate of the first sample image is predicted and calculated by the first-level sub-model. Since the first sample image with a classification loss rate greater than the preset value is a difficult sample image that is difficult to distinguish between positive and negative samples, the difficult sample image can be used to train the second-level sub-model, so that the second-level sub-model learns the ability to distinguish between difficult samples. Finally, the entire video review model can accurately distinguish between positive and negative samples, can accurately determine the presence of illegal images in the video, and improve the accuracy of video submission for review. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is a flowchart of the steps of a video review model training method provided in the first embodiment of the present invention;

[0032] Figure 2A This is a flowchart of the steps of a video review model training method provided by Embodiment 2 of the present invention;

[0033] Figure 2B is a schematic diagram of the structure of a video audit model according to an embodiment of the present invention;

[0034] Figure 2C is a schematic diagram of Densenet in an embodiment of the present invention;

[0035] Figure 2D is a schematic diagram of a residual module in an embodiment of the present invention;

[0036] Figure 2E is a schematic diagram of a primary sub-model and a secondary sub-model in an embodiment of the present invention;

[0037] Figure 2F is a schematic diagram of an attention mechanism module in an embodiment of the present invention;

[0038] Figure 3 is a flowchart of the steps of a video review method provided by Embodiment 3 of the present invention;

[0039] Figure 4 It is a structural block diagram of a video review model training device provided by Embodiment 4 of the present invention;

[0040] Figure 5 is a structural block diagram of a video review device provided in Embodiment 5 of the present invention;

[0041] Figure 6 It is a structural schematic diagram of an electronic device provided in Embodiment 6 of the present invention. DETAILED DESCRIPTION

[0042] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only the parts related to the present invention, rather than all structures, are shown in the accompanying drawings. In the absence of conflict, the embodiments in this application and the features in the embodiments may be combined with each other.

[0043] Embodiment 1

[0044] Figure 1The present invention provides a flowchart of the steps of a video audit model training method according to the first embodiment of the present invention. The present invention can be applied to the case where a video audit model is trained to audit a video. The method can be performed by a video audit model training device according to the present invention. The video audit model training device can be implemented by hardware or software and integrated in the electronic device provided by the present invention. Specifically, Figure 1 As shown, the video review model training method of the embodiment of the present invention may include the following steps:

[0045] S101: Obtain a first sample image and a classification label of the first sample image.

[0046] In an embodiment of the present invention, a sample image may refer to an image used to train a video review model. The sample image may include illegal objects, such as images of illegal objects such as guns, knives, violence and terrorism. The classification label of the sample image may be a label expressing whether the sample image is a normal image or an illegal image. In one example, the classification label may be 0 when the sample image is a normal image, and the classification label may be 1 when the sample image is a illegal image.

[0047] In an optional embodiment of the present invention, multiple original images can be obtained first, and each original image can be enhanced and normalized to obtain multiple sample images. The classification labels of the sample images are determined based on the annotation operation. For example, multiple video images can be captured from multiple live videos as original images, and then the brightness, contrast, and clarity of each original image are adjusted to enhance the original image, and the size of the original image is adjusted to a uniform size, for example, adjusted to an image with a length and width of 224 pixels. Finally, the pixel values ​​of the image are normalized to obtain a sample image, and the classification label of the sample image is annotated based on manual judgment of whether the sample image contains an illegal object. If the sample image contains an illegal object, the classification label of the sample image is 1, otherwise the classification label of the sample image is 0.

[0048] S102: Initialize a video audit model, wherein the video audit model includes a first-level sub-model and a second-level sub-model.

[0049] In an embodiment of the present invention, the video audit model includes a cascaded first-level sub-model and a second-level sub-model, the first-level sub-model is used to predict a first score that the sample image belongs to a violation image, and the second-level sub-model is used to predict a second score that the sample image belongs to a violation image when the first score is greater than a preset value. Specifically, the first-level sub-model and the second-level sub-model can be classification neural networks, and illustratively, the first-level sub-model and the second-level sub-model can be classification neural networks such as VGG, ResNet, and DenseNet. Before training the video audit model, the first-level sub-model and the second-level sub-model can be constructed, and the model parameters of the first-level sub-model and the second-level sub-model can be initialized.

[0050] S103: Use the first sample image to train the first-level sub-model and calculate the classification loss rate of the first-level sub-model for classifying the first sample image according to the classification label.

[0051] Specifically, a first sample image can be randomly extracted from multiple first sample images and input into the first-level sub-model after initialization to obtain a score that the first sample image is a violation image, and the classification loss rate of the first-level sub-model for classifying the first sample image is calculated based on the score and the classification label of the first sample image. Exemplarily, the absolute value of the difference between the score and the classification label can be directly calculated as the classification loss rate, or the mean square error between the score and the classification label can be used as the classification loss rate, or the classification loss rate can be calculated by other methods. The embodiment of the present invention does not limit the method of calculating the classification loss rate.

[0052] After inputting a first sample image to train the first-level sub-model and calculating the classification loss rate, the model parameters of the first-level sub-model can be adjusted according to the classification loss rate. For example, the gradient can be calculated according to the classification loss rate, and the model parameters of the first-level sub-model can be gradient descent before continuing to iteratively train the first-level sub-model until a preset number of iterations is reached or the classification loss rate is less than a preset threshold to obtain a trained first-level sub-model.

[0053] S104: When the classification loss rate is greater than a preset value, use the first sample image to train the secondary sub-model.

[0054] After each iteration of training the first-level sub-model, if the classification loss rate of the first-level sub-model for classifying the first sample image is greater than a preset value, it means that the first sample image is a difficult sample image that is difficult to distinguish whether it is a positive sample or a negative sample. The first sample image can be used to train the second-level sub-model, so that the second-level sub-model learns the ability to distinguish whether the difficult sample image belongs to a positive sample or a negative sample. Specifically, the first sample image with a classification loss rate greater than the preset value is input into the second-level sub-model to obtain the classification loss rate of the second-level sub-model, and the model parameters of the second-level sub-model are adjusted according to the classification loss rate of the second-level sub-model until the preset number of iterations is reached or the classification loss rate of the second-level sub-model is less than the preset threshold to obtain a trained second-level sub-model.

[0055] The video review model of the embodiment of the present invention includes a first-level sub-model and a second-level sub-model. After the video review model is initialized, the first-level sub-model is trained with a first sample image and the classification loss rate of the first-level sub-model for classifying the first sample image is calculated according to the classification label. When the classification loss rate is greater than a preset value, the first sample image is used to train the second-level sub-model. The embodiment of the present invention adopts a cascaded two-level sub-model, and the classification loss rate of the first sample image is predicted and calculated by the first-level sub-model. Since the first sample image with a classification loss rate greater than the preset value is a difficult sample image that is difficult to distinguish between positive and negative samples, the difficult sample image can be used to train the second-level sub-model, so that the second-level sub-model learns the ability to distinguish between difficult samples. Finally, the entire video review model can accurately distinguish between positive and negative samples, can accurately determine the presence of illegal images in the video, and improve the accuracy of video submission for review.

[0056] Embodiment 2

[0057] Figure 2A This is a flowchart of a video review model training method provided in the second embodiment of the present invention. The embodiment of the present invention is optimized on the basis of the above-mentioned first embodiment. Specifically, Figure 2A As shown, the video review model training method of the embodiment of the present invention may include the following steps:

[0058] S201: Obtain a first sample image and a classification label of the first sample image.

[0059] In an optional embodiment of the embodiment of the present invention, multiple video images can be captured from a video, and multiple first sample images can be obtained after image enhancement and normalization processing is performed on the multiple video images, and classification labels of the first sample images are obtained based on manual annotation. In one example, when the first sample image does not include an illegal object, the classification label is 0, and when the first sample image includes an illegal object, the classification label is 1. Of course, a certain number of images can also be randomly selected from a network image library as sample images instead of being limited to capturing video images from a video to obtain sample images. The embodiment of the present invention does not limit the method of obtaining the first sample image.

[0060] S202. Initialize a video audit model, wherein the video audit model includes a primary sub-model and a secondary sub-model.

[0061] like Figure 2B As shown, the video audit model of the embodiment of the present invention includes a cascaded first-level sub-model and a second-level sub-model, the first-level sub-model is used to predict a first score that the sample image belongs to a violation image, and the second-level sub-model is used to predict a second score that the sample image belongs to a violation image when the first score is greater than a preset value. Before training the video audit model, the model parameters of the first-level sub-model and the second-level sub-model can be initialized.

[0062] Optionally, the first-level sub-model can be a DenseNet, such as Figure 2C The figure shows a schematic diagram of DenseNet. In DenseNet, all network layers are interconnected, that is, each network layer accepts all previous network layers as additional inputs, so that each network layer can reuse the output features of all previous network layers to achieve feature reuse and improve efficiency. The secondary sub-model can be ResNet. ResNet uses residual learning methods to reduce the difficulty of training deep networks. ResNet introduces residual modules based on the full convolutional network, such as Figure 2D The figure shows a schematic diagram of a residual module. Each residual module contains two paths, one of which is a direct path of the input feature, and the other path performs two or three convolution operations on the input feature to obtain the residual of the input feature. Finally, the features on the two paths are added together. The residual module can reduce the difficulty of training deep networks and make it easier to extract features. Of course, when implementing the embodiment of the present invention, those skilled in the art can also set the network type of the first-level sub-model and the second-level sub-model according to actual needs, and the embodiment of the present invention does not limit this.

[0063] S203: Use a specified number of the first sample images to perform rough training on the first-level sub-model to obtain a rough first-level sub-model and a first score for each of the first sample images to be a violation image.

[0064] In an embodiment of the present invention, when training a video review model, the first-level sub-model and the second-level sub-model can be roughly trained first, that is, the first-level sub-model and the second-level sub-model are first trained with a specified number of first sample images to obtain a rough first-level sub-model and a rough second-level sub-model after a certain number of training times.

[0065] like Figure 2E The figure shows the network structure of the first-level sub-model and the second-level sub-model. The first-level sub-model and the second-level sub-model include five groups of convolutional layers. A pooling layer is used between every two groups of convolutional layers to perform spatial dimensionality reduction. Multiple consecutive 3×3 convolution operations are used in the same group of convolutional layers. The number of convolutional kernels increases from 64 in the first group of convolutional layers to 512 in the last group of convolutional layers. The number of convolutional kernels in the same group of convolutional layers is the same. The last group of convolutional layers is followed by two fully connected layers, and the fully connected layers are followed by a classification layer. Of course, in practical applications, those skilled in the art can arbitrarily set any number of groups of convolutional layers, as well as arbitrarily set the number of convolutional layers in each group of convolutional layers and the size of the convolutional kernels. The embodiment of the present invention is not limited to this.

[0066] In an optional embodiment of the present invention, the first-level sub-model and the second-level sub-model may be convolutional neural networks with an added attention mechanism module, that is, an attention mechanism module is inserted after some convolutional layers of the first-level sub-model and the second-level sub-model to replace the pooling layer, such as Figure 2E Shown is a schematic diagram of an attention mechanism module, which includes a channel attention submodule and a spatial attention submodule.

[0067] When a specified number of first sample images are used to perform rough training on the first-level sub-model, the first sample images are input into the first-level sub-model, and for the convolution layer connected to the attention mechanism module, the output features of the convolution layer are input into the attention mechanism module to obtain the final output features of the attention mechanism module to input into the next convolution layer; the output features of the last convolution layer are sequentially passed through the fully connected layer and the classification layer to obtain the first score of the first sample image belonging to the illegal image, and the step of inputting the first sample image into the first-level sub-model is returned until the specified number of first sample images are input into the first-level sub-model, thereby achieving training of the first-level sub-model a certain number of times to obtain a rough first-level sub-model.

[0068] like Figure 2F As shown, in the attention mechanism module, the output features of the convolutional layer are input into the channel attention submodule of the attention mechanism module to obtain the channel features, the channel features and the output features of the convolutional layer are multiplied to obtain the intermediate features, the intermediate features are input into the spatial attention submodule of the attention mechanism module to obtain the spatial features, the spatial features and the intermediate features are multiplied to obtain the final output features of the attention mechanism module to input into the next convolutional layer.

[0069] Among them, Figure 2F As shown, the output features of the convolution layer pass through the maximum pooling layer and the average pooling layer in the channel attention submodule, and then pass through the perceptron to output channel features 1 and channel features 2. After the channel features 1 and 2 are added, the final channel features of the channel attention submodule are obtained through the sigmoid activation operation. The channel features output by the channel attention submodule are multiplied by the output features of the convolution layer to obtain the intermediate features. The intermediate features are used as the input features of the spatial attention submodule. In the spatial attention submodule, the intermediate features are respectively passed through the maximum pooling layer and the average pooling layer, and then the convolution operation is performed. Finally, the final spatial features of the spatial attention submodule are obtained through the sigmoid activation operation. The spatial features are multiplied by the intermediate features to obtain the final output features of the entire attention mechanism module. The final output features of the entire attention mechanism module are input into the next convolution layer, and finally the first score of the first sample image belonging to the illegal image is output at the classification layer of the first-level sub-model.

[0070] S204: Calculate the classification loss rate of the first sample image using the first score of the first sample image and the classification label.

[0071] In an embodiment of the present invention, the classification layer of the first-level sub-model outputs a first score that the first sample image belongs to an illegal image. The first score can be a probability value. The classification loss rate of the first-level sub-model for classifying the first sample image can be calculated by the first score and the classification label of the first sample image. In an example, the absolute value of the difference between the predicted value and the classification label can be calculated as the classification loss rate, and the classification loss rate can also be calculated using a loss function such as a mean square error loss function.

[0072] It should be noted that after each iteration of training the first-level sub-model, the model parameters of the first-level sub-model are adjusted according to the classification loss rate.

[0073] S205. After each time the first sample image is used to roughly train the first sub-model, if the classification loss rate is greater than a preset value, the first sample image is used to roughly train the second sub-model to obtain a rough second sub-model, until the first sub-model is roughly trained using the specified number of the first sample images.

[0074] In an embodiment of the present invention, after each iteration of training the first-level sub-model, if the classification loss rate L1 of the first-level sub-model for classifying the first sample image is greater than a preset value, it can be determined that the first sample image is a difficult sample that is difficult to distinguish between a positive sample and a negative sample, and the first sample image can be used to perform rough training on the second-level sub-model to obtain a second-level sub-model, and after the iteration of training the second-level sub-model, return to using a specified number of first sample images to perform rough training on the first-level sub-model, until all the specified number of first sample images are used to perform rough training on the first-level sub-model to obtain a rough first-level sub-model and a rough second-level sub-model. The rough training of the second-level sub-model can refer to the process of rough training of the first-level sub-model in S203-S204, which will not be described in detail here.

[0075] S206: Obtain a thermal map of the first sample image.

[0076] In an embodiment of the present invention, the heat map expresses the mapping relationship between the first score of the first-level sub-model predicting that the first sample image belongs to a violation image and the sensitive areas in the first sample image, that is, the first score of the first-level sub-model predicting that the first sample image belongs to a violation image is related to which areas in the first sample image are more sensitive.

[0077] In one example, all first sample images may be input into a trained coarse first-level sub-model to obtain a second score of the first sample image being a violation image, and a heat map of the first sample image may be generated based on the Grad-CAM and the second score.

[0078] Specifically, the partial derivative of the second score of the first sample image belonging to the illegal image with respect to all pixels Aij of the feature map output by the fully connected layer of the first-level sub-model can be calculated, and then the global average value of the partial derivative in the width and height dimensions of the feature map is taken to obtain the sensitivity of the illegal object in the first sample image relative to the Kth channel (RGB channel) in the feature map output by the fully connected layer. Finally, the sensitivity of multiple channels of each pixel is weighted linearly combined to obtain a heat map. For specific details, please refer to the method of generating a heat map by Grad-CAM in the prior art, and the embodiments of the present invention will not be described in detail here.

[0079] S207: splice the thermal map and the first sample image to obtain a second sample image.

[0080] In one example, the first sample image can be represented as H×W×3, where H is the number of pixels of the first sample image in the length direction, W is the number of pixels of the first sample image in the height direction, and 3 is the RGB channel data of the first sample image. Based on this, the first sample image adds a fourth channel with a value of 0, that is, the first sample image is represented as H×W×3×0. After generating the heat map of the first sample image, the pixel value of the heat map can be used as the value of the fourth channel of the first sample image, so as to splice the heat map and the first sample image to obtain the second sample image H×W×3×1, where 1 represents the pixel value of the heat map.

[0081] S208: Use the second sample image to train the rough first-level sub-model to obtain a final trained first-level sub-model.

[0082] In an optional embodiment, the fourth channel values ​​of a specified number of second sample images may be randomly set to 0 to obtain a third sample image, and the second sample image and the third sample image may be used to train a coarse first-level sub-model to obtain a finally trained first-level sub-model. Specifically, the pixel values ​​of the highlighted parts in some second sample images may be set to 0, that is, the channel values ​​of the fourth channel of the second sample image whose channel values ​​are greater than a preset threshold are set to 0 to obtain a third sample image, and then the second sample image and the third sample image may be randomly used to iteratively train the coarse first-level sub-model until the number of training times reaches a preset number of times or the loss rate is less than a preset threshold to obtain a trained first-level sub-model.

[0083] S209: Determine, from the first sample images, a fourth sample image whose classification loss rate is greater than a preset value.

[0084] After the first sample images are input into the rough first-level sub-model, the scores of each first sample image belonging to the illegal image can be obtained. The classification loss rate of the first sample image can be calculated based on the score, so that the first sample image with a classification loss rate greater than a preset value can be used as the fourth sample image. The fourth sample image is a difficult sample image that is difficult for the first-level sub-model to distinguish as a positive sample or a negative sample.

[0085] S210: Obtain a thermal map of the fourth sample image.

[0086] Specifically, the fourth sample image can be input into the trained rough secondary sub-model to obtain the third score of the fourth sample image, and a heat map of the fourth sample image is generated based on Grad-CAM and the third score. For details, please refer to S206 for obtaining the heat map of the first sample image, which will not be described in detail here.

[0087] S211: splice the thermal map and the fourth sample image to obtain a fifth sample image.

[0088] Specifically, the pixel value of the pixel point in the heat map may be used as the channel value of the fourth channel of the fourth sample image to splice the heat map and the fourth sample image. For details, please refer to S207 and will not be described in detail here.

[0089] S212: Use the fifth sample image to train the rough secondary sub-model to obtain a final trained secondary sub-model.

[0090] The use of the fifth sample image to train the rough second-level sub-model may refer to the training of the rough first-level sub-model in S208, which will not be described in detail here.

[0091] In an optional embodiment of the present invention, the last convolution layer of the rough secondary sub-model adopts a variable convolution kernel, and the receptive field of the secondary sub-model is variable, so that the secondary sub-model can learn the characteristics of the illegal object and enhance the secondary sub-model's ability to identify the illegal object.

[0092] The video review model of the embodiment of the present invention includes a first-level sub-model and a second-level sub-model. After the video review model is initialized, the first-level sub-model is trained with a first sample image and the classification loss rate of the first-level sub-model for classifying the first sample image is calculated according to the classification label. When the classification loss rate is greater than a preset value, the first sample image is used to train the second-level sub-model. The embodiment of the present invention adopts a cascaded two-level sub-model, and the classification loss rate of the first sample image is predicted and calculated by the first-level sub-model. Since the first sample image with a classification loss rate greater than the preset value is a difficult sample image that is difficult to distinguish between positive and negative samples, the difficult sample image can be used to train the second-level sub-model, so that the second-level sub-model learns the ability to distinguish between difficult samples. Finally, the entire video review model can accurately distinguish between positive and negative samples, can accurately determine the presence of illegal images in the video, and improve the accuracy of video submission for review.

[0093] Furthermore, the first sample image is first used to perform rough training on the first-level sub-model and the second-level sub-model, and then the sample image with the heat map spliced ​​on it is used to train the first-level sub-model and the second-level sub-model after the rough training. On the one hand, the rough training can accelerate the convergence of the model, and on the other hand, the heat map is added to the sample image to provide weak supervision data for model training, thereby improving the classification accuracy of the video review model for images.

[0094] Furthermore, by adding attention mechanism modules to the first-level sub-model and the second-level sub-model, the model focuses on the local area of ​​the illegal objects in the image, which is conducive to improving the ability of the video review model to detect illegal objects.

[0095] Furthermore, the last convolution layer of the secondary sub-model adopts a variable convolution kernel, so that the secondary sub-model can better learn the characteristics of the illegal objects and improve the ability of the secondary sub-model to identify illegal objects.

[0096] Furthermore, randomly setting the pixel values ​​of the highlighted areas in the heat map to 0 can not only avoid overfitting of the model, but also improve the model's ability to identify occluded illegal objects and enhance the robustness of the model in identifying occluded illegal objects.

[0097] Embodiment 3

[0098] Figure 3 This is a flowchart of a video review method provided in Embodiment 3 of the present invention. The embodiment of the present invention can be applied to the case where a trained video review model is used to review a video. The method can be performed by a video review device in the embodiment of the present invention. The video review device can be implemented by hardware or software and integrated in the electronic device provided in the embodiment of the present invention. Specifically, Figure 3 As shown, the video review method of the embodiment of the present invention may include the following steps:

[0099] S301, obtaining a video image from a video to be reviewed.

[0100] In the embodiment of the present invention, the video to be reviewed may be a short video. For example, the video to be reviewed may be a live video on a live broadcast platform, or a short video on a short video platform, or a long video, etc. After the video to be reviewed is determined, a certain number of video images may be captured from the video to be reviewed. For example, a certain number of video images may be captured from the video to be reviewed at a certain sampling rate, or a certain number of video images may be captured from the video to be reviewed at a certain time interval. The embodiment of the present invention does not limit the manner of acquiring video images from the video to be reviewed.

[0101] S302. Input the video image into a pre-trained video audit model to obtain a score for the video image being an illegal image, wherein the video audit model includes a first-level sub-model and a second-level sub-model, the first-level sub-model is used to predict a first score for the video image being an illegal image, and output the first score when the first score is less than a preset value, and the second-level sub-model is used to predict a second score for the video image being an illegal image when the first score is greater than a preset value, and output the second score.

[0102] The video audit model of the embodiment of the present invention can be trained by the video audit model training method of embodiment one or embodiment two. The video audit model includes a cascaded first-level sub-model and a second-level sub-model. The video image is first input into the first-level sub-model to obtain a first score for the video image to be a violation image. If the first score is less than a preset value, the video audit model outputs the first score. If the first score is greater than the preset value, the video image is input into the second-level sub-model to obtain a second score for the video image to be a violation image and outputs the second score.

[0103] S303: When the score is greater than a preset threshold, the video to be reviewed is reviewed.

[0104] If the score of the video image is greater than the preset threshold, it means that the video image is likely to contain an illegal object, and the user ID and video image of the video to be reviewed can be sent to the background, where the video can be manually reviewed.

[0105] The video audit model of the embodiment of the present invention includes a first-level sub-model and a second-level sub-model. The video image of the video to be audited is first input into the first-level sub-model to obtain a first score that the video image is a violation image. If the first score is less than a preset value, the video audit model outputs the first score. If the first score is greater than the preset value, the video image is input into the second-level sub-model to obtain a second score that the video image is a violation image and outputs the second score. The video audit model adopts a cascaded two-level sub-model. During training, the first-level sub-model predicts and calculates the classification loss rate of the first sample image. Since the first sample image with a classification loss rate greater than the preset value is a difficult sample image that is difficult to distinguish between positive and negative samples, the difficult sample image can be used to train the second-level sub-model, so that the second-level sub-model learns the ability to distinguish between difficult samples. Finally, the entire video audit model can accurately distinguish between positive and negative samples, and can accurately determine the presence of violation images in the video, thereby improving the accuracy of video submission for audit.

[0106] Embodiment 4

[0107] Figure 4 is a structural block diagram of a video audit model training device provided by Embodiment 4 of the present invention, such as Figure 4 As shown, the video audit model training device of the embodiment of the present invention includes:

[0108] The sample acquisition module 401 is used to acquire a first sample image and a classification label of the first sample image;

[0109] A model initialization module 402 is used to initialize a video audit model, wherein the video audit model includes a primary sub-model and a secondary sub-model;

[0110] A first-level sub-model training module 403 is used to train the first-level sub-model using the first sample image and calculate the classification loss rate of the first-level sub-model for classifying the first sample image according to the classification label;

[0111] The secondary sub-model training module 404 is used to train the secondary sub-model using the first sample image when the classification loss rate is greater than a preset value.

[0112] The video review model training device provided in the embodiment of the present invention can execute the video review model training method provided in the first and second embodiments of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0113] Embodiment 5

[0114] Figure 5 is a structural block diagram of a video review device provided by Embodiment 5 of the present invention, such as Figure 5 As shown, the video review device of the embodiment of the present invention may specifically include the following modules:

[0115] The video image acquisition module 501 is used to acquire the video image from the video to be reviewed;

[0116] A model prediction module 502 is used to input the video image into a pre-trained video audit model to obtain a score of the video image being an illegal image, wherein the video audit model includes a primary sub-model and a secondary sub-model, the primary sub-model is used to predict a first score of the video image being an illegal image, and output the first score when the first score is less than a preset value, and the secondary sub-model is used to predict a second score of the video image being an illegal image when the first score is greater than a preset value, and output the second score;

[0117] Review module 503, used for reviewing the video to be reviewed when the score is greater than a preset threshold;

[0118] Wherein, the video audit model is trained by the video audit model training method described in Example 1 or Example 2.

[0119] The video review device provided in the embodiment of the present invention can execute the video review method provided in the third embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0120] Embodiment 6

[0121] Reference Figure 6 , shows a schematic diagram of the structure of an electronic device in an example of the present invention. Figure 6 As shown, the electronic device may specifically include: a processor 601, a storage device 602, a display screen 603 with a touch function, an input device 604, an output device 605, and a communication device 606. The number of processors 601 in the electronic device may be one or more. Figure 6 A processor 601 is taken as an example. The processor 601, storage device 602, display screen 603, input device 604, output device 605 and communication device 606 of the electronic device can be connected through a bus or other means. Figure 6 The electronic device is used to execute the video audit model training method and / or the video audit method as provided in any embodiment of the present invention.

[0122] An embodiment of the present invention also provides a computer-readable storage medium. When the instructions in the storage medium are executed by the processor of the device, the device can execute the video review model training method and / or the video review method as described in the above method embodiment.

[0123] It should be noted that, for the device, electronic device, and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0124] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0125] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A video review model training method, characterized in that: include: Acquire a first sample image and a classification label of the first sample image; Initializing a video audit model, wherein the video audit model includes a primary sub-model and a secondary sub-model; Using the first sample image to train the first-level sub-model and calculating the classification loss rate of the first-level sub-model for classifying the first sample image according to the classification label; When the classification loss rate is greater than a preset value, using the first sample image to train the secondary sub-model, wherein the first sample image whose classification loss rate is greater than the preset value is a difficult sample image; The adopting the first sample image to train the first-level sub-model and calculating the classification loss rate of the first-level sub-model for classifying the first sample image according to the classification label includes: Using a specified number of the first sample images to perform rough training on the first sub-model to obtain a rough first sub-model and a first score for each of the first sample images to be a violation image; Calculating a classification loss rate of the first sample image using a first score of the first sample image and the classification label; Inputting all first sample images into the coarse first-level sub-model to obtain a second score of whether the first sample image is a violation image; generating a heat map of the first sample image based on Grad-CAM and the second score; Splicing the thermal map and the first sample image to obtain a second sample image; The second sample image is used to train the rough first-level sub-model to obtain a final trained first-level sub-model.

2. The video audit model training method according to claim 1, characterized in that: The obtaining of the first sample image and the classification label of the first sample image includes: Get the original image; Performing image enhancement and normalization processing on the original image to obtain a first sample image; A classification label of the first sample image is determined based on the labeling operation, where the classification label indicates whether the first sample image is a normal image or an illegal image.

3. The video audit model training method according to claim 1, characterized in that: The first-level sub-model includes a convolutional layer, an attention mechanism module, a fully connected layer, and a classification layer. The first-level sub-model is roughly trained using a specified number of the first sample images to obtain a rough first-level sub-model and a first score of each of the first sample images belonging to a violation image, including: Input the first sample image into the first-level sub-model, and for the convolution layer connected to the attention mechanism module, input the output feature of the convolution layer into the attention mechanism module to obtain the final output feature of the attention mechanism module to input into the next convolution layer; The output features of the last convolutional layer are sequentially passed through the fully connected layer and the classification layer to obtain a first score for the first sample image being a violation image, and the step of inputting the first sample image into the first-level sub-model is returned until a specified number of first sample images are input into the first-level sub-model.

4. The video audit model training method according to claim 3, characterized in that: For the convolution layer connected to the attention mechanism module, inputting the output feature of the convolution layer into the attention mechanism module to obtain the final output feature of the attention mechanism module to input into the next convolution layer, including: Input the output features of the convolutional layer into the channel attention submodule of the attention mechanism module to obtain channel features; Multiplying the channel feature and the convolutional layer output feature to obtain an intermediate feature; Inputting the intermediate features into the spatial attention submodule of the attention mechanism module to obtain spatial features; The spatial feature and the intermediate feature are multiplied to obtain the final output feature of the attention mechanism module to input the next convolutional layer.

5. The video audit model training method according to claim 3, characterized in that: The step of splicing the heat map and the first sample image to obtain a second sample image includes: The pixel values ​​of the heat map are spliced ​​onto the fourth channel of the first sample image to obtain a second sample image, wherein the first channel, the second channel and the third channel of the second sample image are respectively the RGB values ​​of the second sample image.

6. The video audit model training method according to claim 5, characterized in that: The step of using the second sample image to train the rough first-level sub-model to obtain a finally trained first-level sub-model includes: Randomly set the fourth channel values ​​of a specified number of second sample images to 0 to obtain a third sample image; The second sample image and the third sample image are used to train the rough first-level sub-model to obtain a final trained first-level sub-model.

7. The video audit model training method according to any one of claims 1 to 6, characterized in that: When the classification loss rate is greater than a preset value, using the first sample image to train the secondary sub-model includes: After each time the first sample image is used to perform rough training on the first sub-model, if the classification loss rate is greater than a preset value, the first sample image is used to perform rough training on the second sub-model to obtain a rough second sub-model, until the first sample image is used to perform rough training on the first sub-model in the specified number of times; Determine, from the first sample images, a fourth sample image whose classification loss rate is greater than a preset value; Acquire a thermal map of the fourth sample image; splicing the thermal map and the fourth sample image to obtain a fifth sample image; The fifth sample image is used to train the rough secondary sub-model to obtain a final trained secondary sub-model.

8. The video audit model training method according to claim 7, characterized in that: The step of obtaining a thermal map of the fourth sample image includes: Inputting the fourth sample image into the trained rough secondary sub-model to obtain a third score indicating that the fourth sample image is a violation image; A heat map of the fourth sample image is generated based on Grad-CAM and the third score.

9. The video audit model training method according to claim 7, characterized in that: The convolution kernel of the last convolution layer of the secondary sub-model is a deformable convolution kernel.

10. A video review method, characterized in that: include: Obtain video images from the video to be reviewed; Input the video image into a pre-trained video audit model to obtain a score of the video image being an illegal image, wherein the video audit model includes a primary sub-model and a secondary sub-model, the primary sub-model is used to predict a first score of the video image being an illegal image, and output the first score when the first score is less than a preset value, and the secondary sub-model is used to predict a second score of the video image being an illegal image when the first score is greater than a preset value, and output the second score; When the score is greater than a preset threshold, reviewing the video to be reviewed; Wherein, the video audit model is trained by the video audit model training method described in any one of claims 1-9.

11. A video review model training device, characterized in that: include: A sample acquisition module, used to acquire a first sample image and a classification label of the first sample image; A model initialization module, used to initialize a video audit model, wherein the video audit model includes a primary sub-model and a secondary sub-model; A first-level sub-model training module, used to train the first-level sub-model using the first sample image and calculate the classification loss rate of the first-level sub-model for classifying the first sample image according to the classification label; a secondary sub-model training module, configured to, when the classification loss rate is greater than a preset value, use the first sample image to train the secondary sub-model, wherein the first sample image whose classification loss rate is greater than the preset value is a difficult sample image; The first-level sub-model training module is specifically used for: Using a specified number of the first sample images to perform rough training on the first sub-model to obtain a rough first sub-model and a first score for each of the first sample images to be a violation image; Calculating a classification loss rate of the first sample image using a first score of the first sample image and the classification label; Inputting all first sample images into the coarse first-level sub-model to obtain a second score of whether the first sample image is a violation image; generating a heat map of the first sample image based on Grad-CAM and the second score; Splicing the thermal map and the first sample image to obtain a second sample image; The second sample image is used to train the rough first-level sub-model to obtain a final trained first-level sub-model.

12. A video review device, characterized in that: include: A video image acquisition module, used to acquire video images from the video to be reviewed; A model prediction module, used for inputting the video image into a pre-trained video audit model to obtain a score of the video image being an illegal image, wherein the video audit model includes a primary sub-model and a secondary sub-model, the primary sub-model is used for predicting a first score of the video image being an illegal image, and outputting the first score when the first score is less than a preset value, and the secondary sub-model is used for predicting a second score of the video image being an illegal image when the first score is greater than a preset value, and outputting the second score; An audit module, used for auditing the video to be audited when the score is greater than a preset threshold; Wherein, the video audit model is trained by the video audit model training method described in any one of claims 1-9.

13. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the video review model training method as described in any one of claims 1-9, and / or the video review method as described in claim 10.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements the video review model training method as described in any one of claims 1-9, and / or the video review method as described in claim 10.