3

There are multiple pages (like this and this) that present examples about the effect of channel_shift_range in images. At first glance, it appears as if the images have only had a change in brightness applied.

Example of channel_shift_range application.

This issue has multiple comments mentioning this observation. So, if channel_shift_range and brightness_range do the same, why do they both exist?

Tedpac
  • 862
  • 6
  • 14

2 Answers2

4

After long hours of reverse engineering, I found that:

  • channel_shift_range: applies the (R + i, G + i, B + i) operation to all pixels in an image, where i is an integer value within the range [0, 255].
  • brightness_range: applies the (R * f, G * f, B * f) operation to all pixels in an image, where f is a float value around 1.0.

Both parameters are related to brightness, however, I found a very interesting difference: the operation applied by channel_shift_range roughly preserves the contrast of an image, while the operation applied by brightness_range roughly multiply the contrast of an image by f and roughly preserves its saturation. It is important to note that these conclusions could not be fulfilled for large values of i and f, since the brightness of the image will be intense and it will have lost much of its information.

Tedpac
  • 862
  • 6
  • 14
1

Channel shift and Brightness change are completely different.

Channel Shift: Channel shift changes the color saturation level(eg. light Red/dark red) of pixels by changing the [R,G,B] channels of the input image. Channel shift is used to introduce the color augmentation in the dataset so as to make the model learn color based features irrespective of its saturation value. Below is the example of Channel shift from mentioned the article: Fig. 1 In the above image, if you observe carefully, objects(specially cloud region) are still clearly visible and distinguishable from their neighboring regions even after channel shift augmentation.

Brightness change: Brightness level of the image explains the light intensity throughout the image and used to add under exposure and over exposure augmentation in the dataset. Below is the example of Brightness augmentation: enter image description here In the above image, at low brightness value objects(eg. clouds) have lost their visibility due to low light intensity level.

flamelite
  • 2,654
  • 3
  • 22
  • 42
  • Sorry but this answer is partially incorrect, since channel shift does not serve to consistently change the saturation of the image. – Tedpac Jan 02 '22 at 07:32