Transform using an image individual mean and standard deviation

114 views
Skip to first unread message

Felipe del Río

unread,
May 12, 2016, 5:19:30 PM5/12/16
to Caffe Users
Hi!

I am doing a classification net for image into text based on the paper "Reading Text in the Wild with Convolutional Neural Networks" by Max Jaderberg and others. Here it says I need to normalize each image subtracting its mean and dividing by its standard deviation. 

Because each mean and standard deviation is exclusive for each image, using a constant value or a mean file doesn't serve my purpouse.

Is there a way to do this in the prototxt declaration of the net? Or using python?

Thanks a lot for the help!

Jan

unread,
May 13, 2016, 3:42:10 AM5/13/16
to Caffe Users
I don't think so; there are several approaches to this, however:
  • Preprocess the data beforehand, put it in a supported db and use a corresponding data layer. I'd use a python script for that, I guarantee this is possible in < 100 lines of code. Or:
  • Write up a layer that does that preprocessing. This should be quite easy using a python layer. I have no idea how that affects performance, however.
In the past I went with option 1 and an HDF5 db. It is a bit additional work, but once you have the scripts to do the preprocessing you can reuse them quite easily.

Jan
Reply all
Reply to author
Forward
0 new messages