Skip to content

An AWS Sagemaker Model developed for Nudity / NSFW Images Classification. This Model was developed during my Machine Learning Engineer Nanodegree.

License

Notifications You must be signed in to change notification settings

deepanshu-yadav/NSFW-Classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email me at [email protected] if you want the trained model.

alt text

NSFW-Classifier

An AWS Sagemaker Model developed for Nudity / NSFW Images Classification

This is project done for the fullfillment of Udacity Machine Learning Engineer NanoDegree. I have build a model that classifies input image into five categories.

  1. Nude
  2. Semi Nude
  3. Animated
  4. Porn
  5. Safe For Work

Demo

The model is deployed on aws check it yourself by downloading this repository , then going to demo folder and running index.html.

Contents

  1. classification_tool.ipynb
  2. clean and prepare data.ipynb
  3. nsfw-training_built_in_aws.ipynb
  4. nsfw_deploy.ipynb
  5. batch_transform.ipynb
  6. benchmark.ipynb
  7. analyze_bench.ipynb
  8. Metrics.ipynb
  9. analyze_results.ipynb
  10. Capstone_Project_Report.pdf
  11. Project_Proposal.pdf
  12. results.csv
  13. results_bench.csv

Data Collection And Organization

The following guys had collected the data

  1. B Praneeth 's Data . He did an awesome job in collection of data . The data is for three classes
    • Nude
    • Sexy
    • Safe
    1. But the problem is I need more categories for my problem . So I made a simple tool that is helpful for sub classifying the above Nude Images. You just keep all the training samples in one folder and run and run it in a jupyter notebook. I classified a few thousands of these , but then i realized that it would take a while to gather huge data. For class Safe For Work i sampled randomly from his huge dataset.
    2. Further More I also made a tool that takes a screenshot of the screen and saves it into a folder. It becomes handy when you want to deliberately put difficult examples in your dataset.

The above tools proved helpful but did not solved the problem of gathering large number of examples for training. Therefore scraping was necessary.

  1. Bazarov 's Dataset . For collecting set of nude images I included the the sub category in the list he provided namely:
    • Female genitalia
    • Male genitalia
    • Breasts
      By now I had enough examples of class nude.

3. Alex's Dataset . For classes animated and porn i scraped the data from here.

  1. Instagram Scrapper For class Semi Nude I used his tool to scrape few Instagram pages that regularly post arousing images of men and women.