Method, device and equipment for identifying vulgar attribution of pictures

By extracting and combining vulgar regional feature information of pictures, using vulgar attribution recognition model to accurately identify vulgar attribution of pictures, the problem of not being able to identify fine-grained vulgar content in the prior art is solved, and the efficiency and accuracy of image review are improved.

CN110610206BActive Publication Date: 2025-01-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910836283.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-05
Publication Date
2025-01-10
Estimated Expiration
2039-12-05

AI Technical Summary

Technical Problem

The existing technology cannot accurately identify the fine-grained vulgar attribution of pictures, which makes it difficult for reviewers to clarify the source of vulgar content during the image review process and cannot adapt to scenarios where vulgar attribution is needed.

Method used

By obtaining the characteristic information of the picture to be identified, the vulgar area detection model is used to extract the benchmark vulgar area pictures, and combining the global vulgar area pictures as input, and using the vulgar attribution recognition model for identification, to achieve accurate identification of vulgar attribution of pictures.

Benefits of technology

While realizing whether the pictures have vulgar content, it also determines the area and reasons for the vulgar content, reducing the workload of the reviewers and improving the accuracy and efficiency of vulgar recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110610206B_ABST
    Figure CN110610206B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and equipment for identifying the vulgar attribution of an image, the method comprising: obtaining an image to be identified; extracting feature information of the image to be identified based on a vulgar area detection model, and performing vulgar area detection using the feature information to obtain a reference vulgar area image in the image to be identified; obtaining a global vulgar area image from the image to be identified based on the reference vulgar area image; extracting vulgar feature information of the reference vulgar area image and the global vulgar area image based on a vulgar attribution recognition model, and performing vulgar attribution recognition using the vulgar feature information to determine the vulgar attribution of the image to be identified. The technical solution provided by the present application can accurately identify the vulgar attribution of an image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, device and equipment for identifying vulgar attribution of images. Background Art

[0002] In recent years, with the research and progress of artificial intelligence technology, artificial intelligence technology has been widely used in many fields. Among them, the application of artificial intelligence in the field of image content recognition is the basic guarantee for the maintenance of image materials on major Internet platforms.

[0003] At present, when reviewing image materials, major Internet platforms need to review and filter images with vulgar content. Vulgar content mainly refers to low-level taste, vulgarity, and content that makes people depressed and decadent. The existing technology often combines artificial intelligence technology to build a vulgarity recognition model, but the vulgarity recognition models in the existing technology are all coarse-grained vulgarity recognition, which can distinguish between real-life vulgarity or cartoon vulgarity, male vulgarity or female vulgarity, but cannot identify fine-grained vulgar attribution. As a result, during the image review process, the reviewer still cannot clearly identify the vulgar attribution, and needs to mark the attribution one by one. Therefore, the existing solution cannot adapt to the scenario where vulgar attribution needs to be identified. Summary of the invention

[0004] The present application provides a method, device and equipment for identifying the vulgar attribution of an image, which can accurately identify the vulgar attribution of an image.

[0005] On the one hand, the present application provides a method for identifying vulgar attribution of a picture, the method comprising:

[0006] Get the image to be identified;

[0007] Extracting feature information of the image to be identified based on a vulgar area detection model, and performing vulgar area detection using the feature information to obtain a reference vulgar area image in the image to be identified;

[0008] Acquire a global vulgar area picture from the picture to be identified based on the benchmark vulgar area picture;

[0009] Based on the vulgar attribution recognition model, the vulgar feature information of the baseline vulgar area picture and the global vulgar area picture is extracted, and the vulgar attribution recognition is performed using the vulgar feature information to determine the vulgar attribution of the picture to be identified.

[0010] Another aspect provides a device for identifying vulgar attribution of a picture, the device comprising:

[0011] The module for obtaining the image to be identified is used to obtain the image to be identified;

[0012] A first vulgar region detection processing module is used to extract feature information of the image to be identified based on a vulgar region detection model, and to perform vulgar region detection using the feature information to obtain a reference vulgar region image in the image to be identified;

[0013] A global image acquisition module, used for acquiring a global vulgar area image from the image to be identified based on the reference vulgar area image;

[0014] The vulgar attribution recognition module is used to extract the vulgar feature information of the baseline vulgar area picture and the global vulgar area picture based on the vulgar attribution recognition model and use the vulgar feature information to perform vulgar attribution recognition to determine the vulgar attribution of the picture to be recognized.

[0015] On the other hand, a device for identifying vulgar attribution of an image is provided, the device comprising a processor and a memory, the memory storing at least one instruction, at least one program, a code set or an instruction set, the at least one instruction, the at least one program, the code set or the instruction set being loaded and executed by the processor to implement the method for identifying vulgar attribution of an image as described above.

[0016] On the other hand, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the method for identifying vulgar attribution of images as described above.

[0017] The method, device and apparatus for identifying vulgar attribution of pictures provided by this application have the following technical effects:

[0018] The present application can determine whether a picture has vulgar content based on the vulgar area detection model, and at the same time determine the area where the vulgar content is located in the picture with vulgar content, and obtain a baseline vulgar area picture that represents the local characteristics of the vulgar content in the picture to be identified; then, in order to obtain more comprehensive global characteristics, a global vulgar area picture can be obtained from the picture to be identified; then, by using the baseline vulgar area picture that represents the local characteristics of the vulgar content in the picture and the global vulgar area picture that represents the global characteristics of the vulgar content in the picture as inputs of the vulgar attribution recognition model, vulgar attribution recognition of the picture is performed, and the vulgar attribution of the picture can be accurately identified. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 is a schematic diagram of an application environment provided by an embodiment of the present application;

[0021] Figure 2 It is a flowchart of a training process of a vulgar area detection model provided in an embodiment of the present application;

[0022] Figure 3 It is a flowchart of a training process of a vulgar attribution recognition model provided in an embodiment of the present application;

[0023] Figure 4 It is a flowchart of training a vulgar area detection model and a vulgar attribution recognition model provided in an embodiment of the present application;

[0024] Figure 5 It is a flowchart of a method for identifying vulgar attribution of a picture provided by an embodiment of the present application;

[0025] Figure 6 This is a schematic diagram of obtaining a reference vulgar area image in a to-be-identified image provided by an embodiment of the present application;

[0026] Figure 7 A schematic diagram of a process for extracting vulgar feature information of the reference vulgar region picture and the global vulgar region picture based on a vulgar attribution recognition model and performing vulgar attribution recognition using the vulgar feature information to determine the vulgar attribution of the picture to be recognized, provided by an embodiment of the present application;

[0027] Figure 8 It is a schematic diagram of an example of vulgar attribution recognition of a picture provided by an embodiment of the present application;

[0028] Fig. 9 It is a flowchart of another method for identifying vulgar attribution of an image provided by an embodiment of the present application;

[0029] Fig.10 It is a structural schematic diagram of a device for identifying vulgar attribution of a picture provided by an embodiment of the present application;

[0030] Fig.11 It is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0033] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology and machine learning / deep learning.

[0034] In recent years, with the research and progress of artificial intelligence technology, artificial intelligence technology has been widely used in many fields. The solution provided in the embodiment of the present application involves artificial intelligence machine learning / deep learning and other technologies, which are specifically described by the following embodiments:

[0035] See also Figure 1 , Figure 1 is a schematic diagram of an application environment provided by an embodiment of the present application, such as Figure 1 As shown, the application environment may include at least a server 01 and a terminal 02 .

[0036] In the embodiments of this specification, the server 01 may include an independently operated server, a distributed server, or a server cluster composed of multiple servers. The server 01 may include a network communication unit, a processor, a memory, etc. Specifically, the server 01 may be used to train a vulgar area detection model and a vulgar attribution recognition model.

[0037] In the embodiment of this specification, the terminal 02 may include physical devices such as smart phones, desktop computers, tablet computers, laptop computers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices, etc., and may also include software running in physical devices, such as applications, etc. The operating system running on the terminal 02 in the embodiment of this application may include but is not limited to Android system, IOS system, Linux, Windows, etc. In the embodiment of this specification, the terminal 02 can be used to provide a service for vulgar attribution recognition of images based on the vulgar area detection model and vulgar attribution recognition model trained by the server 01.

[0038] In addition, it should be noted that Figure 1 What is shown is only an application environment for vulgar attribution recognition of an image. In actual applications, the training of the vulgar area detection model and the vulgar attribution recognition model can also be processed on a device that provides vulgar attribution recognition services for images.

[0039] In the embodiments of this specification, the training data for training the vulgar area detection model and / or the vulgar attribution identification model can be stored in a distributed system; in a specific embodiment, taking the distributed system as a blockchain system as an example, when the distributed system 100 is applied to the blockchain system, it can be formed by multiple nodes (any form of computing devices in the access network, such as servers, user terminals), and the nodes form a peer-to-peer (P2P, Peer To Peer) network. The P2P protocol is an application layer protocol running on the Transmission Control Protocol (TCP, Transmission Control Protocol) protocol. In a distributed system, any machine such as a server or a terminal can join and become a node, and the node includes a hardware layer, an intermediate layer, an operating system layer, and an application layer. Specifically, the functions of each node in the blockchain system may include:

[0040] 1) Routing: a basic function of a node, used to support communication between nodes.

[0041] In addition to the routing function, the node can also have the following functions:

[0042] 2) Applications are deployed in the blockchain to implement specific businesses based on actual business needs, record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system for other nodes to add the record data to a temporary block when they successfully verify the source and integrity of the record data.

[0043] In order to ensure accurate identification of the vulgar attribution of a picture in the embodiments of this specification, a vulgar area detection model for detecting vulgar areas in pictures and a vulgar attribution identification model for identifying vulgar attributions of vulgar pictures can be trained.

[0044] In practical applications, the vulgar area detection model and the vulgar attribution recognition model can be two independent deep neural networks or two different neural network modules in the same deep neural network.

[0045] The following takes the vulgar area detection model and the vulgar attribution recognition model as two independent deep neural networks as an example to introduce an embodiment of the training process of the vulgar area detection model of the present application, which may include:

[0046] In an embodiment of the present specification, the vulgar area detection model may include a model obtained by training and learning a first deep learning model for vulgar area detection based on training sample images with vulgar areas.

[0047] In the embodiments of this specification, the first deep learning model may include but is not limited to deep learning models such as SSD neural network (Single Shot MultiBox Detector), convolutional neural network, recurrent neural network or recursive neural network.

[0048] In a specific embodiment, taking the SSD neural network as an example, the SSD neural network can use multiple different feature maps to detect targets (vulgar areas) of different scales. The SSD neural network can directly input the original image, and the annotation information of each training sample image can be determined by the priorbox layer in the SSD neural network.

[0049] The following combination Figure 2 Introducing an example of the training process of a vulgar area detection model

[0050] S201: Obtain a first training sample image.

[0051] In the embodiment of the present specification, the first training sample pictures include a large number of pictures with vulgar areas. In the embodiment of the present specification, the vulgar area can be an area in the picture where vulgar content is located.

[0052] S203: Using the first training sample image as an input of a first deep learning model, training the first deep learning model for vulgar area detection, and obtaining a predicted probability that the first training sample image has a vulgar area;

[0053] S205: Determine whether the predicted probability is greater than or equal to a preset threshold.

[0054] In the embodiments of the present specification, the preset threshold can be set in combination with the requirements for the vulgar area detection accuracy of the vulgar area detection model in actual applications. Generally, the larger the preset threshold, the higher the vulgar area detection accuracy of the trained vulgar area detection model, but the training time is longer; conversely, the smaller the preset threshold, the lower the vulgar area detection accuracy of the trained vulgar area detection model, but the training time is shorter.

[0055] In the embodiment of the present specification, the first training sample pictures include a large number of pictures with vulgar areas. Accordingly, it can be determined whether the prediction probability of each picture is greater than or equal to a preset threshold; when the prediction probability of a first percentage of pictures in the first training sample pictures is greater than or equal to the preset threshold, the result of the determination is yes, otherwise, the result of the determination is no.

[0056] Specifically, the first percentage may be a value less than or equal to 100% that is set in combination with actual applications.

[0057] S207: When the result of the judgment is no, adjust the model parameters in the first deep learning model and repeat the above steps of vulgar area detection training (S203-S205).

[0058] S209: When the result of the judgment is yes, the current first deep learning model is used as the vulgar area detection model.

[0059] In the embodiment of the present specification, a large number of pictures with vulgar areas are used as training data, and vulgar area detection training and learning are performed on the first deep learning model to obtain a vulgar area detection model. Subsequently, the vulgar area detection model can be used to detect the vulgar area in the picture, so as to determine whether the picture has vulgar content and the area where the vulgar content is located in the picture with vulgar content.

[0060] In addition, it should be noted that the above Figure 2 The corresponding training process of the vulgar area detection model is only an example. In actual applications, when different neural networks are used as the first deep learning model, the training process may be different. For example, it may also include steps such as labeling the vulgar areas of the first training sample image.

[0061] An embodiment of the training process of the vulgar attribution recognition model of the present application is introduced, which may specifically include:

[0062] In an embodiment of the present specification, the vulgar attribution recognition model may include a model obtained by training and learning a second deep learning model for vulgar attribution recognition based on pictures with specified vulgar attributions and training sample pictures without the specified vulgar attributions.

[0063] In the embodiments of this specification, the second deep learning model may include but is not limited to deep learning models such as convolutional neural networks, recurrent neural networks or recursive neural networks.

[0064] In a specific embodiment, taking the deep residual network resenet50 in the convolutional neural network as an example, the deep residual network resenet50 may include a feature extraction layer, a maximum pooling layer, an average pooling layer and a classification layer. Specifically, the feature extraction layer can be used to extract feature information of the image (generally, the feature information can be a feature vector); the maximum pooling layer and the average pooling layer normalize the feature vectors of each image to feature vectors of the same length; specifically, the maximum pooling layer can be used to extract the significant feature information of the image; the average pooling layer can be used to extract the macro feature information of the image. The classification layer can be used to classify the image into vulgar attributes based on the significant feature information and macro feature information of the image extracted by the maximum pooling layer and the average pooling layer, and determine the vulgar attribution of the image.

[0065] The following combination Figure 3 Introducing an Example of the Training Process of a Vulgar Attribution Identification Model

[0066] S301: Obtain a second training sample image.

[0067] In the embodiment of the present specification, the second training sample pictures may include pictures with designated vulgar attributions and pictures without the designated vulgar attributions.

[0068] In the embodiment of this specification, the vulgar attribution of the picture can be the category of the vulgar content in the picture.

[0069] In the embodiment of the present specification, the pictures without designated vulgar attribution may include pictures with vulgar content whose vulgar attribution is different from the designated vulgar attribution and / or pictures without vulgar content.

[0070] In addition, it should be noted that, in the embodiment of this specification, the second training sample image may include the first training sample image.

[0071] S303: Performing labeling processing of vulgar attribution on the pictures in the second training sample pictures to obtain positive training pictures with labeling information of having the vulgar attribution and negative training pictures with labeling information of not having the vulgar attribution.

[0072] S305: Performing vulgar area detection on the positive training picture based on the vulgar area detection model to obtain the vulgar area training picture in the positive training picture.

[0073] In an embodiment of the present specification, after distinguishing the positive training pictures with the vulgar attribution and the negative training pictures with annotation information that does not have the vulgar attribution through labeling processing, vulgar area detection can be performed on the positive training pictures based on the vulgar area detection model to obtain vulgar area training pictures.

[0074] S307: Acquire a global vulgar region training picture from the positive example training pictures, wherein the global vulgar region training picture includes the vulgar region training picture.

[0075] In the embodiments of this specification, the method for obtaining the global vulgar area training picture may include but is not limited to the following methods:

[0076] Taking the vulgar region training picture as the center, obtaining a picture of a specified size from the positive example training pictures corresponding to the vulgar region training picture, wherein the specified size is larger than the size of the vulgar region training picture;

[0077] Using the picture of the specified size as the global vulgar area training picture;

[0078] or,

[0079] Acquire a picture of a specified size including the vulgar area training picture from the positive example training pictures, wherein the specified size is larger than the size of the vulgar area training picture;

[0080] The picture of the specified size is used as the global vulgar area training picture.

[0081] S309: Using the vulgar area training picture, the global vulgar area training picture and the negative example training picture as inputs of a second deep learning model, training the second deep learning model for vulgar attribution recognition, and obtaining a predicted probability that each training picture has a vulgar attribution.

[0082] Specifically, each of the training pictures includes any positive training picture corresponding to the vulgar area training picture and the global vulgar area training picture, and any negative training picture.

[0083] In the embodiment of the present specification, taking the deep residual network resenet50 as the second deep learning model as an example, in the process of training and learning the second deep learning model for vulgar attribution recognition by taking the vulgar area training pictures, the global vulgar area training pictures and the negative training pictures as the input of the second deep learning model, the feature extraction layer can be used to extract the feature information of the vulgar area training pictures, the global vulgar area training pictures and the negative training pictures; then, the maximum pooling layer and the average pooling layer are used to extract the significant feature information (i.e., significant feature vectors) and macro feature information (macro feature vectors) of the pictures from the feature information extracted by the feature extraction layer respectively; finally, the significant feature vectors and macro feature vectors corresponding to the vulgar area training pictures and the global vulgar area training pictures are spliced ​​to obtain the vulgar feature vectors of the corresponding positive training pictures; the significant feature vectors and macro feature vectors corresponding to the negative training pictures are spliced ​​to obtain the vulgar feature vectors of the negative training pictures; finally, the classification layer is used to classify the vulgar feature information by vulgar attribution respectively to obtain the predicted probability of each negative training picture and the positive training picture having the vulgar attribution.

[0084] S311: Calculate the error value between the sample label corresponding to each training image and the predicted probability based on the first loss function.

[0085] In the embodiment of the present specification, the sample label corresponding to each training image represents the probability that the annotation information corresponding to each training image has the vulgar attribution.

[0086] In the embodiment of the present specification, each training picture has a predicted probability p (p is a number between 0 and 1) of a specified vulgar attribution, and the annotation information of each training picture is that the sample labels y of the picture with the specified vulgar attribution and the picture with the annotation information not having the specified vulgar attribution are 1 and 0 respectively, and the loss (first loss function) of the sample label y and the predicted probability p is defined as (yp)^2. Accordingly, the error value error can be obtained according to (yp)^2 during the training process.

[0087] In addition, it should be noted that the first loss function in the embodiment of this specification is not limited to the above-mentioned (yp)^2. In practical applications, other loss functions may also be included. The embodiment of this specification is not limited to the above-mentioned.

[0088] S313: Determine whether the error value satisfies a first preset condition.

[0089] In the embodiment of the present specification, satisfying the first preset condition may be that the error value corresponding to the second percentage of images in the second training sample images is less than or equal to a specified threshold, or that the current error value corresponding to the second percentage of images in the second training sample images and the error value after the last training learning are less than a certain threshold.

[0090] Specifically, the second percentage may be a value less than or equal to 100% that is set in combination with actual applications.

[0091] In the embodiments of the present specification, the specified threshold can be set in combination with the requirements for the vulgar attribution recognition accuracy of the vulgar attribution recognition model in actual applications. Generally, the larger the specified threshold, the higher the recognition accuracy of the trained vulgar attribution recognition model, but the training time is longer; conversely, the smaller the specified threshold, the lower the recognition accuracy of the trained vulgar attribution recognition model, but the training time is shorter.

[0092] S315: When the result of the judgment is no, adjust the model parameters in the second deep learning model and repeat the above steps (S309-S313).

[0093] S317: When the result of the judgment is yes, the current second deep learning model is used as the vulgar attribution identification model.

[0094] In the embodiments of the present specification, a large number of pictures with designated vulgar attributions and pictures without designated vulgar attributions are used as training data, and vulgar attribution recognition training is performed on the second deep learning model to obtain a vulgar attribution recognition model. Subsequently, the vulgar attribution recognition model can be used to identify whether the vulgar reason of the picture is the designated vulgar attribution, thereby realizing whether the picture has vulgar content and accurately identifying the reason why the picture is vulgar.

[0095] The following takes the vulgar area detection model and the vulgar attribution recognition model as two neural network modules in the same deep neural network as an example to introduce an embodiment of the training process of the vulgar area detection model and the vulgar attribution recognition model of the present application. Specifically, Figure 4 As shown, it may include:

[0096] S401: Obtain a third training sample image.

[0097] In the embodiment of the present specification, the third training sample pictures may include pictures with designated vulgar attributions and pictures without the designated vulgar attributions.

[0098] S403: Performing labeling processing of vulgar attribution on the pictures in the third training sample pictures to obtain positive training pictures with labeling information of having the vulgar attribution and negative training pictures with labeling information of not having the vulgar attribution.

[0099] S405: Perform vulgar area detection on the positive training picture based on the vulgar area detection module in the third deep learning model to obtain the vulgar area training picture in the positive training picture.

[0100] S407: Acquire a global vulgar region training picture from the positive example training picture, wherein the global vulgar region training picture includes the vulgar region training picture.

[0101] In the embodiment of this specification, the specific steps of obtaining the global vulgar area training picture can be referred to above Figure 3 The specific steps of obtaining the global vulgar area training picture in the corresponding embodiment will not be repeated here.

[0102] S409: Using the vulgar area training picture, the global vulgar area training picture and the negative example training picture as inputs of a vulgar attribution recognition module in a third deep learning model, training the vulgar attribution recognition module to obtain a predicted probability of each training picture having a vulgar attribution.

[0103] In the embodiment of the present specification, each training picture includes any positive training picture corresponding to the vulgar area training picture and the global vulgar area training picture, and any negative training picture.

[0104] In the embodiment of this specification, the third deep learning model may include but is not limited to the RA-CNN (Recurrent Attention Convolutional Neural Network) model. Specifically, the training and learning of attribution recognition here can refer to the above Figure 3 The relevant descriptions in the corresponding embodiments are not repeated here.

[0105] S411: Calculate the error value between the sample label corresponding to each training image and the predicted probability based on the second loss function.

[0106] In the embodiment of the present specification, the sample label corresponding to each training image represents the probability that the annotation information corresponding to each training image has the vulgar attribution.

[0107] S413: Determine whether the error value satisfies a second preset condition.

[0108] In the embodiment of the present specification, satisfying the second pass preset condition may be that the error value corresponding to the third percentage of images in the third training sample images is less than or equal to a specified threshold, or that the current error value corresponding to the third percentage of images in the second training sample images and the error value after the last training learning are less than a certain threshold.

[0109] Specifically, the third percentage may be a value less than or equal to 100% that is set in combination with actual applications.

[0110] In the embodiments of this specification, the specified threshold can be set in combination with the requirements for the detection and recognition accuracy of the vulgar area detection model and the vulgar attribution recognition model in actual applications. Generally, the larger the specified threshold, the higher the detection or recognition accuracy of the trained model, but the training time is longer; conversely, the smaller the specified threshold, the lower the detection or recognition accuracy of the trained model, but the training time is shorter.

[0111] S415: When the result of the judgment is no, adjust the model parameters in the third deep learning model, and repeat the above steps (S405 to S413) to the judgment.

[0112] S417: When the result of the judgment is yes, the vulgar area detection module in the current third deep learning model is used as the vulgar area detection model, and the vulgar attribution recognition module in the current third deep learning model is used as the vulgar attribution recognition model.

[0113] In the embodiments of this specification, a large number of pictures with designated vulgar attributions and pictures without designated vulgar attributions are used as training data, and vulgar area detection and vulgar attribution recognition are trained and learned in the third deep learning model to obtain a vulgar area detection model and a vulgar attribution recognition model. Subsequently, the vulgar area detection model can be used to detect the vulgar area in the picture, and whether the picture has vulgar content can be determined while determining the area where the vulgar content is located in the picture with vulgar content. In addition, the vulgar attribution recognition model can be used to identify whether the vulgar reason of the picture is the designated vulgar attribution, and whether the picture has vulgar content can be accurately identified while the reason for the vulgarity of the picture is identified. Using a neural network model to train to obtain a vulgar area detection model and a vulgar attribution recognition model can greatly improve the speed of training.

[0114] Based on the above-mentioned vulgar area detection model and vulgar attribution recognition model, a vulgar attribution recognition method of the present application is introduced below. Figure 5 is a flow chart of a method for identifying vulgar attribution of an image provided by an embodiment of the present application, and specifically Figure 5 As shown, the method may include:

[0115] S501: Obtain a picture to be identified.

[0116] In the embodiments of the present specification, the picture to be identified may be any one or more pictures that need to be identified as vulgar. Specifically, the picture to be identified may include pictures with vulgar content or pictures without vulgar content.

[0117] S503: Extracting feature information of the image to be identified based on a vulgar area detection model, and performing vulgar area detection using the feature information to obtain a reference vulgar area image in the image to be identified.

[0118] In the embodiments of this specification, Figure 6 As shown, Figure 6 This is a schematic diagram of obtaining a reference vulgar region image in a to-be-identified image provided by an embodiment of the present application. Specifically, the to-be-identified image can be input into a vulgar region detection model; the vulgar region detection model can extract feature information of the to-be-identified image, and perform vulgar region detection based on the extracted feature information. The vulgar region detection model can detect the probability of a vulgar region having vulgar content in at least one to-be-identified image, and accordingly, output the region with a probability greater than a confidence threshold as a reference vulgar region image.

[0119] In addition, it should be noted that in actual applications, if the picture to be identified does not contain vulgar content, after vulgar area detection is performed on the picture to be identified based on the vulgar area detection model, when the probability of vulgar areas with vulgar content in the picture to be identified is less than the confidence threshold, a specified picture can be output, which represents that the picture to be identified does not contain vulgar content.

[0120] S505: Obtaining a global vulgar area picture from the picture to be identified based on the benchmark vulgar area picture.

[0121] In the embodiment of the present specification, the reference vulgar region picture detected based on the vulgar region detection model can represent the local features of the vulgar content in the picture. In order to obtain more comprehensive global features, the global vulgar region picture can be obtained from the picture to be identified based on the reference vulgar region picture, which can specifically include:

[0122] Taking the reference vulgar region picture as the center, obtaining a picture of a first size from the picture to be identified, wherein the first size is larger than a size of the reference vulgar region picture;

[0123] Using the picture of the first size as the global vulgar area picture;

[0124] or,

[0125] Acquire a picture of a second size including the benchmark vulgar area picture from the picture to be identified, wherein the second size is larger than a size of the benchmark vulgar area picture;

[0126] The picture of the second size is used as the global vulgar area picture.

[0127] Specifically, the first size and the second size here can be set according to actual conditions.

[0128] S507: extracting the vulgar feature information of the benchmark vulgar area picture and the global vulgar area picture based on the vulgar attribution recognition model and performing vulgar attribution recognition using the vulgar feature information to determine the vulgar attribution of the picture to be recognized.

[0129] like Figure 7 As shown, extracting the vulgar feature information of the benchmark vulgar area picture and the global vulgar area picture based on the vulgar attribution recognition model and performing vulgar attribution recognition using the vulgar feature information to determine the vulgar attribution of the picture to be recognized may include:

[0130] S5071: extracting first feature information of the benchmark vulgar region picture and second feature information of the global vulgar region picture by using the feature extraction layer;

[0131] S5073: using the maximum pooling layer to perform maximum pooling operations on the first feature information and the second feature information respectively, to obtain first significant feature information corresponding to the benchmark vulgar area picture and second significant feature information corresponding to the global vulgar area picture;

[0132] S5075: using the average pooling layer to perform an average pooling operation on the first feature information and the second feature information respectively, to obtain first macro feature information corresponding to the benchmark vulgar area picture and second macro feature information corresponding to the global vulgar area picture;

[0133] S5077: performing splicing processing on the first significant feature information, the first macro feature information, the second significant feature information, and the second macro feature information to obtain vulgar feature information of the image to be identified;

[0134] Specifically, the first significant feature information and the first macro-feature information can be spliced ​​to obtain the third feature information representing local vulgar features; specifically, the second significant feature information and the second macro-feature information can be spliced ​​to obtain the fourth feature information representing global vulgar features; then, the third feature information and the fourth feature information are spliced ​​to obtain the vulgar feature information of the picture to be identified.

[0135] S5079: Using the classification layer to classify the vulgar feature information into vulgar attributes, and determine the vulgar attribution of the image to be identified.

[0136] In the embodiments of the present specification, by performing maximum pooling and average pooling operations on a baseline vulgar region image representing local features of vulgar content in a picture and a global vulgar region image representing global features of vulgar content in a picture, vulgar feature information that better represents the vulgar features in the picture can be obtained, and vulgar attribution classification is performed based on the vulgar feature information, which can greatly improve the recognition accuracy of vulgar attribution of the picture.

[0137] In a specific embodiment, Figure 8 As shown, Figure 8 is a schematic diagram of an example of vulgar attribution recognition of a picture provided by an embodiment of the present application. Figure 8 It can be seen that after the image to be identified is tested by the vulgar area detection model, the vulgar area in the image can be determined, and a baseline vulgar area picture representing the local vulgar features is output. At the same time, in order to obtain more comprehensive global features, a global vulgar area picture is obtained; then, the detected baseline vulgar area picture and the global vulgar area picture are used as inputs of the vulgar attribution recognition model to perform vulgar attribution recognition, so as to determine the vulgar attribution of the image to be identified.

[0138] In actual applications, during the image review work of some Internet platforms, reviewers may trigger a vulgar identification request. The following describes a method for identifying the vulgar attribution of an image in this application in combination with the scenario of image review work. Specifically, Fig. 9 As shown, it may include:

[0139] S901: receiving a vulgarity identification request for a picture to be identified;

[0140] S903: Obtain the image to be identified;

[0141] S905: extracting feature information of the image to be identified based on the vulgar area detection model, and performing vulgar area detection using the feature information to obtain a vulgar area image in the image to be identified;

[0142] S907: Obtaining a global vulgar area picture from the picture to be identified based on the benchmark vulgar area picture;

[0143] S909: extracting the vulgar feature information of the baseline vulgar area picture and the global vulgar area picture based on the vulgar attribution recognition model and performing vulgar attribution recognition using the vulgar feature information to determine the vulgar attribution of the picture to be recognized.

[0144] S911: Feedback a vulgarity recognition result, where the vulgarity recognition result includes the vulgarity attribution of the image to be recognized.

[0145] It can be seen from the technical solutions provided in the above embodiments of this specification that this specification can determine whether a picture has vulgar content based on the vulgar area detection model, and at the same time determine the area where the vulgar content is located in the picture with vulgar content, so as to obtain a baseline vulgar area picture that represents the local features of the vulgar content in the picture to be identified; then, in order to obtain more comprehensive global features, a global vulgar area picture can be obtained from the picture to be identified based on the baseline vulgar area picture; then, by using the baseline vulgar area picture that represents the local features of the vulgar content in the picture and the global vulgar area picture that represents the global features of the vulgar content in the picture as inputs of the vulgar attribution recognition model, vulgar attribution recognition of the picture is performed. In the vulgar attribution recognition process, by performing maximum pooling and average pooling operations on the baseline vulgar area picture and the global vulgar area picture that represents the vulgar content in the picture, respectively, vulgar feature information that better represents the vulgar features in the picture can be obtained, and vulgar attribution recognition is performed based on the vulgar feature information, so that the vulgar attribution of the picture can be accurately identified, and the workload of the reviewer can be reduced during the picture review application process.

[0146] The present application also provides a device for identifying vulgar attribution of a picture, such as Fig.10 As shown, the device comprises:

[0147] The to-be-recognized picture acquisition module 1010 can be used to acquire the to-be-recognized picture;

[0148] The first vulgar region detection processing module 1020 may be used to extract feature information of the image to be identified based on the vulgar region detection model, and perform vulgar region detection using the feature information to obtain a reference vulgar region image in the image to be identified;

[0149] The global image acquisition module 1030 may be used to acquire a global vulgar region image from the image to be identified based on the reference vulgar region image;

[0150] The vulgar attribution identification module 1040 can be used to extract the vulgar feature information of the baseline vulgar area picture and the global vulgar area picture based on the vulgar attribution identification model and use the vulgar feature information to perform vulgar attribution identification to determine the vulgar attribution of the picture to be identified.

[0151] In some embodiments, the vulgar attribution recognition model includes a feature extraction layer, a maximum pooling layer, an average pooling layer, and a classification layer;

[0152] The vulgar attribution identification module 1040 includes:

[0153] A feature extraction unit, configured to extract first feature information of the reference vulgar region picture and second feature information of the global vulgar region picture using the feature extraction layer;

[0154] A maximum pooling operation unit, configured to perform maximum pooling operations on the first feature information and the second feature information respectively using the maximum pooling layer to obtain first significant feature information corresponding to the benchmark vulgar area picture and second significant feature information corresponding to the global vulgar area picture;

[0155] an average pooling operation unit, configured to use the average pooling layer to perform an average pooling operation on the first feature information and the second feature information respectively, to obtain first macro feature information corresponding to the reference vulgar area picture and second macro feature information corresponding to the global vulgar area picture;

[0156] a splicing processing unit, configured to splice the first significant feature information, the first macro feature information, the second significant feature information, and the second macro feature information to obtain the vulgar feature information of the image to be identified;

[0157] The vulgar attribution classification unit is used to use the classification layer to perform vulgar attribution classification on the vulgar feature information to determine the vulgar attribution of the image to be identified.

[0158] In some embodiments, the apparatus further comprises:

[0159] A first training sample picture acquisition module, acquiring a first training sample picture, wherein the first training sample picture includes a picture having a vulgar area;

[0160] A first training learning module is used to use the first training sample image as an input of a first deep learning model, perform training learning on the first deep learning model for vulgar area detection, and obtain a predicted probability that the first training sample image has a vulgar area;

[0161] A first judgment module, used to judge whether the predicted probability is greater than or equal to a preset threshold;

[0162] A first model parameter adjustment module, used for adjusting the model parameters in the first deep learning model when the result of the judgment of the first judgment module is no, and repeating the above training, learning and judgment steps;

[0163] The vulgar area detection model determination module is used to use the current first deep learning model as the vulgar area detection model when the result of the judgment of the first judgment module is yes.

[0164] In some embodiments, the apparatus further comprises:

[0165] A second training sample image acquisition module, used to acquire a second training sample image;

[0166] A first labeling processing module is used to label the pictures in the second training sample pictures with vulgar attributions, and obtain positive training pictures with labeling information of having the vulgar attributions and negative training pictures with labeling information of not having the vulgar attributions;

[0167] A second vulgar area detection processing module is used to perform vulgar area detection on the positive example training picture based on the vulgar area detection model to obtain the vulgar area training picture in the positive example training picture;

[0168] A first global training picture acquisition module, configured to acquire a global vulgar region training picture from the positive example training picture, wherein the global vulgar region training picture includes the vulgar region training picture;

[0169] A second training learning module is used to use the vulgar area training picture, the global vulgar area training picture and the negative training picture as inputs of a second deep learning model, and to perform training learning on the second deep learning model for vulgar attribution recognition to obtain a predicted probability that each training picture has vulgar attribution, wherein each training picture includes any positive training picture corresponding to the vulgar area training picture and the global vulgar area training picture, and any negative training picture;

[0170] A first error calculation module, configured to calculate an error value between a sample label corresponding to each training image and the predicted probability based on a first loss function, wherein the sample label corresponding to each training image represents a probability that the annotation information corresponding to each training image has the vulgar attribution;

[0171] A second judgment module, used to judge whether the error value meets a first preset condition;

[0172] A second model parameter adjustment module, used for adjusting the model parameters in the second deep learning model when the result of the judgment of the second judgment module is no, and repeating the above training and learning to judgment steps;

[0173] The vulgar attribution identification model determination module is used to use the current second deep learning model as the vulgar attribution identification model when the result of the judgment of the second judgment module is yes.

[0174] In some embodiments, the apparatus further comprises:

[0175] A vulgarity identification request ending module, used for receiving a vulgarity identification request of a picture to be identified before obtaining the picture to be identified;

[0176] Accordingly, the device further comprises:

[0177] The vulgarity recognition result feedback module is used to feed back the vulgarity recognition result after determining the vulgarity attribution of the picture to be recognized, and the vulgarity recognition result includes the vulgarity attribution of the picture to be recognized.

[0178] In some embodiments, the global picture acquisition module includes:

[0179] A first picture acquisition unit, configured to acquire a picture of a first size from the picture to be identified, with the picture in the reference vulgar area as the center, wherein the first size is larger than a size of the picture in the reference vulgar area;

[0180] A first global picture acquisition unit, configured to use the picture of the first size as the global vulgar area picture;

[0181] or,

[0182] A second picture acquisition unit, configured to acquire a picture of a second size including the reference vulgar area picture from the picture to be identified, wherein the second size is larger than a size of the reference vulgar area picture;

[0183] The second global image acquisition unit is used to use the image of the second size as the global vulgar area image.

[0184] In some embodiments, the vulgar area detection model and the vulgar attribution recognition model are two independent deep neural networks, or the vulgar area detection model and the vulgar attribution recognition model are two neural network modules in the same deep neural network.

[0185] In some embodiments, when the vulgar area detection model and the vulgar attribution recognition model are two neural network modules in the same deep neural network, the device further includes:

[0186] A third training sample image acquisition module, used to acquire a third training sample image;

[0187] A second labeling processing module is used to label the pictures in the third training sample pictures with vulgar attributions, and obtain positive training pictures with labeling information of having the vulgar attribution and negative training pictures with labeling information of not having the vulgar attribution;

[0188] A third vulgar area detection processing module is used to perform vulgar area detection on the positive example training picture based on the vulgar area detection module in the third deep learning model to obtain the vulgar area training picture in the positive example training picture;

[0189] A second global training picture acquisition module, configured to acquire a global vulgar region training picture from the positive example training picture, wherein the global vulgar region training picture includes the vulgar region training picture;

[0190] A third training and learning module is used to use the vulgar area training picture, the global vulgar area training picture and the negative training picture as inputs of a vulgar attribution recognition module in a third deep learning model, and to perform training and learning of vulgar attribution recognition on the vulgar attribution recognition module to obtain a predicted probability that each training picture has vulgar attribution, wherein each training picture includes any positive training picture corresponding to the vulgar area training picture and the global vulgar area training picture, and any negative training picture;

[0191] A second error calculation module, configured to calculate an error value between a sample label corresponding to each training image and the predicted probability based on a second loss function, wherein the sample label corresponding to each training image represents a probability that the annotation information corresponding to each training image has the vulgar attribution;

[0192] A third judgment module, used to judge whether the error value meets a second preset condition;

[0193] A third model parameter adjustment module, used for adjusting the model parameters in the third deep learning model when the result of the judgment of the third judgment module is no, and repeating the above steps of detecting and judging the vulgar area;

[0194] The model determination module is used to use the vulgar area detection module in the current third deep learning model as the vulgar area detection model and the vulgar attribution identification module in the current third deep learning model as the vulgar attribution identification model when the result of the judgment of the third judgment module is yes.

[0195] The device and method embodiments in the device embodiments are based on the same application concept.

[0196] An embodiment of the present application provides a device for identifying vulgar attribution of an image, which includes a processor and a memory, in which at least one instruction, at least one program, a code set or an instruction set is stored. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method for identifying vulgar attribution of an image provided by the above-mentioned method embodiment.

[0197] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.

[0198] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal, a server or a similar computing device. Taking running on a server as an example, Fig.11 1 is a hardware structure block diagram of a server for a method for identifying vulgar attribution of a picture provided by an embodiment of the present application. Fig.11 As shown, the server 1100 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1110 (the processor 1110 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1130 for storing data, and one or more storage media 1120 (such as one or more mass storage devices) for storing application programs 1123 or data 1122. Among them, the memory 1130 and the storage medium 1120 can be short-term storage or permanent storage. The program stored in the storage medium 1120 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 1110 can be configured to communicate with the storage medium 1120 and execute a series of instruction operations in the storage medium 1120 on the server 1100. The server 1100 may also include one or more power supplies 1160, one or more wired or wireless network interfaces 1150, one or more input and output interfaces 1140, and / or one or more operating systems 1121, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, FreeBSD TM, etc.

[0199] The input / output interface 1140 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 1100. In one example, the input / output interface 1140 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 1140 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0200] It can be understood by those skilled in the art that Fig.11 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.11 More or fewer components as shown, or with Fig.11 Different configurations are shown.

[0201] An embodiment of the present application also provides a storage medium, which can be set in a server to store at least one instruction, at least one program, code set or instruction set related to a method for identifying vulgar attribution of a picture in a method embodiment. The at least one instruction, the at least one program, the code set or instruction set is loaded and executed by the processor to implement the method for identifying vulgar attribution of a picture provided in the above method embodiment.

[0202] Optionally, in this embodiment, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0203] It can be seen from the embodiments of the method, device, server or storage medium for identifying the vulgar attribution of pictures provided by the present application that the present application can determine whether a picture has vulgar content while determining the area where the vulgar content is located in the picture with vulgar content based on the vulgar area detection model, and obtain a baseline vulgar area picture representing the local features of the vulgar content in the picture to be identified; then, in order to obtain a more comprehensive global feature, a global vulgar area picture can be obtained from the picture to be identified; then, by using the baseline vulgar area picture representing the local features of the vulgar content in the picture and the global vulgar area picture representing the global features of the vulgar content in the picture as the input of the vulgar attribution recognition model, the vulgar attribution recognition of the picture is performed. In the vulgar attribution recognition process, by performing maximum pooling and average pooling operations on the baseline vulgar area picture and the global vulgar area picture representing the vulgar content in the picture, respectively, vulgar feature information that better represents the vulgar features in the picture can be obtained, and vulgar attribution recognition is performed based on the vulgar feature information, and the vulgar attribution of the picture can be accurately identified. In the process of picture review application, the workload of the reviewer is reduced.

[0204] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0205] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and server 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.

[0206] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by instructing the relevant hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0207] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A method for identifying vulgar attribution of an image, characterized in that: The method comprises: Get the image to be identified; Extracting feature information of the image to be identified based on a vulgar area detection model, and performing vulgar area detection using the feature information to obtain a reference vulgar area image in the image to be identified; Acquire a global vulgar region picture from the to-be-identified picture based on the benchmark vulgar region picture, wherein the global vulgar region picture includes the benchmark vulgar region picture, and a size of the global vulgar region picture is larger than a size of the benchmark vulgar region picture; Extracting first feature information of the benchmark vulgar region picture and second feature information of the global vulgar region picture using a feature extraction layer in a vulgar attribution recognition model; Using the maximum pooling layer in the vulgar attribution recognition model to perform maximum pooling operations on the first feature information and the second feature information, respectively, to obtain first significant feature information corresponding to the benchmark vulgar area picture and second significant feature information corresponding to the global vulgar area picture; Using the average pooling layer in the vulgar attribution recognition model, average pooling operations are performed on the first feature information and the second feature information respectively to obtain first macro feature information corresponding to the benchmark vulgar area picture and second macro feature information corresponding to the global vulgar area picture; Performing splicing processing on the first significant feature information, the first macro feature information, the second significant feature information, and the second macro feature information to obtain the vulgar feature information of the image to be identified; The vulgar feature information is classified into vulgar attributions using the classification layer in the vulgar attribution recognition model to determine the vulgar attribution of the image to be identified.

2. The method according to claim 1, characterized in that The method further comprises: Acquire a first training sample picture, wherein the first training sample picture includes a picture having a vulgar area; Using the first training sample image as an input of a first deep learning model, training the first deep learning model for vulgar area detection, and obtaining a predicted probability that the first training sample image has a vulgar area; Determining whether the predicted probability is greater than or equal to a preset threshold; When the result of the judgment is no, adjusting the model parameters in the first deep learning model, and repeating the above training, learning and judging steps; When the result of the judgment is yes, the current first deep learning model is used as the vulgar area detection model.

3. The method according to claim 1, characterized in that The method further comprises: Obtain a second training sample image; Performing labeling processing of vulgar attribution on the pictures in the second training sample pictures, to obtain positive training pictures with labeling information of having the vulgar attribution and negative training pictures with labeling information of not having the vulgar attribution; Performing vulgar area detection on the positive training picture based on the vulgar area detection model to obtain the vulgar area training picture in the positive training picture; Acquire a global vulgar region training picture from the positive example training picture, wherein the global vulgar region training picture includes the vulgar region training picture, and a size of the global vulgar region training picture is larger than a size of the vulgar region training picture; The vulgar region training picture, the global vulgar region training picture and the negative training picture are used as inputs of a second deep learning model, and the second deep learning model is trained to learn vulgar attribution recognition to obtain a predicted probability that each training picture has vulgar attribution, wherein each training picture includes any positive training picture corresponding to the vulgar region training picture and the global vulgar region training picture, and any negative training picture; Calculating an error value between the sample label corresponding to each training image and the predicted probability based on a first loss function, wherein the sample label corresponding to each training image represents a probability that the annotation information corresponding to each training image has the vulgar attribution; Determining whether the error value satisfies a first preset condition; When the result of the judgment is no, adjusting the model parameters in the second deep learning model, and repeating the above steps of training and learning to judgment; When the result of the judgment is yes, the current second deep learning model is used as the vulgar attribution identification model.

4. The method according to claim 1, characterized in that: Before obtaining the image to be identified, the method further includes: Receiving a vulgarity identification request for a picture to be identified; Accordingly, after determining the vulgar attribution of the to-be-identified image, the method further includes: Feedback a vulgarity recognition result, wherein the vulgarity recognition result includes the vulgarity attribution of the image to be recognized.

5. The method according to claim 1, characterized in that The step of acquiring a global vulgar area picture from the picture to be identified based on the benchmark vulgar area picture comprises: Taking the reference vulgar region picture as the center, obtaining a picture of a first size from the picture to be identified, wherein the first size is larger than a size of the reference vulgar region picture; Using the picture of the first size as the global vulgar area picture; or, Acquire a picture of a second size including the benchmark vulgar area picture from the picture to be identified, wherein the second size is larger than a size of the benchmark vulgar area picture; The picture of the second size is used as the global vulgar area picture.

6. The method according to claim 1, characterized in that The vulgar area detection model and the vulgar attribution recognition model are two independent deep neural networks, or the vulgar area detection model and the vulgar attribution recognition model are two neural network modules in the same deep neural network.

7. The method according to claim 1, characterized in that When the vulgar area detection model and the vulgar attribution recognition model are two neural network modules in the same deep neural network, the method further includes: Obtain a third training sample image; Performing a labeling process of vulgar attribution on the pictures in the third training sample pictures, to obtain positive training pictures with labeling information of having the vulgar attribution and negative training pictures with labeling information of not having the vulgar attribution; Performing vulgar area detection on the positive training picture based on the vulgar area detection module in the third deep learning model to obtain the vulgar area training picture in the positive training picture; Acquire a global vulgar region training picture from the positive example training picture, wherein the global vulgar region training picture includes the vulgar region training picture, and a size of the global vulgar region training picture is larger than a size of the vulgar region training picture; The vulgar region training picture, the global vulgar region training picture and the negative training picture are used as inputs of a vulgar attribution recognition module in a third deep learning model, and the vulgar attribution recognition module is trained to learn vulgar attribution recognition to obtain a predicted probability that each training picture has vulgar attribution, wherein each training picture includes any positive training picture corresponding to the vulgar region training picture and the global vulgar region training picture, and any negative training picture; Calculating an error value between the sample label corresponding to each training image and the predicted probability based on a second loss function, wherein the sample label corresponding to each training image represents a probability that the annotation information corresponding to each training image has the vulgar attribution; Determining whether the error value satisfies a second preset condition; When the result of the judgment is no, adjusting the model parameters in the third deep learning model, and repeating the above steps of detecting and judging the vulgar area; When the result of the judgment is yes, the vulgar area detection module in the current third deep learning model is used as the vulgar area detection model, and the vulgar attribution recognition module in the current third deep learning model is used as the vulgar attribution recognition model.

8. The method according to claim 1, characterized in that The training data for training the vulgar area detection model and / or the vulgar attribution recognition model is stored in a distributed system; The distributed system includes a blockchain system.

9. A device for identifying vulgar attribution of an image, characterized in that: The device comprises: A module for obtaining images to be identified, used to obtain images to be identified; A first vulgar region detection processing module is used to extract feature information of the image to be identified based on a vulgar region detection model, and to perform vulgar region detection using the feature information to obtain a reference vulgar region image in the image to be identified; A global image acquisition module, configured to acquire a global vulgar region image from the image to be identified based on the benchmark vulgar region image, wherein the global vulgar region image includes the benchmark vulgar region image, and the size of the global vulgar region image is larger than the size of the benchmark vulgar region image; A vulgarity attribution recognition module, comprising a feature extraction unit, for extracting first feature information of the reference vulgarity region picture and second feature information of the global vulgarity region picture by using a feature extraction layer in a vulgarity attribution recognition model; A maximum pooling operation unit, configured to perform maximum pooling operations on the first feature information and the second feature information respectively using the maximum pooling layer in the vulgar attribution recognition model to obtain first significant feature information corresponding to the benchmark vulgar region picture and second significant feature information corresponding to the global vulgar region picture; an average pooling operation unit, configured to perform an average pooling operation on the first feature information and the second feature information respectively by using the average pooling layer in the vulgar attribution recognition model, so as to obtain first macro feature information corresponding to the reference vulgar region picture and second macro feature information corresponding to the global vulgar region picture; a splicing processing unit, configured to splice the first significant feature information, the first macro feature information, the second significant feature information, and the second macro feature information to obtain the vulgar feature information of the image to be identified; The vulgar attribution classification unit is used to perform vulgar attribution classification on the vulgar feature information by using the classification layer in the vulgar attribution recognition model to determine the vulgar attribution of the image to be identified.

10. The device according to claim 9, characterized in that The device also includes: A first training sample picture acquisition module, acquiring a first training sample picture, wherein the first training sample picture includes a picture having a vulgar area; A first training and learning module is used to use the first training sample image as an input of a first deep learning model, perform training and learning on the first deep learning model for vulgar area detection, and obtain a predicted probability that the first training sample image has a vulgar area; A first judgment module, used to judge whether the predicted probability is greater than or equal to a preset threshold; A first model parameter adjustment module, used for adjusting the model parameters in the first deep learning model when the result of the judgment of the first judgment module is no, and repeating the above training, learning and judgment steps; The vulgar area detection model determination module is used to use the current first deep learning model as the vulgar area detection model when the result of the judgment of the first judgment module is yes.

11. The device according to claim 9, characterized in that The device also includes: A second training sample image acquisition module, used to acquire a second training sample image; A first labeling processing module is used to label the pictures in the second training sample pictures with vulgar attributions, so as to obtain positive training pictures with labeling information of having the vulgar attributions and negative training pictures with labeling information of not having the vulgar attributions; A second vulgar area detection processing module is used to perform vulgar area detection on the positive example training picture based on the vulgar area detection model to obtain the vulgar area training picture in the positive example training picture; A first global training picture acquisition module is used to acquire a global vulgar region training picture from the positive example training picture, wherein the global vulgar region training picture includes the vulgar region training picture, and the size of the global vulgar region training picture is larger than the size of the vulgar region training picture; A second training learning module is used to use the vulgar area training picture, the global vulgar area training picture and the negative training picture as inputs of a second deep learning model, and to perform training learning on the second deep learning model for vulgar attribution recognition to obtain a predicted probability that each training picture has vulgar attribution, wherein each training picture includes any positive training picture corresponding to the vulgar area training picture and the global vulgar area training picture, and any negative training picture; A first error calculation module, configured to calculate an error value between a sample label corresponding to each training image and the predicted probability based on a first loss function, wherein the sample label corresponding to each training image represents a probability that the annotation information corresponding to each training image has the vulgar attribution; A second judgment module, used to judge whether the error value meets a first preset condition; A second model parameter adjustment module, used for adjusting the model parameters in the second deep learning model when the result of the judgment of the second judgment module is no, and repeating the above training and learning to judgment steps; The vulgar attribution identification model determination module is used to use the current second deep learning model as the vulgar attribution identification model when the result of the judgment of the second judgment module is yes.

12. The device according to claim 9, characterized in that The device also includes: A vulgarity identification request ending module, used for receiving a vulgarity identification request of a picture to be identified before obtaining the picture to be identified; The device also includes: The vulgarity recognition result feedback module is used to feed back the vulgarity recognition result after determining the vulgarity attribution of the picture to be recognized, and the vulgarity recognition result includes the vulgarity attribution of the picture to be recognized.

13. The device according to claim 9, characterized in that The global image acquisition module includes: A first picture acquisition unit, configured to acquire a picture of a first size from the picture to be identified, with the picture in the reference vulgar area as the center, wherein the first size is larger than a size of the picture in the reference vulgar area; A first global picture acquisition unit, configured to use the picture of the first size as the global vulgar area picture; or, A second picture acquisition unit is used to acquire a picture of a second size including the reference vulgar area picture from the picture to be identified, wherein the second size is larger than the size of the reference vulgar area picture; The second global image acquisition unit is used to use the image of the second size as the global vulgar area image.

14. The device according to claim 9, characterized in that The vulgar area detection model and the vulgar attribution recognition model are two independent deep neural networks, or the vulgar area detection model and the vulgar attribution recognition model are two neural network modules in the same deep neural network.

15. The device according to claim 9, characterized in that When the vulgar area detection model and the vulgar attribution recognition model are two neural network modules in the same deep neural network, the device further includes: A third training sample image acquisition module, used to acquire a third training sample image; A second labeling processing module is used to label the pictures in the third training sample pictures with vulgar attributions, and obtain positive training pictures with labeling information of having the vulgar attribution and negative training pictures with labeling information of not having the vulgar attribution; A third vulgar area detection processing module is used to perform vulgar area detection on the positive example training picture based on the vulgar area detection module in the third deep learning model to obtain the vulgar area training picture in the positive example training picture; a second global training picture acquisition module, configured to acquire a global vulgar region training picture from the positive example training picture, wherein the global vulgar region training picture includes the vulgar region training picture, and a size of the global vulgar region training picture is larger than a size of the vulgar region training picture; A third training and learning module is used to use the vulgar area training picture, the global vulgar area training picture and the negative training picture as inputs of a vulgar attribution recognition module in a third deep learning model, and to perform training and learning of vulgar attribution recognition on the vulgar attribution recognition module to obtain a predicted probability that each training picture has vulgar attribution, wherein each training picture includes any positive training picture corresponding to the vulgar area training picture and the global vulgar area training picture, and any negative training picture; A second error calculation module, configured to calculate an error value between a sample label corresponding to each training image and the predicted probability based on a second loss function, wherein the sample label corresponding to each training image represents a probability that the annotation information corresponding to each training image has the vulgar attribution; A third judgment module, used to judge whether the error value meets a second preset condition; A third model parameter adjustment module, used for adjusting the model parameters in the third deep learning model when the result of the judgment of the third judgment module is no, and repeating the above steps of detecting and judging the vulgar area; The model determination module is used to use the vulgar area detection module in the current third deep learning model as the vulgar area detection model and the vulgar attribution identification module in the current third deep learning model as the vulgar attribution identification model when the result of the judgment of the third judgment module is yes.

16. The device according to claim 9, characterized in that The training data for training the vulgar area detection model and / or the vulgar attribution recognition model is stored in a distributed system; The distributed system includes a blockchain system.

17. A device for identifying vulgar attribution of an image, characterized in that: The device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method for identifying vulgar attribution of an image as described in any one of claims 1 to 8.

18. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method for identifying vulgar attribution of images as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Sensitive image authentication method and terminal system

    CN109145979A

  • Heart MRI left ventricle segmentation method and system

    CN110197492A