GantMan / nsfw_model

Keras model of NSFW detector
Other
1.67k stars 267 forks source link

different model results beteewn keras/tensorflow models and tensorflowjs model #28

Open sodagreat opened 5 years ago

sodagreat commented 5 years ago

I have compared the results between keras/pb and tensorflowjs , the js model is always good, but the tensorflow pb model and keras h5 model produce much worse result. Every model I have all tried as i can. Is there something wrong with the model?

GantMan commented 5 years ago

Odd! The JS model is generated FROM the Keras model. Would you like to share your Keras comparison code?

sodagreat commented 5 years ago

Odd! The JS model is generated FROM the Keras model. Would you like to share your Keras comparison code?

I just use the predict interface of nsfw_detecor as the example. Found two factors that affect the results: image resize params and model quantization. I have checked the nsfwjs source code, which use bilinear interpolation. And i also compared results between normal model and quantized model, quantized model gives more reasonable predictions.

GantMan commented 5 years ago

This is news to me! I wonder why quantization improves accuracy.