Introducing Grayscale and Hue/Saturation Augmentations
Published Sep 27, 2020 • 3 min read

Roboflow is constantly improving how developers can build better computer vision models based on better input data. One key piece to this puzzle is enabling users to select augmentations that best improve dataset representation through augmentation.

Augmentation creates altered training data based on existing examples. Image augmentation improves model performance, especially on small datasets and in conditions of class imbalance.

Image augmentation techniques for computer vision.
Roboflow supports a wide variety of image augmentation options.

We've recently introduced three new augmentation techniques to improve your model performance. All three modify an image's colors, causing a model to generalize better to objects of various potential input colors.

Grayscale Augmentation

Grayscale augmentation in computer vision.
In Roboflow, select the percentage of images in a training set that should randomly be converted to grayscale.

Grayscale augmentation randomly causes an input image to be converted to a single channel, grayscale output image. This causes a model to place a lower emphasis on color as a signal – which, depending on your problem's context, may be desirable or not. (For example, if you're building a model where detecting an object that is always a single color, grayscale augmentation may not be suitable.)

Unlike grayscale as a preprocessing step, grayscale as an augmentation step randomly applies to a subset of the images in a training dataset. In Roboflow, the user selects the percentage of images to be randomly translated to grayscale (depicted above with a slider), and Roboflow generates a version of this dataset accordingly.

Don't forget to subscribe to our YouTube.

Hue Augmentation

Hue augmentation (altering color) in computer vision.
A user selects a maximum amount of hue augmentation to be applied, and Roboflow randomly applies up to that amount – positively or negatively – to an input training image.

Hue augmentation randomly alters the color channels of an input image, causing a model to consider alternative color schemes for objects and scenes in input images. This technique is useful to ensure a model is not memorizing a given object or scene's colors. While output image colors can appear odd, even bizarre, to human interpretation, hue augmentation helps a model consider the edges and shape of objects rather than only the colors.

Due to its color circle origins, hue is measured radially, meaning input images are altered relative to some amount of degrees plus or minus their starting point. Thus, in Roboflow, a user selects the number of degrees for a hue augmentation, and Roboflow randomly determines (1) the number of degrees between 0 and N, where N is the user selection and (2) whether to positively or negatively apply the hue shift (depicted above with the degree slider).

Saturation Augmentation

Each image will have a random amount of saturation applied or removed up to the max value selected.

Saturation augmentation is similar to hue except that it adjusts how vibrant the image is. A fully desaturated image is grayscale, partially desaturated has muted colors, and a positive saturation shifts colors more towards the primary colors.

Adjusting the saturation of an image can help your model perform better when colors in the wild are different (for example, if a different white-balance is set, different lighting is in effect, or even if it's foggy outside).


With these new color-altering augmentations at your disposal, we're excited to see boosts in your model performance! Try them out.

Cite this Post

Use the following entry to cite this post in your research:

Joseph Nelson. (Sep 27, 2020). Introducing Grayscale and Hue/Saturation Augmentations. Roboflow Blog: https://blog.roboflow.com/introducing-grayscale-and-hue-augmentations/

Discuss this Post

If you have any questions about this blog post, start a discussion on the Roboflow Forum.

Written by

Joseph Nelson
Roboflow cofounder and CEO. On a mission to transform every industry by democratizing computer vision. Previously founded and sold a machine learning company.