NeurIPS 2026 Workshop · Trustworthy AI for Good (AI4GOOD)

Do Deepfake Heatmaps Identify Image Changes?

Evaluating B-cos and Post-hoc Explanations
Tilo Schütz1 · Toby Fuchs1 · Kai Reffert1 · Linus Neumann1 · Nils Becker1 · Robin-Kiara Braun1 · Margret Keuper1,2 · Steffen Jung1,2
1 University of Mannheim   2 Max Planck Institute for Informatics, Saarland Informatics Campus
University of Mannheim Max Planck Institute for Informatics NeurIPS
.975 vs .976FF++ frame AUC, B-cos Xception vs. standard Xception
.683 → .720Mean AUC over five established cross-dataset benchmarks (Xception)
13 / 16B-cos networks where inherent maps beat all five post-hoc methods on the new PPG
4 · 18 · 3backbones · out-of-distribution test sets · pointing games
Explanations of one fake frame per FF++ manipulation family on B-cos and standard Xception
Same fake, eleven heatmaps. One fake frame per FF++ manipulation family (DeepFakes, Face2Face, FaceSwap, NeuralTextures), explained on B-cos Xception (B=1.75, left) and standard Xception (right). Cyan: official manipulation mask; inset: MPG S0. Inherent B-cos concentrates on eye, nose and mouth borders; Grad-CAM gives face-covering blobs, LIME drifts to the background, IxG and Integrated Gradients stay diffuse. Click to enlarge.

Abstract

Deepfake detectors are usually judged by how accurately they classify an image or video. In forensic use, however, it is also important to inspect the visual evidence behind a decision. We study B-cos networks, which produce an attribution map as part of their prediction, and adapt four common detector backbones within DeepfakeBench. The models are trained on compressed FaceForensics++ and tested both in-domain and on 18 external datasets. B-cos Xception nearly matches the standard model in-domain (0.975 versus 0.976 frame-level area under the ROC curve) and improves the average over five established cross-dataset benchmarks from 0.683 to 0.720. We evaluate explanations with three localization tests: whether evidence points to the fake image in a grid, falls inside the official manipulation mask, and concentrates on the pixels that differ most between aligned real and fake frames. We introduce the third test as the Pixel Pointing Game. The experiments show that convolutional B-cos models often place a larger share of their positive evidence in the relevant region, even when standard and B-cos models identify the same strongest pixel. The finer pixel target also reveals cases that look nearly perfect under the broad manipulation mask but localize no better than chance on the pixels that changed most. Across the evaluated B-cos models, inherent explanations outperform all five post-hoc explanation methods in this finer comparison in 13 of 16 cases. These results show that B-cos can retain competitive deepfake-detection performance while providing faithful and spatially concentrated visual evidence.

1B-cos: the explanation is part of the model

A detector score alone does not tell an analyst whether the model found manipulation evidence or a shortcut such as compression, background, or identity. Post-hoc heatmaps approximate a trained model after the fact. B-cos networks instead make every layer dynamic-linear, so the whole network computes f(x) = W(x)x and the contributions W(x)x are a faithful attribution.

B-cos(x; ŵ) = ‖x‖ · |cos θ|B · sgn(cos θ)
B = 1 (normalized linear unit)current B
linear unit output0.77
B-cos unit output0.59

Raising B suppresses inputs that are poorly aligned with the weight, so weights must align with task-relevant input patterns. At B = 1 the unit is a normalized linear operation; in our experiments every B = 1 detector collapses to near-chance AUC.

What we built

Four backbones inside DeepfakeBench: ResNet-34, Xception, ConvNeXt-Tiny and a small ViT with a convolutional stem (ViT-C). ResNet-34, ConvNeXt and ViT-C use B-cos v2 components; for Xception we wrote a new B-cos implementation (every convolution and projection replaced, ReLU and dropout removed, average instead of max pooling, bias-free uncentered normalization). Inputs use the six-channel encoding [r,g,b,1−r,1−g,1−b]. We sweep B ∈ {1, 1.25, 1.75, 2, 2.5}; with the four standard models that gives 24 detectors, all trained from scratch on FF++ c23 for 100 epochs with matched schedules.

2Detection: does B-cos keep its accuracy?

Intermediate B values recover the convolutional detectors, and sometimes improve transfer. The best B depends on the metric and the dataset group. Choose a group to see the sweep.

B-cos detector at each Bstandard modelchance (0.5) / uniform level

Per-dataset AUC: averages hide ranking reversals

Group means mix very different behaviors. On several recent generators the detectors rank fakes as more real than real images (AUC far below 0.5): standard ResNet-34 reaches 0.09 on CollabDiff and 0.15 on WhichIsReal but 0.83 on MidJourney. Hover a cell for its value.

3Three pointing games

Each test asks how much positive attribution lands in a target region R. Maps are smoothed (15×15) before negatives are clipped, normalized to [0, 1], and values below threshold t are dropped.

St(A, R) = Σ(i,j)∈R Ãtij / Σ(i,j) Ãtij  ·  S0 = share of the complete positive map in R  ·  S1 = does the peak fall in R?
GPG example grid with B-cos explanation

One fake and eight real images from the same dataset, the fake placed at random. The target is the whole fake cell, so a uniform map scores 1/9. Up to 100 grids per dataset for 16 datasets; fakes are taken in descending confidence and every image must be correctly classified.

Left: input grid with the fake outlined in green. Right: inherent B-cos explanation; the dashed red box marks the cell containing its maximum. Scoring uses the full attribution map, not the rendering.

Aligned FF++ manipulation masks ordered by area

1,000 fake test frames (250 each from DeepFakes, Face2Face, FaceSwap, NeuralTextures), shared by every model and method. The target is the official FF++ mask after alignment.

MPG has no fixed chance level: a uniform map scores the mask's area fraction, which averages 0.27 of the crop. Many masks are whole-face ovals or coarse boxes, so any face-centred blob scores well. A model-free face-centred Gaussian reaches S1 = 1.00, higher than every explanation method.

Masks from the shared list, ordered by crop fraction (printed above each panel).

Dij = ⅓ Σc∈{r,g,b} |If,ijc − Ir,ijc| / 255  →  keep the top 50 % of D inside the aligned mask

The PPG target always holds exactly half of its parent MPG mask (0.129 of the crop on average). A map with no preference between the higher- and lower-difference halves scores half its MPG value, so Ct = S̄tPPG / S̄tMPG > 0.5 means the map favors the pixels that actually changed. Click the steps or use ← →.

4Localization explorer

All GPG, MPG and PPG endpoint scores for every backbone and every usable B. Each method is shown on the standard network (light) and on the B-cos network (dark); the inherent B-cos map exists only on the latter.

Accuracy vs. localization

FF++ frame AUC against GPG S0. For each standard model the vertical strip spans the five post-hoc methods; the square marks the best. B-cos points use the inherent map, one per B. Convolutional B-cos detectors reach the high-AUC, high-localization corner; ViT-C stays near the uniform level.

5PPG exposes what the broad mask hides

Same fakes, finer target. Hollow circles show the MPG score, filled circles the PPG score, and the tick marks half the MPG score: what mask area alone predicts. Points right of the tick favor the pixels that changed.

MPG (broad mask)PPG (changed pixels)½ · MPG, area-only expectation

Area-conditioned PPG analysis over all backbones, B values and methods
All configurations at once. Left: complete-map PPG against MPG score; the dashed line y = 0.5x is equal attribution in both halves of the mask. Right: peak-hit ratio C1 per explanation family. Inherent B-cos has the highest median (0.73), followed by Grad-CAM(++) (≈0.55–0.58); IxG/IntGrad sit at the reference and LIME below it. Filled markers: B-cos networks; hollow: standard networks.

6Take-aways

Accuracy holdsIntermediate B (1.75–2) keeps convolutional detectors competitive in-domain; B-cos Xception raises the Legacy-5 mean from 0.683 to 0.720. B = 1 always collapses.
Evidence concentratesCAM methods already find the GPG peak, but inherent B-cos keeps far more of its complete positive map in the fake cell (0.95 vs. 0.15–0.81 for standard Xception) and is nearly threshold-invariant.
Broad masks inflate scoresA model-free face-centred Gaussian scores S1 = 1.00 on MPG. Standard ResNet-34 IntGrad falls from 0.92 on MPG to 0.41 on PPG, below its 0.46 area reference.
Check per datasetStable below-chance AUC on recent generators (CollabDiff, WhichIsReal) is a deployment signal for dataset-specific recalibration, invisible in group means.

Limitations. Pointing games measure agreement with constructed targets, not an oracle of which pixels a detector should use. We study frame-level detectors only; ViT-C B-cos localizes poorly. CAM maps are upsampled from coarse feature maps, so pixel-level IxG and IntGrad are the fairer comparison on fine targets.

Citation

@inproceedings{schuetz2026deepfakeheatmaps,
  title     = {Do Deepfake Heatmaps Identify Image Changes?
               Evaluating {B}-cos and Post-hoc Explanations},
  author    = {Sch{\"u}tz, Tilo and Fuchs, Toby and Reffert, Kai and
               Neumann, Linus and Becker, Nils and Braun, Robin-Kiara and
               Keuper, Margret and Jung, Steffen},
  booktitle = {NeurIPS 2026 Workshop on Trustworthy AI for Good (AI4GOOD)},
  year      = {2026},
  url       = {https://openreview.net/forum?id=UM3Ff8mgd2}
}

Acknowledgments

Steffen Jung and Margret Keuper acknowledge support by BMFTR project TrackOpt (01IS24074A-D). Margret Keuper acknowledges funding by DFG Research Unit 5336 – Learning to Sense. The authors acknowledge support by the state of Baden-Württemberg through bwHPC, the bwHPC-S5 project, and the German Research Foundation (DFG) through grant INST 35/1597-1 FUGG.