Skip to main content

VAAS (Vision-Attention Anomaly Scoring) is a dual-module vision framework for image anomaly detection and localisation.

Project description

VAAS — Vision-Attention Anomaly Scoring

VAAS is a research-driven, inference-first dual-module vision framework for image anomaly detection and localisation.

It integrates global attention-based reasoning with patch-level consistency analysis to produce:

  • A continuous hybrid anomaly score (S_H)
  • Dense spatial anomaly maps
  • Interpretable attention overlays

The output is designed to be spatially grounded, explainable, and suitable for research and prototyping workflows.

This package provides the runtime inference pipeline only.
Pretrained model weights are hosted separately on Hugging Face.

Research Paper | GitHub | Hugging Face Models


Installation

pip install vaas

Optional dependency: PyTorch

VAAS uses lazy loading for PyTorch.

  • Importing vaas does not require PyTorch
  • PyTorch is required only when running inference

If PyTorch is not installed, VAAS will raise a clear runtime error when inference is invoked.

Install PyTorch (CPU, CUDA, or ROCm) from: https://pytorch.org/get-started/locally/


Quick Start

from vaas.inference.pipeline import VAASPipeline
from PIL import Image

pipeline = VAASPipeline.from_pretrained(
    repo_id = "OBA-Research/vaas",
    device="cpu",
    alpha=0.5,
    model_variant = "v1-base-df2023" # v1-medium-df2023 and v1-large-df2023 are other model variants you can use.
  )

image = Image.open("image.jpg").convert("RGB")
result = pipeline(image)

print(result["S_H"])

Output format

{
    "S_F": float,           # global feature anomaly score
    "S_P": float,           # patch consistency score
    "S_H": float,           # hybrid anomaly score
    "anomaly_map": ndarray  # shape (224, 224)
}

Visualisation

Generate qualitative visual explanations combining:

  • Patch-level anomaly heatmaps
  • Global attention overlays
  • A hybrid anomaly score gauge
pipeline.visualize(
    image="image.jpg",
    save_path="vaas_visualization.png",
    mode="all",
    threshold=0.5,
)

Model Variants

VAAS models are versioned by architecture, scale, and dataset.

Example:

  • v1-base-df2023
  • v1-medium-df2023
  • 1-large-df2023

Each variant is stored as a separate versioned branch on Hugging Face.

See:


Reproducibility

Each published model variant contains structured metadata:

  • Architecture version
  • Dataset
  • Dataset fraction -Runtime defaults
  • Backbone configuration

This ensures reproducible loading and transparent model lineage.

Intended Use

VAAS is intended for:

  • Image anomaly detection
  • Visual integrity assessment
  • Explainable inspection of irregular regions
  • Research on attention-based anomaly scoring
  • Digital forensics research
  • Prototyping anomaly-aware vision systems

Supports CPU-only inference and GPU acceleration.


Limitations

  • Trained on a single dataset
  • Does not classify anomaly types
  • Performance may degrade on out-of-distribution imagery

VAAS should not be used as a standalone decision-making system in high-stakes applications.


Citation

If you use VAAS in your research, please cite both the software and the associated paper as appropriate.

Software Citation

@software{vaas,
  title        = {VAAS: Vision-Attention Anomaly Scoring},
  author       = {Bamigbade, Opeyemi and Scanlon, Mark and Sheppard, John},
  year         = {2025},
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.18064355},
  url          = {https://doi.org/10.5281/zenodo.18064355}
}

Paper Citation

@article{bamigbade2025vaas,
  title={VAAS: Vision-Attention Anomaly Scoring for Image Manipulation Detection in Digital Forensics},
  author={Bamigbade, Opeyemi and Scanlon, Mark and Sheppard, John},
  journal={arXiv preprint arXiv:2512.15512},
  year={2025}
}

License

MIT License


Maintainers

OBA-Research

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vaas-0.1.8.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vaas-0.1.8-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file vaas-0.1.8.tar.gz.

File metadata

  • Download URL: vaas-0.1.8.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for vaas-0.1.8.tar.gz
Algorithm Hash digest
SHA256 56bca13680e011e6fe19684a3f0451fd3bc22a9d405ca48113c6b3606cc993a8
MD5 bdf7dd9f500087a5f752d0e380ef1d02
BLAKE2b-256 3ce7dd92fe99458b43afa733a28444df88991816e9ec9ab235c4c06dfb003f63

See more details on using hashes here.

File details

Details for the file vaas-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: vaas-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for vaas-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 70a4f2238ce95e1fef78061baab8aa302ec25c2d3fcbe0e6a61acf0f0f6e7c2f
MD5 301fd89f325af037591b0229abc36125
BLAKE2b-256 a5f7efbd25e631fdf2a88e96c414f39d84c812a58b958eb7256d55dba94e8f16

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page