ResAIKit
Research Integrity Toolkit
Back to the encyclopedia
I5Image forensicsGeneric ForensicsLayer 1 (Deterministic)

Histogram Analysis

Analyzes the distribution of pixel brightness values in each color channel. Manipulated images often show unnatural gaps, spikes, or patterns in their brightness distributions.

Technical description

Reads two colour-statistic signals. Per-channel Shannon entropy H = -sum p_i log2(p_i) of each 256-bin histogram: a natural channel scores 5 to 7 bits, and each channel contributes max(0, (3 - H)/3) (capped at 3.0 total), rising as the palette flattens. The saturation cue (McCloskey and Albright): from the HSV saturation S and value V, evaluated only when the median saturation exceeds 0.15, it measures the deficit of highly-saturated pixels (S > 0.9, floor 0.02) and clipped pixels (V > 0.98 or V < 0.02, floor 0.005); the score is min(2.0, 2.0 * sat_deficit * clip_deficit), firing only when both extremes are absent. The two contributions sum to a score capped at 5.0.

How it works

Layer 1 (deterministic). Computes the per-channel histogram entropy and, from the HSV saturation and value, the saturation cue conditioned on the image carrying real colour. Sums the entropy and saturation contributions, caps at 5.0, and reports the three channel entropies, the median saturation, the highly-saturated-pixel fraction, and the clipped-pixel fraction.

Why this matters

Colour statistics are a strong cue for synthetic images. A generative network normalises its activations and so underproduces both the highly-saturated colours and the clipped highlights a real sensor records through saturation, making the frequency of saturated and over-exposed pixels separate generated from camera imagery (McCloskey and Albright). The broader point that real and synthetic images differ in colour distribution recurs across the literature (co-occurrence statistics, colour and autocorrelation differences for GANs and diffusion). Entropy captures the complementary case of a flat or posterised palette.

Score thresholds

0-1
Natural colour spread with saturated and clipped extremes present
2-3
One signal: a flat or near-monochrome palette, or a colourful image lacking saturated and clipped extremes
4-5
Both signals together, consistent with a synthetic or heavily processed palette

Limitations

Both signals are directional. Low entropy is normal for legitimately simple images (logos, diagrams, screenshots, flat graphics), so it must be read alongside the others. The saturation cue is conservative (both extremes must be absent) but a genuinely soft, hazy, or toned-down photograph can still trip it, and a generated image colour-graded to add saturation or clipping will pass. Histogram-comb and tone-curve gaps live in the tone-curve indicator, local intensity-range anomalies in the local-histogram indicator, and frequency and noise fingerprints elsewhere.

References

  1. McCloskey S, Albright M. (2019). Detecting GAN-Generated Imagery Using Saturation Cues. IEEE ICIP 2019, p.4584-4588 (arXiv:1812.08247)
  2. Nataraj L, Mohammed TM, Chandrasekaran S, Flenner A, Bappy JH, Roy-Chowdhury AK, Manjunath BS. (2019). Detecting GAN generated Fake Images using Co-occurrence Matrices. arXiv:1903.06836
  3. Corvi R, Cozzolino D, Poggi G, Nagano K, Verdoliva L. (2023). Intriguing properties of synthetic images: from generative adversarial networks to diffusion models. IEEE/CVF CVPR Workshops 2023 (arXiv:2304.06408)
  4. Verdoliva L. (2020). Media Forensics and DeepFakes: An Overview. IEEE Journal of Selected Topics in Signal Processing 14(5):910-932