Skip to main content

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

Reason this release was yanked:

readme needed update

Project description

VAAS: Vision-Attention Anomaly Scoring

VAAS (Vision-Attention Anomaly Scoring) is a dual-module vision framework for image anomaly detection and localisation.
It combines global attention-based reasoning with patch-level self-consistency analysis to produce interpretable anomaly scores and dense anomaly maps.

This repository provides the inference-ready implementation of VAAS for research engineers and practitioners.


Paper

The conference paper link will be added upon publication.


Architecture

VAAS Methodology

VAAS integrates two complementary components:

  • Fx — Global Attention Module
    A Vision Transformer capturing semantic/global irregularities from attention patterns.

  • Px — Patch Consistency Module
    A SegFormer-based model capturing local inconsistencies across image patches.

These combine to produce:

  • S_F — global attention fidelity
  • S_P — patch-level plausibility
  • S_H — hybrid anomaly score (final)

S_H is continuous and reflects anomaly intensity, not just presence.


Installation

pip install vaas

Important: VAAS requires PyTorch + torchvision.
Install the correct PyTorch build for your system (CPU / CUDA / ROCm):

https://pytorch.org/get-started/locally/


Quick Inference Example

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

pipeline = VAASPipeline.from_pretrained(
    "OBA-Research/vaas-v1-df2023",
    device="cpu",
    alpha=0.5,
)

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

print(out["S_H"])

Output format

{
    "S_F": float,
    "S_P": float,
    "S_H": float,
    "anomaly_map": numpy.ndarray  # shape (224, 224)
}

Model Variants

Version Training Data Description
v1 DF2023 (10%) Initial public inference release

Future updates will include:

  • full DF2023 training
  • cross-dataset benchmarking
  • improved calibration
  • more efficient backbones
  • richer visualisation modes

Example Notebooks

A set of runnable example notebooks covering:

These cover:

  • Quick-start inference with VAAS
  • Visualising anomaly maps
  • Batch / folder inference
  • How S_F, S_P, and S_H are combined
  • Device selection (CPU, CUDA, MPS)

If you would like to contribute a notebook, see
CONTRIBUTING.md for guidelines.


Roadmap

  • Cross-dataset evaluation
  • Larger-scale training
  • Model compression
  • Batch inference and folder-level CLI
  • Extended anomaly-map visualisation
  • Streamlit/Gradio demo (optional)
  • ONNX / TorchScript export

Contributing

We welcome contributions that improve the usability, robustness, and extensibility of VAAS.

Please see the full guidelines in CONTRIBUTING.md.


Citation

Citation will be added once the paper is published.


License

MIT License.


Maintainers

OBA-Research
https://github.com/OBA-Research
https://huggingface.co/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.6.tar.gz (10.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.6-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vaas-0.1.6.tar.gz
  • Upload date:
  • Size: 10.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.6.tar.gz
Algorithm Hash digest
SHA256 2dabde8faa07a643fa3a5d2ff47dd0fc3af7f278fedc987f814181fd49300aa4
MD5 bdc24dc60886440820f6856f32499c97
BLAKE2b-256 6003912b639a0806d45f35647ced0360c32d54d32e79d18a0b06b068d667ba5b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vaas-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 12.9 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 06f1641d9b13a534089e9dbad871e19d1c2cfe4c9ca43bfa157b2ade77c6e086
MD5 045652bbb647df1a6a95242b3c7df013
BLAKE2b-256 a6abc5f0844c718481ef5ab6b4def694e2448a859a70a3554b65c58858b1859b

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