I've been exploring neural style transfer and noticed that some implementations, such as the official PyTorch versions of Universal Style Transfer via Feature Transforms and unofficial Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization's include an additional 1x1 convolution layer in the VGG19 model architecture. This layer seems to perform a channel swap from RGB to BGR and scales the values, rather than acting as a feature extraction layer.
This extra layer is not mentioned in the papers for these methods, which only state that VGG19 was used as the encoder. I’m curious about the rationale behind this modification. Why is this preprocessing layer used instead of the standard VGG19 architecture? How does it affect the model’s performance or results, and why might the weights of these modified layers differ from those in the common VGG19 model found in PyTorch?
Any insights or explanations would be greatly appreciated. Thank you!
Update: I unexpectedly found the answer. I mostly use pytorch for deep learning. The pretrained vgg19 model in pytorch was trained with normalization values mean=[0.485, 0.456, 0.406] and std=[0.229, 0.224, 0.225]. Where in the paper they used the original model that was trained in vgg paper. In the vgg paper they only performed mean substraction from pixel values ranging from 0to255. So the extra conv layer only converts rgb channel to bgr channel and subtracts mean. It is actually a preprocessing layer depended on the the pretrained model used