ResAIKit
Research Integrity Toolkit
Back to the encyclopedia
G10-imgImage forensicsChart AnalysisLayer 1 (Deterministic)

Post-hoc Editing

Screens a chart for after-the-fact edits to its own content: a label or number whose compression history is inconsistent with the other text (an edited or spliced value), a block deliberately blurred to hide an edit, and colors foreign to the chart's palette (a pasted element). It targets the chart's semantic elements, complementing the whole-image forensics indicators, and works from the pixels and optical character recognition (OCR) alone, with no model.

Technical description

G10 is a deterministic screen for localized manipulation of a chart's content. Where the general image-forensics indicators scan the whole frame, G10 focuses on the parts of a chart a manipulator changes: the printed numbers and labels, and small pasted or concealed regions. It combines three signals. The first recompresses the image and compares the Error Level Analysis (ELA) residual of each OCR-detected text region to the others, so a label whose compression history differs from its neighbours stands out as edited or spliced. The second flags a block whose Laplacian variance is far below its sharp neighbours, the signature of deliberate blurring. The third flags blocks whose mean color is far from the chart's dominant palette, the signature of a pasted or painted-over element. The signals sum to a 0 to 5 score (capped). It requires the image to be at least 32 by 32 pixels.

How it works

The indicator runs deterministically at Layer 1 using extract_text_regions (OCR) and get_dominant_colors, with I the RGB image as a pixel array.

The text-localized editing signal looks for a chart label whose compression history differs from the others. The image is recompressed as JPEG at quality 95 to give I', and the Error Level Analysis (ELA) residual map is D(x, y) = (1/3) Σ_{c in {R,G,B}} |I_c(x, y) − I'_c(x, y)|. For each OCR text region of at least 4 by 4 pixels, the residual is ρ_r = mean of D over the region's bounding box. With at least four regions, robust outliers are found from the median m = median(ρ) and the median absolute deviation MAD = median(|ρ − m|): a region is an outlier when |ρ_r − m| > 2.0 and the robust z-score |ρ_r − m| / (1.4826 · MAD) > 3.5, where the factor 1.4826 rescales the MAD to a standard-deviation estimate; when the residuals are near-identical (MAD close to 0) any departure above 2.0 is flagged. Each outlier region is reported as an edited or spliced label, and the count o of outliers contributes min(2.5, 1.25 · o). Comparing text regions to each other, rather than to the whole image, isolates an edited number while controlling for the fact that text is intrinsically higher-residual than background.

The localized-blur signal looks for a region deliberately smoothed to hide an edit. The grayscale image is tiled into 16 by 16 blocks, and for each block B the Laplacian L = ∇²B is computed by convolution with the kernel [[0, 1, 0], [1, −4, 1], [0, 1, 0]], and its variance v_B = Var(L) is taken as a sharpness measure. With v̄ the mean block variance, a block is an isolated blurred region when v_B < v̄ / 3 while all four orthogonal neighbours exceed v̄ / 3; one or more such blocks contributes 1.5.

The color-consistency signal looks for a pasted element foreign to the chart palette. The dominant palette {P_1, ..., P_5} is extracted by k-means in RGB, and for each block its mean color μ_B is compared to the nearest palette color by the Euclidean distance dist_B = min_k ‖μ_B − P_k‖_2. With the block distances having mean μ_d and standard deviation σ_d, a block whose distance exceeds max(μ_d + 2 · σ_d, 30) is a color outlier; one or more contributes 1.0.

The three contributions are summed and reported as min(5.0, total). The metadata records the number of text regions analysed, the edited-text-region count, the isolated-blur block count, and the color-outlier block count.

Score thresholds

Score Meaning
0 to 1 Consistent compression across the chart's text, uniform sharpness, colors within the palette. No sign of local editing.
2 to 3 One signal: a text region with an inconsistent compression history, an isolated blurred block, or a foreign-color block.
4 to 5 Several signals together, such as an edited label that is also blurred or pasted in a foreign color. Consistent with post-hoc editing.

Why this matters

Editing a chart after the fact, changing a number, pasting a different bar, painting over a label, leaves localized traces even when the result looks seamless. Error Level Analysis, introduced by Krawetz, exposes these traces by recompressing the image: regions with a different compression history show anomalous residuals, which makes ELA a standard tool for splicing, copy-move, and retouching detection [1]. Splicing in particular is the most common and least-studied manipulation of scientific figures, and recent work localizes it precisely by reasoning about texture and artifact inconsistencies between regions [2]. The growing wave of image misconduct in biomedical publications, from duplication to splicing to inappropriate alteration, has made automated screening a priority [4], and ELA combined with other cues remains a practical front-line method [3]. G10 applies this logic where charts are actually manipulated: an edited number is a small region re-encoded into the figure, so its compression history diverges from the surrounding text, and a pasted element introduces a foreign color or a tell-tale blur. By comparing the chart's own text regions to each other, the indicator turns a general forensic method into a targeted test for edited chart content.

Limitations

The text-editing signal needs at least four OCR-readable text regions to compare, so charts with little text, or text OCR cannot read, are screened only by the blur and color signals. ELA is sensitive to the image's compression history: a figure saved once losslessly, or uniformly recompressed, weakens the residual contrast the signal relies on, and a chart legitimately assembled from panels of different origin can show benign residual differences. The blur and color signals are directional cues rather than proof, since legitimate anti-aliasing, gradients, and multi-color designs can raise them. Whole-image Error Level Analysis, JPEG-ghost analysis of compression history, noise-residual consistency, and copy-move (clone) detection live in the dedicated image-forensics indicators (I1, I7, I3, and I6), so G10 deliberately does not repeat them and stays on chart-element-localized editing to remain complementary rather than redundant.

Theoretical background

G10 rests on the principle that an edit is a region with a different history than its surroundings. Error Level Analysis makes that history visible: a single recompression drives every region toward its compression fixed point, so a region that was encoded differently, a spliced number, a pasted patch, releases a different amount of residual. The key modelling choice is the comparison set. Rather than asking whether any block in the image is anomalous, which is the whole-image forensic question answered elsewhere, G10 asks whether the chart's own labels are mutually consistent, which isolates the most common chart edit, changing a printed value, while controlling for the fact that text is intrinsically high-residual. The blur and color signals add independent geometric and chromatic evidence of concealment and pasting. Each signal is a property of the pixels and the chart's elements rather than a learned fingerprint, which keeps the screen model-free.

References

  1. Krawetz N. A Picture's Worth: Digital Image Analysis and Forensics (Error Level Analysis). Black Hat USA Briefings. 2007. https://www.hackerfactor.com/papers/bh-usa-07-krawetz-wp.pdf
  2. Lin X, Tang W, Wang H, Liu Y, Ju Y, Wang S, Yu Z. Exposing image splicing traces in scientific publications via uncertainty-guided refinement. Patterns. 2024. DOI: 10.1016/j.patter.2024.101038
  3. Nagm AM, Moussa MM, Shoitan R, Ali A, Mashhour M, Salama AS, AbdulWakel HI. Detecting image manipulation with ELA-CNN integration: a powerful framework for authenticity verification. PeerJ Computer Science. 2024;10:e2205. DOI: 10.7717/peerj-cs.2205
  4. Nandi S, Natarajan P. Rescind: Countering Image Misconduct in Biomedical Publications with Vision-Language and State-Space Modeling. arXiv preprint arXiv:2601.08040. 2026. https://arxiv.org/abs/2601.08040