Home > Enterprise >  Difference between channel_shift_range and brightness_range in ImageDataGenerator (Keras)?
Difference between channel_shift_range and brightness_range in ImageDataGenerator (Keras)?

Time:01-02

There are multiple pages (like Example of channel_shift_range application.

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.

CodePudding user response:

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.

  • Related