Do I need to subtract the ImageNet mean during pre-processing? (black n' white images)

482 views
Skip to first unread message

Ioannis Kalfas

unread,
Aug 18, 2016, 2:48:04 PM8/18/16
to Caffe Users
I want to extract the features of black and white images (0 or 1 for pixel values) and use them in a different task (principal component regression). Do I need the mean-subtraction?

Does it matter that I have black and white images? (silhouettes)

charles....@digitalbridge.eu

unread,
Aug 19, 2016, 7:09:39 AM8/19/16
to Caffe Users
If it were me I would scale the values to whatever the network expects (presumably (0, 255)), duplicate the image 3 times, and perform mean subtraction.

This is assuming you're using a model pretrained on imagenet data, which is sounds as if you are.

Ioannis Kalfas

unread,
Aug 19, 2016, 7:41:53 AM8/19/16
to Caffe Users
Thank you. This is what I also ended up doing right now... 
I am still skeptical about whether it's necessary to subtract the mean and I can't find any sources to be certain about this issue.
But anyways, your reasoning seems to be the most logical.

charles....@digitalbridge.eu

unread,
Aug 19, 2016, 11:49:21 AM8/19/16
to Caffe Users
The mean normalisation can essentially be seen as 'part of the model'. As such it's pretty safe to assume that you should always use it. When using grayscale however, you'd have to know how they handled it while training in order to use the same normalisation. I suspect that the approach we've both used and talked about above is the best way.
Reply all
Reply to author
Forward
0 new messages