gridmix
**GridMix** is a **data augmentation technique that divides images into a grid and randomly assigns each cell to one of two training images** — creating a checkerboard-like mixing pattern that distributes information from both images evenly across the spatial dimensions.
**How Does GridMix Work?**
- **Grid**: Divide the image into an $n imes n$ grid of cells.
- **Assignment**: Randomly assign each cell to image $A$ or image $B$ with probability $lambda$.
- **Mix**: Fill each cell with the corresponding region from the assigned image.
- **Labels**: Mixed proportionally to the number of cells assigned to each image.
**Why It Matters**
- **Spatial Distribution**: Unlike CutMix (single contiguous region), GridMix distributes both images across the entire spatial extent.
- **Multiple Regions**: Forces the model to handle multiple disjoint regions from each class simultaneously.
- **Complementary**: Can be combined with other augmentation strategies.
**GridMix** is **checkerboard image mixing** — distributing both images across a grid for spatially diverse data augmentation.