Local Histogram Consistency
Detects localized brightness manipulation, content erasure, and splice seams by checking whether local contrast and tonal response stay consistent across the image. Erased regions become abnormally uniform, pasted patches carry foreign contrast, and a splice produces an abrupt change in local dynamic range.
Technical description
Reproduces two Office of Research Integrity (ORI) examination procedures: local histogram (dynamic-range) inconsistency and the forensic gradient map. The grayscale image is tiled into overlapping blocks of side B = 16 px on a stride of 8 px. Each block's robust dynamic range uses the 5th and 95th percentiles, r = P95(block) - P5(block), which ignores single hot or dead pixels. The image reference is median_range = median({r}), with a coefficient of variation (CV) = std({r}) / median_range. Signal A flags three sets. A fill or erasure block satisfies median_range > 15 and r < 0.12*median_range and r < 10 (near-uniform in both relative and absolute terms). A contrast-spike block satisfies r > 3.5*median_range. A splice boundary is found by an 8-neighbour z-score z = |r - mu_n| / sigma_n > 2.5, promoted to a seam only when at least two boundary candidates are consecutive in the same grid row or column. Signal B applies the solarize tent map solarize(p) = p if p < 128 else 255 - p, summarises each block by its solarized mean sm, and flags a gradient-map anomaly when the neighbourhood carries signal (sigma_s > 5.0) and z = |sm - mu_s| / sigma_s > 1.5. With ratios fill_ratio, splice_ratio, solar_ratio over the block count, the score = min(5.0, fill_ratio*fill_weight + splice_ratio*15 + solar_ratio*10 + n_spike*0.3), where fill_weight is 25.0 but drops to 5.0 when more than 20 percent of blocks are uniform fill, so natural chart and diagram whitespace is not scored as erasure.
How it works
Layer 1 (deterministic). Converts the image to grayscale, tiles it into overlapping 16x16 blocks (stride 8), and computes each block's robust dynamic range from the 5th and 95th percentiles. Signal A compares every block to the image-wide median (near-uniform fill blocks and contrast spikes) and to its 8 neighbours (splice-boundary z-score with a 2-consecutive line requirement). Signal B compares each block's solarized mean to its neighbourhood to surface subtle mid-tone retouching. The anomaly counts are normalised to ratios and combined into the 0 to 5 score, with a chart-whitespace discount. Reports total_blocks, fill_blocks, splice_blocks, solar_blocks, contrast_spike_blocks, median_range, and the range coefficient of variation (mean_range_cv).
Why this matters
Image manipulation is among the most common forms of misconduct in the experimental life sciences, where blots, gels, and micrographs are the primary evidence for a claim. A screen of 20,621 papers found 3.8 percent contained problematic figures, at least half with features consistent with deliberate manipulation, and the prevalence rose over the surveyed decade. The operations this indicator targets, erasing or whitening unwanted features and splicing foreign content into a panel, are exactly the actions the foundational guidance on scientific image handling identifies as inappropriate changes to original data. Such edits are matched visually to their surroundings and are invisible to the eye, but they leave statistical traces in local dynamic range that the ORI examination procedures reproduced here were designed to make visible.
Score thresholds
- 0-1
- Local dynamic range and gradient-map response are consistent, or uniform regions are explained by a natural background
- 2-3
- Some localized anomalies: a few fill blocks, isolated contrast spikes, or a short boundary segment to inspect
- 4-5
- Strong evidence of localized manipulation: many erasure or spike blocks, a confirmed splice line, or multiple gradient anomalies
Limitations
The block scale is fixed, so manipulations much smaller than a 16-pixel block, or feathered edits spread across many blocks, weaken the per-block signature. Heavy lossy compression and aggressive denoising both flatten local dynamic range and can mimic erasure or mask a splice. The two-consecutive line requirement for seams is deliberately crude and can miss short or diagonal boundaries while occasionally promoting a strong natural edge. The forensic gradient map is a sensitivity amplifier, not a classifier, so legitimate gradients such as fluorescence falloff are reported as warnings for human review. The chart-whitespace discount keys on the global fraction of uniform blocks, so a mostly-solid image with a single small erasure receives a reduced fill weight and a lower score.
References
- Krueger J. (2002). Forensic Examination of Questioned Scientific Images. Accountability in Research 9(2):105-125. See also ORI Forensic Tools, https://ori.hhs.gov/forensic-tools
- Rossner M, Yamada KM. (2004). What's in a picture? The temptation of image manipulation. Journal of Cell Biology 166(1):11-15
- Bik EM, Casadevall A, Fang FC. (2016). The Prevalence of Inappropriate Image Duplication in Biomedical Research Publications. mBio 7(3):e00809-16
- Cromey DW. (2010). Avoiding Twisted Pixels: Ethical Guidelines for the Appropriate Use and Manipulation of Scientific Digital Images. Science and Engineering Ethics 16(4):639-667