caffe icon indicating copy to clipboard operation
caffe copied to clipboard

What format is the 'mean file' in?

Open polySolo opened this issue 11 years ago • 3 comments

...and do I need it for training on my own data?

The story is that I have about 1000 images of a particular fruit (positives), and I have about 1000 negatives images. (They are all RGB). Therefore, I have N = 2000 images in total. Let us assume that each image is of size c x w x h, where c is the number of channels, (3 because they are RGB), w is the width in pixels, and h is the height in pixels.

As a simple learning exercise I would like to take the "bvlc_reference_caffenet", lop off the beginning and the end layers in order to make my own deep network classifier. However, one thing that I noticed in the 'train_val.prototxt' was that they give a "mean_file", as such: mean_file: "data/ilsvrc12/imagenet_mean.binaryproto".

Thus my question is three fold:

  1. Do I really need a mean_file to train my samples?
  2. If I do, is it simply another image containing the mean value of every pixel, (ie, is it an c x w x h size image, where each pixel corresponds of all the mean values of all pixels from that location), OR is it simply 3 numbers, by which we subtract the red, green, and blue channels by?
  3. Either way, where/what are the instructions for how I go about creating a mean.binaryproto file?

Thanks in advance.

polySolo avatar Apr 11 '15 16:04 polySolo

Please ask on the caffe-users group and see the ImageNet example http://caffe.berkeleyvision.org/gathered/examples/imagenet.html. It is simply an "image" of mean values but even a mean pixel (single value per channel) can work just as well.

shelhamer avatar Apr 27 '15 08:04 shelhamer

Did someone created a meanfile. Can you share the process? Thanks!

gsrungarapu avatar May 10 '17 23:05 gsrungarapu

If you converted the training images to a lmdb file, just run

$<caffe installation folder>/build/tools/compute_image_mean <lmdb folder> mean.binaryproto

gsnasc avatar May 25 '17 13:05 gsnasc