CN111783812A - Method and device for identifying forbidden images and computer readable storage medium - Google Patents

Method and device for identifying forbidden images and computer readable storage medium Download PDF

Info

Publication number
CN111783812A
CN111783812A CN201911125531.2A CN201911125531A CN111783812A CN 111783812 A CN111783812 A CN 111783812A CN 201911125531 A CN201911125531 A CN 201911125531A CN 111783812 A CN111783812 A CN 111783812A
Authority
CN
China
Prior art keywords
image
target
category
forbidden
identified
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.)
Granted
Application number
CN201911125531.2A
Other languages
Chinese (zh)
Other versions
CN111783812B (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

Images

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 method and a device for identifying forbidden images 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 recognized into the classification model to obtain the image category information of the output image to be recognized; 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 recognized belongs to the candidate forbidden image, inputting the image to be recognized into a target detection model to obtain target category information of each target in the image to be recognized; 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

Method and device for identifying forbidden images and computer readable storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for identifying forbidden images, and a computer-readable storage medium.
Background
With the development of internet technology, information is spread more widely and more rapidly. Networks are flooded with a wide variety of information. In order to maintain network order and purify the network environment, some illegal and bad information, such as illegal images of pornography, violence and the like, needs to be removed. Due to the fact that the content of the forbidden images is complex and the details are more, at present, the forbidden images are generally checked manually.
Disclosure of Invention
The inventor finds that the efficiency of manually auditing the forbidden images is low.
One technical problem to be solved by the present disclosure is: how to improve the efficiency of illicit image identification.
According to some embodiments of the present disclosure, there is provided a method for identifying forbidden images, including: inputting the image to be recognized into the classification model to obtain the image category information of the output image to be recognized; 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 recognized belongs to the candidate forbidden image, inputting the image to be recognized into a target detection model to obtain target category information of each target in the image to be recognized; 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 includes: determining an application scene of an image to be identified; matching a preset image category to which the candidate forbidden image belongs in an application scene with image category information of an image to be identified; determining whether the image to be identified belongs to a candidate forbidden image or not according to the matching result; the candidate forbidden images under different application scenes belong to different preset image categories.
In some embodiments, the image category information of the image to be recognized includes: the probability that the image to be recognized 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 recognized belongs to each image category with the preset image category probability corresponding to the application scene, and determining the image category of the image to be recognized; 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; and the preset image category probabilities corresponding to different application scenes are different.
In some embodiments, determining whether the image to be recognized is a forbidden image according to the object class information of each object in the image to be recognized comprises: determining an application scene of an image to be identified; matching preset forbidden target categories in an application scene with target category information of each target in an image to be identified; determining whether the image to be identified belongs to a forbidden image or not according to the matching result; the preset forbidden object categories in different application scenes are different.
In some embodiments, the object class information of each object in the image to be recognized includes: a probability that each object belongs to each object class; matching 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 recognized belongs to each target category with the preset target category probability corresponding to the application scene, and determining the target category of each target in the image to be recognized; matching preset forbidden target classes in an application scene with target classes of all targets in an image to be identified; and the preset target category probabilities corresponding to different application scenes are different.
In some embodiments, 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 the parameters of the classification model.
In some embodiments, training the classification model using the image of the first training sample set comprises: 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 the classification results 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 (5) training the initially trained classification model again by using the difficult sample image.
In some embodiments, further comprising: acquiring a second sample image of a target class marked with a target, and taking the second sample image 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 the second sample image of the object class labeled with the object comprises: inputting the candidate sample image into a classification model to obtain image category 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 other embodiments of the present disclosure, there is provided a contraband image recognition apparatus including: the image category determining module is used for inputting the image to be recognized into the classification model to obtain the image category information of the output image to be recognized; the image screening module is used for determining whether the image to be identified belongs to the candidate forbidden image or not 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 recognized into the target detection model under the condition that the image to be recognized belongs to the candidate forbidden image to obtain the target category information of each target in the image to be recognized; and the forbidden image determining module is used for determining 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 image screening module is configured to determine an application scenario of the image to be identified; matching a preset image category to which the candidate forbidden image belongs in an application scene with image category information of an image to be identified; determining whether the image to be identified belongs to a candidate forbidden image or not according to the matching result; the candidate forbidden images under different application scenes belong to different preset image categories.
In some embodiments, the image category information of the image to be recognized includes: the probability that the image to be recognized 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 preset image category probability corresponding to the application scene to determine 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; and the preset image category probabilities corresponding to different application scenes are different.
In some embodiments, the illicit image determination module is configured to determine an application scenario of the image to be identified; matching preset forbidden target categories in an application scene with target category information of each target in an image to be identified; determining whether the image to be identified belongs to a forbidden image or not according to the matching result; the preset forbidden object categories in different application scenes are different.
In some embodiments, the object class information of each object in the image to be recognized includes: a probability that each object belongs to each object 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 preset target category probability corresponding to the application scene, and determining the target category of each target in the image to be identified; matching preset forbidden target classes in an application scene with target classes of all targets in an image to be identified; and the preset target category probabilities corresponding to different application scenes are 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 as a first training sample set; and training the classification model by using the image of the first training sample set to obtain the 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 the classification results 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 (5) 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 and taking the second sample image 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, and obtain image category 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 other embodiments of the present disclosure, there is provided a contraband 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 a method of illicit image identification as in any of the preceding embodiments.
According to still further embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the illicit image identification method of any of the foregoing embodiments.
The invention discloses a method for automatically identifying forbidden images by a machine, which comprises the steps of firstly inputting images to be identified into a classification model to obtain roughly classified image categories of the images to be identified, screening out candidate forbidden images according to the roughly classified image categories, further identifying targets in the images to be identified by using a target detection model to obtain target category information of each target, and determining whether the images to be identified are forbidden images 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 recognized is roughly classified to recognize the characteristics of the whole image, and then finely classified to recognize the target detail characteristics in the image, so that the forbidden image is recognized in an all-around manner from the whole and the local, and the recognition accuracy and efficiency are improved.
Other features of the present disclosure and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, 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 used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 illustrates a flow diagram of a method of illicit image identification in accordance with some embodiments of the present disclosure.
Fig. 2 shows a schematic flow diagram of a method of illicit image identification according to further embodiments of the present disclosure.
Fig. 3 illustrates a schematic structural diagram of a contraband image recognition apparatus according to some embodiments of the present disclosure.
Fig. 4 shows a schematic structural diagram of a contraband image recognition apparatus according to another embodiment of the present disclosure.
Fig. 5 shows a schematic structural diagram of a contraband image recognition apparatus according to still other embodiments of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all of the 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. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
Aiming at the problem that manual checking of prohibited pictures is low in efficiency in the prior art, a method for automatically identifying scarf images through 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 method for contraband image identification according to 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 recognized is input into the classification model, and the image category information of the output image to be recognized is obtained.
And acquiring an image to be identified from the network, wherein the image to be identified can be an image frame extracted from a video to be identified. The image to be recognized can be preprocessed, for example, the image to be recognized is rotated, zoomed, color-adjusted, and the like, so that the subsequent image to be recognized is recognized more accurately. Inputting the preprocessed image to be recognized into the classification model, extracting the features (such as CNN (convolutional neural network) features) of the image to be recognized, and determining the image category information of the image to be recognized according to the features. The classification model can be, for example, a neural network model or a convolutional neural network model, more specifically, the existing models such as ResNeXt, ResNeXt50 or SE-ResNeXt50 can be used, and a model with better and more accurate classification effect can be selected according to actual requirements.
The classification model can configure the divided image classes according to actual requirements, and after pre-training, the classification model can determine that the image to be recognized belongs to one or more of the configured image classes. For example, the image classes determined by the classification model include two image classes, a normal image and an illicit image. For another example, the image categories determined by the classification model include three image categories, a normal image, an intermediate image, and an illicit image, the intermediate image belongs to an image category between normal and illicit, and for example, for pornographic illicit 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, a normal image, a bias contraband image, and a contraband image, for example, for pornographic and contraband image identification, the bias normal image may represent a sexual feeling image, and the bias contraband image may represent a vulgar image. The image category determined by the classification model is determined according to the labeling of the training samples 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 recognized belongs to each image category, and further determine one or more image categories of the image to be recognized according to the probability that the image to be recognized belongs to each image category.
In step S104, it is determined whether the image to be recognized belongs to a candidate prohibited image according to the image category information of the image to be recognized.
The candidate illicit images represent images that are likely to be illicit images, requiring images that are subdivided using subsequent object detection models. In some embodiments, an application scene of the image to be recognized is determined; matching a preset image category to which the candidate forbidden image belongs in an application scene with image category information of an image to be identified; determining whether the image to be identified belongs to a candidate forbidden image or not according to the matching result; the candidate forbidden images under different application scenes belong to different preset image categories.
The discrimination scales of the forbidden images in different application scenes are different, so that the discrimination scales of the candidate forbidden images are also different. For example, in a more serious news-like content, the sexy images may belong to prohibited images, and thus, the images to be recognized belonging to the sexy image category may be determined as candidate prohibited images, whereas for entertainment content, the sexy images do not belong to prohibited images, and thus, the images to be recognized belonging to the sexy image category may not be determined as candidate prohibited images. 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 recognized are searched, and then the image category information of the images to be recognized is compared with the corresponding preset image categories.
Further, in some embodiments, the image category information of the image to be recognized includes: the probability that the image to be recognized belongs to each image category. And comparing the probability that the image to be recognized belongs to each image category with the preset image category probability corresponding to the application scene, and determining the image category of the image to be recognized. 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. And if the image category of the image to be identified comprises one or more of the 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 recognized belongs to each image category with the preset image category probability corresponding to the application scene, the image to be recognized may be determined to be a plurality of categories at the same time. That is, for the probability that the image to be recognized belongs to each image category, in the case that the probability of belonging to the image category exceeds the preset image category probability, the image to be recognized belongs to the image category.
And the preset image category probabilities corresponding to different application scenes are different. Due to the fact that the distinguishing scales of the forbidden images in different application scenes are different, the image category of the image to be identified can be adjusted by adjusting the preset image category probability in different application scenes, selection of the candidate forbidden images is adjusted, and the model can adapt to different application scenes.
Further, different image categories in the same application scene may correspond to different preset image category probabilities. And comparing the probability of the image to be recognized belonging to each image category with the preset image category probability of the image category pair in the belonging application scene, thereby determining whether the image to be recognized belongs to the image category.
In step S106, when the image to be recognized belongs to the candidate prohibited image, the image to be recognized is input into the target detection model, and the target category information of each target in the image to be recognized is obtained.
And selecting the images to be identified which belong to the candidate forbidden images to input the 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 fast-RCNN (Faster cyclic convolution neural network), and a model with a better effect can be selected according to actual needs.
In step S108, it is determined whether the image to be recognized is a forbidden image according to the object class information of each object in the image to be recognized.
In some embodiments, an application scene of the image to be recognized is determined; matching preset forbidden target categories in an application scene with target category information of each target in an image to be identified; and determining whether the image to be identified belongs to the forbidden image or not according to the matching result. The preset forbidden object categories under different application scenes are different. The preset contraband object categories corresponding to different application scenes can be preset. For example, swimsuits belong to the prohibited object category in certain application scenarios (news scenarios) and do not belong to the prohibited object category in certain application scenarios (shopping platform scenarios). The forbidden images conforming to different application scenes can be determined by adjusting the preset forbidden object categories under different application scenes, and the forbidden images are flexibly determined according to the application scenes.
Further, in some embodiments, the object class information of each object in the image to be recognized includes: the probability that each object belongs to each object class. The target detection model can determine the probability that each target in the image to be recognized belongs to each target category, and compares the probability that each target in the image to be recognized belongs to each target category with the preset target category probability corresponding to the application scene to determine the target category of each target in the image to be recognized; and matching the preset forbidden target class in the application scene with the target class of each target in the image to be identified. And if the target in the image to be identified comprises one or more preset forbidden target categories corresponding to the application scene, the image to be identified belongs to a forbidden image. For example, the image to be recognized may include some naked human body parts or some specific actions, and may be determined as a forbidden image.
By comparing the probability that each target in the image to be recognized belongs to each target category with the preset target category probability corresponding to the application scene, the target may be determined to be a plurality of categories at the same time. I.e. for the probability that each object belongs to each object class, in case the probability that the object belongs to the object class exceeds a preset object class probability, the object belongs to the object class.
And the preset target category probabilities corresponding to different application scenes are different. Due to the fact that the distinguishing scales of the forbidden images in different application scenes are different, the target class of each target in the image to be recognized can be adjusted by adjusting the preset target class probability in different application scenes, selection of the forbidden images is adjusted, and the model can adapt to different application scenes.
Further, different target categories in the same application scene may correspond to different preset target category probabilities. And aiming at the probability that each target in the image to be recognized belongs to each image category, comparing the probability that the target belongs to the target category with the preset target category probability of the target category pair in the application scene to which the target belongs, and thus determining whether the target belongs to the target category.
The embodiment provides a method for automatically identifying an illegal image by a machine, which includes inputting an image to be identified into a classification model, obtaining a coarsely classified image category of the image to be identified, screening out a candidate illegal image according to the coarsely classified image category, further identifying a target in the image to be identified by using a target detection model, obtaining target category information of each target, and determining whether the image to be identified is the illegal 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 recognized is roughly classified to recognize the characteristics of the whole image, and then finely classified to recognize the target detail characteristics in the image, so that the forbidden image is recognized in an all-around manner from the whole and the local, and the recognition accuracy and efficiency are improved. In addition, the determination of candidate forbidden images and forbidden images can be adjusted by flexibly configuring the preset image categories, the preset forbidden target categories, the preset image category probability, the preset target category probability and the like in different application scenes, so that the method is suitable for identifying the images in different application scenes, and the forbidden images are more accurately and flexibly identified.
The training process for the classification model and the target detection model in the present disclosure is described below with reference to fig. 2.
Fig. 2 is a flow chart of further embodiments of the illicit 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 category is acquired as a first training sample set.
As in the foregoing embodiment, the image categories into which the classification model can be divided may be set according to actual requirements, and each first sample image is labeled with a corresponding image category. In order to improve the accuracy of the classification model, the first sample images of various scenes, various media and various sources can be obtained. The first sample image may be pre-processed, e.g., rotated, scaled, color adjusted, etc., to form a uniform specification.
In step S204, the classification model is trained by using the image of the first training sample set, so as to obtain parameters of the classification model.
In some embodiments, the images in the first training sample set are input into the classification model, the image category of each output image is obtained, a first loss function value is calculated according to the difference between the image category of each output image and the labeled image category, the parameter of the classification model is adjusted according to the first loss function, and the above processes are repeated until a preset condition is reached, for example, the first loss function value reaches the minimum value or reaches a threshold value, and the like.
In each training process, a preset number of image input classification models in the first training sample set are extracted, and the image input classification models belonging to each image category can be extracted according to a first preset proportion. For example, images of four image categories are extracted in 1:1:1:1, respectively.
In some embodiments, the classification model is initially trained using images of a first training sample set; inputting the images of the first training sample set into the initially trained classification model to obtain the classification results 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 (5) training the initially trained classification model again by using the difficult sample image. And the classification model is retrained again by using the hard sample images, 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 to which the target is labeled is acquired as a second training sample set.
In some embodiments, the candidate sample image is input into the classification model, and image category information of the output candidate sample image is obtained; 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. After the classification model is trained, screening out partial candidate sample images by using the classification model to serve as second sample images. The candidate sample images may be images in the first set of training samples. Therefore, a plurality of normal pictures can be removed, so that possible confusion can be reduced to a great extent, and the training efficiency and the training accuracy are improved.
Because the content of the forbidden pictures is complicated and the characteristics are dispersed, the labeled target categories are more than the target categories determined in the application of the embodiment. The object categories can be set to include multiple categories, for example, human body, motion and the like are high-level categories, gender is middle-level categories, and the description of specific parts or motion is bottom-level categories, so that an object can be determined as an object category through multiple levels of tags, which facilitates management of the tags and further determines whether the object belongs to a prohibited picture according to the object category.
In step S208, the target detection model is trained by using the image of the second training sample set, so as to obtain a target detection parameter.
In some embodiments, the images in the second training sample set are input into the object detection model, so as to obtain an output object class of each object, a second loss function value is calculated according to a difference between the output object class of each object and the labeled object class, parameters of the object detection model are adjusted according to the second loss function, and the above process is repeated until a preset condition is reached, for example, the second loss function value reaches a minimum value or reaches a threshold value, and the like. In each training process, a preset number of image input target detection models in the second training sample set are extracted, and image input target detection models belonging to each target category can be extracted according to a second preset proportion.
The present disclosure also provides a contraband image recognition apparatus, which is described below with reference to fig. 3.
Fig. 3 is a block diagram of some embodiments of a contraband image identification apparatus of the present disclosure. As shown in fig. 3, the apparatus 30 of this embodiment includes: an image category determination module 310, an image screening module 320, a target category determination module 330, and a forbidden image determination module 340.
The image category determining module 310 is configured to input the image to be recognized into the classification model, so as to obtain image category information of the output image to be recognized.
The image screening module 320 is configured to determine whether the image to be identified belongs to the candidate prohibited 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 a preset image category to which the candidate forbidden image belongs in an application scene with image category information of an image to be identified; determining whether the image to be identified belongs to a candidate forbidden image or not according to the matching result; the candidate forbidden images under different application scenes belong to different preset image categories.
In some embodiments, the image category information of the image to be recognized includes: the probability that the image to be recognized belongs to each image category; the image screening module 320 is configured to compare the 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; and the preset image category probabilities corresponding to different application scenes are different.
And the target category determining module 330 is configured to, under the condition that the image to be recognized belongs to the candidate prohibited image, input the image to be recognized into the target detection model, so as to obtain target category information of each target in the image to be recognized.
The forbidden image determining module 340 is configured to determine whether the image to be recognized is a forbidden image according to the target category information of each target in the image to be recognized.
In some embodiments, the contraband image determination module 340 is used to determine the application scenario of the image to be identified; matching preset forbidden target categories in an application scene with target category information of each target in an image to be identified; determining whether the image to be identified belongs to a forbidden image or not according to the matching result; the preset forbidden object categories in different application scenes are different.
In some embodiments, the object class information of each object in the image to be recognized includes: a probability that each object belongs to each object class; the forbidden image determining module 340 is configured to compare the probability that each target in the image to be identified belongs to each target category with a preset target category probability corresponding to the application scene, and determine the target category of each target in the image to be identified; matching preset forbidden target classes in an application scene with target classes of all targets in an image to be identified; and the preset target category probabilities corresponding to different application scenes are 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 category as a first training sample set; and training the classification model by using the image of the first training sample set to obtain the parameters of the classification model.
In some embodiments, the first training module 350 is configured 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 the classification results 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 (5) training the initially trained classification model again by using the difficult sample image.
In some embodiments, the apparatus 30 further comprises: the second training module 360 is 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, and obtain image category 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 apparatus in the embodiments of the present disclosure may be implemented by various computing devices or computer systems, which are described below with reference to fig. 4 and 5.
Fig. 4 is a block diagram of some embodiments of a contraband image identification 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 configured to perform a method of illicit image identification in any of the embodiments of the present disclosure based on instructions stored in the memory 410.
Memory 410 may include, for example, system memory, fixed non-volatile storage media, and the like. The system memory stores, for example, an operating system, an application program, a BootLoader (BootLoader), a database, and other programs.
Fig. 5 is a block diagram of further embodiments of a contraband image recognition apparatus according to 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. An input output interface 530, a network interface 540, a storage interface 550, and the like may also be included. These interfaces 530, 540, 550 and the connections between the memory 510 and the processor 520 may be, for example, via a bus 560. The input/output interface 530 provides a connection interface for input/output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 540 provides a connection interface for various networking devices, such as a database server or a cloud storage server. The storage interface 550 provides a connection interface for external storage devices such as an SD card and a usb disk.
As will be appreciated by one skilled in the art, 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, and the like) 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 flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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 above description is only exemplary of the present disclosure and is not intended to limit the present disclosure, so that any modification, equivalent replacement, or improvement made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (12)

1. A method of contraband image identification, comprising:
inputting an image to be recognized into a classification model to obtain output image category information of the image to be recognized;
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 recognized belongs to a candidate forbidden image, inputting the image to be recognized into a target detection model to obtain target category information of each target in the image to be recognized;
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.
2. The contraband 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:
determining an application scene of the image to be recognized;
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 candidate forbidden images under different application scenes belong to different preset image categories.
3. The contraband 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 recognized belongs to each image category;
the matching of the preset image category to which the candidate forbidden image belongs and the image category information of the image to be identified in the application scene comprises:
comparing the probability that the image to be recognized belongs to each image category with the preset image category probability corresponding to the application scene, and determining the image category of the image to be recognized;
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;
and the preset image category probabilities corresponding to different application scenes are different.
4. The contraband image recognition method of claim 1, wherein,
the determining whether the image to be identified is a forbidden image according to the object category information of each object in the image to be identified comprises:
determining an application scene of the image to be recognized;
matching preset forbidden target categories in the application scene with target category information of each target in the image to be identified;
determining whether the image to be identified belongs to a forbidden image or not according to a matching result;
the preset forbidden object categories in different application scenes are different.
5. The contraband image recognition method of claim 4, wherein,
the target category information of each target in the image to be recognized comprises: a probability that each object belongs to each object class;
the matching of the preset forbidden target class in the application scene with the target class information of each target in the image to be identified comprises:
comparing the probability that each target in the image to be recognized belongs to each target category with the preset target category probability corresponding to the application scene, and determining the target category of each target in the image to be recognized;
matching preset forbidden target classes in the application scene with target classes of all targets in the image to be identified;
and the preset target category probabilities corresponding to different application scenes are different.
6. The contraband image identification 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 the parameters of the classification model.
7. The contraband image recognition method of claim 5, wherein,
the training of the classification model with the image of the first training sample set comprises:
initially training the classification model using the 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 output classification result of the image of the first training sample set and the accurate classification result;
and training the classification model after the initial training again by using the difficult sample image.
8. The contraband image identification method of claim 1, further comprising:
acquiring a second sample image of a target class marked with a target, and taking the second sample image 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 parameters of the target detection.
9. The contraband image recognition method of claim 8, wherein,
the obtaining of the second sample image of the target category labeled with the target includes:
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.
10. A contraband image recognition apparatus comprising:
the image category determining module is used for inputting the image to be recognized into the classification model to obtain the output image category information of the image to be recognized;
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 recognized into a target detection model under the condition that the image to be recognized belongs to a candidate forbidden image to obtain target category information of each target in the image to be recognized;
and the forbidden image determining module is used for determining 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.
11. A contraband image recognition apparatus 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 contraband image identification method of any of claims 1-9.
12. 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 one of claims 1-9.
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 true CN111783812A (en) 2020-10-16
CN111783812B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113516088A (en) * 2021-07-22 2021-10-19 中移(杭州)信息技术有限公司 Object recognition method, device and computer readable storage medium
CN115546824A (en) * 2022-04-18 2022-12-30 荣耀终端有限公司 Taboo picture identification method, equipment and storage medium
CN115565201A (en) * 2022-04-18 2023-01-03 荣耀终端有限公司 Taboo picture identification method, equipment and storage medium

Citations (4)

* 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
WO2018112783A1 (en) * 2016-12-21 2018-06-28 深圳前海达闼云端智能科技有限公司 Image recognition method and device
CN110020647A (en) * 2018-01-09 2019-07-16 杭州海康威视数字技术股份有限公司 A kind of contraband object detection method, device and computer equipment
CN110321873A (en) * 2019-07-12 2019-10-11 苏州惠邦医疗科技有限公司 Sensitization picture recognition methods and system based on deep learning convolutional neural networks

Patent Citations (4)

* 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
WO2018112783A1 (en) * 2016-12-21 2018-06-28 深圳前海达闼云端智能科技有限公司 Image recognition method and device
CN110020647A (en) * 2018-01-09 2019-07-16 杭州海康威视数字技术股份有限公司 A kind of contraband object detection method, device and computer equipment
CN110321873A (en) * 2019-07-12 2019-10-11 苏州惠邦医疗科技有限公司 Sensitization picture recognition methods and system based on deep learning convolutional neural networks

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
崔鹏飞;裘;孙瑞;: "面向网络内容安全的图像识别技术研究", 信息网络安全, no. 09 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113516088A (en) * 2021-07-22 2021-10-19 中移(杭州)信息技术有限公司 Object recognition method, device and computer readable storage medium
CN113516088B (en) * 2021-07-22 2024-02-27 中移(杭州)信息技术有限公司 Object recognition method, device and computer readable storage medium
CN115546824A (en) * 2022-04-18 2022-12-30 荣耀终端有限公司 Taboo picture identification method, equipment and storage medium
CN115565201A (en) * 2022-04-18 2023-01-03 荣耀终端有限公司 Taboo picture identification method, equipment and 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

Also Published As

Publication number Publication date
CN111783812B (en) 2024-06-18

Similar Documents

Publication Publication Date Title
JP6994588B2 (en) Face feature extraction model training method, face feature extraction method, equipment, equipment and storage medium
CN112052787B (en) Target detection method and device based on artificial intelligence and electronic equipment
CN108830235B (en) Method and apparatus for generating information
CN112949710B (en) Image clustering method and device
CN108229504B (en) Image analysis method and device
CN109034069B (en) Method and apparatus for generating information
CN108021806B (en) Malicious installation package identification method and device
CN110363220B (en) Behavior class detection method and device, electronic equipment and computer readable medium
CN111783505A (en) Method and device for identifying forged faces and computer-readable storage medium
CN111783812B (en) Forbidden image recognition method, forbidden image recognition device and computer readable storage medium
CN113449725B (en) Object classification method, device, equipment and storage medium
CN111079816A (en) Image auditing method and device and server
CN112633341A (en) Interface testing method and device, computer equipment and storage medium
CN112381092A (en) Tracking method, device and computer readable storage medium
CN110135428B (en) Image segmentation processing method and device
CN109165572B (en) Method and apparatus for generating information
CN110659631A (en) License plate recognition method and terminal equipment
CN115713669B (en) Image classification method and device based on inter-class relationship, storage medium and terminal
CN111368128A (en) Target picture identification method and device and computer readable storage medium
CN108021918B (en) Character recognition method and device
CN113705559B (en) Character recognition method and device based on artificial intelligence and electronic equipment
CN114332716B (en) Clustering method and device for scenes in video, electronic equipment and storage medium
US20230289522A1 (en) Deep Learning Systems and Methods to Disambiguate False Positives in Natural Language Processing Analytics
CN115546554A (en) Sensitive image identification method, device, equipment and computer readable storage medium
CN114821062A (en) Commodity identification method and device based on image segmentation

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
GR01 Patent grant