CN111783812B - Forbidden image recognition method, forbidden image recognition device and computer readable storage medium - Google Patents

Forbidden image recognition method, forbidden image recognition device and computer readable storage medium Download PDF

Info

Publication number
CN111783812B
CN111783812B CN201911125531.2A CN201911125531A CN111783812B CN 111783812 B CN111783812 B CN 111783812B CN 201911125531 A CN201911125531 A CN 201911125531A CN 111783812 B CN111783812 B CN 111783812B
Authority
CN
China
Prior art keywords
image
identified
target
forbidden
category
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911125531.2A
Other languages
Chinese (zh)
Other versions
CN111783812A (en
Inventor
齐鹏飞
张燕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201911125531.2A priority Critical patent/CN111783812B/en
Publication of CN111783812A publication Critical patent/CN111783812A/en
Application granted granted Critical
Publication of CN111783812B publication Critical patent/CN111783812B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The disclosure relates to a forbidden image recognition method, a forbidden image recognition device and a computer readable storage medium, and relates to the technical field of computers. The method of the present disclosure comprises: inputting the image to be identified into a classification model to obtain the image category information of the output image to be identified; determining whether the image to be identified belongs to a candidate forbidden image or not according to the image category information of the image to be identified; under the condition that the image to be identified belongs to the candidate forbidden image, inputting the image to be identified into a target detection model to obtain target category information of each target in the image to be identified; and determining whether the image to be identified is a forbidden image or not according to the target category information of each target in the image to be identified.

Description

Forbidden image recognition method, forbidden image recognition device and computer readable storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and apparatus for identifying forbidden images, and a computer readable storage medium.
Background
With the development of internet technology, information is spread more and more widely and rapidly. The network is filled with a wide variety of information. To maintain network order, the network environment is cleaned, and illegal and bad information such as pornography, violence and other forbidden images need to be removed. Because the forbidden image has complex content and more details, the forbidden image is generally checked by manpower at present.
Disclosure of Invention
The inventor finds that the efficiency of manually auditing the forbidden image is lower.
One technical problem to be solved by the present disclosure is: how to improve the efficiency of forbidden image recognition.
According to some embodiments of the present disclosure, there is provided a forbidden image recognition method including: inputting the image to be identified into a classification model to obtain the image category information of the output image to be identified; determining whether the image to be identified belongs to a candidate forbidden image or not according to the image category information of the image to be identified; under the condition that the image to be identified belongs to the candidate forbidden image, inputting the image to be identified into a target detection model to obtain target category information of each target in the image to be identified; and determining whether the image to be identified is a forbidden image or not according to the target category information of each target in the image to be identified.
In some embodiments, determining whether the image to be identified belongs to the candidate forbidden image according to the image category information of the image to be identified comprises: determining an application scene of an image to be identified; matching the preset image category to which the candidate forbidden image belongs in the application scene with the image category information of the image to be identified; determining whether the image to be identified belongs to a candidate forbidden image according to the matching result; the preset image categories to which the candidate forbidden images belong in different application scenes are different.
In some embodiments, the image category information of the image to be identified includes: probability that the image to be identified belongs to each image category; the matching of the preset image category to which the candidate forbidden image belongs in the application scene and the image category information of the image to be identified comprises the following steps: comparing the probability that the image to be identified belongs to each image category with the probability of the preset image category corresponding to the application scene, and determining the image category of the image to be identified; matching a preset image category to which the candidate forbidden image belongs in the application scene with an image category of the image to be identified; wherein, the probability of the preset image category corresponding to different application scenes is different.
In some embodiments, determining whether the image to be identified is a forbidden image according to target class information of each target in the image to be identified comprises: determining an application scene of an image to be identified; matching a preset forbidden target class in the application scene with target class information of each target in the image to be identified; determining whether the image to be identified belongs to the forbidden image according to the matching result; the preset forbidden target categories in different application scenes are different.
In some embodiments, the object category information for each object in the image to be identified includes: probability of each target belonging to each target class; the matching of the preset forbidden target category in the application scene with the target category information of each target in the image to be identified comprises the following steps: comparing the probability that each target in the image to be identified belongs to each target category with the probability of the preset target category corresponding to the application scene, and determining the target category of each target in the image to be identified; matching a preset forbidden target class in the application scene with the target class of each target in the image to be identified; the probability of the preset target category corresponding to different application scenes is different.
In some embodiments, further comprising: acquiring a first sample image marked with an image category as a first training sample set; training the classification model by using the image of the first training sample set to obtain parameters of the classification model.
In some embodiments, training the classification model with the images of the first training sample set includes: performing initial training on the classification model by using the image of the first training sample set; inputting the images of the first training sample set into the initially trained classification model to obtain a classification result of the images of the first training sample set; determining a difficult sample image according to the difference between the classification result and the accurate classification result of the output image of the first training sample set; and training the initially trained classification model again by using the difficult sample image.
In some embodiments, further comprising: acquiring a second sample image of the target class marked with the target as a second training sample set; and training the target detection model by using the image of the second training sample set to obtain the target detection parameters.
In some embodiments, obtaining a second sample image of the target class labeled with the target comprises: inputting the candidate sample images into a classification model to obtain the image category information of the output candidate sample images; determining whether the candidate sample belongs to the candidate forbidden image according to the image category information of the candidate sample image; and taking the candidate sample image belonging to the candidate forbidden image as a second sample image.
According to other embodiments of the present disclosure, there is provided an illicit image recognition apparatus including: the image category determining module is used for inputting the image to be identified into the classification model to obtain the image category information of the output image to be identified; the image screening module is used for determining whether the image to be identified belongs to a candidate forbidden image according to the image category information of the image to be identified; the target category determining module is used for inputting the image to be identified into the target detection model to obtain target category information of each target in the image to be identified under the condition that the image to be identified belongs to the candidate forbidden image; and the forbidden image determining module is used for determining whether the image to be identified is the forbidden image according to the target category information of each target in the image to be identified.
In some embodiments, the image screening module is configured to determine an application scenario of the image to be identified; matching the preset image category to which the candidate forbidden image belongs in the application scene with the image category information of the image to be identified; determining whether the image to be identified belongs to a candidate forbidden image according to the matching result; the preset image categories to which the candidate forbidden images belong in different application scenes are different.
In some embodiments, the image category information of the image to be identified includes: probability that the image to be identified belongs to each image category; the image screening module is used for comparing the probability that the image to be identified belongs to each image category with the probability of the preset image category corresponding to the application scene, and determining the image category of the image to be identified; matching a preset image category to which the candidate forbidden image belongs in the application scene with an image category of the image to be identified; wherein, the probability of the preset image category corresponding to different application scenes is different.
In some embodiments, the forbidden image determining module is configured to determine an application scenario of the image to be identified; matching a preset forbidden target class in the application scene with target class information of each target in the image to be identified; determining whether the image to be identified belongs to the forbidden image according to the matching result; the preset forbidden target categories in different application scenes are different.
In some embodiments, the object category information for each object in the image to be identified includes: probability of each target belonging to each target class; the forbidden image determining module is used for comparing the probability that each target in the image to be identified belongs to each target category with the probability of the preset target category corresponding to the application scene, and determining the target category of each target in the image to be identified; matching a preset forbidden target class in the application scene with the target class of each target in the image to be identified; the probability of the preset target category corresponding to different application scenes is different.
In some embodiments, the apparatus further comprises: the first training module is used for acquiring a first sample image marked with an image category and taking the first sample image as a first training sample set; training the classification model by using the image of the first training sample set to obtain parameters of the classification model.
In some embodiments, the first training module is to initially train the classification model using images of the first training sample set; inputting the images of the first training sample set into the initially trained classification model to obtain a classification result of the images of the first training sample set; determining a difficult sample image according to the difference between the classification result and the accurate classification result of the output image of the first training sample set; and training the initially trained classification model again by using the difficult sample image.
In some embodiments, the apparatus further comprises: the second training module is used for acquiring a second sample image of the target class marked with the target as a second training sample set; and training the target detection model by using the image of the second training sample set to obtain the target detection parameters.
In some embodiments, the second training module is configured to input the candidate sample image into the classification model to obtain the image class information of the output candidate sample image; determining whether the candidate sample belongs to the candidate forbidden image according to the image category information of the candidate sample image; and taking the candidate sample image belonging to the candidate forbidden image as a second sample image.
According to still further embodiments of the present disclosure, there is provided an illicit image recognition apparatus including: a processor; and a memory coupled to the processor for storing instructions that, when executed by the processor, cause the processor to perform the forbidden image identification method of any of the preceding embodiments.
According to still further embodiments of the present disclosure, a non-transitory computer-readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, implements the forbidden image identification method of any of the preceding embodiments.
The method comprises the steps of firstly inputting an image to be identified into a classification model to obtain a rough classified image category of the image to be identified, screening out candidate forbidden images according to the rough classified category, further identifying targets in the image to be identified by using a target detection model to obtain target category information of each target, and determining whether the image to be identified is the forbidden image according to the target category information of each target. According to the method, the classification model and the target detection model are combined and applied, the image to be identified is firstly subjected to rough classification to identify the characteristics of the whole image, then subjected to fine classification to identify the target detail characteristics in the image, and the forbidden image is comprehensively identified from the whole and local parts, so that the accuracy and the efficiency of identification are improved.
Other features of the present disclosure and its advantages will become apparent from the following detailed description of exemplary embodiments of the disclosure, which proceeds with reference to the accompanying drawings.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and other drawings may be obtained according to these drawings without inventive effort to a person of ordinary skill in the art.
Fig. 1 illustrates a flow diagram of a forbidden image identification method of some embodiments of the present disclosure.
Fig. 2 shows a flow diagram of a forbidden image recognition method of other embodiments of the present disclosure.
Fig. 3 illustrates a schematic structure of a forbidden image recognition apparatus of some embodiments of the present disclosure.
Fig. 4 is a schematic structural view of an illicit image recognition device of other embodiments of the present disclosure.
Fig. 5 shows a schematic structural diagram of an illicit image recognition device of still other embodiments of the present disclosure.
Detailed Description
The following description of the technical solutions in the embodiments of the present disclosure will be made clearly and completely with reference to the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are only some embodiments of the present disclosure, not all embodiments. The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses. Based on the embodiments in this disclosure, all other embodiments that a person of ordinary skill in the art would obtain without making any inventive effort are within the scope of protection of this disclosure.
Aiming at the problem that the efficiency of manually checking forbidden pictures is low in the prior art, a method for automatically identifying scarf images by a machine is provided, and some embodiments of the scheme are described below with reference to fig. 1.
Fig. 1 is a flow chart of some embodiments of a forbidden image recognition method of the present disclosure. As shown in fig. 1, the method of this embodiment includes: steps S102 to S108.
In step S102, the image to be identified is input into the classification model, and the image type information of the output image to be identified is obtained.
The image to be identified is obtained from the network, and the image to be identified can be an image frame extracted from the video to be identified. The image to be identified can be preprocessed, for example, rotation, scaling, color adjustment and the like are performed on the image to be identified, so that the subsequent identification of the image to be identified is more accurate. And inputting the preprocessed image to be identified into a classification model, extracting characteristics (such as CNN (convolutional neural network) characteristics) of the image to be identified, and determining image category information of the image to be identified according to the characteristics. The classification model is, for example, a neural network model, a convolutional neural network model, more specifically, an existing ResNeXt, resNeXt or SE-ResNeXt model, and the like, and a model with a better and more accurate classification effect can be selected according to actual requirements.
The classification model can configure the classified image categories according to actual requirements, and after pre-training, the classification model can determine that the image to be identified belongs to one or more of the configured image categories. For example, the image categories determined by the classification model include two image categories, a normal image and a forbidden image. For another example, the image categories determined by the classification model include three image categories, normal image, intermediate image, forbidden image, the intermediate image belonging to an image category between normal and forbidden, e.g., for pornographic forbidden image recognition, the intermediate image may represent a sexy image. For another example, the image categories determined by the classification model include four image categories, normal image, partial forbidden image, for example, for pornography forbidden image identification, partial normal image may represent sexy image, partial forbidden image may represent colloquial image. The image class determined by the classification model is determined according to the labeling of the training sample and the training process, and can be determined according to actual requirements. The training process will be described later.
The classification model may determine a probability that the image to be identified belongs to each image category, and further determine one or more image categories of the image to be identified based on the probability that the image to be identified belongs to each image category.
In step S104, it is determined whether the image to be recognized belongs to a candidate forbidden image according to the image category information of the image to be recognized.
The candidate forbidden image represents an image that is likely to be a forbidden image, and an image that needs to be classified into a fine class by using a subsequent object detection model. In some embodiments, determining an application scenario for an image to be identified; matching the preset image category to which the candidate forbidden image belongs in the application scene with the image category information of the image to be identified; determining whether the image to be identified belongs to a candidate forbidden image according to the matching result; the preset image categories to which the candidate forbidden images belong in different application scenes are different.
The discrimination scales of the forbidden images under different application scenes are different, so that the discrimination scales of the candidate forbidden images are also different. For example, in more serious news content, the sexy image may belong to a forbidden image, and thus, the image to be identified belonging to the sexy image category may be determined as a candidate forbidden image, whereas for entertainment content, the sexy image does not belong to the forbidden image, and thus, the image to be identified belonging to the sexy image category may not be determined as a candidate forbidden image. The preset image categories to which the candidate forbidden images corresponding to different application scenes belong can be preset, the preset image categories corresponding to the application scenes of the images to be identified are searched, and then the image category information of the images to be identified is compared with the corresponding preset image categories.
Further, in some embodiments, the image category information of the image to be identified includes: the probability that the image to be identified belongs to each image category. And comparing the probability that the image to be identified belongs to each image category with the probability of the preset image category corresponding to the application scene, and determining the image category of the image to be identified. And matching the preset image category to which the candidate forbidden image belongs in the application scene with the image category of the image to be identified. If the image category of the image to be identified comprises one or more of preset image categories corresponding to the application scene, the image to be identified belongs to the candidate forbidden image. By comparing the probability that the image to be identified belongs to each image category with the probability of the preset image category corresponding to the application scene, the image to be identified can be determined to be a plurality of categories at the same time. I.e. for the probability that the image to be identified belongs to each image category, if the probability of belonging to the image category exceeds the preset image category probability, the image to be identified belongs to the image category.
The probability of the preset image category corresponding to different application scenes is different. Because the discrimination scales of the forbidden images are different in different application scenes, the image types of the images to be identified can be adjusted by adjusting the preset image type probabilities in different application scenes, so that the selection of candidate forbidden images can be adjusted, and the model can be adapted to different application scenes.
Further, different image categories in the same application scene can correspond to different preset image category probabilities. And comparing the probability of the image category with the probability of the preset image category of the image category pair under the application scene aiming at the probability of the image to be identified belonging to each image category, thereby determining whether the image to be identified belongs to the image category.
In step S106, in the case that the image to be identified belongs to the candidate forbidden image, the image to be identified is input into the target detection model, so as to obtain target category information of each target in the image to be identified.
And selecting the images to be identified belonging to the candidate forbidden images to input target detection for fine classification, and further accurately identifying whether the images belong to the forbidden images. The target detection model is, for example, an existing model, such as a fast-RCNN (Faster cyclic convolutional neural network) model, and a model with better effect can be selected according to actual requirements.
In step S108, it is determined whether the image to be recognized is a forbidden image according to the object category information of each object in the image to be recognized.
In some embodiments, determining an application scenario for an image to be identified; matching a preset forbidden target class in the application scene with target class information of each target in the image to be identified; and determining whether the image to be identified belongs to the forbidden image according to the matching result. The preset forbidden target categories in different application scenes are different. Preset forbidden target categories corresponding to different application scenes can be preset. For example, swimwear belongs to a forbidden target class under certain application scenes (news scenes), and does not belong to a forbidden target class under certain application scenes (shopping platform scenes). The forbidden images conforming to different application scenes can be determined by adjusting preset forbidden target categories under different application scenes, and the forbidden images are flexibly determined according to the application scenes.
Further, in some embodiments, the object category information of each object in the image to be identified includes: probability that each target belongs to each target class. The target detection model can determine the probability that each target in the image to be identified belongs to each target category, and compare the probability that each target in the image to be identified belongs to each target category with the probability of the preset target category corresponding to the application scene to determine the target category of each target in the image to be identified; and matching the preset forbidden target category in the application scene with the target category of each target in the image to be identified. If the target in the image to be identified comprises one or more of preset forbidden target categories corresponding to the application scene, the image to be identified belongs to the forbidden image. For example, the images to be identified that include certain bare body parts or certain specific actions may be determined to be forbidden images.
By comparing the probability that each target in the image to be identified belongs to each target category with the probability of the preset target category corresponding to the application scene, the targets can be determined to be a plurality of categories at the same time. I.e. for each target belonging to each target class, if the probability that the target belongs to the target class exceeds a preset target class probability, the target belongs to the target class.
The probability of the preset target category corresponding to different application scenes is different. Because the discrimination scales of the forbidden images are different in different application scenes, the target category of each target in the image to be identified can be adjusted by adjusting the preset target category probability in different application scenes, so that the selection of the forbidden images is adjusted, and the model can be adapted to different application scenes.
Further, different target categories in the same application scene can correspond to different preset target category probabilities. And comparing the probability that each target belongs to each image category in the image to be identified with the probability that the target belongs to the target category with the probability of the preset target category of the target category pair in the application scene to determine whether the target belongs to the target category.
The above embodiment provides a method for automatically identifying forbidden images by a machine, which comprises the steps of firstly inputting an image to be identified into a classification model to obtain a rough classified image category of the image to be identified, screening out candidate forbidden images according to the rough classified category, further identifying targets in the image to be identified by using a target detection model to obtain target category information of each target, and determining whether the image to be identified is the forbidden image according to the target category information of each target. According to the method, the classification model and the target detection model are combined and applied, the image to be identified is firstly subjected to rough classification to identify the characteristics of the whole image, then subjected to fine classification to identify the target detail characteristics in the image, and the forbidden image is comprehensively identified from the whole and local parts, so that the accuracy and the efficiency of identification are improved. In addition, through flexibly configuring preset image categories, preset forbidden target categories, preset image category probabilities, preset target category probabilities and the like in different application scenes, the determination of the candidate forbidden images and the forbidden images can be adjusted, the method can be suitable for identifying the images in different application scenes, and the identification of the forbidden images is more accurate and flexible.
The training process of the classification model and the object detection model in the present disclosure is described below with reference to fig. 2.
Fig. 2 is a flowchart of further embodiments of the forbidden image identification method of the present disclosure. As shown in fig. 2, the method of this embodiment includes: steps S202 to S208.
In step S202, a first sample image labeled with an image class is acquired as a first training sample set.
In the foregoing embodiment, the image categories into which the classification model can divide may be set according to actual requirements, and the image categories corresponding to the first sample images are labeled. To improve the accuracy of the classification model, a first sample image of multiple scenes, multiple media, and multiple sources may be acquired. The first sample image may be pre-processed, e.g., rotated, scaled, color adjusted, etc., to form a uniform specification for the first sample image.
In step S204, the classification model is trained using the images of the first training sample set, and parameters of the classification model are obtained.
In some embodiments, the images in the first training sample set are input into the classification model to obtain the image class of each image to be output, a first loss function value is calculated according to the difference between the image class of each image to be output and the labeled image class, the parameters of the classification model are adjusted according to the first loss function, and the above process is repeated until a preset condition is reached, for example, the first loss function value reaches a minimum value or reaches a threshold value, etc.
And extracting a preset number of image input classification models in the first training sample set in each training process, and extracting the image input classification models belonging to each image category according to a first preset proportion. For example, images of four image categories are extracted at 1:1:1:1, respectively.
In some embodiments, the classification model is initially trained using images of the first training sample set; inputting the images of the first training sample set into the initially trained classification model to obtain a classification result of the images of the first training sample set; determining a difficult sample image according to the difference between the classification result and the accurate classification result of the output image of the first training sample set; and training the initially trained classification model again by using the difficult sample image. The classification model is trained again by using the difficult sample image, so that the accuracy and the training efficiency of the classification model can be enhanced.
In step S206, a second sample image of the target class labeled with the target is acquired as a second training sample set.
In some embodiments, inputting the candidate sample image into a classification model to obtain image class information of the output candidate sample image; determining whether the candidate sample belongs to the candidate forbidden image according to the image category information of the candidate sample image; and taking the candidate sample image belonging to the candidate forbidden image as a second sample image. And screening out part of candidate sample images by using the classification model after training the classification model, and taking the candidate sample images as second sample images. The candidate sample images may be images in a first training sample set. Therefore, a lot of normal pictures can be removed, so that possible confusion can be reduced to a great extent, and training efficiency and accuracy are improved.
Because the content of the forbidden pictures is complex and the characteristics are scattered, the marked target categories are more than the target categories determined during application in the embodiment. The target category can be set to comprise a plurality of levels, for example, a human body, an action and the like are high-level categories, the sex is middle-level categories, and the specific part or the description of the action is bottom-level categories, so that the target can determine the target category through the multi-level tags, and the management of the tags is convenient, and whether the target belongs to forbidden pictures or not is further determined according to the target category.
In step S208, the target detection model is trained using the image of the second training sample set, so as to obtain the parameters of target detection.
In some embodiments, the images in the second training sample set are input into the target detection model, the target class of each target is obtained, a second loss function value is calculated according to the difference between the target class of each target and the labeled target class, the parameters of the target detection model are adjusted according to the second loss function, and the above-mentioned processes are repeated until a preset condition is reached, for example, the second loss function value reaches a minimum value or reaches a threshold value, etc. And extracting a preset number of image input target detection models in the second training sample set in each training process, and extracting the image input target detection models belonging to each target class according to a second preset proportion.
The present disclosure also provides an illicit image recognition device, described below in conjunction with fig. 3.
Fig. 3 is a block diagram of some embodiments of the forbidden image recognition apparatus of the present disclosure. As shown in fig. 3, the apparatus 30 of this embodiment includes: the image category determination module 310, the image screening module 320, the target category determination module 330, the forbidden image determination module 340.
The image category determining module 310 is configured to input the image to be identified into the classification model, and obtain the image category information of the output image to be identified.
The image filtering module 320 is configured to determine whether the image to be identified belongs to a candidate forbidden image according to the image category information of the image to be identified.
In some embodiments, the image screening module 320 is configured to determine an application scenario of the image to be identified; matching the preset image category to which the candidate forbidden image belongs in the application scene with the image category information of the image to be identified; determining whether the image to be identified belongs to a candidate forbidden image according to the matching result; the preset image categories to which the candidate forbidden images belong in different application scenes are different.
In some embodiments, the image category information of the image to be identified includes: probability that the image to be identified belongs to each image category; the image screening module 320 is configured to compare a probability that the image to be identified belongs to each image category with a preset image category probability corresponding to the application scene, and determine an image category of the image to be identified; matching a preset image category to which the candidate forbidden image belongs in the application scene with an image category of the image to be identified; wherein, the probability of the preset image category corresponding to different application scenes is different.
The target class determining module 330 is configured to input the image to be identified into the target detection model to obtain target class information of each target in the image to be identified, where the image to be identified belongs to the candidate forbidden image.
The forbidden image determining module 340 is configured to determine whether the image to be identified is a forbidden image according to the target category information of each target in the image to be identified.
In some embodiments, the forbidden image determination module 340 is configured to determine an application scenario of an image to be identified; matching a preset forbidden target class in the application scene with target class information of each target in the image to be identified; determining whether the image to be identified belongs to the forbidden image according to the matching result; the preset forbidden target categories in different application scenes are different.
In some embodiments, the object category information for each object in the image to be identified includes: probability of each target belonging to each target class; the forbidden image determining module 340 is configured to compare probabilities that each target in the image to be identified belongs to each target class with a preset target class probability corresponding to an application scene, and determine a target class of each target in the image to be identified; matching a preset forbidden target class in the application scene with the target class of each target in the image to be identified; the probability of the preset target category corresponding to different application scenes is different.
In some embodiments, the apparatus 30 further comprises: a first training module 350, configured to obtain a first sample image labeled with an image class as a first training sample set; training the classification model by using the image of the first training sample set to obtain parameters of the classification model.
In some embodiments, the first training module 350 is configured to perform initial training on the classification model using images of the first training sample set; inputting the images of the first training sample set into the initially trained classification model to obtain a classification result of the images of the first training sample set; determining a difficult sample image according to the difference between the classification result and the accurate classification result of the output image of the first training sample set; and training the initially trained classification model again by using the difficult sample image.
In some embodiments, the apparatus 30 further comprises: a second training module 360, configured to obtain a second sample image of the target class labeled with the target as a second training sample set; and training the target detection model by using the image of the second training sample set to obtain the target detection parameters.
In some embodiments, the second training module 360 is configured to input the candidate sample image into the classification model to obtain the image class information of the output candidate sample image; determining whether the candidate sample belongs to the candidate forbidden image according to the image category information of the candidate sample image; and taking the candidate sample image belonging to the candidate forbidden image as a second sample image.
The contraband image recognition apparatuses in embodiments of the present disclosure may each be implemented by various computing devices or computer systems, as described below in connection with fig. 4 and 5.
Fig. 4 is a block diagram of some embodiments of the forbidden image recognition apparatus of the present disclosure. As shown in fig. 4, the apparatus 40 of this embodiment includes: a memory 410 and a processor 420 coupled to the memory 410, the processor 420 being configured to perform the forbidden image identification method in any of the embodiments of the disclosure based on instructions stored in the memory 410.
The memory 410 may include, for example, system memory, fixed nonvolatile storage media, and the like. The system memory stores, for example, an operating system, application programs, boot loader (BootLoader), database, and other programs.
Fig. 5 is a block diagram of other embodiments of the forbidden image recognition apparatus of the present disclosure. As shown in fig. 5, the apparatus 50 of this embodiment includes: memory 510 and processor 520 are similar to memory 410 and processor 420, respectively. Input/output interface 530, network interface 540, storage interface 550, and the like may also be included. These interfaces 530, 540, 550, as well as the memory 510 and the processor 520, may be connected by a bus 560, for example. The input/output interface 530 provides a connection interface for input/output devices such as a display, a mouse, a keyboard, a touch screen, etc. The network interface 540 provides a connection interface for various networking devices, such as may be connected to a database server or cloud storage server, or the like. The storage interface 550 provides a connection interface for external storage devices such as SD cards, U discs, and the like.
It will be appreciated by those skilled in the art that embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable non-transitory storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the disclosure. It will be understood that each flowchart and/or block of the flowchart illustrations and/or block diagrams, and combinations of flowcharts and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing description of the preferred embodiments of the present disclosure is not intended to limit the disclosure, but rather to enable any modification, equivalent replacement, improvement or the like, which fall within the spirit and principles of the present disclosure.

Claims (11)

1. A method of illicit image recognition, comprising:
inputting an image to be identified into a classification model to obtain output image category information of the image to be identified;
determining whether the image to be identified belongs to a candidate forbidden image or not according to the image category information of the image to be identified;
Under the condition that the image to be identified belongs to a candidate forbidden image, inputting the image to be identified into a target detection model to obtain target category information of each target in the image to be identified;
according to the target category information of each target in the image to be identified, determining whether the image to be identified is an forbidden image comprises the following steps: determining an application scene of the image to be identified; matching a preset forbidden target class in the application scene with target class information of each target in the image to be identified; determining whether the image to be identified belongs to an forbidden image according to a matching result; the preset forbidden target categories in different application scenes are different.
2. The forbidden image recognition method of claim 1, wherein,
The determining whether the image to be identified belongs to the candidate forbidden image according to the image category information of the image to be identified comprises the following steps:
determining an application scene of the image to be identified;
Matching the preset image category to which the candidate forbidden image belongs in the application scene with the image category information of the image to be identified;
determining whether the image to be identified belongs to a candidate forbidden image according to a matching result;
The preset image categories to which the candidate forbidden images belong in different application scenes are different.
3. The forbidden image recognition method of claim 2, wherein,
The image category information of the image to be identified comprises: the probability that the image to be identified belongs to each image category;
The matching the preset image category to which the candidate forbidden image belongs in the application scene with the image category information of the image to be identified comprises the following steps:
Comparing the probability that the image to be identified belongs to each image category with the probability of the preset image category corresponding to the application scene, and determining the image category of the image to be identified;
Matching a preset image category to which the candidate forbidden image belongs in the application scene with the image category of the image to be identified;
Wherein, the probability of the preset image category corresponding to different application scenes is different.
4. The forbidden image recognition method of claim 1, wherein,
The target category information of each target in the image to be identified comprises the following steps: probability of each target belonging to each target class;
the matching the preset forbidden target class in the application scene with the target class information of each target in the image to be identified comprises the following steps:
Comparing the probability that each target in the image to be identified belongs to each target category with the probability of the preset target category corresponding to the application scene, and determining the target category of each target in the image to be identified;
Matching a preset forbidden target class in the application scene with the target class of each target in the image to be identified;
The probability of the preset target category corresponding to different application scenes is different.
5. The forbidden image recognition method of claim 1, further comprising:
Acquiring a first sample image marked with an image category as a first training sample set;
and training the classification model by using the image of the first training sample set to obtain parameters of the classification model.
6. The forbidden image recognition method of claim 5, wherein,
The training the classification model using the images of the first training sample set includes:
performing initial training on the classification model by using the image of the first training sample set;
Inputting the image of the first training sample set into the initially trained classification model to obtain a classification result of the image of the first training sample set;
Determining a difficult sample image according to the difference between the output classification result and the accurate classification result of the image of the first training sample set;
And training the classification model after initial training again by using the difficult sample image.
7. The forbidden image recognition method of claim 1, further comprising:
Acquiring a second sample image of the target class marked with the target as a second training sample set;
And training the target detection model by using the image of the second training sample set to obtain the target detection parameters.
8. The forbidden image recognition method of claim 7, wherein,
The obtaining a second sample image marked with the target category of the target comprises:
Inputting the candidate sample image into the classification model to obtain the output image category information of the candidate sample image;
Determining whether the candidate sample belongs to a candidate forbidden image according to the image category information of the candidate sample image;
And taking the candidate sample image belonging to the candidate forbidden image as a second sample image.
9. An illicit image recognition device, comprising:
The image type determining module is used for inputting the image to be identified into the classification model to obtain the output image type information of the image to be identified;
the image screening module is used for determining whether the image to be identified belongs to a candidate forbidden image according to the image category information of the image to be identified;
The target category determining module is used for inputting the image to be identified into a target detection model under the condition that the image to be identified belongs to a candidate forbidden image, so as to obtain target category information of each target in the image to be identified;
The forbidden image determining module is used for determining whether the image to be identified is the forbidden image according to the target category information of each target in the image to be identified, and comprises the following steps: determining an application scene of the image to be identified; matching a preset forbidden target class in the application scene with target class information of each target in the image to be identified; determining whether the image to be identified belongs to an forbidden image according to a matching result; the preset forbidden target categories in different application scenes are different.
10. An illicit image recognition device, comprising:
a processor; and
A memory coupled to the processor for storing instructions that, when executed by the processor, cause the processor to perform the forbidden image identification method of any one of claims 1-8.
11. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the program when executed by a processor implements the steps of the method of any of claims 1-8.
CN201911125531.2A 2019-11-18 2019-11-18 Forbidden image recognition method, forbidden image recognition device and computer readable storage medium Active CN111783812B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911125531.2A CN111783812B (en) 2019-11-18 2019-11-18 Forbidden image recognition method, forbidden image recognition device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911125531.2A CN111783812B (en) 2019-11-18 2019-11-18 Forbidden image recognition method, forbidden image recognition device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111783812A CN111783812A (en) 2020-10-16
CN111783812B true CN111783812B (en) 2024-06-18

Family

ID=72755743

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911125531.2A Active CN111783812B (en) 2019-11-18 2019-11-18 Forbidden image recognition method, forbidden image recognition device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111783812B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113516088B (en) * 2021-07-22 2024-02-27 中移(杭州)信息技术有限公司 Object recognition method, device and computer readable storage medium
CN115546824B (en) * 2022-04-18 2023-11-28 荣耀终端有限公司 Taboo picture identification method, apparatus and storage medium
CN115565201B (en) * 2022-04-18 2024-03-26 荣耀终端有限公司 Taboo picture identification method, apparatus and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107291737A (en) * 2016-04-01 2017-10-24 腾讯科技(深圳)有限公司 Nude picture detection method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107690660B (en) * 2016-12-21 2021-03-23 达闼机器人有限公司 Image recognition method and device
CN110020647B (en) * 2018-01-09 2021-03-02 杭州海康威视数字技术股份有限公司 Contraband target detection method and device and computer equipment
CN110321873B (en) * 2019-07-12 2023-10-10 苏州思萃工业大数据技术研究所有限公司 Sensitive picture identification method and system based on deep learning convolutional neural network

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107291737A (en) * 2016-04-01 2017-10-24 腾讯科技(深圳)有限公司 Nude picture detection method and device

Also Published As

Publication number Publication date
CN111783812A (en) 2020-10-16

Similar Documents

Publication Publication Date Title
JP6994588B2 (en) Face feature extraction model training method, face feature extraction method, equipment, equipment and storage medium
CN108830235B (en) Method and apparatus for generating information
CN105426356B (en) A kind of target information recognition methods and device
CN112949710B (en) Image clustering method and device
CN106778241B (en) Malicious file identification method and device
CN108171203B (en) Method and device for identifying vehicle
CN109034069B (en) Method and apparatus for generating information
CN111783812B (en) Forbidden image recognition method, forbidden image recognition device and computer readable storage medium
CN110363220B (en) Behavior class detection method and device, electronic equipment and computer readable medium
CN108021806B (en) Malicious installation package identification method and device
CN111783505A (en) Method and device for identifying forged faces and computer-readable storage medium
CN111753290B (en) Software type detection method and related equipment
CN110956615B (en) Image quality evaluation model training method and device, electronic equipment and storage medium
CN111338692B (en) Vulnerability classification method and device based on vulnerability codes and electronic equipment
CN112949767A (en) Sample image increment, image detection model training and image detection method
CN113919497A (en) Attack and defense method based on feature manipulation for continuous learning ability system
CN113221918A (en) Target detection method, and training method and device of target detection model
CN110135428B (en) Image segmentation processing method and device
CN108921138B (en) Method and apparatus for generating information
CN115713669B (en) Image classification method and device based on inter-class relationship, storage medium and terminal
CN113114679B (en) Message identification method and device, electronic equipment and medium
KR102342495B1 (en) Method and Apparatus for Creating Labeling Model with Data Programming
CN115037790A (en) Abnormal registration identification method, device, equipment and storage medium
CN113988059A (en) Session data type identification method, system, equipment and storage medium
CN113569879A (en) Training method of abnormal recognition model, abnormal account recognition method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant