/mosaic

Detect Porngraphic Images by Deep Learning (Using Keras and Tensorflow)

Primary LanguagePythonApache License 2.0Apache-2.0

Mosaic: Deep Learning Model for Porngraphic Detection

You have just found Mosaic Models.

Mosaic is a high-level neural networks model, written in Python and capable of running on top of keras with Tensorflow backend .

Now, It was developed with a focus on porngraphic detection.

Use Mosaic Models if you need a deep learning Model that:

  • Allows for easy and fast detecting porngraphic.
  • Design and Fine-tune yourself Network (Mosaic-based).
  • Runs seamlessly on CPU and GPU.

Mosaic is compatible with: Keras 2.0.3 Tensorflow 1.1.0 and Python 2.7.


Guiding principles

  • Easy Usage. Just load the model and weights to predict a image.

  • Work with Python.


Inference Usage:

Download the project and run command(Please download weights file from http://pan.baidu.com/s/1i4POGXB to ./model.):

python mosaic_porngraphic_cnn_demo.py the_path_of_image

the_path_of_image is the input image to be detected.

Output is The PORNGRAPHIC probability.

Training Usage:

Prepare training and validtaion images at first:

python mosaic_porngraphic_cnn_train.py the_path_of_training_image the_path_of_validation_image 

the_path_of_training_image is the full path of training image, which should be include two class sub-directories. the_path_of_validation_image is the full path of validation image, which should be include two class sub-directories.

The best model and last model will be saved.


Example:

Run:

python mosaic_porngraphic_cnn_demo.py ./data/test/22.jpg

Output:

Mosaic: detect porngraghic
=====================================

loading weights..........
load OK!

Try to Predict input images:
=====================================
Input image is: ./data/test/22.jpg
The PORNGRAPHIC probability is: 0.000% 

Also, the model gives JSON Output:

following are return values:
{"results_output": {"porngraphic": "2.15399e-08"}, "image_file_output": "null", "results_file_output": "null"}

Models:

Mosaic Model based on Xception in keras:

  • Input: [128,128,3]
  • Entry Flow: [8,8,728]
  • Middle Flow(repeated 8 times): [8,8,728]
  • Exit Flow: [4,4,2048]
  • Output FC: 1

The accuracy in test datasets is up to 96%.


Donate:

If the project could help you, please star it and give us some donations. Donations will be used to fund expenses related to development (e.g. to cover equipment and server maintenance costs), to sponsor bug fixing, feature development.

Wechat Payment WeChat Payment

Paypal Payment Paypal Payment