# Same value of min and max in min-max normalisation

By the definition of min-max normalisation, the value is divided by max - min, what if the max and min have the same value?

For example, I have an image with n channels and I want to perform min-max normalisation over each channel i.e. $$x_{channel_a} = \frac{x_{channel_a} - min_{channel_a}}{max_{channel_a} - min_{channel_a}}$$

It is possible that only channel a is the same and other channels are different. Does it mean I should drop this channel information? How exactly can I do? What about setting the channel value to 0 if all channel values are the same?

If I drop this value, will it cause any loss of information. For example, I have a image with pixels value in RGB format [12, 23, 34], [12, 25, 87], [12, 182, 230]. Since R channel is the same, I can just drop it and the image become to [0, 23, 34], [0, 25, 87], [0, 182, 230]. Is this correct?

By the way, I am trying to use ResNet-18 to extract the image features.

• 0/0 is undefined – Glen_b Dec 18 '19 at 8:13
• When you are willing to standardize your variables and max==min, you have no information. Equivalently, you may replace the common value by any constant number you wish. – whuber Dec 18 '19 at 14:47
• @Glen_b-ReinstateMonica That is the problem. I am trying to verify is that ok to set the value to any valid constant I want so that I can avoid dividedByZero error. – Dylan Wang Dec 19 '19 at 0:28
• @whuber Thank you for clarifying that. – Dylan Wang Dec 19 '19 at 0:28
• You could make a case for it being any number; 1/2 would be an obvious value to use in some situations, but any other value could be just as meaningful / equally meaningless in another situation. I'd be inclined to just use "missing" (however that's handled in whatever you're using) for those values. – Glen_b Dec 19 '19 at 1:59

If $$\min_i x_i = \max_i x_i$$ then this implies that $$x_1 = \cdots = x_n$$ (i.e., all data values are the same). In that case, there is not really any difference to "normalise". By convention, you would probability set the "normalised" values to $$z_1 = \cdots = z_n = 0$$ in this case, which shifts them to a mean of zero, and retains the property that:
$$z_k (\max_i x_i - \min_i x_i) = x_k - \min_i x_i.$$