CN111259968A - Illegal image recognition method, device, equipment and computer readable storage medium - Google Patents

Illegal image recognition method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN111259968A
CN111259968A CN202010057247.2A CN202010057247A CN111259968A CN 111259968 A CN111259968 A CN 111259968A CN 202010057247 A CN202010057247 A CN 202010057247A CN 111259968 A CN111259968 A CN 111259968A
Authority
CN
China
Prior art keywords
image
illegal
images
sample set
illegal image
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.)
Pending
Application number
CN202010057247.2A
Other languages
Chinese (zh)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010057247.2A priority Critical patent/CN111259968A/en
Publication of CN111259968A publication Critical patent/CN111259968A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Probability & Statistics with Applications (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the invention discloses an illegal image identification method, an illegal image identification device, illegal image identification equipment and a computer readable storage medium. The illegal image identification method comprises the following steps: training the initialized neural network through a first sample set in advance to obtain an illegal image recognition model; the first sample set comprises a positive sample set and a negative sample set, the positive sample set comprises extended sample images obtained by performing data enhancement processing on illegal images, and one illegal image corresponds to at least two extended sample images; and performing illegal image recognition based on the illegal image recognition model. By adopting the embodiment of the invention, the content of the training sample can be greatly enriched, thereby improving the efficiency of model training and the accuracy of illegal image recognition.

Description

Illegal image recognition method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of Artificial Intelligence (AI), and in particular, to an illegal image recognition method, apparatus, device, and computer-readable storage medium.
Background
With the rapid development of internet technology, a large amount of information can be queried and mastered through a network, however, a large amount of illegal websites and illegal pictures (such as illegal gambling pictures such as Liuhe, etc.) are also spread along with the network, which not only pollutes the network environment, but also causes serious consequences such as illegal crimes. In order to purify a network environment and effectively inhibit the propagation of illegal pictures on the network, in the prior art, technologies such as image identification and the like are often adopted to identify and classify pictures in the network, and the identified illegal pictures are intercepted or recalled and the like.
Most of the existing image recognition technologies are based on a deep convolutional neural network, however, the deep convolutional neural network has numerous parameters and a complex structure, and a large number of samples are often needed for training. However, due to the particularity of the illegal pictures, the number of samples that can be obtained is often insufficient and the quality is poor, so the training process becomes extremely difficult, the recognition accuracy of the trained model on the illegal images is low, and the recall of quality guarantee or the interception of the illegal pictures in the network cannot be guaranteed.
Disclosure of Invention
The embodiment of the invention provides an illegal image recognition method, an illegal image recognition device, an illegal image recognition equipment and a computer readable storage medium, which can enrich the quantity and the content of training samples to a greater extent, thereby improving the training efficiency of a model and the accuracy of the model in image recognition and classification.
In one aspect, an embodiment of the present invention provides an illegal image identification method, where the illegal image identification method includes:
training the initialized neural network through a first sample set in advance to obtain an illegal image recognition model; the first sample set comprises a positive sample set and a negative sample set, the positive sample set comprises extended sample images obtained by performing data enhancement processing on illegal images, and one illegal image corresponds to at least two extended sample images;
and performing illegal image recognition based on the illegal image recognition model.
Wherein the data enhancement processing includes at least one of image cropping processing, image rotation processing, and gaussian noise addition processing.
Wherein the negative sample set comprises a plurality of normal images; the training of the initialized neural network through the first sample set in advance to obtain the illegal image recognition model comprises the following steps:
performing image feature extraction on the plurality of images in the first sample set to obtain convolution features corresponding to the plurality of images; the plurality of images includes a plurality of extended sample images in the positive sample set and a plurality of normal images in the negative sample set;
determining probability values of the plurality of images belonging to the illegal image based on convolution features corresponding to the plurality of images;
and correcting one or more parameters in the neural network by taking the illegal images or the normal images as labels according to the difference between the probability value of the illegal images and the labels of the images to obtain the illegal image recognition model.
Wherein, the illegal image recognition based on the illegal image recognition model comprises:
acquiring an image to be identified;
determining the probability value of the image to be recognized belonging to the illegal image through the illegal image recognition model;
and determining the recognition result of the image to be recognized according to a preset threshold value and the probability value of the image to be recognized belonging to the illegal image.
Determining the recognition result of the image to be recognized according to a preset threshold and the probability value of the image to be recognized belonging to the illegal image, wherein the determining comprises the following steps:
if the probability value that the image to be recognized belongs to the illegal image is larger than the preset threshold value, determining that the image to be recognized belongs to the illegal image, and recalling the image to be recognized;
and if the probability value of the image to be recognized belonging to the illegal image is smaller than or equal to the preset threshold value, determining that the image to be recognized belongs to the normal image.
In another aspect, an embodiment of the present invention provides an illegal image recognition apparatus, including:
the training module is used for training the initialized neural network in advance through the first sample set to obtain an illegal image recognition model; the first sample set comprises a positive sample set and a negative sample set, the positive sample set comprises extended sample images obtained by performing data enhancement processing on illegal images, and one illegal image corresponds to at least two extended sample images;
and the identification module is used for carrying out illegal image identification based on the illegal image identification model.
Wherein the data enhancement processing includes at least one of image cropping processing, image rotation processing, and gaussian noise addition processing.
Wherein the negative sample set comprises a plurality of normal images; the training module comprises:
a feature extraction unit, configured to perform image feature extraction on the multiple images in the first sample set to obtain convolution features corresponding to the multiple images; the plurality of images includes a plurality of extended sample images in the positive sample set and a plurality of normal images in the negative sample set;
the first determining unit is used for determining probability values of the plurality of images belonging to the illegal image respectively based on convolution characteristics corresponding to the plurality of images respectively;
and the correcting unit is used for correcting one or more parameters in the neural network according to the difference between the probability value that the plurality of images respectively belong to the illegal image and the label of each of the plurality of images by taking the plurality of images respectively belong to the illegal image or the normal image as the label to obtain the illegal image identification model.
Wherein the identification module comprises:
the device comprises an acquisition unit, a recognition unit and a processing unit, wherein the acquisition unit is used for acquiring an image to be recognized;
the second determining unit is used for determining the probability value of the image to be recognized belonging to the illegal image through the illegal image recognition model;
and the third determining unit is used for determining the recognition result of the image to be recognized according to a preset threshold value and the probability value of the image to be recognized belonging to the illegal image.
Wherein the third determination unit includes:
the first determining subunit is configured to determine that the image to be identified belongs to the illegal image and recall the image to be identified if the probability value that the image to be identified belongs to the illegal image is greater than the preset threshold;
and the second determining subunit is used for determining that the image to be identified belongs to the normal image if the probability value that the image to be identified belongs to the illegal image is smaller than or equal to the preset threshold value.
In yet another aspect, an embodiment of the present invention provides a computing device, which includes a processor and a memory, where the processor is connected to the memory, where the memory is used to store a program code, and the processor is used to call the program code to execute the method in the above aspect.
In yet another aspect, an embodiment of the present invention provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, implements the method in the above-mentioned aspect.
The embodiment of the invention provides an illegal image identification method, which can obtain a large number of new samples (for example, at least two extended sample images corresponding to each illegal image can be included) by performing data enhancement processing (for example, image cropping processing, image rotation processing, gaussian noise adding processing and the like) on an original sample (for example, multiple illegal images can be included). The method realizes that a large number of new samples with rich content are obtained on the basis of rare original samples with weak content. The large number of new samples and the original samples can both belong to illegal images (such as illegal betting images such as Liuhe color) and can be used for training of an illegal image recognition model based on a convolutional neural network. Therefore, compared with the prior art, when the training samples belonging to the illegal images are difficult to obtain and are rare, the training of the illegal image recognition model is carried out by only a small amount of obtained original samples. According to the embodiment of the invention, training samples with rich contents and sufficient quantity can be obtained on the basis of a small quantity of original samples through data enhancement processing, and the efficiency of model training and the accuracy of the model for identifying illegal images are improved. For example, illegal images such as Liuhe lottery and the like in the network can be efficiently identified and recalled or intercepted, and the like, so that the propagation of the illegal images on the network is effectively restrained, the network environment is maintained, and illegal criminal events and the like are reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a system architecture diagram of an illegal image recognition method according to an embodiment of the present invention;
fig. 2 is a schematic view of an application scenario of an illegal image recognition method according to an embodiment of the present invention;
FIG. 3 is a schematic overall flow chart of model training according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of an illegal image recognition method according to an embodiment of the present invention;
FIG. 5 is a flow chart of another illegal image recognition method according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating an image cropping process according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating another image cropping process provided by an embodiment of the present invention;
FIG. 8 is a schematic diagram of an image rotation process provided by an embodiment of the present invention;
FIG. 9 is a schematic diagram of an additive Gaussian noise process provided by an embodiment of the invention;
FIG. 10 is a schematic diagram of a convolutional neural network provided by an embodiment of the present invention;
FIG. 11 is a schematic flow chart of image recognition according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of an illegal image recognition device according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of a computing device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a system architecture diagram of an illegal image recognition method according to an embodiment of the present invention, and the technical solution of the embodiment of the present invention can be embodied in the system architecture shown in fig. 1 by way of example or a similar system architecture. As shown in fig. 1, the system architecture may include a server 100a and a plurality of computing devices, and as shown in fig. 1, may specifically include computing devices 200a, 200b, and 200 c. Any one of the computing devices 200a, 200b, and 200c may obtain training samples for model training from the server 100a in a wired or wireless manner, for example, the training samples may include multiple illegal images. Alternatively, the illegal images may be stored locally on the computing devices 200a, 200b, and 200c and retrieved directly from the memory of the computing devices 200a, 200b, and 200 c. Optionally, the computing devices 200a, 200b, and 200c may also obtain the plurality of illegal images from other devices (for example, a camera, a smartphone, a tablet computer, and the like) in a wired or wireless manner, and the like, which is not limited in this embodiment of the present invention. Then, the computing devices 200a, 200b, and 200c may perform data enhancement processing (for example, image cropping processing, image rotation processing, image horizontal/vertical flipping processing, gaussian white noise adding processing, and the like may be included) on all or part of the illegal images of the multiple illegal images according to the multiple obtained illegal images by using a data enhancement technology, so as to obtain at least two extended sample images (or one extended sample image) corresponding to the illegal images after the data enhancement processing, where the extended sample image is not specifically limited in this embodiment of the present invention. For example, the one or more extended sample images may include an image obtained by cropping the illegal image according to a different aspect ratio, may also include an image obtained by rotating the illegal image according to a different rotation angle and rotation direction, and the like, which is not specifically limited in this embodiment of the present invention. Alternatively, each of the illegal images and each of the extended sample images may belong to an illegal image, and the illegal image may be, for example, a betting image such as a six-color betting image. The computing device may train the initialized neural network based on the first plurality of extended sample images, or may also train the initialized neural network based on the plurality of illegal images and the plurality of extended sample images (that is, the plurality of illegal images and the plurality of extended sample images are used as training samples for model training) at the same time, so as to obtain the illegal image recognition model. Obviously, the illegal image recognition model can be used for recognizing and classifying images in the network, judging whether the images belong to illegal images, and the like. For example, the illegal image may be an illegal image such as a color six, and the illegal image recognition model may recognize a color six picture in the network, further intercept or recall the recognized color six picture, and the like, maintain a network environment, throttle the propagation of the illegal picture on the network, and the like. Thus, the computing devices 200a, 200b, and 200c implement that a large amount of rich new samples are obtained through data enhancement processing based on a small amount of obtained original samples, and an initialized neural network (for example, a classification convolutional neural network) is trained based on the large amount of new samples, so as to obtain an illegal image recognition model for image recognition and classification. The training efficiency of the model and the accuracy of the model for recognizing illegal images are effectively improved, for example, the illegal images such as Liuhe color in the network can be accurately recognized and intercepted, the network environment is maintained, and the like.
As described above, the computing devices 200a, 200b, and 200c may be smart phones, smart wearable devices, tablets, laptops, desktops, and the like with the above-described functions. The server 100a may be one server having the above functions, a server cluster including a plurality of servers, or one cloud computing service center. Server 100a may establish communication connections with computing devices 200a, 200b, and 200c through wireless and wired networks.
In a possible implementation manner, in combination with the system architecture diagram corresponding to the embodiment in fig. 1, an application scenario diagram of an illegal image recognition method is further provided in an embodiment of the present invention. Referring to fig. 2, fig. 2 is a schematic view of an application scenario of an illegal image recognition method according to an embodiment of the present invention. As shown in fig. 2, the computing device may be the computing device 200a in the system architecture of fig. 1, and the server may be the server 100a in the system architecture of fig. 1. In addition, in a possible implementation manner, the embodiment of the present invention further provides an overall flow diagram of model training for a method and a scenario corresponding to the embodiments in fig. 1 and fig. 2. In a possible implementation manner, please refer to fig. 3, and fig. 3 is a schematic overall flow chart of model training according to an embodiment of the present invention. An illegal image recognition method provided by the embodiment of the present invention will be further elaborated with reference to the application scenario shown in fig. 2 and the overall flow shown in fig. 3.
As shown in fig. 2, in one possible embodiment, the training task may be to obtain an illegal image recognition model (for example, a classification convolutional neural network, or referred to as a classification convolutional neural network model) for classifying and recognizing illegal betting pictures such as hexagons, so as to effectively intercept, recall and the like illegal betting pictures such as hexagons propagating in the network. As shown in fig. 2, the computing device may obtain a plurality of illegal images for the training from the server 100a, for example, each of the plurality of illegal images belongs to the six-color lottery shown in fig. 2. Optionally, the computing device may also obtain the illegal images from other devices (e.g., a camera, a smart phone, a tablet computer, etc.) in a wired or wireless manner, and so on. For example, the plurality of illegal images may be existing images (for example, images of a six-in-one lottery in various illegal betting websites) spread in a network, images obtained by shooting a six-in-one lottery in real life through a device such as a camera or a smartphone before the training task starts, and the like, and the embodiment of the present invention is not limited to this. Then, the computing device may perform data enhancement processing on all or part of the acquired illegal images, so as to obtain a plurality of extended sample images corresponding to each illegal image subjected to data enhancement processing. For example, as shown in fig. 3, the data enhancement processing may include image cropping, image rotation, gaussian noise adding, and the like, and optionally, in some possible embodiments, the data enhancement processing may further include image flipping processing (for example, image horizontal flipping, image vertical flipping, image random flipping, and the like), and this is not particularly limited by the embodiment of the present invention. Optionally, as shown in fig. 2, the multiple extended sample images obtained through the data enhancement processing may include, for example, multiple extended sample images obtained by performing clipping processing on the illegal image according to different clipping regions and different clipping proportions, multiple extended sample images obtained by performing rotation processing on the illegal image according to different rotation angles and different rotation directions, multiple extended sample images obtained by adding gaussian noise processing to the illegal image according to random pixel disturbance, and the like, which are not described herein again. It can be understood that, the extended sample images are obtained by performing data enhancement processing on the illegal image, and each of the extended sample images and the illegal image may belong to the illegal image together (for example, as shown in fig. 2, each of the extended sample images belongs to six-color lottery). As shown in fig. 3, the extended sample images may be used as positive samples of the training (the positive samples indicate samples of a category required in the training, for example, the extended sample images and the illegal images all belong to a color of six in the training), or the extended sample images and the illegal images may be used together as the positive samples of the training. Optionally, as shown in fig. 3, the computing device may also obtain, in a wired or wireless manner, a negative sample for the training (the negative sample indicates a sample of an undesired category in the training, for example, an image that does not belong to a color of six in the training, that is, a normal image) from a server or other devices. It can be understood that, due to the particularity of the illegal images such as the Liuhe lottery, the number of the illegal images is rare and difficult to obtain, and negative samples (i.e. images not belonging to the Liuhe lottery, such as normal images of environment, portrait and the like) are common in real life, are large in number, rich in content and easy to obtain, so that the proportion of the positive samples and the negative samples is very inconsistent, and the model training efficiency and the model accuracy are affected. Therefore, the number of positive samples can be increased by the illegal image recognition method provided by the embodiment of the invention, the content of the positive samples is enriched, and data enhancement processing can be generally not carried out on the negative samples according to the actual situation, so that the calculated amount is reduced, and the model training efficiency is improved. For example, as shown in fig. 3, in one possible implementation, the model may be trained based on a deep Convolutional Neural Network (CNN) to obtain an illegal image recognition model for recognizing and classifying images such as six-color images. The convolutional neural network is a feedforward neural network mainly comprising convolutional calculation, has strong deep characterization learning capability, is commonly used for common computer vision tasks and the like, wherein the classification convolutional neural network commonly uses the characterization in the convolutional neural network learning task to solve the classification task, for example, an illegal image identification model related to the embodiment of the invention can be used for solving the image identification classification tasks of six colors and non-six colors, and the like. As shown in fig. 3, optionally, the embodiment of the present invention may train a model based on the convolution neural network based on the positive and negative samples and in combination with a flexible maximum (Softmax) loss function, a gradient descent algorithm, and the like, so as to obtain an illegal image recognition model. Subsequently, the illegal image recognition model can be used for recognizing and classifying the images in the network, outputting the recognition result (for example, outputting the recognition result belonging to the six-color or not belonging to the six-color, and the like), further intercepting, recalling or shielding the recognized images belonging to the six-color, and the like, so as to prevent illegal images such as the six-color from being spread on the network, and maintain the network environment.
Referring to fig. 4, fig. 4 is a schematic flowchart illustrating an illegal image recognition method according to an embodiment of the present invention. As shown in fig. 4, the method may be applied to the system architecture shown in fig. 1, where the server may be the server 100a in the system architecture shown in fig. 1, and the computing device may be any one of the computing devices 200a, 200b, and 200c in the system architecture shown in fig. 1, and may be configured to support and execute the method flow shown in fig. 4. As will be described below with reference to fig. 4 from the side of the computing device, the illegal image recognition method may include the following steps S401 to S403:
step S401, training the initialized neural network in advance through the first sample set to obtain an illegal image recognition model.
Specifically, the computing device trains the initialized neural network in advance through the first sample set to obtain the illegal image recognition model. Optionally, the first sample set includes a positive sample set and a negative sample set, the positive sample set includes extended sample images obtained by performing data enhancement processing on the illegal image by the computing device, and one illegal image may correspond to at least two extended sample images. Alternatively, the data enhancement processing may include, for example, image cropping processing, image rotation processing, gaussian noise addition processing, and the like. Optionally, the positive sample set may further include a plurality of illegal images (that is, the positive sample set may include a plurality of illegal images and a plurality of extended sample images obtained by performing data enhancement on the plurality of illegal images, respectively). Alternatively, the negative sample set may include a plurality of normal images (e.g., normal images of an environment, a portrait, etc., which do not belong to an illegal image). Optionally, the computing device may obtain the illegal images and the normal images from the server in a wired or wireless manner. The computing device may also obtain the illegal images and the normal images from other devices (e.g., a camera, a smart phone, a tablet computer, and the like) in a wired or wireless manner, and the embodiment of the present invention is not limited in this respect. For example, the multiple illegal images may be existing images (e.g., images of the six-in-one lottery in various illegal betting websites) propagated in the network, images obtained by shooting the six-in-one lottery in real life through a camera or a smart phone or other devices before the training task starts, illegal images such as the six-in-one lottery collected according to the report or feedback of the user, and the like, and are not described herein again. Each of the plurality of illegal images belongs to an illegal image (e.g., an illegal image with a small number such as a six-color lottery and difficult to obtain, an illegal image with a small number such as violence and pornography and difficult to obtain, etc.). The illegal image recognition model obtained by training the initialized neural network through the positive sample set and the negative sample set can be used for recognizing and classifying images, for example, the illegal image recognition model can be used for determining whether the images in the network are illegal images such as six-color images and the like, and intercepting, recalling, shielding and the like the images determined as six-color images, so that the propagation of the illegal images such as six-color images on the network is effectively restrained, the network environment is maintained, and illegal criminal events are reduced.
Step S402, based on the illegal image recognition model, illegal image recognition is carried out.
Specifically, the computing device performs illegal image recognition on an image to be recognized (for example, an image in a network) based on the illegal image recognition model obtained through the training, and determines whether the image to be recognized belongs to an illegal image (or determines whether the image to be recognized belongs to an illegal image or a truthful image). Such as determining whether the image to be recognized is an illegal betting image such as a sextant. Optionally, if it is determined that the image to be identified is an illegal image, the image to be identified may be intercepted, recalled, shielded, and the like. For example, illegal images such as the Liuhe lottery in the network can be identified, so that the illegal images such as the Liuhe lottery in the network can be accurately and efficiently intercepted and recalled, the propagation of the illegal images such as the Liuhe lottery in the network is restrained, the network environment is maintained, illegal criminal events are reduced, and the like. Therefore, the transmission of illegal images such as six colors and the like on the network is effectively restrained, the network environment is maintained, and illegal criminal events are reduced.
Referring to fig. 5, fig. 5 is a schematic flowchart illustrating another illegal image recognition method according to an embodiment of the present invention. As shown in fig. 5, the method may be applied to the system architecture shown in fig. 1, where the server may be the server 100a in the system architecture shown in fig. 1, and the computing device may be any one of the computing devices 200a, 200b, and 200c in the system architecture shown in fig. 1 (for example, the computing device 200a in fig. 5), and may be configured to support and execute the method flow shown in fig. 5. As will be described below with reference to fig. 5 from the computing device side, the illegal image recognition method may include the following steps S501 to S506:
in step S501, multiple illegal images are acquired.
Specifically, the computing device obtains a plurality of illegal images (for example, the six colors shown in fig. 5) required by the training task from the server in a wired or wireless manner. The computing device may also obtain the illegal images and the normal images from other devices (e.g., a camera, a smart phone, a tablet computer, and the like) in a wired or wireless manner, and the embodiment of the present invention is not limited in this respect. Optionally, step S501 may refer to step S401 in the embodiment corresponding to fig. 4, which is not described herein again.
Step S502, performing data enhancement processing on the plurality of illegal images to obtain a plurality of extended sample images corresponding to the plurality of illegal images respectively.
Specifically, the computing device performs data enhancement processing on each illegal image in the acquired multiple illegal images to obtain multiple extended sample images corresponding to each illegal image. Alternatively, each of the plurality of expanded sample images and the illegal image may belong to the illegal image together (e.g., belong to the sextant, etc.). Optionally, the computing device may also perform data enhancement processing on a part of the illegal images in the multiple illegal images to obtain one or more extended sample images and the like corresponding to each illegal image in the part of illegal images, which is not specifically limited in this embodiment of the present invention. Optionally, step S502 may refer to step S401 in the embodiment corresponding to fig. 4, which is not described herein again.
Optionally, the data enhancement processing may include image cropping processing, such as image centering cropping and image random cropping, among other common cropping techniques. Referring to fig. 6, fig. 6 is a schematic diagram of an image cropping process according to an embodiment of the present invention. As shown in fig. 6, the center cropping is generally to crop different areas on the illegal image (i.e. the original image) according to different cropping ratios within a certain cropping ratio range around the center of the image, so as to obtain a plurality of extended sample images. The range of the cropping ratio is preferably set to 0.4 to 0.9, and for example, as shown in fig. 6, the cropping ratio may be set to 0.4, which means that an area having a length and width 0.4 times as large as the original image is cropped, and the center of the cropping area (i.e., the center of the extended sample image) coincides with the center of the illegal image. For another example, as shown in fig. 6, the cropping ratio may be 0.5, which indicates that an area having a length and width 0.5 times the original length and width is cropped, and the center of the cropping area (i.e., the center of the extended sample image) coincides with the center of the illegal image. For example, as shown in fig. 6, the cropping ratio may be 0.8, which means that an area having a length and width 0.8 times as large as the original image is cropped, and the center of the cropping area (i.e., the center of the extended sample image) coincides with the center of the illegal image. Alternatively, in some possible embodiments, the trimming ratio may be other values than the range of 0.4 to 0.9, which is not specifically limited in the embodiment of the present invention.
Optionally, referring to fig. 7, fig. 7 is a schematic diagram of another image cropping process according to an embodiment of the present invention. As shown in fig. 7, random cropping generally includes setting one or more fixed sizes in advance, and performing random cutting on an illegal image (i.e., an original image) according to a cutting template of the fixed size to obtain a random cutting region (i.e., an extended sample image), where the image size of the obtained random region is consistent with the preset fixed size. For example, as shown in fig. 7, a cropping size of 680 × 560 (i.e., a cropping length of 680 and a cropping width of 560) is preset, and random cropping may be performed to obtain an image with a size of 680 × 560 in different regions in the illegal image (i.e., an extended sample image, such as random region one, random region two, and random region three shown in fig. 6). Optionally, the cutting templates with different sizes (i.e. cutting templates with different cutting lengths and cutting widths) may be set according to actual situations, for example, the cutting templates may specifically include cutting templates with different sizes, such as 680 × 560, 1280 × 960, 640 × 480, 480 × 320, 720 × 640, 560 × 680, 960 × 1280, 480 × 640, 320 × 480, and 640 × 720. And then random cutting is carried out on the illegal image according to the cutting templates with different sizes to obtain a plurality of extended sample images, so that the number of samples is greatly increased, and the content of the samples is enriched. In some possible implementations, a cutting template with other dimensions than those exemplified above may be further included, and this is not particularly limited in the embodiments of the present invention. Optionally, in some possible embodiments, the illegal image may be randomly cropped according to a certain cropping ratio (for example, 0.3, 0.5, 0.6, 0.8, 0.9, and the like), and the like. In addition, in some possible implementations, the image cropping processing may further include other cropping methods besides the above-mentioned center cropping and random cropping, which is not specifically limited by the embodiment of the present invention.
Optionally, the data enhancement processing may further include image rotation processing, please refer to fig. 8, and fig. 8 is a schematic diagram of image rotation processing according to an embodiment of the present invention. As shown in fig. 8, the image rotation generally includes clockwise rotation and counterclockwise rotation, and generally rotates the illegal image integrally according to different rotation angles and rotation directions within a certain rotation angle range around the center of the illegal image (i.e., the original image) (i.e., the center of the illegal image is used as the origin), so as to obtain a plurality of extended sample images. Optionally, the rotation angle range is generally appropriate to be 0 ° to 30 °, for example, as shown in fig. 8, the illegal image may be subjected to image rotation processing according to schemes of counterclockwise rotation by 10 °, clockwise rotation by 5 °, and counterclockwise rotation by 5 °, so as to obtain a plurality of extended sample images (including black edge filling) as shown in fig. 2, thereby greatly increasing the number of samples and enriching the content of the samples. The multiple extended sample images can be used as positive samples for training and learning of the six-color-combination recognition network, so that the training efficiency and the accuracy of the six-color-combination recognition are improved.
Optionally, the data enhancement processing may further include processing of adding gaussian noise, please refer to fig. 9, and fig. 9 is a schematic diagram of processing of adding gaussian noise according to an embodiment of the present invention. Gaussian noise is a common white noise and is very effective for deep neural network training. In one possible implementation, gaussian white noise with a mean value of 0 and a variance of 0.1 can be used to randomly perturb the illegal image according to a certain random probability. For example, the random probability may be 0.1 (i.e., 10% probability), and then a random number of 0 to 1 is generated at each position of the illegal image, for example, an image with 100 × 100 of the illegal image may generate a random number of 0 to 1 at 1000 positions of the illegal image respectively. If a random number generated at a location is less than the random probability (i.e., less than 0.1, e.g., the random number is 0.05, etc.), then a perturbation may be added to the pixel at the location, which perturbation may range in size from-13 to 13 in the case of a white gaussian noise variance of 0.1. For example, in the range of-13 to 13, if the number of the perturbations is randomly extracted, such as to the number 8, then the pixel at the location may be increased by 8 pixels over the original pixel (e.g., if the original pixel at the location is 120, then the pixel at the location becomes 128 after the perturbations are added). For another example, if the number is-7, the number of the pixels at the position may be reduced by 7 pixels based on the original pixels (for example, if the original pixel at the position is 120, the pixel at the position becomes 113 after the disturbance is added), and so on, which is not described herein again. Optionally, after the gaussian noise is added to the illegal image, it is required to ensure that the pixels at all positions in the final image (i.e., the obtained extended sample image) are greater than or equal to 0 and less than or equal to 255. Alternatively, if the random number generated at a location in the illegal image is greater than or equal to the random probability (i.e., greater than or equal to 0.1, e.g., the random number is 0.2, etc.), the pixel at the location remains unchanged. For example, as shown in fig. 9, in a plurality of extended sample images obtained after gaussian noise processing is performed on an illegal image, compared with the illegal image, the pixel sizes of partial positions in the extended sample image are changed to different degrees, so that the number of samples is greatly increased, the content of the samples is enriched, the pixel range is expanded, and therefore, the training efficiency of the model and the accuracy of image recognition and classification can be effectively improved.
Optionally, the above values (for example, the mean value is 0, the variance is 0.1, the random probability is 0.1, and the disturbance range is-13 to 13, etc.) are only suitable values in the embodiment of the present invention, in some possible implementations, the mean value of the white gaussian noise may be other than 0, the variance of the white gaussian noise may be other than 0.1, the random probability may be other than 0.1, and the disturbance range may be other than-13 to 13, etc., which is not limited in this embodiment of the present invention.
Optionally, the data enhancement process may further include an image flipping process, which may include horizontal flipping, vertical flipping, random flipping, and so on. For example, the illegal image is horizontally flipped around a vertical center line of the illegal image or vertically flipped around a horizontal center line of the illegal image, and the like, which is not particularly limited in this embodiment of the present invention. Obviously, a large amount of abundant extended sample images can be obtained on the basis of a small amount of original illegal images through data enhancement processing. The large amount of extended sample images can be used as positive samples for model training, so that the number of the positive samples is greatly increased, the content of the positive samples is enriched, and the efficiency of model training and the accuracy of the model are improved. For example, the method can ensure accurate identification of illegal images such as the Liuhe lottery in the network, further accurately and efficiently intercept and recall the illegal images such as the Liuhe lottery in the network, and the like, inhibit the propagation of the illegal images such as the Liuhe lottery in the network, maintain the network environment, reduce illegal criminal events and the like.
Step S503, a first sample set is obtained, where the first sample set includes a positive sample set and a negative sample set.
In particular, a computing device obtains a first set of samples, which may include a positive set of samples and a negative set of samples. The positive sample set may include one or more extended sample images corresponding to each of the illegal images, or one or more extended sample images corresponding to a part of the illegal images, and optionally, the positive sample set may further include the illegal images (i.e., original images), and so on. Optionally, as described above, the multiple illegal images and the multiple extended sample images obtained by the computing device may be stored locally in the computing device, and the computing device may directly obtain the multiple illegal images and the multiple extended sample images by accessing the memory and make them into the positive sample set. The negative sample set may include a plurality of normal images, each of the plurality of normal images belongs to a normal image (for example, the normal images of the environment, the urban external scene, the urban slogan, and the like shown in fig. 5), or each of the plurality of normal images does not belong to an illegal image. For example, each illegal image and each extended sample image in the positive sample set belong to six colors, and can be used as a positive sample of the current model training, and each normal image in the negative sample set does not belong to six colors, and can be used as a negative sample of the current model training, and the like. Optionally, the computing device may obtain the negative sample set from the server in a wired or wireless manner, and may also obtain the negative sample set from other devices (for example, a camera, a smart phone, a tablet computer, a desktop computer, and the like) in a wired or wireless manner, which is not limited in this embodiment of the present invention.
Step S504, training the initialized neural network through the first sample set to obtain an illegal image recognition model.
Specifically, as described above, after the computing device obtains the first sample set (for example, including the positive sample set and the negative sample set), the positive sample set and the negative sample set are used as training inputs, and each image in the positive sample set and the negative sample set belongs to an illegal image or a normal image as a label, the initialized neural network is trained, so as to obtain an illegal image recognition model. The each image may include each extended sample image, each normal image, and may further include each illegal image. Alternatively, as described above, the label of each illegal image belongs to an illegal image (for example, "1"), the label of each extended sample image belongs to an illegal image (for example, "1"), and the label of each normal image belongs to a normal image (for example, "0").
Optionally, after the training sample (i.e., the first sample set) is made and before training is started, the embodiment of the present invention may further design a deep convolutional neural network (i.e., an initialized neural network) based on the training task of this time. Optionally, referring to fig. 10, fig. 10 is a schematic diagram of a convolutional neural network according to an embodiment of the present invention. The learning and training process of the convolutional neural network is shown in fig. 10, and may specifically include the following steps s 11-s 14:
step s11, samples are convolved.
Specifically, convolution sampling is performed on a plurality of images in the first sample set (for example, each illegal image in the positive sample set, each extended sample image and each normal image in the negative sample set, or a part of illegal image in the positive sample set, a part of extended sample image and a part of normal image in the negative sample set, etc.) through a multilayer convolution neural network, so as to obtain respective target features corresponding to the plurality of images.
The convolution sampling comprises the steps of carrying out image feature extraction on the multiple images respectively to obtain convolution features of the multiple images respectively, carrying out feature sampling on the convolution features of the multiple images respectively, reserving typical features of the multiple images, neglecting other features with a small effect, and obtaining target features of the multiple images respectively, so that the feature quantity is small and effective, and the training efficiency is improved.
Optionally, in a possible implementation manner, for example, for an image with obvious text features such as six-color composition, the image features of the plurality of images in the first sample set may be extracted by using only three layers of convolutional neural networks, so that a smaller and lighter neural network may be designed in consideration of actual conditions on the premise of ensuring the quality of image feature extraction, so as to reduce the amount of computation and the training cost. For example, the three-tiered convolutional neural network may include a first tier 5 × 5 convolutional neural network (the number of convolutional kernels may be 64), a second tier 5 × 5 convolutional neural network (the number of convolutional kernels may be 128), and a third tier 5 × 5 convolutional neural network (the number of convolutional kernels may be 128). Optionally, in some possible implementations, four or more layers of convolutional neural networks may be used to perform image feature extraction, or two or less layers of convolutional neural networks may be used to perform image feature extraction, which is not specifically limited in this embodiment of the present invention. Optionally, before the training samples are input into the neural network for training, each image in the neural network may be preprocessed to ensure the training quality. For example, the size of each image is scaled to a fixed size such as 224 × 224 (for example, when the fixed size of the preprocessed image is 224 × 224 and the original size of one image is 680 × 560, the image may be scaled down and filled with black edges to the size of 224 × 224, and the like), and the pixels of each image are divided by 255 (i.e., the range of pixels of each image is adjusted from 0-255 to 0-1), and the like, which is not specifically limited in the embodiment of the present invention.
Optionally, the feature samples may include a maximum value sample (or referred to as maximum pooling) and a mean value sample (or referred to as mean pooling), and in one possible embodiment, the maximum value sample may be used to sample the convolution features of each of the plurality of images. For example, the size of each image as a training input is 224 × 224, and after the image feature extraction of the three-layer convolutional neural network, the size of each image becomes 28 × 28, which includes 784 feature values, and obviously, the feature quantity is large, which affects the training efficiency. In this case, maximum sampling may be used, for example, in the range of 28 × 28, the sub-region sampled with 2 × 2 as the maximum value, the maximum feature at 4 positions included in each sub-region is selected as the typical feature of the sub-region, and then the features at the other 3 positions in the sub-region are omitted. Therefore, target features (including 49 feature values) with the size of 7 × 7 corresponding to each image can be obtained, and obviously, the technical scheme of sampling through the maximum value can help the neural network to quickly capture key features, and ignore the rest large number of irrelevant features. Optionally, in some possible implementations, the convolution feature of each of the multiple images may be sampled by using mean value sampling, for example, an average value of feature values at 4 positions included in each sub-region is used as a typical feature of the sub-region, and the like, which is not specifically limited in this embodiment of the present invention.
Step s12, feature stitching.
Specifically, the neural network is spread out in a tiled manner based on all or part of the target features learned by the first sample set (including multiple illegal images, multiple extended sample images and multiple normal images, for example), feature splicing is carried out, and all or part of the target features are fused for determining the category of the image input into the neural network (determining that the input image belongs to the illegal image or the normal image, for example)
Step s13, a loss function is calculated.
Specifically, a currently input image (for example, one of a plurality of illegal images, a plurality of extended sample images, and a plurality of extended sample images) is predicted and determined according to the characteristics of the splicing and the fusion, so as to obtain a probability value that the image belongs to the illegal image, and a loss function value between the probability value and a real label thereof (i.e., a difference between the probability value and the real label thereof) is calculated. For example, if the probability value of the image belonging to the illegal image is 0.1, and the label of the image (e.g., one of the normal images) is 0 (i.e., the image belongs to the normal image), the current loss function value can be calculated according to the 0.1 and 0. Optionally, in some possible embodiments, a difference between a probability value that each image belongs to an illegal image and a real tag of each image may be calculated through a Softmax function or another function, which is not specifically limited in the embodiment of the present invention.
Step s14, the neural network is modified by a gradient descent algorithm.
Specifically, by using a gradient descent algorithm, the gradient of the loss function value to the neural network is calculated according to the loss function value between the calculated probability value and the real tag thereof, and the current neural network is modified (for example, one or more parameters included in the neural network are modified) by using the gradient, that is, the current neural network is updated. And the probability value obtained by the neural network for the next input image is closer to or even consistent with the real label of the image. It can be understood that when the probability value is consistent with the real label, the training of the neural network can be stopped, that is, finally, based on the convolutional neural network, the illegal image recognition model with higher accuracy rate for image recognition classification is obtained through training. The gradient descent algorithm is a relatively common machine learning optimization algorithm, and is mostly applied to an optimization algorithm of a deep neural network, and in some possible embodiments, other algorithms except for the gradient descent algorithm and the like may be used to modify the neural network, which is not specifically limited in the embodiment of the present invention.
And step S505, acquiring an image to be recognized, and determining a recognition result of the image to be recognized according to the illegal image recognition model.
Specifically, the computing device obtains an image to be recognized, and then determines a recognition result of the image to be recognized according to the illegal image recognition model (for example, a trained convolutional neural network), for example, determines whether the image to be recognized belongs to an illegal image such as a Liuhe color, and the like. Optionally, the image to be recognized may be images in various websites, and the computing device may obtain the image to be recognized through a network.
Optionally, please refer to fig. 11, where fig. 11 is a schematic flowchart of an image recognition process according to an embodiment of the present invention. As shown in fig. 11, the image to be recognized is input into the trained convolutional neural network (that is, the above-mentioned illegal image recognition model), and after a series of operations such as convolution and sampling, a probability value that the image to be recognized belongs to the illegal image is output. Then, the probability value is compared with a preset threshold, if the probability value is greater than the preset threshold, it may be determined that the image to be recognized belongs to an illegal image (for example, belongs to a six-color lottery), for example, the probability value is 0.8, and the preset threshold is 0.7, it may be determined that the image to be recognized belongs to an illegal image. If the probability value is less than or equal to the preset threshold, it may be determined that the image to be recognized belongs to a normal image (e.g., belongs to non-six-color lottery), for example, the probability value is 0.3, and the preset threshold is 0.7, it may be determined that the image to be recognized belongs to a normal image. Further, the computing device can also recall, intercept and the like the classified images belonging to the six-color lottery, inhibit the propagation of illegal images of the six-color lottery and the like on the network, maintain the network environment and the like. Optionally, the size of the threshold may be adjusted according to the actual service background and the actual requirement, in general, the threshold is too high, the accuracy of the illegal image recognition model is higher, but the recall rate of illegal images such as Liuhe color is lower; if the threshold is too low, the accuracy of the illegal image recognition model will be low, but the recall rate for illegal images such as Liuhe color will be high. For example, the embodiment of the present invention performs a test by collecting 10 million non-six-color images and 1 million six-color images, wherein the illegal image recognition model has an accuracy of classifying six-color images of 65% and a recall rate of 80% in the case that the threshold is 0.8; under the condition that the threshold value of the illegal image recognition model is 0.9, the accuracy rate of classifying the six-color image is 75%, and the recall rate of the six-color image is 67%.
It should be noted that before the to-be-recognized image is recognized and classified, that is, before the to-be-recognized image is input into the illegal image recognition model (that is, the convolutional neural network), in general, the illegal image recognition model needs to be set to a prediction mode from a training mode during original training, and parameters in the illegal image recognition model are all adjusted to parameter settings in the prediction mode, so as to be used for recognizing and classifying the to-be-recognized image. In addition, generally, before the image to be recognized is input into the illegal image recognition model, preprocessing is required on the image to be recognized, which may include adjusting the image to be recognized to a given input format of the illegal image recognition model (for example, setting the image to be recognized to be Red, Green, Blue, RGB) three-channel image reading manner, for example, scaling the image to be recognized to a fixed size such as 224 × 224, for example, dividing all pixels of the image to be recognized by 225, and the like), and the like, which is not particularly limited in the embodiment of the present invention.
The embodiment of the invention provides an illegal image identification method, which can obtain a large number of new samples (for example, at least two extended sample images corresponding to each illegal image can be included) by performing data enhancement processing (for example, image cropping processing, image rotation processing, gaussian noise adding processing and the like) on an original sample (for example, multiple illegal images can be included). The method realizes that a large number of new samples with rich content are obtained on the basis of rare original samples with weak content. The large number of new samples and the original samples can both belong to illegal images (such as illegal betting images such as Liuhe color) and can be used for training of an illegal image recognition model based on a convolutional neural network. Therefore, compared with the prior art, when the training samples belonging to the illegal images are difficult to obtain and are rare, the training of the illegal image recognition model is carried out by only a small amount of obtained original samples. According to the embodiment of the invention, training samples with rich contents and sufficient quantity can be obtained on the basis of a small quantity of original samples through data enhancement processing, and the efficiency of model training and the accuracy of the model for identifying illegal images are improved. For example, illegal images such as Liuhe lottery and the like in the network can be efficiently identified and recalled or intercepted, and the like, so that the propagation of the illegal images on the network is effectively restrained, the network environment is maintained, and illegal criminal events and the like are reduced.
It should be noted that, the embodiment of the present invention aims to obtain a large number of rich new samples on the basis of fewer original samples through a data enhancement technique for the case that original samples are rare and difficult to obtain, and to use the new samples as input of model training, so as to improve the efficiency of model training and the accuracy of the model. In some possible implementations, the embodiments of the present invention may be applied to illegal gambling images with a small number, which are difficult to obtain, such as a six-in-one lottery, and the like, and may also be applied to other images with a small number, which are difficult to obtain, such as images related to violence, pornography, and the like, and the embodiments of the present invention are not limited in this respect.
Based on the above description of the illegal image identification method embodiment, the embodiment of the present invention also discloses an illegal image identification apparatus, which may be a computer program (including a program code) running in a computing device. Referring to fig. 12, fig. 12 is a schematic structural diagram of an illegal image recognition device according to an embodiment of the present invention, as shown in fig. 12, the illegal image recognition device includes a device 1, the device 1 may perform the method shown in fig. 4 or fig. 5, and the illegal image recognition device may include: training module 11 and recognition module 12:
the training module 11 is used for training the initialized neural network in advance through a first sample set to obtain an illegal image recognition model; the first sample set comprises a positive sample set and a negative sample set, the positive sample set comprises extended sample images obtained by performing data enhancement processing on illegal images, and one illegal image corresponds to at least two extended sample images;
and the identification module 12 is used for carrying out illegal image identification based on the illegal image identification model.
Wherein the data enhancement processing includes at least one of image cropping processing, image rotation processing, and gaussian noise addition processing.
The specific functional implementation manners of the training module 11 and the recognition module 12 may refer to steps S401 to S402 in the embodiment corresponding to fig. 4. The specific functional implementation manner of the training module 11 may refer to step S501-step S504 in the embodiment corresponding to fig. 5, and the specific functional implementation manner of the identification module 12 may refer to step S505 in the embodiment corresponding to fig. 5, which is not described herein again.
Wherein the data enhancement processing includes one or more of image cropping processing, image rotation processing, and Gaussian noise addition processing.
Referring to fig. 12, the training module 11 may include: feature extraction unit 111, first determination unit 112, and correction unit 113:
a feature extraction unit 111, configured to perform image feature extraction on the multiple images in the first sample set to obtain convolution features corresponding to the multiple images; the plurality of images includes a plurality of extended sample images in the positive sample set and a plurality of normal images in the negative sample set;
a first determining unit 112, configured to determine probability values that the plurality of images belong to the illegal image respectively based on convolution features corresponding to the plurality of images respectively;
a correcting unit 113, configured to correct one or more parameters in the neural network according to a difference between a probability value that each of the plurality of images belongs to the illegal image and a label of each of the plurality of images, with the illegal image or the normal image as the label, so as to obtain the illegal image identification model.
The specific functional implementation manners of the feature extraction unit 111, the first determination unit 112, and the modification unit 113 may refer to step S401 in the embodiment corresponding to fig. 4. For specific functional implementation manners of the feature extraction unit 111, the first determination unit 112, and the modification unit 113, reference may also be made to step S504 in the embodiment corresponding to fig. 5, which is not described herein again.
Referring also to fig. 12, the identification module 12 may include: the acquisition unit 121, the second determination unit 122, and the third determination unit 123:
an acquisition unit 121 configured to acquire an image to be recognized;
a second determining unit 122, configured to determine, through the illegal image recognition model, a probability value that the image to be recognized belongs to the illegal image;
a third determining unit 123, configured to determine, according to a preset threshold and a probability value that the image to be recognized belongs to the illegal image, a recognition result of the image to be recognized.
For specific functional implementation manners of the obtaining unit 121, the second determining unit 122, and the third determining unit 123, reference may be made to step S402 in the embodiment corresponding to fig. 4. For specific functional implementation manners of the obtaining unit 121, the second determining unit 122, and the third determining unit 123, reference may also be made to step S505 in the embodiment corresponding to fig. 5, which is not described herein again.
Referring to fig. 12, the third determining unit may include: the first and second determining sub-units 1231 and 1232:
a first determining subunit 1231, configured to determine that the image to be identified belongs to the illegal image and recall the image to be identified if a probability value that the image to be identified belongs to the illegal image is greater than the preset threshold;
a second determining subunit 1232, configured to determine that the image to be identified belongs to the normal image if the probability value that the image to be identified belongs to the illegal image is smaller than or equal to the preset threshold.
For specific functional implementation manners of the first determining subunit 1231 and the second determining subunit 1232, refer to step S402 in the embodiment corresponding to fig. 4. The specific functional implementation manners of the first determining subunit 1231 and the second determining subunit 1232 may also refer to step S505 in the embodiment corresponding to fig. 5, which is not described herein again.
According to the embodiment provided by the present invention, each module in the illegal image recognition device shown in fig. 12 may be respectively or entirely combined into one or several other modules to form, or some module(s) thereof may be further split into a plurality of functionally smaller units to form, which may achieve the same operation without affecting the achievement of the technical effect of the embodiment of the present invention. The modules are divided based on logic functions, and in practical application, the functions of one module can be realized by a plurality of modules, or the functions of a plurality of modules can be realized by one module. In other embodiments of the present invention, the illegal image recognition-based device may also include other modules, and in practical applications, these functions may also be implemented by the assistance of other modules, and may be implemented by cooperation of a plurality of modules.
According to the embodiment provided by the present invention, the illegal image recognition apparatus shown in fig. 12 can be constructed by running a computer program (including a program code) capable of executing each step involved in the corresponding method shown in fig. 4 or fig. 5 on a general test service terminal, such as a computer, including a processing element and a storage element, such as a Central Processing Unit (CPU), a random access storage medium (RAM), a Read only storage medium (ROM), etc., and the illegal image recognition method of the embodiment of the present invention can be implemented. The computer program may be recorded on a computer-readable recording medium, for example, and loaded and executed in the test service terminal through the computer-readable recording medium.
Based on the description of the method embodiment and the apparatus embodiment, the embodiment of the present invention further provides a computing device. Referring to fig. 13, fig. 13 is a schematic structural diagram of a computing device according to an embodiment of the present invention. As shown in fig. 13, the computing device includes at least a processor 201, an input device 202, an output device 203, and a computer-readable storage medium 204. Wherein the processor 201, input device 202, output device 203, and computer-readable storage medium 204 within the computing device may be connected by a bus or other means.
A computer-readable storage medium 204 may be stored in a memory of the computing device, the computer-readable storage medium 204 for storing a computer program comprising program instructions, the processor 201 for executing the program instructions stored by the computer-readable storage medium 204. The processor 201 (or CPU) is a computing core and a control core of the computing device, and is adapted to implement one or more instructions, and in particular, is adapted to load and execute the one or more instructions so as to implement a corresponding method flow or a corresponding function; in one embodiment, the processor 201 according to the embodiment of the present invention may be configured to perform a series of classification model training processes, including: training the initialized neural network through a first sample set in advance to obtain an illegal image recognition model; the first sample set comprises a positive sample set and a negative sample set, the positive sample set comprises extended sample images obtained by performing data enhancement processing on illegal images, and one illegal image corresponds to at least two extended sample images; and performing illegal image recognition based on the illegal image recognition model, and the like.
An embodiment of the present invention further provides a computer-readable storage medium (Memory), which is a Memory device in a computing device and is used for storing programs and data. It is understood that the computer readable storage medium herein may include both built-in storage media in the computing device and, of course, extended storage media supported by the computing device. The computer-readable storage medium provides a storage space that stores an operating system of the computing device. Also stored in this memory space are one or more instructions, which may be one or more computer programs (including program code), suitable for loading and execution by processor 201. It should be noted that the computer-readable storage medium may be a high-speed RAM memory, or may be a non-volatile memory (non-volatile memory), such as at least one disk memory; and optionally at least one computer readable storage medium located remotely from the aforementioned processor.
In one embodiment, one or more instructions stored in a computer-readable storage medium may be loaded and executed by processor 201 to perform the corresponding steps of the method described above in connection with the training embodiment of the classification model; in particular implementations, one or more instructions in the computer-readable storage medium are loaded and specifically executed by the processor 201:
training the initialized neural network through a first sample set in advance to obtain an illegal image recognition model; the first sample set comprises a positive sample set and a negative sample set, the positive sample set comprises extended sample images obtained by performing data enhancement processing on illegal images, and one illegal image corresponds to at least two extended sample images;
and performing illegal image recognition based on the illegal image recognition model.
In one embodiment, the data enhancement process includes at least one of an image cropping process, an image rotation process, and a gaussian noise addition process.
In one embodiment, the negative sample set includes a plurality of normal images; in the step of training the initialized neural network in advance through the first sample set to obtain the illegal image recognition model of the illegal image recognition model, the one or more instructions may be further loaded and specifically executed by the processor 201:
performing image feature extraction on the plurality of images in the first sample set to obtain convolution features corresponding to the plurality of images; the plurality of images includes a plurality of extended sample images in the positive sample set and a plurality of normal images in the negative sample set;
determining probability values of the plurality of images belonging to the illegal image based on convolution features corresponding to the plurality of images;
and correcting one or more parameters in the neural network by taking the illegal images or the normal images belonging to the plurality of images as labels according to the difference between the probability value of the illegal images belonging to the plurality of images and the labels of the images to obtain the illegal image recognition model of the illegal image recognition model.
In one embodiment, in the performing illegal image recognition based on the illegal image recognition model, the one or more instructions may be further loaded and specifically executed by the processor 201:
acquiring an image to be identified;
identifying an illegal image identification model through the illegal image, and determining a probability value of the image to be identified belonging to the illegal image;
and determining the recognition result of the image to be recognized according to a preset threshold value and the probability value of the image to be recognized belonging to the illegal image.
In one embodiment, in the determining the recognition result of the image to be recognized according to the preset threshold and the probability value that the image to be recognized belongs to the illegal image, the one or more instructions may be further loaded and specifically executed by the processor 201:
if the probability value that the image to be recognized belongs to the illegal image is larger than the preset threshold value, determining that the image to be recognized belongs to the illegal image, and recalling the image to be recognized;
and if the probability value of the image to be recognized belonging to the illegal image is smaller than or equal to the preset threshold value, determining that the image to be recognized belongs to the normal image.
The embodiment of the invention provides an illegal image identification method, which can obtain a large number of new samples (for example, at least two extended sample images corresponding to each illegal image can be included) by performing data enhancement processing (for example, image cropping processing, image rotation processing, gaussian noise adding processing and the like) on an original sample (for example, multiple illegal images can be included). The method realizes that a large number of new samples with rich content are obtained on the basis of rare original samples with weak content. The large number of new samples and the original samples can both belong to illegal images (such as illegal betting images such as Liuhe color) and can be used for training of an illegal image recognition model based on a convolutional neural network. Therefore, compared with the prior art, when the training samples belonging to the illegal images are difficult to obtain and are rare, the training of the illegal image recognition model is carried out by only a small amount of obtained original samples. According to the embodiment of the invention, training samples with rich contents and sufficient quantity can be obtained on the basis of a small quantity of original samples through data enhancement processing, and the efficiency of model training and the accuracy of the model for identifying illegal images are improved. For example, illegal images such as Liuhe lottery and the like in the network can be efficiently identified and recalled or intercepted, and the like, so that the propagation of the illegal images on the network is effectively restrained, the network environment is maintained, and illegal criminal events and the like are reduced.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (10)

1. An illegal image recognition method, comprising:
training the initialized neural network through a first sample set in advance to obtain an illegal image recognition model; the first sample set comprises a positive sample set and a negative sample set, the positive sample set comprises extended sample images obtained by performing data enhancement processing on illegal images, and one illegal image corresponds to at least two extended sample images;
and performing illegal image recognition based on the illegal image recognition model.
2. The method of claim 1, wherein the data enhancement process comprises at least one of an image cropping process, an image rotation process, and an additive gaussian noise process.
3. The method of claim 1, wherein the negative sample set comprises a plurality of normal images; the training of the initialized neural network through the first sample set in advance to obtain the illegal image recognition model comprises the following steps:
performing image feature extraction on the plurality of images in the first sample set to obtain convolution features corresponding to the plurality of images; the plurality of images includes a plurality of extended sample images in the positive sample set and a plurality of normal images in the negative sample set;
determining probability values of the plurality of images belonging to the illegal image based on convolution features corresponding to the plurality of images;
and correcting one or more parameters in the neural network by taking the illegal images or the normal images as labels according to the difference between the probability value of the illegal images and the labels of the images to obtain the illegal image recognition model.
4. The method of claim 3, wherein performing illegal image recognition based on the illegal image recognition model comprises:
acquiring an image to be identified;
determining the probability value of the image to be recognized belonging to the illegal image through the illegal image recognition model;
and determining the recognition result of the image to be recognized according to a preset threshold value and the probability value of the image to be recognized belonging to the illegal image.
5. The method according to claim 4, wherein the determining the recognition result of the image to be recognized according to a preset threshold and a probability value that the image to be recognized belongs to the illegal image comprises:
if the probability value that the image to be recognized belongs to the illegal image is larger than the preset threshold value, determining that the image to be recognized belongs to the illegal image, and recalling the image to be recognized;
and if the probability value of the image to be recognized belonging to the illegal image is smaller than or equal to the preset threshold value, determining that the image to be recognized belongs to the normal image.
6. An illegal image recognition device, comprising:
the training module is used for training the initialized neural network in advance through the first sample set to obtain an illegal image recognition model; the first sample set comprises a positive sample set and a negative sample set, the positive sample set comprises extended sample images obtained by performing data enhancement processing on illegal images, and one illegal image corresponds to at least two extended sample images;
and the identification module is used for carrying out illegal image identification based on the illegal image identification model.
7. The apparatus of claim 6, wherein the negative sample set comprises a plurality of normal images; the training module comprises:
a feature extraction unit, configured to perform image feature extraction on the multiple images in the first sample set to obtain convolution features corresponding to the multiple images; the plurality of images includes a plurality of extended sample images in the positive sample set and a plurality of normal images in the negative sample set;
the first determining unit is used for determining probability values of the plurality of images belonging to the illegal image respectively based on convolution characteristics corresponding to the plurality of images respectively;
and the correcting unit is used for correcting one or more parameters in the neural network according to the difference between the probability value that the plurality of images respectively belong to the illegal image and the label of each of the plurality of images by taking the plurality of images respectively belong to the illegal image or the normal image as the label to obtain the illegal image identification model.
8. The apparatus of claim 6, wherein the identification module comprises:
the device comprises an acquisition unit, a recognition unit and a processing unit, wherein the acquisition unit is used for acquiring an image to be recognized;
the second determining unit is used for determining the probability value of the image to be recognized belonging to the illegal image through the illegal image recognition model;
and the third determining unit is used for determining the recognition result of the image to be recognized according to a preset threshold value and the probability value of the image to be recognized belonging to the illegal image.
9. A computing device comprising a processor and a memory, the processor and the memory being coupled, wherein the memory is configured to store program code and the processor is configured to invoke the program code to perform the method of any of claims 1 to 5.
10. A computer-readable storage medium, characterized in that it stores a computer program which, when being executed by a processor, carries out the method of any one of the preceding claims 1 to 5.
CN202010057247.2A 2020-01-17 2020-01-17 Illegal image recognition method, device, equipment and computer readable storage medium Pending CN111259968A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010057247.2A CN111259968A (en) 2020-01-17 2020-01-17 Illegal image recognition method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010057247.2A CN111259968A (en) 2020-01-17 2020-01-17 Illegal image recognition method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN111259968A true CN111259968A (en) 2020-06-09

Family

ID=70954268

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010057247.2A Pending CN111259968A (en) 2020-01-17 2020-01-17 Illegal image recognition method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111259968A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111814810A (en) * 2020-08-11 2020-10-23 Oppo广东移动通信有限公司 Image recognition method and device, electronic equipment and storage medium
CN111932514A (en) * 2020-08-07 2020-11-13 上海媒智科技有限公司 Image noise level estimation and suppression method and device and electronic equipment
CN111951217A (en) * 2020-07-07 2020-11-17 上海鹰瞳医疗科技有限公司 Model training method, medical image processing method and electronic device
CN112073391A (en) * 2020-08-25 2020-12-11 深圳市安络科技有限公司 Method and device for monitoring network traffic
CN112149745A (en) * 2020-09-27 2020-12-29 上海高德威智能交通系统有限公司 Method, device, equipment and storage medium for determining difficult example sample
CN113436138A (en) * 2021-03-31 2021-09-24 成都飞机工业(集团)有限责任公司 Image preprocessing method for aviation structural part identification based on digital image
US20220114259A1 (en) * 2020-10-13 2022-04-14 International Business Machines Corporation Adversarial interpolation backdoor detection
CN114781548A (en) * 2022-05-18 2022-07-22 平安科技(深圳)有限公司 Image scene classification method, device, equipment and storage medium
US12019747B2 (en) * 2020-10-13 2024-06-25 International Business Machines Corporation Adversarial interpolation backdoor detection

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108154134A (en) * 2018-01-11 2018-06-12 天格科技(杭州)有限公司 Internet live streaming pornographic image detection method based on depth convolutional neural networks
CN110033417A (en) * 2019-04-12 2019-07-19 江西财经大学 A kind of image enchancing method based on deep learning
CN110070548A (en) * 2019-04-22 2019-07-30 杨勇 A kind of deep learning training sample optimization method
CN110288082A (en) * 2019-06-05 2019-09-27 北京字节跳动网络技术有限公司 Convolutional neural networks model training method, device and computer readable storage medium
CN110335330A (en) * 2019-07-12 2019-10-15 创新奇智(北京)科技有限公司 Image simulation generation method and its system, deep learning algorithm training method and electronic equipment
CN110555007A (en) * 2019-09-09 2019-12-10 成都西山居互动娱乐科技有限公司 Method and device for judging number stealing behavior, computing equipment and storage medium
CN110647916A (en) * 2019-08-23 2020-01-03 苏宁云计算有限公司 Pornographic picture identification method and device based on convolutional neural network

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108154134A (en) * 2018-01-11 2018-06-12 天格科技(杭州)有限公司 Internet live streaming pornographic image detection method based on depth convolutional neural networks
CN110033417A (en) * 2019-04-12 2019-07-19 江西财经大学 A kind of image enchancing method based on deep learning
CN110070548A (en) * 2019-04-22 2019-07-30 杨勇 A kind of deep learning training sample optimization method
CN110288082A (en) * 2019-06-05 2019-09-27 北京字节跳动网络技术有限公司 Convolutional neural networks model training method, device and computer readable storage medium
CN110335330A (en) * 2019-07-12 2019-10-15 创新奇智(北京)科技有限公司 Image simulation generation method and its system, deep learning algorithm training method and electronic equipment
CN110647916A (en) * 2019-08-23 2020-01-03 苏宁云计算有限公司 Pornographic picture identification method and device based on convolutional neural network
CN110555007A (en) * 2019-09-09 2019-12-10 成都西山居互动娱乐科技有限公司 Method and device for judging number stealing behavior, computing equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
NINGANME: "【计算机视觉】数据预处理-统一图片大小-image_resize-crop-pad-SPPnet-OpenCV-Python实现", pages 1 - 3, Retrieved from the Internet <URL:https://blog.csdn.net/NingAnMe/article/details/103238519> *
查红彬等主编: "大型调水工程安全信息感知、生成与利用", 31 December 2019, 上海交通大学出版社, pages: 180 - 181 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111951217A (en) * 2020-07-07 2020-11-17 上海鹰瞳医疗科技有限公司 Model training method, medical image processing method and electronic device
CN111932514A (en) * 2020-08-07 2020-11-13 上海媒智科技有限公司 Image noise level estimation and suppression method and device and electronic equipment
CN111814810A (en) * 2020-08-11 2020-10-23 Oppo广东移动通信有限公司 Image recognition method and device, electronic equipment and storage medium
CN112073391A (en) * 2020-08-25 2020-12-11 深圳市安络科技有限公司 Method and device for monitoring network traffic
CN112149745A (en) * 2020-09-27 2020-12-29 上海高德威智能交通系统有限公司 Method, device, equipment and storage medium for determining difficult example sample
CN112149745B (en) * 2020-09-27 2022-10-21 上海高德威智能交通系统有限公司 Method, device, equipment and storage medium for determining difficult example sample
US20220114259A1 (en) * 2020-10-13 2022-04-14 International Business Machines Corporation Adversarial interpolation backdoor detection
US12019747B2 (en) * 2020-10-13 2024-06-25 International Business Machines Corporation Adversarial interpolation backdoor detection
CN113436138A (en) * 2021-03-31 2021-09-24 成都飞机工业(集团)有限责任公司 Image preprocessing method for aviation structural part identification based on digital image
CN113436138B (en) * 2021-03-31 2023-07-21 成都飞机工业(集团)有限责任公司 Image preprocessing method for aviation structure identification based on digital image
CN114781548A (en) * 2022-05-18 2022-07-22 平安科技(深圳)有限公司 Image scene classification method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111259968A (en) Illegal image recognition method, device, equipment and computer readable storage medium
US10896349B2 (en) Text detection method and apparatus, and storage medium
US11275961B2 (en) Character image processing method and apparatus, device, and storage medium
CN111950723B (en) Neural network model training method, image processing method, device and terminal equipment
US11790499B2 (en) Certificate image extraction method and terminal device
CN108777815A (en) Method for processing video frequency and device, electronic equipment, computer readable storage medium
CN109711407B (en) License plate recognition method and related device
WO2020224109A1 (en) Real-time object recognition method and apparatus, and computer device
CN111325051B (en) Face recognition method and device based on face image ROI selection
CN109409210B (en) Face detection method and system based on SSD (solid State disk) framework
CN111414879A (en) Face shielding degree identification method and device, electronic equipment and readable storage medium
WO2022193523A1 (en) Image processing method and apparatus, device, and storage medium
CN112069977A (en) Image processing method, image processing device, electronic equipment and computer readable medium
EP3952315A1 (en) Scalable multi-level collaborative content moderation
US11709914B2 (en) Face recognition method, terminal device using the same, and computer readable storage medium
CN111428740A (en) Detection method and device for network-shot photo, computer equipment and storage medium
CN110288560A (en) A kind of image fuzzy detection method and device
WO2020082731A1 (en) Electronic device, credential recognition method and storage medium
CN111435445A (en) Training method and device of character recognition model and character recognition method and device
CN103516959B (en) Image processing method and equipment
CN112434640B (en) Method, device and storage medium for determining rotation angle of document image
CN113139419A (en) Unmanned aerial vehicle detection method and device
WO2019205400A1 (en) Image rotation method and device, computer apparatus, and storage medium
WO2020228171A1 (en) Data enhancement method and device, and computer readable storage medium
CN113850238B (en) Document detection method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40024183

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination