Resampling Detection
Detects whether an image was resized or rotated after capture, the geometric step a forger uses to make a pasted region fit. Interpolation leaves a periodic trace in the second derivative of the image: the variance of the second derivative becomes periodic, with the period set by the resampling factor. The indicator reads the spread of that second-derivative variance across blocks and the strength of a periodic peak in the directional second-derivative profile. It works on the pixels alone, with no model.
Technical description
M9 is a deterministic, generator-agnostic screen for resampling. When an image is resized or rotated, each new pixel is interpolated from its neighbours, which introduces a fixed, periodic correlation between pixels. Gallagher showed that this makes the variance of the image's second derivative periodic, with a period equal to the resampling factor, and Popescu and Farid showed that the periodic correlation itself is recoverable and exposes the transform. M9 takes the Laplacian as the discrete second derivative and reads two signals from it. The primary signal is the coefficient of variation of the Laplacian variance measured on 8 by 8 blocks: interpolation modulates the local roughness, so the per-block second-derivative variance spreads more widely than in an unresampled image. The corroborating signal is the strength of a periodic peak in the one-dimensional spectrum of the directional second-derivative profile, the mean absolute Laplacian taken along each axis, which concentrates energy at the resampling period. The image must be at least 64 by 64 pixels, or the indicator returns a zero score and records that it was skipped.
How it works
The grayscale image is filtered with the Laplacian operator to obtain the discrete second derivative. The Laplacian is tiled into 8 by 8 blocks and the variance of each block is taken; with bv the per-block variances, the primary signal is their coefficient of variation,
block_cv = std(bv) / mean(bv).
An unresampled image has a relatively uniform second-derivative variance, while interpolation imposes a periodic smooth-rough modulation that widens the spread, raising the CV.
The corroborating signal is periodicity. The mean absolute Laplacian is taken along each axis to form two profiles, one over columns and one over rows. Each profile is detrended, its real-FFT magnitude is computed, the DC term and the two slowest bins are dropped because they carry only a global trend, and the largest remaining magnitude is expressed in robust standard deviations above the median of the spectrum:
peak_sigma = (max(magnitude) - median) / (1.4826 * MAD).
Interpolation at a fixed factor concentrates energy at one period and produces a large peak_sigma; aperiodic content does not. The maximum over the two axes is taken.
The two signals are combined into a count of evidence units. A block_cv above 0.22 adds 3 and above 0.20 adds 1, and a directional peak sigma above 6.0, a clear interpolation period, adds 2. If the count is zero the score is zero; otherwise the score is min(5.0, 1.0 + 0.5 times the count). A finding reports the block-variance CV and the periodic peak strength when the count is positive. The metadata records the evidence count, the maximum periodic peak sigma, and the block-variance CV.
Score thresholds
| Score | Meaning |
|---|---|
| 0 to 1 | The second-derivative variance is uniform and aperiodic, consistent with an image that was not resampled. |
| 2 to 3 | A widened second-derivative variance, or a periodic interpolation peak, indicating likely resizing or rotation. |
| 4 to 5 | Both a widened variance and a clear periodic interpolation peak. Strong evidence of resampling. |
Why this matters
Resizing and rotation are almost unavoidable when a region is taken from one image and made to fit another, so detecting resampling is a core forensic capability and a direct sign that an image was geometrically edited after capture. The foundational method is that of Popescu and Farid, who recovered the periodic inter-pixel correlations that interpolation creates and read their Fourier spectrum to expose the transform, including the resampling factor [1]. Gallagher established the complementary and computationally light signature M9 builds on, that interpolation makes the variance of the second derivative periodic, detectable as a peak in the spectrum of the row or column profile [2]. Mahdian and Saic generalised the periodicity argument to the derivatives of interpolated signals and turned it into an automatic blind detector of scaling, rotation, and skew, the very operations used when splicing images together [3]. For microscopy this matters because combining fields of view, aligning panels, or matching magnifications all require resampling, and an honest single capture carries none of these traces. M9 reads the periodic fingerprint of interpolation to flag that geometric editing took place.
Limitations
The block-variance signal is content-dependent: a genuinely textured image with strongly varying local roughness can raise the coefficient of variation without resampling, which is why the periodic peak is used as an independent corroborating cue rather than relying on the variance alone. The periodic peak, in turn, is clearest for integer or simple rational resampling factors and for sharp content; a small fractional resize, a heavily noisy image, or strong subsequent compression can weaken or hide it. The thresholds are directional rather than exact, and the screen returns a single global verdict rather than localizing a resampled region. JPEG compression imposes its own 8-pixel periodicity that can interact with the measurement. The general frequency-domain screen for synthetic-generation fingerprints across the whole spectrum is indicator I2; M9 is specific to the periodic interpolation trace left by resizing and rotation in the second derivative, so the two read different frequency structure and corroborate each other.
Theoretical background
M9 rests on the algebra of interpolation. Producing a resampled pixel as a fixed linear combination of its neighbours imposes a deterministic, periodic correlation on the output: every pixel at the same phase of the resampling grid is built by the same rule, so the signal and its derivatives acquire a cyclostationary structure whose period is the resampling factor. The second derivative is the natural place to read this, because differentiation amplifies the high-frequency content where interpolation differs most from a genuine capture, and the variance of the second derivative then oscillates with the resampling period. Two consequences follow. Across space, the local second-derivative variance is no longer uniform but modulated, widening its distribution and raising its coefficient of variation. Along each axis, the averaged magnitude of the second derivative is periodic, so its Fourier spectrum carries a peak at the resampling frequency. An unresampled capture, whose pixels are independent draws from the scene and sensor, has neither the modulation nor the peak. Reading both turns the deterministic periodicity of interpolation into a test of whether the pixels were geometrically transformed after they were recorded.
References
- Popescu AC, Farid H. Exposing digital forgeries by detecting traces of resampling. IEEE Transactions on Signal Processing. 2005;53(2):758-767. DOI: 10.1109/TSP.2004.839932
- Gallagher AC. Detection of linear and cubic interpolation in JPEG compressed images. Proceedings of the 2nd Canadian Conference on Computer and Robot Vision (CRV'05). 2005. DOI: 10.1109/CRV.2005.33
- Mahdian B, Saic S. Blind authentication using periodic properties of interpolation. IEEE Transactions on Information Forensics and Security. 2008;3(3):529-538. https://ieeexplore.ieee.org/document/4540058/