GuoShi28 / CBDNet

Code for "Toward Convolutional Blind Denoising of Real Photographs", CVPR 2019

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Questions regarding estimator training

TouqeerAhmad opened this issue · comments

Hi Guo Shi,

I am trying to train the estimator network alone in the tensorflow and have few questions about training settings that I could not get answers from the paper of the GitHub page; would you please answer them?

  1. In paper the patch size is mentioned to be 128x128 -- are these patches cropped from images at random? or they are cropped on a grid basis with a stride from each training image?
  2. How many number of batches are there in one epoch?
  3. Are the 1600 images from each Waterloo and FiveK data sets are chosen at random befogging the training or they different in each epoch?
  4. From paper it takes around 3 days to train full network, do you have any estimate for the estimator network -- since the estimator seems to be a fraction of the full CBDNet.

Hoping to get a prompt response.
Thank you!

Also could you provide the code for losses (even Matlab code if you can).
Thanks!

@TouqeerAhmad , The training data are choosen randomly. And for loss function, I gauss you mean TV_loss. It's my implement of TV_loss. If you have other questions or find mistake in my work, please feel free to contact me.

function Y = vl_nnloss(X,c,dzdy,varargin)


if nargin <= 2 || isempty(dzdy)
    switch varargin{2}
        case 'TVlossl2'
            PxX = X(:,[2:end end],:,:) - X;
            PxY = X([2:end end],:,:,:) - X;
            Y = sum(PxX(:).^2)/2 + sum(PxY(:).^2)/2;
    end
else
     switch varargin{2}
         case 'TVlossl2'
            PxX = X(:,[2:end end],:,:) - X;
            PxY = X([2:end end],:,:,:) - X;
            dzdy_temp_x = PxX .* dzdy;
            dzdy_temp_y = PxY .* dzdy;
            dzdy_X = dzdy_temp_x(:,[1 1:end-1],:,:) - dzdy_temp_x;
            dzdy_Y = dzdy_temp_y([1 1:end-1],:,:,:) - dzdy_temp_y;
            Y = dzdy_X + dzdy_Y;
     end
end

Thank you for sharing the "TV_loss" code! Can you please let me know the number of batches per epoch?

Have you tried training the estimator CNN only? In that case how are you generating the Ground Truth noise maps? I understand it should be some parts from "AddNoiseMosai.m" -- would you be able to share the code to generate Ground Truth sigma maps.

Just looked at the other issues -- feels like "L*n_sigma_s + n_sigma_c" is being used as GT noise map. Is that correct?

Yes, In this paper, the ground-truth is defined as this