How to normalize the input data when transferring a pretrained model to a new dataset

When we transfer a pretrained model to a new dataset, how should I normalizing the input data?
For example, if I use the vgg16 model pretrained on imagenet, should I use the mean and std computed on imagenet (i.e. mean = [0.485, 0.456, 0.406] and std = [0.229, 0.224, 0.225]), or I need to compute the mean and std on the new dataset?

If you are not finetuning the pre-trained model, you should use the same stats that were used during training.
In your case you should use the ImageNet stats.

1 Like