These are chat archives for beniz/deepdetect

15th
May 2017
cchadowitz-pf
@cchadowitz-pf
May 15 2017 20:08
hi @beniz, looping back to that Memory Data layer transform_params question I had a little while ago (https://gitter.im/beniz/deepdetect?at=590795d0f22385553d94f957) - it doesn't look like there's any way currently to specify a center crop in DeepDetect, only the mean and resize params. Would it be possible to either add params for a center crop (to be applied after a resize), or to include the changes from the mdl_reset branch (https://github.com/beniz/caffe/tree/mdl_reset) so that we can define those types of transform params in the deploy.prototxt directly?
Emmanuel Benazera
@beniz
May 15 2017 20:10
hi, why do you need cropping at predict time ?
cchadowitz-pf
@cchadowitz-pf
May 15 2017 20:12
we're looking to integrate the Yahoo NSFW caffe model, which is distributed with this python helper script: https://github.com/yahoo/open_nsfw/blob/master/classify_nsfw.py
looking through the script, they seem to do resizing, center-cropping, and mean subtraction as part of the python script rather than within Caffe itself. In order to convert the model to use with DeepDetect, we're looking to shift that preprocessing to either the deploy.prototxt or within DeepDetect (like the mean subtraction) and avoid having to utilize an external preprocessing step before sending the image to the DeepDetect service for prediction
Emmanuel Benazera
@beniz
May 15 2017 20:17
hum, we have a modified version of that model, and you don't need the cropping. Cropping at predict time is often found in publications in order to strengthen the statistics over multiple predictions for the same image.
mean subtraction is already supported, pass the array of int.
cchadowitz-pf
@cchadowitz-pf
May 15 2017 20:23
interesting - we have a modified version running to with mean subtraction as you say, but we have cases (yet to be verified, hopefully will be soon) of mismatching confidences between the original model and our modified model, and those transform params are the things that stand out to me as a place where they differ

i agree that cropping typically shouldn't make a large difference, but offhand i didn't have another reason as to why the confidences would differ by more than 0.5. the python script had this caveat which i skimmed over in first pass:

Resize image. Please use this resize logic for best results instead of the caffe, since it was used to generate training dataset

Emmanuel Benazera
@beniz
May 15 2017 20:26
remove the cropping from the python script, but I don't believe this would change the results much. I remember that the model was very sensitive to the mean, which IMO is a bad sign...
cchadowitz-pf
@cchadowitz-pf
May 15 2017 20:27
i'm not using the python script, i was just referring to it while converting the model to use with DD. i agree, the sensitivity to mean is a bit concerning, but the model does overall perform relatively decently