Papers
Topics
Authors
Recent
Search
2000 character limit reached

Anomagic: Unified Anomaly Detection & Generation

Updated 5 March 2026
  • Anomagic Framework is a unified, model-independent system that defines anomalies by exhaustively modeling known objects, using veto strategies in collider physics and zero-shot inpainting in vision.
  • The approach leverages advanced techniques such as Boosted Decision Trees and crossmodal prompt encoding to precisely separate standard objects from anomalies.
  • Empirical benchmarks demonstrate high efficiency, with detection rates up to 90% in physics and pixel-wise F1 scores over 54% in vision, underscoring its robust performance.

The Anomagic framework encompasses both pioneering anomaly detection methodology for high energy physics (Chakraborty et al., 2017) and a state-of-the-art zero-shot anomaly generation architecture for computer vision (Jiang et al., 13 Nov 2025). Both systems are unified by the central philosophy of discriminating anomalous instances by rigorously modeling and excluding distributions of known or standard objects, then flagging anything outside these priors as anomalous. While the specific implementations differ radically across the domains of collider data and visual inpainting, both realize robust, model-independent strategies for identifying out-of-distribution phenomena.

1. Philosophical Foundation

The foundational principle of the Anomagic approach is that anomalies should be characterized not by modeling the unknown directly, but by exhaustively describing the known. In the context of the Large Hadron Collider (LHC), this translates to exhaustively identifying and vetoing jets consistent with standard object hypotheses—photons, electrons, taus, QCD jets—such that any jet escaping all such vetoes is declared anomalous (Chakraborty et al., 2017).

In anomaly generation for vision, Anomagic operates under the assumption that a generative model conditioned on crossmodal cues and precise mask localization can synthesize semantically coherent, mask-adherent, and diverse anomalies without explicit examples of real defects (Jiang et al., 13 Nov 2025). This unifying philosophy leverages deep prior knowledge of the standard or background class to drive rigorous assessment or augmentation of anomalous events.

2. The Anomagic Framework in High Energy Physics

Veto-Based Anomaly Finder

The original Anomagic framework for the LHC is a veto-based object identification scheme that proceeds as follows:

  • All reconstructed objects—γ, e, τₕ, QCD jets, or non-standard—are reclustered into anti-kₜ jets (R=0.4, pTp_T > 50 GeV), creating a universal phase-space for classification.
  • The standard object phase-space is mapped in data using multidimensional descriptors: hadronic energy fraction (θJ\theta_J), track multiplicity NTN_T, and a set of 10–12 jet substructure observables (e.g., NN-subjettiness, energy correlation functions).
  • Boosted Decision Trees (BDTs) are trained pairwise to separate each standard object class, yielding response scores (rJj/γr_J^{j/\gamma}, rJj/τr_J^{j/\tau}, rJγ/τr_J^{\gamma/\tau}).
  • In each phase-space segment (θJ,NT)(\theta_J, N_T), 3D histograms of BDT outputs are used to define tight vetoes with acceptance rates RjR_j (QCD: 0.5%), Rγ=Re=Rτ=5%R_\gamma = R_e = R_\tau = 5\%.
  • Any jet passing all veto masks is classified as anomalous.

Data-Driven Calibration and Performance

Control samples for each standard object are extracted from well-characterized physics processes and sidebands. Systematic stability is ensured by varying target rates, pile-up subtraction methods, and retraining across operational epochs. Efficiencies for detecting non-standard objects (collimated di-photons, -electrons, -taus) are ~60–90% depending on topology, with standard background mistag rates tightly controlled. The computational design enables deployment at the trigger level.

3. The Anomagic Zero-Shot Anomaly Generation Pipeline

Crossmodal Prompt Encoding

The computer vision incarnation of Anomagic introduces a Crossmodal Prompt Encoding (CPE) module to fuse visual and textual anomaly descriptions:

  • The image encoder EvE_v (frozen CLIP-ViT) extracts dense spatial features FF from a reference anomaly image IrefI^{\mathrm{ref}}.
  • Mask-gated self-attention (PvP_v) ensures features focus on the defect by suppressing non-masked regions.
  • The text encoder EtE_t encodes a free-form caption treft^{\mathrm{ref}}, split and average-pooled if needed.
  • The CrossFusion block combines PvP_v and PtP_t into a unified crossmodal prompt PcP_c, used for downstream conditioning.

Inpainting-Based Generation

The anomaly generator is a Stable Diffusion-based inpainting model fine-tuned via LoRA (cross-attention layers only):

  • Inputs: A normal image II, inpainting mask MinpM_{\mathrm{inp}}, and conditioning prompt PcP_c.
  • At each diffusion timestep, noisy latents, the mask, and PcP_c steer the model toward semantically-valid, mask-aligned, defect synthesis.
  • The masked LDM loss enforces fidelity within MinpM_{\mathrm{inp}}; an adversarial penalty can be added.

Contrastive Refinement

Post-generation, a contrastive alignment step ensures that synthesized defects exactly match the intended mask:

  • Features from anomaly and mask regions are extracted by a lightweight encoder.
  • The contrastive loss Lcr\mathcal{L}_{\mathrm{cr}} encourages alignment between the inpainted anomaly and its ground-truth mask, improving boundary precision.

AnomVerse Dataset

Training is conducted on AnomVerse, a 12,987-sample collection comprising anomaly-mask-caption triplets from 13 public datasets. Automatic captioning by a multimodal LLM using template-based structured hints ensures semantically rich, defect-grounded textual supervision.

4. Algorithmic and Implementation Specifics

Computer Vision Anomaly Generator

  • Only the cross-attention layers of the UNet are fine-tuned, promoting efficient adaptation.
  • Sampling and mask application allow zero-shot, cross-category anomaly synthesis.
  • Inference speed: 1.2\sim1.2 seconds per 512×512512 \times 512 image on A100 GPU.
  • No per-category fine-tuning is required; arbitrary prompts such as “cracks, bulges, scratches in cashews” are supported.

LHC Anomaly Finder

  • Phase-space is partitioned using segmentation variables and BDT outputs, with binning at Δr=0.04\Delta r=0.04 granularity.
  • Each segment’s veto is calculated to leave only the specified residual acceptance.
  • Computational efficiency enables deployment in online environments (HLT) at O(10 μ\mathcal{O}(10~\mus per jet).

5. Quantitative Outcomes and Empirical Benchmarks

Computer Vision

  • On VisA, Inception Score (IS) and Intra-cluster LPIPS (IL) for Anomagic: 2.16/0.394, outperforming prior zero-shot (AnomalyAny: 1.94/0.330) and few-shot (AnoGen: 2.10/0.390) methods.
  • In downstream detection with INP-Former++, Anomagic achieves image-level ROC 99.08%, pixel-wise F1 54.00%—surpassing RealNet (52.87%) and AnoGen (52.61%) (Jiang et al., 13 Nov 2025).

High Energy Physics

  • Non-standard object efficiencies: collimated di-photon jets \sim60–80%, di-electrons \sim80–90%, di-taus \sim15–20%.
  • Standard object mistag rates: QCD 0.5%\leq0.5\%, photons/electrons/taus 5%\leq5\%.
  • Algorithm robust to pile-up, segmentation choices, and systematic shifts in veto rates (Chakraborty et al., 2017).

6. Scope, Domain Transfer, and Significance

The Anomagic concept generalizes across domains. In collider physics, it operationalizes a robust, model-independent search for new physics—flagging any event with at least one outlier object. In the computer vision setting, Anomagic requires no anomalous exemplars during generation, instead fusing multi-modal, region-focused cues to produce diverse, mask-adherent, semantically-matched synthetic anomalies, providing high-fidelity augmentation for anomaly detection pipelines.

Both implementations demonstrate that rigorous modeling, exclusion, and conditioning on the known or background class is a scalable, principled route to anomaly discovery or augmentation—a paradigm validated by quantitative empirical superiority in both LHC physics searches and state-of-the-art visual anomaly detection.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (2)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Anomagic Framework.