I-217Bilateral Filter Trace

Pixel Analysisimage2012

Detects traces of bilateral filtering, an edge-preserving smoothing technique that replaces each pixel with a weighted average of nearby pixels, where the weights depend on both spatial distance and intensity similarity. AI generators and post-processing pipelines frequently use bilateral filtering to smooth flat regions while keeping edges sharp — leaving detectable forensic residuals.

Bilateral Filter Residual Detection via Spatial-Range Kernel Estimation
The bilateral filter (Tomasi & Manduchi, 1998) computes output pixel h(x) = (1/W) Σ f(ξ)·c(ξ,x)·s(f(ξ),f(x)), where c() is a spatial Gaussian kernel and s() is a range (intensity) Gaussian kernel. This dual-kernel design creates a characteristic forensic fingerprint: flat regions become unnaturally uniform (pushed toward local mean), while edges maintain their full gradient — a combination that rarely occurs in optical imaging.The detector operates in three stages: (1) Flat Region Analysis — measures the variance of pixel intensities within detected homogeneous regions; bilateral filtering drives this variance below the camera sensor's expected noise floor. (2) Edge Profile Analysis — examines the gradient profiles perpendicular to detected edges; bilateral filtering produces distinctive 'plateau-cliff' transitions instead of the natural 'smooth roll-off' of optical blur. (3) Spatial-Range Inconsistency — computes the joint histogram of spatial gradient vs. intensity gradient; bilateral-filtered images show an anomalous gap at medium gradients where the range kernel suppresses transitions.The final anomaly score combines these three signals using a weighted Fisher discriminant.
Spatial kernel σ_s estimate: 3–10 pixels
Range kernel σ_r estimate: 10–75 intensity levels

Flat region threshold: variance < 2.0 (8-bit scale)

Edge detection: Canny with adaptive thresholds

Gradient profile sampling: perpendicular to edge, ±15 pixels

Scoring: Fisher discriminant (3 features)
Moderate to High — 72-85% accuracy. Strong bilateral filtering (σ_r > 30) is reliably detected; subtle filtering (σ_r < 15) approaches the noise floor.
• The 'plateau-cliff' edge profile is a highly distinctive and well-characterized forensic signature
• Flat-region variance suppression below sensor noise floor provides a physically grounded detection criterion

• Fast O(n) approximation algorithms exist for real-time bilateral filter estimation

• Robust detection even after moderate JPEG compression (quality > 60)
• Cannot reliably distinguish bilateral filtering from guided filtering or weighted least squares, which produce similar smoothing effects
• Modern 'fast bilateral filter' approximations (e.g., bilateral grid) leave slightly different traces

• Very small kernel sizes (σ_s ≤ 2) produce traces below the detection threshold

• Multiple sequential bilateral passes create a different residual pattern than the single-pass model
Detecting AI post-processing where bilateral filtering was used to smooth generator artifacts, identifying photograph manipulation where smoothing was applied to hide splicing seams, and forensic verification of 'beauty mode' or 'skin smoothing' filters in smartphone photography.