RPCP: Copy-and-Paste Augmentation for Rare Segmentation
- RPCP is a targeted augmentation strategy designed to improve semantic segmentation in imbalanced wheat images by inserting rare insect-damage patches into healthy regions.
- It employs random geometric transformations and spatial constraints to ensure that pasted patches blend naturally and maintain semantic validity.
- The method consistently boosts performance on rare insect-damage classes across various segmentation models without degrading common-class accuracy.
Searching arXiv for the specified paper to ground the article and citation. Random Projected Copy-and-Paste (RPCP) is a targeted data-augmentation technique for semantic segmentation under extreme pixel-level imbalance, introduced for wheat foliar disease and insect-damage segmentation. In the studied setting, insect damage occupies only a tiny fraction of annotated pixels, so optimization is biased toward dominant classes such as healthy leaf tissue. RPCP addresses this by extracting annotated rare-class patches, applying random geometric transformations, pasting them into semantically valid healthy-leaf regions while avoiding overlap with lesions or existing damage, and then refining only the pasted region with a localized random projection filter. On the STB wheat dataset, the method substantially improves segmentation of the rare insect-damage class while maintaining, and in some cases slightly enhancing, performance on common classes (Wei et al., 12 Sep 2025).
1. Problem setting and the nature of pixel-level imbalance
The underlying task is semantic segmentation of wheat foliar disease and insect damage. Given an RGB image , the objective is to predict a dense label map
assigning a semantic class to each pixel. The dataset considered contains three classes: healthy leaf, leaf necrosis / STB lesion, and insect damage (Wei et al., 12 Sep 2025).
The imbalance is explicitly described as strongly long-tailed at the pixel level rather than merely at the image level. Healthy leaf pixels dominate the distribution, lesion pixels are moderate, and insect-damage pixels are extremely rare. This distinction is operationally important: a dataset may contain images with insect damage while still providing too few insect-damage pixels for stable representation learning. The paper attributes several failure modes to this condition, including biased optimization, overfitting to dominant classes, and insufficient learning of rare-class features.
A common misconception is that high segmentation scores on the dominant classes imply robust dense prediction overall. The reported setting contradicts that assumption. Even strong models such as SegFormer can obtain high scores on common classes while remaining weaker on insect-damage regions. In this formulation, the central difficulty is not merely recognizing the presence of the rare class, but learning sufficiently diverse and robust local representations from very sparse supervisory signal.
2. RPCP workflow and operational design
RPCP consists of two stages: copy-and-paste of rare insect-damage patches and local random-projection refinement of the pasted regions. The method begins with category-aware patch extraction: annotated insect-damage regions are identified in training images, cropped into patches, and paired with corresponding binary masks to form a pool of rare-class exemplars (Wei et al., 12 Sep 2025).
Each selected patch then undergoes random geometric transformation. The paper specifies random rotation and random scaling, with transformation parameters denoted by
where is the paste location, is the scaling factor, and is the rotation angle. These transformations are intended to simulate natural variability so that augmented instances do not appear as exact duplicates.
Placement is spatially constrained. Patches are pasted only into appropriate regions, specifically healthy leaf regions, while avoiding overlap with lesions or existing damaged regions. This design preserves semantic consistency and prevents artificial class conflicts. The augmentation is therefore not arbitrary copy-and-paste; it is constrained by the label structure of the target image.
The paste operation is mask-based. Let denote the transformed patch, the transformed binary mask, and the target image. The augmented image and updated labels 0 are defined as
1
Inside the pasted mask, the patch content and its label are used; outside the mask, the original image and labels are preserved.
This workflow indicates that RPCP is a rare-class-oriented augmentation strategy rather than a generic photometric perturbation. Its purpose is to increase both the amount and the diversity of insect-damage pixels while preserving the semantic coherence of the training data.
3. Random projection refinement and mathematical formulation
The paper argues that pure copy-and-paste may introduce abrupt texture changes, boundary artifacts, and inconsistent color or texture statistics relative to the surrounding leaf. RPCP addresses this with a second stage termed Damage Pixel Random Projection, which modifies only the pasted insect-damage region (Wei et al., 12 Sep 2025).
Given the augmented image 2 and patch mask 3, a random projection filter is generated as
4
where 5 controls perturbation magnitude. The perturbed image is
6
with 7 denoting convolution.
The filtered image is then blended only inside the pasted mask according to
8
Here 9 is the blending coefficient. Inside the pasted region, the refinement introduces localized texture and color variation; outside the mask, the image remains unchanged. The method is therefore region-wise rather than global.
The training objective is standard pixel-wise cross-entropy over augmented batches 0: 1 where 2.
Within this formulation, copy-and-paste and random projection serve distinct roles. Copy-and-paste increases rare-class exposure, whereas random projection is intended to reduce synthetic appearance and improve compatibility with surrounding leaf context. The paper presents the combination as more effective than either unaugmented training or copy-paste alone.
4. Experimental framework
The experiments are conducted on the STB dataset from Zenkl et al. (2025), described as containing 422 RGB images at resolution 3, with pixel-wise annotations for healthy leaf, necrotic tissue / STB lesions, and insect damage. The dataset is explicitly characterized as highly imbalanced, with sparse insect-damage pixels (Wei et al., 12 Sep 2025).
RPCP is evaluated on a diverse set of segmentation backbones: DeepLabV3, DeepLabV3+, PSPNet, CCNet, SAN, SegFormer, ConvNeXt, and SegNeXt. Because both CNN-based and transformer-based architectures are included, the method is presented as model-agnostic.
Implementation uses MMSegmentation built on PyTorch. Optimization employs AdamW, with learning rates in the range
4
weight decay values in
5
and batch sizes in
6
Standard preprocessing and augmentation include random resize over scale range 7, random crop to 8, horizontal flip with probability 9, and color jittering. RPCP is added on top of this pipeline.
Evaluation uses class-wise intersection over union and accuracy: 0 with overall metrics
1
5. Quantitative performance
The central empirical finding is that RPCP consistently improves the rare Class 3, insect damage, across all evaluated backbones (Wei et al., 12 Sep 2025).
| Model | Class 3 IoU | Class 3 Acc |
|---|---|---|
| DeepLabV3 | 2 3 | 4 5 |
| DeepLabV3+ | 6 7 | 8 9 |
| PSPNet | 0 1 | 2 3 |
| CCNet | 4 5 | 6 7 |
| SAN | 8 9 | 0 1 |
| SegFormer | 2 3 | 4 5 |
| ConvNeXt | 6 7 | 8 9 |
| SegNeXt | 0 1 | 2 3 |
The effect on common classes is reported as small and generally favorable. Healthy leaf changes are often within about 4, lesion performance is usually stable or slightly improved, and only a few cases show tiny drops in one metric. The overall trend is that rare-class gains do not come at the cost of materially degraded common-class performance.
SegFormer provides one of the clearest summaries of overall benefit, with
5
and
6
A caveat is also reported: ConvNeXt shows a slight degradation in overall mAcc. This indicates that the method is not uniformly beneficial for every backbone-metric combination, even though the dominant empirical pattern is positive.
6. Ablation evidence and parameter sensitivity
The paper isolates the contributions of copy-paste (CP) and random projection (RP) through ablation on SegNeXt (Wei et al., 12 Sep 2025). With neither CP nor RP, Class 3 IoU is 7, Class 3 Acc is 8, mIoU is 9, and mAcc is 0. Enabling CP while disabling RP yields Class 3 IoU 1, Class 3 Acc 2, mIoU 3, and mAcc 4. Enabling both CP and RP yields the best values: Class 3 IoU 5, Class 3 Acc 6, mIoU 7, and mAcc 8.
These results separate the roles of the two components. CP alone helps by inserting more rare-class pixels into training, whereas RP adds further gains beyond simple copy-paste. The reported interpretation is that RP makes pasted patches more realistic and reduces artifacts.
Sensitivity studies further constrain the effective regime of the method. Best performance is achieved with 1 pasted patch per image; 2 patches is still good, but more patches eventually hurt performance. For the random projection filter, the best size is 9; larger filters increasingly oversmooth and reduce performance. The best perturbation magnitude is 0; if perturbation is too weak, refinement is insufficient, whereas excessively strong perturbation distorts the image too much. The best blending coefficient is 1; increasing blending helps up to a point, but 2 hurts because it can override background context.
A plausible implication is that RPCP is effective when augmentation remains moderate and spatially credible. The reported failures under excessive patch count, oversmoothing filters, or overly aggressive blending are consistent with that interpretation.
7. Scope, limitations, and possible extensions
The paper concludes that RPCP is a rare-class-oriented augmentation strategy for pixel-level imbalance, is model-agnostic, is easy to integrate into existing segmentation pipelines, and is beneficial for wheat disease and pest segmentation (Wei et al., 12 Sep 2025). The strongest evidence supporting these claims is the consistent improvement in insect-damage segmentation across multiple backbones without material harm to common-class performance.
Several limitations are implied by the reported experiments. Too much copy-paste can hurt performance, so augmentation intensity must remain moderate. Hyperparameters matter: filter size, blending coefficient, and perturbation magnitude all affect outcomes, and overly strong random projection can degrade segmentation. Effects are partly backbone-dependent, as shown by the slight overall decline in one ConvNeXt metric. Generality is also only directly established on the STB wheat dataset; broader validation across additional crops, diseases, pests, or field conditions would strengthen external validity.
The paper further suggests that RPCP is promising as a scalable augmentation framework. This suggests possible extension to other agricultural segmentation tasks, other rare disease or pest classes, and other imbalance regimes beyond wheat. A plausible implication is that the method could transfer to dense prediction settings in which small, sparse, semantically constrained regions are difficult to learn, provided that suitable rare-class extraction, placement constraints, and localized refinement can be defined.