-
Notifications
You must be signed in to change notification settings - Fork 904
✨ Add CutPaste-based synthetic anomaly generation to anomalib pipeline #3462
Copy link
Copy link
Open
Description
Description
The current synthetic anomaly generation in anomalib primarily relies on Perlin noise-based methods. While efficient, these approaches often lack structural realism and do not capture localized defect patterns commonly observed in industrial settings (e.g., scratches, misalignments, or surface artifacts).
To address this, we propose adding a CutPaste-based synthetic anomaly generator inspired by:
"CutPaste: Self-Supervised Learning for Anomaly Detection and Localization" (CVPR 2021)
Motivation
CutPaste introduces feature-based anomaly generation by copying and pasting patches within the same image. This enables:
- More realistic, localized anomalies
- Better simulation of surface defects (scratches, dents, etc.)
- Improved diversity compared to purely procedural noise
Expected Impact
- Improved realism of synthetic anomalies
- Better alignment with real-world industrial defect patterns
- Increased flexibility for experimentation and benchmarking
Proposed Solution
- Implement a CutPaste-based generator
- Support multiple variants:
- CutPaste-Normal (rectangular patches)
- CutPaste-Scar (elongated scratch-like patches)
- CutPaste-Union (random combination of both)
- Integrate it into the existing synthetic anomaly pipeline
- Ensure compatibility with existing dataset and datamodule APIs
- Provide optional blending and intensity perturbation for improved realism
Alternatives Considered
No response
Additional Context
- The implementation should remain lightweight and CPU-efficient
- Backward compatibility must be preserved (default behavior remains unchanged)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels