// [04] COMPLETE GUIDE, GLOSSARY & MATHEMATICAL SPECIFICATION

WHAT EVERY METRIC, SLIDER & LAYER MEANS.

A complete plain-English and mathematical reference guide to reading PixelProof's heatmaps, scores, bounding boxes, DIP sliders, and 7 forensic detection layers.

// PART 01 · UI TELEMETRY & GLOSSARY

HOW TO READ THE WORKBENCH (PLAIN-ENGLISH GUIDE)

TERM_01WORKBENCH READOUT

TAMPER SCORE (0 – 100)

Final suspicion score combining all 7 DIP layers.

HOW TO READ: 0–32 = AUTHENTIC (Clean unmodified photo) | 33–51 = SUSPICIOUS (Re-saved or globally filtered) | 52–100 = TAMPERED (Localized forgery detected).
TERM_02WORKBENCH READOUT

CONFIDENCE (%)

How decisive and consistent the signal is across layers.

HOW TO READ: Higher percentage (>85%) means multiple independent layers agree on the exact same tampered region.
TERM_03WORKBENCH READOUT

BBOX [R1, R2...]

Red Bounding Boxes drawn around detected tampered regions.

HOW TO READ: Each box shows [x, y, width, height], how much % of the photo it covers, and WHICH layer caught the edit (e.g., ELA vs Copy-Move vs Wavelet Noise).
TERM_04WORKBENCH READOUT

VECTORS [GREEN → RED]

Cyan lines connecting two identical regions inside the same photo.

HOW TO READ: Appears when someone uses the Clone Stamp / Copy-Move tool to copy one part of an image (Green square) and paste it over another part (Red square).
TERM_05WORKBENCH READOUT

8×8 DCT GRID & PHASE (MOD 8)

The invisible 8×8 pixel block grid used by JPEG compression.

HOW TO READ: Every JPEG compresses 8×8 blocks. If an object is cut and pasted at coordinates not divisible by 8 (e.g., x=253), its 8×8 grid shifts out of sync with the background.
TERM_06WORKBENCH READOUT

5× LOUPE

Synchronized 5× pixel zoom magnifier that follows your cursor.

HOW TO READ: Left box shows raw RGB pixels; Right box shows the active DIP heatmap at the exact same spot so you can inspect edges pixel-by-pixel.
TERM_07WORKBENCH READOUT

32-BIN RESIDUAL HISTOGRAM

Bar chart showing the distribution of error/anomaly intensities [0..255].

HOW TO READ: Clean images have almost all energy concentrated on the left (low error). Tampered images have a long tail or spikes on the right (high anomaly outliers).
TERM_08WORKBENCH READOUT

Z-SCORE (σ — SIGMA)

How many standard deviations a block deviates from the rest of the image.

HOW TO READ: Normal blocks stay under 2.5σ. When a spliced or airbrushed patch hits 3.5σ to 30σ+, it means that area is statistically impossible to belong to the original camera frame.
// PART 02 · DIP PARAMETER TUNING GUIDE

WHAT EACH FILTER SLIDER CONTROLS

[SLIDER_01]

ELA JPEG QUALITY (Q = 55..98)

Sets the JPEG quality level used when re-compressing the image in Layer 1 (Error Level Analysis).

WHEN TO TUNE: Default Q=90 works best for high-quality photos. Lower it to Q=75 if the suspect image was downloaded from WhatsApp/social media.
[SLIDER_02]

ELA RESIDUAL GAIN (γ = 5×..40×)

Multiplies the brightness of the ELA difference map so subtle compression differences become visible to the human eye.

WHEN TO TUNE: Increase to 25×–35× if the heatmap looks too dark; decrease to 10× if the image has very noisy textures.
[SLIDER_03]

2D-DWT WAVELET BASIS (HAAR / DB2 / DB4)

Selects the mathematical wavelet filter used in Layer 2 to separate camera sensor noise from the main scene.

WHEN TO TUNE: `HAAR` is sharpest for hard rectangular edges; `DB4` (Daubechies-4) is smoother and best at catching Gaussian blur, airbrushing, or healing brush edits.
[SLIDER_04]

MAD SLIDING WINDOW (16×16, 32×32, 48×48)

Controls the size of the square window that scans across the image to measure local sensor noise.

WHEN TO TUNE: Use `16×16` to catch tiny retouched spots; use `32×32` or `48×48` for stable noise estimation on large photos.
[SLIDER_05]

MORPHOLOGICAL SE KERNEL (B = 3×3..17×17)

Controls the size of the elliptical brush used in Stage 8 (Opening & Closing) to clean up random noise dots and merge the red tamper mask.

WHEN TO TUNE: Increase to 11×11 or 15×15 to merge fragmented boxes into one solid region; decrease to 3×3 or 5×5 for fine detail.
[SLIDER_06]

FALSE-COLOR LUT (INFERNO / VIRIDIS / JET / HOT)

Changes the color palette used to draw the heatmaps (does not change the mathematical score).

WHEN TO TUNE: `INFERNO` (black → purple → orange → yellow) is best for dark rooms; `JET` (blue → green → red) highlights medium-level gradients.
// PART 03 · THE 7 CLASSICAL DIP DETECTION LAYERS

LAYER-BY-LAYER MEANING & MATHEMATICAL FORMULATION

L01WEIGHT: 22%
ITU-R BT.601 YCbCr Color Space & 8×8 DCT Quantization

ERROR LEVEL ANALYSIS (ELA) & MULTI-QUALITY JPEG GHOSTS

WHAT IT MEANS: Checks if one part of the photo was compressed at a different JPEG quality than the rest of the photo. If someone cuts an object from one photo and pastes it into another, that object glows brightly here.
E_Q(x,y) = || I_YCbCr(x,y) - D_Q(E_Q(I_YCbCr(x,y))) ||_w, Z(x,y) = |G_σ * E_Q - μ_med| / (1.4826 · MAD)

Every JPEG image partitions the frame into non-overlapping 8×8 pixel blocks and quantizes their 2D Discrete Cosine Transform (DCT) coefficients. Re-compressing an unmodified JPEG at quality Q produces a uniform quantization residual across the scene. Foreign spliced regions originating from a different compression quality sit away from the local quantization minimum and exhibit high Z-score residuals after Sobel edge-energy normalization.

L02WEIGHT: 22%
Daubechies db4 / Haar HH1 Sub-Band + 5×5 Adaptive Wiener Filter

2D DISCRETE WAVELET TRANSFORM (DWT) & WIENER NOISE VARIANCE

WHAT IT MEANS: Every camera sensor leaves an invisible grain (noise) across the whole photo. If someone uses a blur/healing brush to hide something (erasing the noise), or pastes an object from another camera (different noise), this layer catches the mismatch.
σ̂_b = median(|HH_{1,b} - median(HH_{1,b})|) / 0.6745, R_W(x,y) = I(x,y) - Wiener_{5×5}(I(x,y))

PixelProof decomposes the luminance channel via a 1-level 2D Discrete Wavelet Transform to extract the diagonal detail sub-band (HH1) and combines it with a 5×5 spatial Adaptive Wiener denoising residual. After masking out the top 15% highest Sobel gradient edges, Donoho's Median Absolute Deviation (MAD) estimator computes local noise variance across sliding windows.

L03WEIGHT: 22%
16×16 Block 2D-DCT Lexicographical Sort + ORB Keypoints

HYBRID COPY-MOVE (CLONE) FORGERY DETECTION

WHAT IT MEANS: Catches 'Clone Stamp' edits where someone copies a patch from inside the same photo (like grass, wall, or an object) and pastes it somewhere else in the same photo. Draws cyan lines connecting the original spot to the copied spot.
F(u,v) = α(u)α(v) Σ_x Σ_y f(x,y) cos((2x+1)uπ/2B) cos((2y+1)vπ/2B), s_ij = p_i - p_j

Internal copy-move clones share the exact same camera sensor noise and JPEG compression history as the background. Layer 3 slides an overlapping 16×16 window across the image, extracts quantized low-frequency 2D-DCT coefficients, and lexicographically sorts the feature rows so identical patches become adjacent in O(N log N) time.

L04WEIGHT: 14%
3×3 Isotropic Laplacian Derivative + Hanning 2D-FFT

RESAMPLING & 2D-FFT SPECTRAL PERIODICITY

WHAT IT MEANS: When a pasted object is resized (stretched/shrunk) or rotated to fit the scene, the computer interpolates neighbouring pixels. This layer detects that artificial stretching pattern in the frequency domain.
∇²f(x,y) = f(x+1,y)+f(x-1,y)+f(x,y+1)+f(x,y-1)-4f(x,y), M(u,v) = log(1 + |FFT2(∇²f · w)|)

Bilinear and bicubic interpolation introduce periodic linear correlations between neighboring pixels. Convolving the luminance channel with an isotropic 2nd-order Laplacian high-pass kernel suppresses low-frequency scene structure and exposes these periodic correlations.

L05WEIGHT: 10%
AC(0,1)/AC(1,0) DCT Comb Histograms & Grid Phase (mod 8)

DOUBLE JPEG QUANTIZATION & 8×8 BLOCKING ARTIFACT GRID (BAG)

WHAT IT MEANS: JPEG saves images in strict 8×8 pixel squares. If a cropped or pasted region does not line up with the 8×8 grid of the background image, this layer detects the broken grid alignment.
Q_{12}(c) = round( round(c / q_1) · q_1 / q_2 ), Δ_x(x,y) = |2I(x,y) - I(x-1,y) - I(x+1,y)|

Independent 8×8 block DCT quantization creates subtle pixel discontinuities along coordinates x ≡ 0 (mod 8) and y ≡ 0 (mod 8). When a region is cropped or spliced at coordinates not divisible by 8, its internal 8×8 blocking grid shifts out of phase with the background grid.

L06WEIGHT: 12%
3×3 Rotational-Symmetric Scharr R/G/B Gradients

LATERAL CHROMATIC ABERRATION & SCHARR EDGE CONSISTENCY

WHAT IT MEANS: Checks the Red, Green, and Blue color edges around objects. Cut-and-paste selections leave unnatural sharp color seams along the border of the pasted object.
G_c = [K_x * I_c, K_y * I_c]^T, D_chroma(x,y) = 0.5(||G_R|| - ||G_G||) + (1 - |G_R · G_B| / (||G_R|| ||G_B||))

Physical camera lenses refract Red, Green, and Blue wavelengths with consistent directional collinearity. Composited objects and selection masks introduce abrupt inter-channel gradient magnitude divergences and vector misalignments along the splice boundary.

L07WEIGHT: 8%
JPEG Annex-K Quantization Matrix & Container Headers

EXIF METADATA & 8×8 LUMINANCE DQT FINGERPRINTING

WHAT IT MEANS: Reads the hidden file header to check if editing software (like Adobe Photoshop, GIMP, Lightroom, or Canva) saved the file, and inspects the 8×8 JPEG compression table.
Q_IJG(u,v) = clip( floor((S(Q) · Q_base(u,v) + 50) / 100), 1, 255 )

Parses EXIF headers for explicit editing software signatures and extracts the 64-element Luminance Quantization Table (DQT) from the JPEG stream, comparing its divisors against standard camera and editing profiles.

// PART 04 · STAGE 08 COMPOSITE FUSION & MORPHOLOGICAL SEGMENTATION

OTSU THRESHOLDING + MORPHOLOGICAL OPENING/CLOSING + 8-CONNECTIVITY

[01] OTSU ADAPTIVE THRESHOLD

Maximizes between-class variance σ²_B(t*) bounded by an 89th-percentile floor so unmodified images do not false-segment.

[02] MORPHOLOGICAL OPEN & CLOSE

Applies elliptical Opening (M ⊖ B₁) ⊕ B₁ to remove isolated salt noise and Closing (M ⊕ B₂) ⊖ B₂ to bridge fragmented masks.

[03] 8-CONNECTED COMPONENT BBOXES

Extracts contiguous bounding boxes [x, y, w, h] and attributes each suspect zone to the DIP layer with peak local activation.

0–32 // AUTHENTIC33–51 // SUSPICIOUS52–100 // TAMPERED