Applying data augmentations is one of the most essential steps when developing your dataset. Roboflow offers a wide variety of augmentations that you can apply to your dataset including an augmentation called the cutout augmentation. In this blog you will learn:
- What cutout augmentations are
- When you should use cutout augmentations
- How to use cutout augmentations in Roboflow
What are Cutout Augmentations?
Cutout is an augmentation technique, introduced in the YOLOv4 paper, that randomly covers a region of an input image with a square.
This achieves two primary objectives:
- Helps in training models to recognize partial or occuluded objects (i.e. objects behind one another)
- The model analyzes the image in a holistic fashion by considering more of the image context (such as minor features) before making a decision
When Should You Use Cutout Augmentations?
Cutout augmentations are great when you have a computer vision problem that requires your model to detect objects that may overlap one another. For example, if you are applying object detection to a video stream with a flock of birds, you may use cutout augmentations to help your model differentiate birds that overlap with other birds because your model will now focus on birds that appear partially. Below is an instance where cutout augmentations may assist your model in detecting all of the target objects:
Cutout augmentations also have applications when other, minor details of an object need to be considered when making a decision rather than relying on major details of an object. For example, when trying to detect American flags, your model may rely heavily on the stars. However, by covering up the stars in some of the images through a cutout agumentation, you model starts to learn about the stripes. This allows your model to learn about other details aside from the stars, improving its overall performance.
Using Cutout Augmentations in Roboflow
Applying cutout augmentations can be very time consuming and oftentimes, results in hundreds of new lines of code being written. Fortunately, Roboflow provides tools to apply image augmentations to the dataset including cutout augmentations!
Applying a cutout augmentation in Roboflow is very easy! Simply open up a Roboflow project and create a new version. In the augmentation step, select "Cutout":
After this, you will see two settings to configure the cutout augmentation: percent and count.
- Percent: Percent refers to the size of the cutout in relation to the image (i.e. 50% percent for the cutout augmentation would mean each cutout would be 50% the total size of the image)
- Count: Count refers the number of cutouts per image (i.e. a count of 3 means there would be 3 black squares in the augmented image.)
Below the original image you can see what a sample augmentation with cutout augmentations applied looks like. After this, press apply and your cutout augmentations will be applied to the dataset after you finalize and generate the new version.
Conclusion
Cutout augmentations are a powerful way to make your dataset more versatile. To summarize:
- Cutout is an augmentation technique that randomly covers a region of an input image with a square.
- Cutout helps in training models to recognize partial or occuluded objects
- Cutout allows the model to consider more of the image context such as minor features rather than relying heavily on major features before making a decision
- Roboflow offers easy ways to apply cutout augmentations and adjust cutout settings such as the percent size of the cutout and the number of cutouts.
Cite this Post
Use the following entry to cite this post in your research:
Samrat Sahoo. (May 24, 2021). What is a Cutout Augmentation and When Can it Help?. Roboflow Blog: https://blog.roboflow.com/what-is-cutout-augmentation-and-when-can-it-help/
Discuss this Post
If you have any questions about this blog post, start a discussion on the Roboflow Forum.