Cutout<T>

Models & Types · AiDotNet.Augmentation.Image

Randomly masks out (cuts out) rectangular regions of an image.

Inheritance: AugmentationBase<T, ImageTensor<T>> → Cutout<T>

For Beginners

Imagine covering parts of a photo with sticky notes. If you can still recognize what’s in the photo with pieces hidden, you understand the whole object better, not just one specific feature. Cutout does this automatically during training, teaching the model to recognize objects even when parts are obscured.

How It Works

Cutout is a regularization technique that randomly removes rectangular patches from training images by filling them with a constant value (usually gray or black). This forces the model to focus on multiple parts of the object rather than relying on a single distinctive feature, improving robustness and generalization.

When to use:

  • Image classification where objects might be partially occluded
  • When you want to prevent the model from overfitting to specific features
  • As a regularization technique to improve generalization

When NOT to use:

  • Object detection or segmentation (might remove the entire object)
  • When fine-grained features are crucial for classification
  • Very small images where cutout would remove too much information

Constructors

Constructor Summary
Cutout(int numberOfHoles, int minHoleHeight, int maxHoleHeight, int minHoleWidth, int maxHoleWidth, T fillValue, double probability) Creates a new cutout augmentation.

Properties

Property Summary
T FillValue { get; } Gets the fill value for the cutout regions.
int MaxHoleHeight { get; } Gets the maximum height of each hole.
int MaxHoleWidth { get; } Gets the maximum width of each hole.
int MinHoleHeight { get; } Gets the minimum height of each hole.
int MinHoleWidth { get; } Gets the minimum width of each hole.
int NumberOfHoles { get; } Gets the number of rectangular holes to cut out.

Methods

Method Summary
IDictionary<string, object> GetParameters()