limbee / NTIRE2017

Torch implementation of "Enhanced Deep Residual Networks for Single Image Super-Resolution"
652 stars 146 forks source link

Preprocessing in this work #19

Closed zhiyang-fu closed 6 years ago

zhiyang-fu commented 6 years ago

In the paper, you mentioned the only preprocessing you did was subtracting the mean RGB value from entire dataset. But did you also preprocess your label(high resolution image) in the same way, subtracting the mean RGB value from all the label images? Another thing I noticed was the constant 255 was used to scale the input in you code. Is it because the dynamic range of input is [0,1]?

Could you show more details about your image preprocessing?

Thanks,

limbee commented 6 years ago

The things you mentioned are all the preprocessing we used. For each input and label image, we scale the pixel value to 0~255 and subtract the RGB average value of the DIV2K dataset.

zhiyang-fu commented 6 years ago

If you compute the mean for the input and label images, they should be different. How do think of subtracting the mean separately for the input and label images? And when you say DIV2K dataset, do you mean the high resolution image?

limbee commented 6 years ago

The mean value is calculated over whole DIV2K high-resolution (GT) images, so it should be the same. We apply this single mean value to both of input and label images. What I mean by DIV2K is the high-resolution image.

zhiyang-fu commented 6 years ago

But the input of network is low resolution image. We are supposed to preprocess on input of network to make faster and better convergence, isn't it? Why don't you compute the mean of all the low resolution images directly?

limbee commented 6 years ago

I don't think the pixel mean of low- and high-resolution images differ significantly. The input image is just a bicubic downsampled version of label image, so ideally there should be no mean shift.

zhiyang-fu commented 6 years ago

That is a good point! Thank you! I have a follow up question. Let's say you trained your net on DIV2K dataset, then you are going to test it on another unknown dataset. How are you gonna to preprocess the test image from the unknown dataset? Do you rescale to [0,255] and then subtract the mean of DIV2K dataset? And after you get your output of network, you add back the same mean and rescale it by the same scaling factor. Is this right?

limbee commented 6 years ago

When we do some training or testing algorithms in a DIV2K dataset, I think it implicitly assumes that this dataset represents the entire image. Therefore, I think it is correct to use the same mean value as in DIV2K and same preprocessing unless there is information about the statistics of the new dataset. If I test for an unknown dataset, I will do the same as you described.

zhiyang-fu commented 6 years ago

Thank you very much! I appreciate your patience.