During offline data augmentation for a convolutional neural network that must locate hairline cracks on metal parts, captured images occasionally contain impulse (salt-and-pepper) noise introduced by electromagnetic interference in the factory. You want to create a second, denoised version of each training image that removes most of this noise without softening the extremely fine crack edges. Which filter-based augmentation is the most appropriate choice for this requirement?
Apply a Gaussian blur with a randomly sampled σ between 1.0 and 2.0 pixels.
Apply a random median filter using an odd kernel size between 3 × 3 and 7 × 7 pixels.
Add uniform random noise to up to 5 % of the image's pixels.
Apply a Laplacian sharpening filter and then perform histogram equalization.
A median filter is a non-linear operation that replaces each pixel with the median value in a local neighborhood. Because the median statistic is robust to outliers, the filter suppresses salt-and-pepper (impulse) noise while largely preserving edge information-exactly the combination needed when the goal is to keep hairline cracks visible but eliminate spurious bright or dark pixels.
Gaussian blur (a linear, low-pass filter) would indeed remove noise, but it also reduces high-frequency detail and would blur the thin cracks the model must learn. A Laplacian sharpening filter enhances edges yet does nothing to remove impulse noise, so the noise would remain (and might even be amplified). Adding uniform noise simply injects additional corruption rather than delivering a denoised reference image. Therefore, the median-filtered augmentation is the only option that meets both objectives: impulse-noise removal and edge preservation.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a median filter, and how does it work?
Open an interactive chat with Bash
Why is impulse (salt-and-pepper) noise best handled by a median filter?
Open an interactive chat with Bash
How does a Gaussian blur differ from a median filter in their effects on edges?