GantMan / nsfw_model

Keras model of NSFW detector
Other
1.8k stars 279 forks source link

model.json version model is not as good as .h5 version #83

Closed qiankunxienb closed 1 year ago

qiankunxienb commented 3 years ago

For example, https://s3.amazonaws.com/ir_public/nsfwjscdn/nsfw_mobilenet2.224x224.h5 is more accurate than https://github.com/GantMan/nsfw_model/releases/download/1.2.0/mobilenet_v2_140_224.1.zip.

What is the key difference?

GantMan commented 3 years ago

The one on s3 was created using TF1.0 by me, and the second one was by @TechnikEmpire who's been helping improve the model.

TechnikEmpire commented 3 years ago

I would ask for evidence to back up the accuracy claims but, yesterday I re-trained a model and tf said it was 96% accurate... then I tested it in a brand new group of images never seen before in train or validation and "accuracy" was not a word I would even use to describe anything about it. Puzzling.

GantMan commented 3 years ago

Agreed. We need data.

qiankunxienb commented 3 years ago

for example, please see the images below: 0OUtSc_G_004dBV7E00

the results of mode.json vs h5 are like below:

image

mode.json version model says it is more like a porn image than h5 version model.

qiankunxienb commented 3 years ago

However, https://nsfwjs.com/ always do the right job.

image

How does this site do a better job? Did the site train the mode by itself or use the same mode as you?

GantMan commented 3 years ago

The site 93% model I believe is one release version old.

The 90% accuracy was from the TF 1.0 training session.

Can you look through release history and see which model works best for you and we'll try to update?

TechnikEmpire commented 3 years ago

However, https://nsfwjs.com/ always do the right job.

I'd just like to point out that, it's not doing "the right job", it's calling a screen grab of a police interaction a "drawing".

colindean commented 1 year ago

I believe this is resolved. Please reopen if you have further questions or discussion.