random erasing

**Random Erasing in ViT** is a data augmentation technique that randomly masks rectangular patches in input images during Vision Transformer training to improve robustness and reduce overfitting. ## What Is Random Erasing? - **Method**: Replace random image regions with random values or mean pixel - **Parameters**: Probability, area ratio (0.02-0.4), aspect ratio - **Effect**: Forces model to learn from partial information - **Origin**: Zhong et al. 2017, widely adopted in ViT training ## Why Random Erasing Matters ViTs can overfit to specific image regions. Random erasing encourages attention to diverse features and improves generalization. ```svg Random Erasing Example:Original Image: After Random Erasing:┌─────────────────┐ ┌─────────────────┐ 🐱 🐱 Cat face Cat███ ███ Body Body ███████└─────────────────┘ └─────────────────┘Model must recognize cat without erased patches ``` **Random Erasing in ViT Recipe**: ```python transforms.Compose([ transforms.RandomResizedCrop(224), transforms.RandomHorizontalFlip(), transforms.ToTensor(), RandomErasing( probability=0.25, sl=0.02, sh=0.4, # area ratio r1=0.3, # aspect ratio min ), ]) ``` Typical improvement: +0.5-1.5% top-1 accuracy on ImageNet.

Go deeper with CFSGPT

Get AI-powered deep-dives, save terms, and run advanced simulations — free account.

Create Free Account