Skip to content

Explainability artifacts and on-disk formats ​

Every output in Verity is built to be supervisor-reviewable: no detector result is ever stored as a bare scalar score detached from what the model actually saw. This reference catalogs every on-disk file across the five stages of an examination, why each exists, and how the UI and PDF dossier surface them.

All workspace paths live under $VERITY_WORKSPACE (~/.local/share/verity/workspace in standalone binary mode; ./workspace in repository dev) and $VERITY_OUTPUT_DIR (defaulting to <workspace>/output). Case identifiers (media_id) equal the first 12 hex characters of the file's SHA-256 hash.

Artifact overview & custody design invariants ​

CategoryStage / OwnerPrimary FilesEvidence Role
Case recordIngest, Extract, Analyze, Select, Compile.{media_id}.json, analysis.json, selection.json, finding.jsonBytes-to-ID link, eligibility proof, and raw-to-finding provenance
Forensic exhibitsForensicsRunner (5 analyzers)forensics.json, ela.png, ela_overlay.png, blockiness.png, noise_*.png, spectrum.png, timeline.png, spectrogram.pngModel-free signal & metadata measurements
Detector exhibitsdetectors/common/engine.py + output_parser.pyresult.json, faces/, frames/, full_frames/, attention_maps/, reconstructions/, timeline.png, logsExact cropped/full inputs, spatial attribution, auxiliary sub-scores, verbatim logs
Compiled deliverablesReportGeneratorreport.html, report.pdfPortable self-contained exhibit (base64 images, zero aggregate verdict)
Preservation bundleverity.exportverity-evidence-<stem>-<id>.zip (MANIFEST.json, SHA256SUMS.txt)Standard sha256sum -c verifiable archive for court/lab custody

Four invariants govern this layout:

  1. Determinism: Media IDs derive from SHA-256; frame readers iterate sequentially; PNG compression strips timestamps; galleries sort by descending probability with filename tie-breakers.
  2. Traceability: Every prose sentence in Finding.reasoning traces back to raw keys inside result.json or forensics.json.
  3. Examiner-first inspection: Images (cropped inputs, overlays, bounding boxes, spectrograms) accompany every table so reviewers verify what the detector saw instead of trusting numbers blindly.
  4. Honest absence: Missing Grad-CAMs, dead decoders (recce), or missing audio tracks are explicitly documented rather than fabricated or silently hidden.

1. Case record files ​

  • workspace/media/<media_id>.<ext> (0o444) & .{media_id}.json: Immutable working copy and MediaInfo sidecar (original_path, media_type, checksum, size_bytes, mime_type, original_name, ingested_at).
  • <output_dir>/<media_id>/analysis.json: Deterministic MediaAnalysis (ffprobe stream characteristics plus OpenCV Haar face scan over up to 30 evenly sampled frames).
  • <output_dir>/<media_id>/selection.json: Sorted SelectionDecision list for all 58 registered detectors, proving which ran and why each excluded detector failed rule 0..5.
  • workspace/output/<media_id>_<detector_id>/finding.json: Parsed Finding preserving classification, confidence, tier, reasoning, normalized raw_output, and discovered evidence paths.

2. Model-free forensic artifacts (artifacts/<media_id>/forensics/) ​

Indexed by forensics.json (ForensicsReport, sorted by severity warning -> notice -> info via src/verity/forensics/models.py):

AnalyzerArtifacts Written
metadatametadata/metadata.json, metadata/observations.json
compressioncompression/ela.png, compression/ela_overlay.png, compression/blockiness.png, compression/compression.json
noisenoise/noise_residual.png, noise/noise_variance.png, noise/spectrum.png, noise/noise.json
video_temporalvideo_temporal/temporal.json, video_temporal/timeline.png
audioaudio/audio.json, audio/audio_native.wav, audio/spectrogram.png

3. Detector artifacts (workspace/output/<media_id>_<detector_id>/) ​

Produced by detectors/common/engine.py and collected automatically by verity.detect.output_parser.discover_evidence_paths:

ArtifactProducer ModesEvidence Value
result.json & per_face_results.jsonAll modesUnmodified prediction, confidence, stats, unit, input_mode, aux_aggregate, region_aggregate, and per_face unit records
faces/<face_id>.pngface_crop, face_clip, av_clipExact MTCNN face crop fed to the network (exposes detector false-positives or bad framing)
frames/<id>.pngfull_frame, full_clip, av_clipThumbnails of whole frames / windows scored directly without face cropping
full_frames/<face_id>_frame.pngVideo face detectors (top-3 suspicious)Full uncropped frame with bounding box overlay (shows background/scene context in PDF & UI)
attention_maps/<id>_attention.pngNative attention or cam: true backbones3-panel figure (Original -> Heatmap -> Overlay) highlighting spatial attribution
reconstructions/<id>_recon.pngRECCE (only when decoder_alive)Original vs reconstruction vs `
timeline.pngVideo, audio, av_clipFrame probability mean/range plot, or waveform/log-mel spectrogram overlaid with window fake scores
stdout.log, stderr.logDetectorRunner (last 20,000 chars each)Verbatim subprocess execution audit trail

Region-energy attribution & native attention vs Grad-CAM ​

  • When region_analysis: true and MediaPipe FaceMesh locates landmarks on a face crop, normalized attention energy maps onto six convex-hull facial regions (left_eye, right_eye, nose, mouth, jaw, forehead) in region_energy and region_aggregate.
  • _cam_for prefers native attention_map tensors (LAA-Net boundary map, Forensics Adapter / VLAForge / DF40 ViT patch attention, SRM spatial attention, RECCE guided attention) and falls back to Grad-CAM only when spec.cam is True.
  • Models whose physics/input make spatial Grad-CAM meaningless (aeroblade, univfd, safe, timesformer, videomae, xclip, tall, audio detectors) set cam: false and emit aux_aggregate / timelines instead.

Modality-aware presentation (FindingTables & ReportGenerator) ​

Instead of forcing audio and whole-image models into face-bounding-box columns:

  • When unit == "window" (audio, av_clip), tables render Window ID + Time Span (s) (start_s–end_s) + telemetry/info columns (av_offset_seconds, confidence, region_weight_max).
  • When unit is "frame" or "clip", tables render Dimensions (w × h) alongside Frame.
  • When aux_aggregate is non-empty (ProDet branches, VLAForge dual heads, AEROBLADE SD1.1/SD2.1/Kandinsky LPIPS distances, SyncNet measurements), both ReportGenerator._key_figures_html and UI AuxSignalsTable render each metric.

4. Exported reports & Preservation Bundles ​

Self-contained reports (<output_dir>/<media_id>/report.{html,pdf}) ​

Embeds top-3 full_frames, top-6 faces (or top-6 frames when no face crops exist), top-4 attention_maps, top-4 reconstructions, collapsible full sets, forensics galleries, and AuxSignalsTable / Per-Window / Per-Face tables — with zero aggregate verdict.

Evidence Preservation Bundle (verity-evidence-<stem>-<media_id>.zip) ​

Produced by export_evidence_bundle (src/verity/export.py) via verity export --media-id <id> or GET /api/media/{id}/export:

text
verity-evidence-<stem>-<media_id>.zip
├── MANIFEST.json          # verity-evidence-bundle/1 metadata, checksums, findings_summary
├── SHA256SUMS.txt         # sorted sha256sum-compatible checksums for EVERY file + MANIFEST.json
├── media/                 # <original_name> (0o444 bytes) + ingest_record.json
├── report/                # report.html, report.pdf, analysis.json, selection.json
├── forensics/             # forensics.json + per-analyzer JSON and PNG figures
└── detectors/<det_id>/    # result.json, finding.json, logs, faces, frames, full_frames, attention_maps, timeline.png

Running sha256sum -c SHA256SUMS.txt inside the unpacked bundle verifies every retained byte independently of Verity.

Verity v0.6.0 · Non-commercial forensic workbench (CC BY-NC 4.0) · Grounded in OpenWiki