tensorflowimage-processingkerascomputer-visionimage-augmentation

Difference between channel_shift_range and brightness_range in ImageDataGenerator (Keras)?


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?


Solution

  • After long hours of reverse engineering, I found that:

    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.