LADBench / README.md
SahasraK's picture
Update README.md
0101ea4 verified
|
Raw
History Blame Contribute Delete
5.2 kB
---
license: mit
configs:
- config_name: default
data_files:
- split: train
path: metadata.jsonl
---
# LADBench: A Benchmark for Logical Anomaly Detection in Images
Large Vision Language Models (VLMs) excel at visual question answering and semantic grounding, but their capacity for autonomous logical reasoning remains underexplored. Existing anomaly benchmarks emphasize visual errors or direct prompting rather than the physical and social common sense needed for open-world deployment. To address this, we introduce LAD-Bench, a benchmark of more than 1,000 curated synthetic images with logical anomalies across four domains: Residential, Urban, Collaborative, and Nature. We further propose a Tiered Prompting Protocol based on progressive disclosure, which measures how much explicit assistance a model needs to localize and reason about a logical fault. Evaluating leading foundation models reveals substantial weaknesses: even the best achieves only 70.11% overall accuracy, showing that implicit logical fault detection remains unsolved. Crucially, models often fail to identify anomalies even after receiving explicit hints in deeper tiers. By surfacing these limitations in sequential multimodal reasoning, LAD-Bench offers a rigorous framework for advancing the safety, reliability, and cognitive alignment of autonomous visual systems.
## Dataset
The dataset for LAD-Bench is fully synthetic and contains over 1,000 images generated using OpenAI’s gpt-image-1 model, selected for its image generation quality, speed,
and prompt fidelity. Using synthetic images also reduces the risk of overlap with existing training data, since the samples are newly created. This also makes adding to the dataset simpler. The images are organized into both a super category and a sub category. The super categories are Nature, Collaborative, Urban, and Residential, and are designed to consider settings of human inhabitation or frequent human interaction. The sub categories are more specific, and help in organizing images into specific settings or processes associated with humans in the super categories. A small dataset of 100 negatives, where no anomaly is present, is also provided.
## Evaluation
The benchmark uses a Tiered Prompting Protocol, where there are three levels of progressive disclosure and assistance. Level 1 provides no assistance or companion prompt with the image, and holds the highest weightage in results. Level 2 provides explicit disclosure about the existence of an anomaly, and rewards 66.67% towards their overall accuracy. Level 3 provides a hint, which uses the sub category to direct the model's attention, and awards 33.33% towards their overall accuracy. If the model fails after all this, it gets 0% for that image.
To automate grading, we use OpenAI's gpt-5-nano as our grading module. It is given ground truth label, the response to be graded, and some other instructions to explain the task at hand. The grading and prompting protocol is slightly different between the pictures with anomalies and without. For those with anomalies, an image is only tested at a level if it failed the previous level. If it succeeds at one level, it will not be passed for the remaining levels. For those without, an image is tested at all three levels. There is a high rate of success at level 1, since there's neither direction nor anomaly. For level 2, we tell the model that there is an anomaly in this image, which also misdirects them. At level 3, we ask the models to look carefully and tell for certain if there is any anomaly in this image. We graded all responses for this dataset manually, and did not include it in our paper's published results.
### Instructions
To run this benchmark, edit the testing code to match the model being tested. The code provided is generalized for the OpenAI API client. Here, `judge_client` refers to the client for the model performing the grading and `test_client` refers to the client for the model being tested. Small edits to default values will have to be made on a model by model basis. We recommend using one image as a test case with debug mode on to make sure responses are being recieved and not being cut off. Refer to our .env.example file and create a .env file in your enviroment configured with your API keys and other specifications.
Clone the repository:
```
git clone https://huggingface.co/datasets/SahasraK/LADBench
cd LADBench
```
Initially, set up environment:
```
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
```
Suggested requirements:
```
openai>=1.50.0
datasets
python-dotenv
openpyxl
pillow
```
Create a copy of .env.example as .env and configure it. We provide a testing mode and a debug mode. For testing mode, download an image locally and label it in the .env file.
```
MODE=test
DEBUG=true
TEST_IMAGE_PATH=examples/stove.png
TEST_LABEL=A stove burner is lit while the control knobs are switched off.
```
To run: `python ladbench_logic_test.py`
Results are written to results.xlsx, or the file defined in the .env file. Runs, if interrupted, can be picked up from where they left off upon running `python ladbench_logic_test.py` again.