Normalization statistics for fine-tuning a pretrain model

Hello :slight_smile:

My objective is to fine-tune a model which was pretrain on ImageNet dataset.

In my previous work, I’ve always used normalization statistics of ImageNet dataset to “fully benefit from pretrained weights”, both at inference and at fine-tuning.

However in my current work, my data is significantly different from ImageNet images.
In the way that, after performing normalization to my data with ImageNet statistics, my images are very dark and an important part of information seem to be lost.

To give you an idea of this difference :

  • Mean of ImageNet : [0.485, 0.456, 0.406]
  • Mean of my dataset : [0.321, 0.373, 0.303]

On this post Should we use our normalization for training a pretrained model? - PyTorch Forums, it is recommended to use statistics of our fine-tuning dataset, but this is not what I usually do as I said before.

My question is : which normalization statistics should I use, and why ? The ImageNet ones ? Or my dataset ones ?

Thank you very much for your answer and have a nice day !

Update :
Maybe to give you more information for understanding my problem, when I display images without clipping (i.e. just after normalization), images look very dark. When I display images with linear mapping ( Why do images look weird after (Imagenet) normalization? - vision - PyTorch Forums ), my images are correctly displayed, but it is not what is given to the neural network. So, is the information still meaningfull even if images displayed without clipping are very dark and seem to have less information ?

The point of e.g., subtracting the mean and dividing by the standard deviation is to “center” the distribution, among other things. You would not be centering your training data if you used the ImageNet statistics, so you should use the statistics of your dataset.

However, in practice, I suspect the model would be able to learn around the “mistake” even if you used the ImageNet statistics during finetuning.