CN115700809A - Intelligent AI image pornography detection method based on deep learning - Google Patents

Intelligent AI image pornography detection method based on deep learning Download PDF

Info

Publication number
CN115700809A
CN115700809A CN202110827835.4A CN202110827835A CN115700809A CN 115700809 A CN115700809 A CN 115700809A CN 202110827835 A CN202110827835 A CN 202110827835A CN 115700809 A CN115700809 A CN 115700809A
Authority
CN
China
Prior art keywords
image
model
crop
size
data
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
CN202110827835.4A
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.)
Beijing Zhishi Digital Technology Development Co ltd
Original Assignee
Beijing Zhishi Digital Technology Development Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zhishi Digital Technology Development Co ltd filed Critical Beijing Zhishi Digital Technology Development Co ltd
Priority to CN202110827835.4A priority Critical patent/CN115700809A/en
Publication of CN115700809A publication Critical patent/CN115700809A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses an intelligent AI image pornography detection method based on deep learning, which increases the number and diversity of samples by carrying out data enhancement on training set data and verification set data, optimizes a model architecture, inputs the model data into a model for image classification training, and detects the performance of the model by using a test set. The model test accuracy rate of the invention is 11 percent to 96.2 percent, the accuracy rate reaches 97.1 percent, the recall rate reaches 96.5 percent, and the background interference is effectively reduced without losing the target to be identified.

Description

Intelligent AI image pornography detection method based on deep learning
Technical Field
The invention relates to the field of intelligent AI image pornography detection, in particular to an intelligent AI image pornography detection method based on deep learning.
Background
A large amount of videos are uploaded by network users every day, a large amount of auditors are needed to perform manual checking, the efficiency is low, and the cost is high; in addition, another difficulty of manual review is that the judgment of the temperament is too subjective, and even some background knowledge is required for partially obscure contents. Therefore, the image pornographic identification model is generated at the same time, the subjective factors and the 'knowledge' blind area of manual examination are eliminated, and the labor cost is saved.
Because background information of a plurality of pornographic images has more or less interference on identification of the pornographic images, before image identification, data enhancement processing is generally carried out, so that the data volume can be increased, the diversity of samples can be increased, random image interception is carried out, a target object is shielded equivalently, the robustness of the model can be increased to a great extent, but target information needing to be identified is lost with a great probability, a great part of noise is also involved in an original clean training set, and great interference is caused on the training and identification of the model, so that the model is not converged.
Disclosure of Invention
The invention aims to overcome the technical defects and provides an intelligent AI image pornography detection method based on deep learning, which can preprocess image classification training set data, reduce the interference of background information without losing target information and improve the training and detection effects.
In order to solve the problems, the technical scheme of the invention is as follows: an intelligent AI image pornography detection method based on deep learning comprises the following steps:
(1) Training set data and validation set data were normalized by 9:1, storing the image data into a txt file according to a format that each line is an image path and a label, then loading the image data, and respectively storing the image path and the label into different lists;
(2) Performing image enhancement on the data, wherein the crop mode is to define a variable crop _ size, firstly, using an image resize as the crop _ size, subtracting the model input size from the crop _ size, then subtracting 2 from the model input size, then using Gaussian distribution probability to take the value from 0 to the difference as the starting point of crop, and using the weight and the width of crop as the image input size;
(3) Training the model by using resnet50, and optimizing the model structure;
(4) Loading a pre-training model, accelerating convergence by using an SGD momentum algorithm, reducing oscillation in the convergence process, optimizing learning rate by using cosine optimization, escaping from a current local optimum point, and searching for a new local optimum point;
(5) Storing an optimal model by adopting a checkpoint strategy, adopting a tensorbard strategy visual training process, and selecting the optimal model by integrating acc and loss;
(6) And (3) testing by using an optimal model, defining a picture variable crop _ size during testing, firstly, reducing the image resize to crop _ size, subtracting the model input size from crop _ size, then, dividing by 2 to obtain a crop starting point, and finally, inputting the intercepted image into the model for testing and calculating the index.
Further, the image enhancement method in step (2) includes random angle rotation, mirror image flipping, color gamut transformation, and the like.
Further, in step (3), after the data enters the network, the original ResNet undergoes 3 × 3 convolutions of 3 stride =1, which can reduce information loss, increase feature size, reduce calculation amount, and increase model nonlinearity.
Further, in the step (4), after the calculation is completed in each period, the model parameters of different local optimal points are stored, and as the models of different local optimal points have greater diversity, the effect after the set is better.
Further, the starting point is no longer selected by using the gaussian distribution during the test in the step (6), so that the test result can be unstable.
Compared with the prior art, the invention has the advantages that: the model test accuracy rate of the invention is 11 percent to 96.2 percent, the accuracy rate reaches 97.1 percent, the recall rate reaches 96.5 percent, and the background interference is effectively reduced without losing the target to be identified.
Drawings
FIG. 1 is a data flow diagram of the present invention.
FIG. 2 is a graph showing the effect of the first embodiment of the present invention.
Detailed Description
The present invention is further described below by way of specific examples, but the present invention is not limited to only the following examples. Variations, combinations, or substitutions of the invention, which are within the scope of the invention or the spirit, scope of the invention, will be apparent to those of skill in the art and are within the scope of the invention.
Example one
The configuration of 1 server is used, and the specific server is as follows:
Gpu:NVIDIA Corporation GP102[TITAN Xp]
memory: 128g
Network card: kilomega network card
A magnetic disk: 5T
Experimental data frames were extracted for a pornographic movie, with 5 million pornographic frames as the porn data and normal frames as the normal data. And then the ratio of 9: the ratio of 1 divides the training set into a training set and a validation set, and the effect of the model on the validation set during the training process is shown in fig. 2.
Example two
Using 1 server, the configuration of the specific server is as follows:
Gpu:NVIDIA Corporation GP102[TITAN Xp]
memory: 128g
Network card: kilomega network card
Magnetic disk: 5T
Experimental data frames were extracted for a pornographic movie, with 5 million pornographic frames as the porn data and normal frames as the normal data.
Test data other pornographic movies perform frame extraction, sexual sense small videos and seaside videos perform frame extraction, and 5 thousand porn data, 5 thousand sexy data (sexual sense dancers and seaside swimsuit data with less wear) and 5 thousand normal data are randomly selected.
In the testing process, the fixed value obtained by subtracting the input size from the crop _ size and subtracting 2 from the crop _ size is used as a crop starting point, the crop length is the image input size, and the utilization rate of gpu reaches 90-100%.
The results of the test were: after the test data is added into the sexy data, a test heat map is generated, attention points of the model are observed, the model can well pay attention to key information such as sensitive parts appearing in the burn picture, the influence of the sexy image is avoided, the model test accuracy rate reaches 97.9%, the accuracy rate reaches 97.5%, and the recall rate reaches 98.7%.
EXAMPLE III
Using 1 server, the configuration of the specific server is as follows:
Gpu:NVIDIA Corporation GP102[TITAN Xp]
memory: 128g
Network card: kilomega network card
A magnetic disk: 5T
Experimental data frames were extracted for a pornographic movie, with 5 million pornographic frames as the porn data and normal frames as the normal data.
The method comprises the steps of testing data, carrying out frame extraction on other pornographic movies, carrying out frame extraction on a sexy small video and a seaside video, randomly selecting 5 thousand pieces of porn data, 5 thousand pieces of sexy data (sexy dancers and seaside swimsuit data with less wearing) and 5 thousand pieces of normal data, adding 5 thousand pieces of data to reduce sensitive parts, or complicating peripheral images and scenes and adding some interferences, such as noise, compression and the like.
In the testing process, the fixed value obtained by subtracting the input size from the crop _ size and subtracting 2 from the crop _ size is used as a crop starting point, the crop length is the image input size, and the utilization rate of gpu reaches 90-100%.
The results of the test were: after interference data are newly added into the test data, a test heat map is generated, attention points of the model are observed, the model can still well pay attention to key points such as sensitive parts appearing in the burn picture and the like without being interfered, the model test accuracy rate reaches 97.1%, the accuracy rate reaches 97.8%, and the recall rate reaches 98.2%.
A combination of the three examples forms Table 1
Figure RE-GDA0003292676630000041
TABLE 1
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the present invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (5)

1. An intelligent AI image pornography detection method based on deep learning is characterized by comprising the following steps:
(1) Storing training set data and verification set data in a ratio of 9:1, storing the training set data and the verification set data into a txt file according to a format that each line is an image path and a label, then loading image data, and storing the image path and the label into different lists respectively;
(2) Performing image enhancement on data, wherein the crop mode is to define a variable crop _ size, an image resize is the crop _ size, the crop _ size is used for subtracting a model input size and then subtracting 2, then a value from 0 to a difference value is taken as a starting point of crop by using Gaussian distribution probability, and the weight and width of crop are image input sizes;
(3) Training the model by using resnet50, and optimizing the model structure;
(4) Loading a pre-training model, accelerating convergence by using an SGD momentum algorithm, reducing oscillation in the convergence process, optimizing learning rate by using cosine optimization, escaping from a current local optimum point, and searching for a new local optimum point;
(5) Storing an optimal model by adopting a checkpoint strategy, adopting a tensorbard strategy visual training process, and selecting the optimal model by integrating acc and loss;
(6) And (3) testing by using an optimal model, defining a picture variable crop _ size during testing, firstly, reducing the image resize to crop _ size, subtracting the model input size from crop _ size, then, dividing by 2 to obtain a crop starting point, and finally, inputting the intercepted image into the model for testing and calculating the index.
2. The intelligent AI image pornography detection method based on deep learning of claim 1, wherein: the image enhancement method in the step (2) comprises random angle rotation, mirror image turning, color gamut transformation and the like.
3. The intelligent AI image pornography detection method based on deep learning of claim 1, wherein: in step (3), the original ResNet undergoes 3 × 3 convolutions of 3 stride =1 after the data enters the network.
4. The intelligent AI image pornography detection method based on deep learning of claim 1, wherein: and (4) after the calculation of each period is completed, storing the model parameters of different local optimal points.
5. The intelligent AI image pornography detection method based on deep learning of claim 1, wherein: and (4) no longer using Gaussian distribution to select a starting point during the test in the step (6).
CN202110827835.4A 2021-07-21 2021-07-21 Intelligent AI image pornography detection method based on deep learning Pending CN115700809A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110827835.4A CN115700809A (en) 2021-07-21 2021-07-21 Intelligent AI image pornography detection method based on deep learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110827835.4A CN115700809A (en) 2021-07-21 2021-07-21 Intelligent AI image pornography detection method based on deep learning

Publications (1)

Publication Number Publication Date
CN115700809A true CN115700809A (en) 2023-02-07

Family

ID=85120701

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110827835.4A Pending CN115700809A (en) 2021-07-21 2021-07-21 Intelligent AI image pornography detection method based on deep learning

Country Status (1)

Country Link
CN (1) CN115700809A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116452836A (en) * 2023-05-10 2023-07-18 武汉精阅数字传媒科技有限公司 New media material content acquisition system based on image data processing

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116452836A (en) * 2023-05-10 2023-07-18 武汉精阅数字传媒科技有限公司 New media material content acquisition system based on image data processing
CN116452836B (en) * 2023-05-10 2023-11-28 杭州元媒科技有限公司 New media material content acquisition system based on image data processing

Similar Documents

Publication Publication Date Title
US10896349B2 (en) Text detection method and apparatus, and storage medium
CN111709883B (en) Image detection method, device and equipment
US20210166015A1 (en) Certificate image extraction method and terminal device
CN111915525A (en) Low-illumination image enhancement method based on improved depth separable generation countermeasure network
CN110851675B (en) Data extraction method, device and medium
Yan et al. [Retracted] Optimization Research on Deep Learning and Temporal Segmentation Algorithm of Video Shot in Basketball Games
CN110688524A (en) Video retrieval method and device, electronic equipment and storage medium
CN110032931B (en) Method and device for generating countermeasure network training and removing reticulation and electronic equipment
CN107545049A (en) Image processing method and related product
CN108319672A (en) Mobile terminal malicious information filtering method and system based on cloud computing
CA3166091A1 (en) An identification method, device computer equipment and storage medium for identity document reproduction
Tang et al. Low‐light image enhancement with strong light weakening and bright halo suppressing
CN115700809A (en) Intelligent AI image pornography detection method based on deep learning
CN113505702A (en) Pavement disease identification method and system based on double neural network optimization
Qiao et al. Csc-net: Cross-color spatial co-occurrence matrix network for detecting synthesized fake images
Li et al. A cascaded algorithm for image quality assessment and image denoising based on CNN for image security and authorization
CN115760641B (en) Remote sensing image cloud and fog removing method and equipment based on multiscale characteristic attention network
CN108460673A (en) A kind of processing method and processing device of training data
CN114567798B (en) Tracing method for short video variety of Internet
Liu et al. Sky detection‐and texture smoothing‐based high‐visibility haze removal from images and videos
CN112699726B (en) Image enhancement method, genuine-fake commodity identification method and equipment
CN114708635A (en) Face video tampering detection method based on MesoNet and LSTM
Xiao et al. Generative image inpainting by hybrid contextual attention network
CN111739025A (en) Image processing method, device, terminal and storage medium
Wang et al. Multi‐DS Strategy for Source Camera Identification in Few‐Shot Sample Data Sets

Legal Events

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