nsfw_model icon indicating copy to clipboard operation
nsfw_model copied to clipboard

How to Train porn Class Only?

Open chenzi opened this issue 6 years ago • 5 comments

I have 10,000 pornographic pictures. How to Train porn Class Only? I trained only one category to predict that all pictures were pornographic.

chenzi avatar Apr 06 '19 03:04 chenzi

You'll want to make a porn/not_porn group of roughly the same size.

It's 2 categories. Preferably have the not_porn folder have a lot of images of people interacting, but not pornographically.

GantMan avatar Apr 06 '19 03:04 GantMan

How do I train a class based on the model https://s3.amazonaws.com/nsfwdetector/nsfw.299x299.h5, I want to train my 10000 pornographic pictures to porn class.

chenzi avatar Apr 06 '19 03:04 chenzi

but I have not other class pictures

chenzi avatar Apr 06 '19 03:04 chenzi

I think you need to get 10,000 non-porn photos. Then use the training code you have, but change the final layer to softmax sigmoid with 2 neurons. Porn and not-porn.

GantMan avatar Apr 07 '19 00:04 GantMan

ACTUALLY, you could use "K-Nearest Neighbors Classifier" to turn the model into classifying 2 different items. If you use the inference data. I'm not an expert on how to do this, though.

GantMan avatar Apr 07 '19 15:04 GantMan