Why does normalizing image twice work? I made a 'mistake' while training a neural network, it is a typical image classification problem like this. However the data is much larger and came from Kaggle.
In my Dataset class from PyTorch, I defined a flag
if self.transform_norm is False:
    image = image.astype(np.float32) / 255.0

and this would signify that if my augmentations pipeline does not have a normalization technique, then we set this flag to False. One example that I would set the above flag to be True the below augmentation appear in my pipeline:
albumentations.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225], max_pixel_value=255.0, p=1.0)

I forgot to set the flag to True and thus, the images first went through a standardization from [0,255] to [0,1] and then normalized using mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]. I thought I did wrong but the training results were actually good. So I dug deeper and found PyTorch's documentation and realized that it may be me who has been doing it all wrong? However, I am not using PyTorch's pretrained model out of the box, usually, I go to Ross's timm/geffnet for the models. Do let me know if there is a "right" approach.
To quote the link:

All pre-trained models expect input images normalized in the same way,
i.e. mini-batches of 3-channel RGB images of shape (3 x H x W), where
H and W are expected to be at least 224. The images have to be loaded
in to a range of [0, 1] and then normalized using mean = [0.485,
0.456, 0.406] and std = [0.229, 0.224, 0.225]. You can use the following transform to normalize:

 A: It's not normalized twice! It's normalized once, using two steps.
I say it's normalized once because all the normalization does is apply two linear transformations. We can rewrite two or more linear transformations as a single linear transformation. All we need to do is to choose a certain linear function to transform the raw pixel values to the values that the neural network expects to receive. We can show that the two-step process achieved in code is exactly the same as an equivalent operation carried out in one step.
The network expects to receive images with a certain scale, but images are encoded by with values between 0 and 255.  The route suggested in the documentation is two-step.

*

*For some pixel $p\in[0,255]$, divide by 255: $q = \frac{p}{255}$. If we wanted to emphasize that this is a "linear scale and shift" transformation, we could even write $q = \frac{p-0}{255}$.

*Subtract the mean and divide by the standard deviation: $z = \frac{q - \mu}{\sigma}$. The network expects to receive $z$ as inputs.

We can do this in one step instead, because the composition of linear functions is linear. Just doing substitution and rearranging, we can show
$$\begin{align}
z&=\frac{q - \mu}{\sigma} \\
&=\frac{p/255 - \mu}{\sigma} \\
&=\frac{p - 255\mu}{255\sigma} \\
\end{align}
$$
So in the specific case, you can achieve the exact same scaling using the transformation
albumentations.Normalize(mean=[255*0.485, 255*0.456, 255*0.406], std=[255*0.229, 255*0.224, 255*0.225]). This should make intuitive sense, because we're just rescaling the transformation to take place on the $[0,255]$ interval of pixel values, instead of a $[0,1]$ interval.
