GantMan / nsfw_model

Keras model of NSFW detector
Other
1.71k stars 270 forks source link

How to Train porn Class Only? #15

Open chenzi opened 5 years ago

chenzi commented 5 years ago

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

GantMan commented 5 years ago

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.

chenzi commented 5 years ago

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 commented 5 years ago

but I have not other class pictures

GantMan commented 5 years ago

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 commented 5 years ago

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.