moabitcoin / holy-edge

Holistically-Nested Edge Detection

Home Page:https://arxiv.org/pdf/1504.06375.pdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

what is im -= self.cfgs['mean_pixel_value'] mean?

CangHaiQingYue opened this issue · comments

In data_parser.py ,I find ‘ im -= self.cfgs['mean_pixel_value'] ’,
mean_pixel_value: [103.939, 116.779, 123.68]
I dont understand what is this op mean? Is it for normalization?
Can I use tf.image.per_image_standardization() instead?

A good start to data processing is what we commonly refer to as normalised representations. One example of which would be whitening. Which sets dataset statistics to mean 0 and variance 1.0 . Here we use a simplified version of that and set to dataset statistics to mean 0.

tf.image.per_image_standardization() use per sample statistics to scale each image to mean 0 and variance 1. What we would like it to have mean 0 variance 1 over the whole dataset and not just each sample separately.

Thanks, I'd read the paper of VGG, and found the reason.
This op will speed up the convergence.

I have a question on the same topic. I am using my own dataset for this project I wanted to ask is the mean_pixel_value: [103.939, 116.779, 123.68] is specific to the BSDS dataset or can be used for any dataset?
Thank you.

Hi Thanks for your question. The mean value is usually computed on the training set which was used to train the base (VGG) Model. In this case the mean value is computed over the entire ImageNet data-set which was used to train the VGG base model. Hence you don't have to change the mean pixel value if you train on your own dataset.