sfw / NudityDetection / 1.1.6


Note: There is a higher accuracy alternative to this algorithm called NudityDetectionI2v, you can check it out here: https://algorithmia.com/algorithms/sfw/NudityDetectioni2v

This algorithm detects nudity in pictures. For a demo of this algorithm, check out: https://isitnude.com/

Table of content

  1. Introduction
  2. Examples
  3. Credits


The idea behind the algorithm is based primarily on observations that in general, nude images contain large amounts of skin, people have different skin tones, and skin regions in nude images are relatively close to each other. In order to make the algorithm more robust, we have incorporated face detection for skin ratio tweaking and skin color detection for limiting the generic skin color value interval. 


  • (Required): Image: You can send your input as a String (base64 encoded image, arbitrary Url pointing to an image or a data api Url pointing to an image) or pipe the image in as binary data.


  • JSON object containing values for "nude" and "confidence".


Example 1.

  • Parameter 1: Safe image URL


    "nude": "false",
    "confidence": 0.95

Example 2.

  • Parameter 1: Nude image URL


    "nude": "true",
    "confidence": 0.93


Implementation is based on: An Algorithm for Nudity Detection

The limits that decide on the skin regions are based on the values in RGB, HSV and normalized RGB color spaces in the book Human Computer Interaction Using Hand Gestures by Prashan Premaratne, derived from multiple papers as described in the book.

1.1.3 - Adjusted the URL validator to urls from domains with more than 2 periods (IE: *.co.uk, *.com.br, etc)
1.1.4 - Allows self-signed ssl certificates, meaning all https// requests will be treated identically to http://