I-202Spectral Flatness Measure

Frequency Analysisimage2008

Computes spectral flatness (Wiener entropy) to distinguish noise-like AI spectrum from natural image spectra (Johnston, 1988).

Spectral Flatness Computation
This method computes the spectral flatness measure (SFM), also known as Wiener entropy, to characterize how noise-like or tonal an image's frequency spectrum is, providing a discriminative feature for AI-generated image detection:\n\n1. Spectral Flatness Computation: The 2D DFT of the image is computed, yielding the power spectrum P(u,v). The spectral flatness is defined as the ratio of the geometric mean to the arithmetic mean of the power spectrum: SFM = (∏ P(u,v))^(1/N) / ((1/N) Σ P(u,v)), where the product and sum are over all N frequency bins. SFM ranges from 0 (purely tonal, all energy at one frequency) to 1 (white noise, uniform energy). Natural images have SFM ≈ 0.01–0.05 due to their 1/f² spectral structure.\n\n2. Band-Specific Spectral Flatness: The method computes SFM separately for different frequency bands: SFM_low (0–f_N/4), SFM_mid (f_N/4–f_N/2), and SFM_high (f_N/2–f_N). Natural images show increasing SFM with frequency (higher bands are more noise-like). GAN-generated images often show abnormally low SFM_high (spectral dropout at high frequencies from upsampling) or abnormally high SFM_low (more uniform energy distribution at low frequencies). The ratio SFM_high/SFM_low provides a compact discriminative feature.\n\n3. Local Spectral Flatness Map: The image is divided into overlapping blocks, and SFM is computed per block. This creates a spatial map of spectral flatness. In natural photographs, SFM varies with content: textured regions have higher SFM (more uniform spectrum) while smooth regions have lower SFM (dominated by low frequencies). Manipulated regions that break this content-dependent pattern are identified as anomalies.\n\n4. Directional Spectral Flatness: For detecting orientation-specific spectral anomalies, the method computes directional SFM by taking 1D slices of the 2D power spectrum at orientations θ ∈ {0°, 45°, 90°, 135°}. The ratio of directional SFM values reveals anisotropic spectral properties. Neural network-generated images with transposed convolution artifacts show lower SFM at 0° and 90° (horizontal/vertical spectral peaks) compared to diagonal orientations, creating a characteristic 'cross' pattern in directional SFM space.
DFT size: image dimensions\nFrequency bands: low [0, f_N/4], mid [f_N/4, f_N/2], high [f_N/2, f_N]\nBlock size for local SFM: 64×64 pixels\nBlock overlap: 50%\nDirectional slices: 4 (0°, 45°, 90°, 135°)\nExpected natural SFM range: 0.01–0.05 (global)\nMinimum image size: 64×64 pixels
80–88% accuracy for AI-generated image detection using spectral flatness features. Band-specific SFM ratio achieves AUC of 0.87 for GAN detection. Directional SFM detects transposed convolution artifacts with 85% accuracy. Combined SFM features achieve F1-score of 0.84. Performance is best on GAN outputs and weakest on diffusion model images.
• Spectral flatness is a single scalar that compactly characterizes frequency distribution\n• Band-specific analysis targets known spectral deficiencies in AI generators\n• Directional SFM captures architecture-specific artifacts (transposed convolution)\n• Computationally efficient — requires only one FFT per block\n• Well-established measure from signal processing theory
• SFM alone has limited discriminative power — best combined with other spectral features\n• Natural images with very uniform textures (sand, grass) have high SFM similar to noise\n• JPEG compression alters the spectral flatness, particularly at high frequencies\n• Modern AI generators with improved spectral properties produce near-natural SFM values\n• Very small images produce unreliable SFM estimates due to limited frequency resolution
Detecting AI-generated images through spectral uniformity analysis. Identifying GAN outputs with characteristic spectral flatness anomalies. Measuring the 'naturalness' of image frequency content. Feature extraction for multi-signal forensic classification pipelines.