sfw

sfw / NudityDetectionEnsemble / 0.3.12

README.md

Nudity Detection Ensemble

This algorithm detects nudity in images with very high accuracy.

Table of Contents


Introduction

This  nudity detection algorithm uses an ensemble, which is a machine learning technique that uses a number of independent models to solve a single tough problem. In our case we weight the output prediction of each model depending on their individual strengths and weaknesses to create a more accurate and reliable prediction.


Inputs

We allow for two independent input formats; the first as a standard string input, and the second as a JSON object.

string formatted input

"src"

 src (required)  - Src can be an http://, https:// or data:// url link to an image file. The currently supported image types are .jpg and .png. As of 0.1.2, src can also be a String (base64 encoded image.

json formatted Input

{  
   "src": String,
   "sensitivity": Int
}

 src (required) - Src can be an http://, https:// or data:// url link to an image file. The currently supported image types are .jpg and .png. As of 0.1.2, src can also be a String (base64 encoded image.

sensitivity (optional)  - An integer value (between -6, 6) that determines which internal weight pre-sets to select for prediction. For example; A pre-set close to -6 will return more false negatives, while a pre-set close to 6 will return more false positives. Only adjust this if necessary, the default pre-set works for most situations.


Outputs

The single output format is backwards compatible with isitnude while remaining flexible for future enhancements.

Standard Output

{
  "confidence": Double,
  "nude": Boolean
}

confidence - An indicator of how confident we are with a particular decision (nude/notnude).

nude - A boolean operator that indicates explicitly whether the ensemble model considers the image to contain nudity or not.

Examples

positive nudity example

 enter image description here

input

{  
   "src":"http://www.isitnude.com.s3-website-us-east-1.amazonaws.com/assets/images/sample/young-man-by-the-sea.jpg",
   "sensitivity":0
}

output

{
  "confidence": 0.6100000000000001,
  "nude": true
}


negative nudity example

 enter image description here

input

"https://camblyblog.files.wordpress.com/2015/10/justin-trudeau1.jpg"

output

{
  "confidence": 0.9793914872243101,
  "nude": false,
}