MeshCut data augmentation for deep learning in computer vision

Wei Jiang, Kai Zhang, Nan Wang, Miao YuPLoS 2020

Abstract

To solve overfitting in machine learning, we propose a novel data augmentation method called MeshCut, which uses a mesh-like mask to segment the whole image to achieve more partial diversified information. In our experiments, this strategy outperformed the existing augmentation strategies and achieved state-of-the-art results in a variety of computer vision tasks. MeshCut is also an easy-to-implement strategy that can efficiently improve the performance of the existing convolutional neural network models by a good margin without careful hand-tuning. The performance of such a strategy can be further improved by incorporating it into other augmentation strategies, which can make MeshCut a promising baseline strategy for future data augmentation algorithms.

Introduction

Deep Convolutional Neural Networks (CNNs) often suffer from overfitting due to their massive parameter counts, leading them to "memorize" specific training features rather than learning robust, generalizable representations. While "information occlusion" methods like Cutout (removing a single large square) or GridMask (removing blocks in a regular grid) attempt to mitigate this, they often fail to simulate realistic occlusion or inadvertently delete critical small objects.

MeshCut addresses these shortcomings by superimposing a randomized, mesh-like mask over training images. This "global fragmentation" forces the network to recognize objects from scattered partial features rather than relying on a single dominant patch, significantly enhancing performance across classification, detection, and segmentation tasks.

Methodology: The MeshCut Strategy

The core of MeshCut is a binary mesh mask ($M$) applied to the input image ($I_{in}$) during training. The mask functions as a "mosaic" filter where pixels are either preserved or zeroed out based on a grid pattern.

MeshCut mask application on a fan image, demonstrating how the object is fragmented into multiple partial features.

The strategy relies on three primary hyperparameters:

  1. Line Spacing ($p$): Controls the size of the "holes" or fragments.
  2. Line Width Ratio ($wr$): Determines the thickness of the mesh lines, effectively controlling the amount of information removed.
  3. Intervention Rate ($m_{prob}$): The probability of applying the augmentation to any given training image.

To prevent the model from simply learning the static grid pattern, the mask is randomly shifted and rotated (0° to 360°) for every image. Crucially, MeshCut is a "plug-and-play" training-time intervention; the original, unmasked images are used during inference.

Key Insights and Performance

MeshCut operates on the principle of forcing feature diversity. By breaking an image into many small fragments, the network can no longer rely on a single discriminative feature (e.g., just the beak of a bird). Instead, it must integrate features from across the entire object.

Class Activation Maps (CAMs) showing how MeshCut encourages the network to attend to more distributed regions of the input image.

This approach creates a "harder training" environment. While training loss may increase, validation loss decreases significantly—a hallmark of effective regularization. Using Class Activation Maps (CAMs), researchers observed that models trained with MeshCut look at much larger, more spatially distributed areas compared to baseline models that hyper-focus on small regions.

Experimental Results

MeshCut consistently outperformed existing occlusion methods across multiple benchmarks:

  • ImageNet: Improved ResNet50 top-1 accuracy by 1.8% (to 78.3%) and ResNet101 by 2.1% (to 79.9%).
  • CIFAR-10: Achieved 96.79% accuracy on ResNet18, surpassing both GridMask and Cutout.
  • Object Detection (COCO): Increased mean Average Precision (mAP) for Faster R-CNN by up to 2.3%.
  • Semantic Segmentation (Cityscapes): Improved mean Intersection over Union (mIoU) for PSPNet by 1.0-1.3%.

Conclusion

MeshCut provides a simple yet powerful baseline for data augmentation. While it requires some hyperparameter tuning—as overly fine meshes can hinder feature extraction—its ability to synergize with other techniques like AutoAugment makes it a versatile tool for modern deep learning pipelines. Future work may involve automating the search for optimal mesh parameters to further streamline its application to niche datasets.

Summary updated

BibTeX
@inproceedings{jiang2020meshcut,
  author = {Wei Jiang and Kai Zhang and Nan Wang and Miao Yu},
  title = {{MeshCut data augmentation for deep learning in computer vision}},
  booktitle = {PLoS},
  year = {2020},
  doi = {10.1371/journal.pone.0243613},
}
Figure