ZSASZero-Shot Anomaly Segmentation With Class-Specific Text Prompts
Image
ZSAS
What the MLLM wrote for hazelnut
Normal
- The hazelnut rests on a dark background, shell intact.
- The hazelnut shows uniform reddish-brown color with fine ridges.
- The hazelnut displays a circular basal scar, edges clean.
Abnormal
- The hazelnut shows a long crack exposing kernel.
- The hazelnut has black mold spots around the base.
- The hazelnut features a drilled hole straight through.
Six of the 40 sentences written for the class hazelnut of MVTec AD from its name and one reference image. Browse every class.
Abstract
Zero-shot anomaly segmentation (ZSAS) detects anomalous regions in unseen classes without training samples, and is valuable in data-restricted industrial and medical domains. Existing methods based on CLIP rely on class-agnostic text prompts that fail to capture class-specific anomaly characteristics, resulting in semantic ambiguity and misalignment with patch-level visual features.
We use a multimodal large language model (MLLM) to automatically generate class-specific text prompts (CSTPs), which describe each class's physical structure, normal patterns, and representative anomaly characteristics. An adapter-based residual connection structure and an alternating learning strategy enable stable training while preserving CLIP's pretrained knowledge. On diverse industrial and medical datasets, the approach attains the highest mean anomaly detection score (mAD) over the two domains and the strongest medical-domain performance, with a substantially better accuracy and efficiency trade-off in inference speed and memory.
- 57.7mAD over the industrial and medical domains, the highest of six methods
- 56.1mAD on the six medical datasets, the highest of six methods
- 218msand 2,280 MB of GPU memory per image
- $0.007to write the prompts of one class, paid once per class
Prompts written for each class, adapters trained in turns
ZSAS has three parts. An MLLM writes text prompts for each class, small residual adapters adapt a frozen CLIP to these prompts, and the image and text adapters are trained in alternate epochs. Play the figure, or select a step or a module.
- frozen
- adapters in training
- per image
- update
- normal
- abnormal
- Ccosine similarity
- Aaverage
Why the prompts are written for each class
Highest mAD overall and in the medical domain
ZSAS has the highest mAD of the six methods on the average of the two domains (57.7) and on the medical datasets (56.1). On the industrial average Bayes-PFL is higher, 61.0 against 59.2.
Select a column to sort by it.
Pixel-level metrics in percent. R is AUROC, F is F1-max, A is AP, P is AUPRO, I is IoU-max, and mAD is the mean of the five. Bold marks the best value of a column, and the bars show the column the table is sorted by.
Weights trained on MVTec AD are used for every dataset except MVTec AD, which uses weights trained on VisA, so training and test classes never overlap. Only the test split of each dataset is used. The weights are on Hugging Face.
Every dataset, every method
ZSAS on each dataset
The last column is the mean and standard deviation of mAD over 30 independent CSTP sets.
Anomaly maps next to four zero-shot methods
Image
ZSAS
Eight classes from the industrial and medical test sets, with the ground truth and the maps of WinCLIP, AnoVL, AnomalyCLIP, AdaCLIP and ZSAS. Drag the divider, or use the arrow keys while it has focus.
The prompts the MLLM wrote
GPT-5 wrote these prompts from the class name and one reference image, 20 normal and 20 abnormal sentences per class. They are the sets behind the reported numbers. They are released with the code, so the results can be reproduced without an API key.
Loading the prompts.
Normal
No normal sentence contains it.
Abnormal
No abnormal sentence contains it.
Which MLLM, and at what cost
| MLLM | Tokens in / out | Total ($) |
|---|
Cost of the prompts of one class. It is paid once per class, and the prompts are reused for every image. The two open models are priced at the rate of a hosted endpoint.
Ablation, reference image and efficiency
Each component adds to the result
On VisA, mAD rises from 25.4 without any of the three components to 44.1 with the residual adapters, 48.1 when CSTPs are added, and 52.2 with alternating learning as well.
The reference image matters
When the MLLM is given only the class name, mAD drops by 2.0 %p on the industrial data and by 6.4 %p on the medical data.
Speed and memory
Cite
@ARTICLE{11783453,
author={Son, Junyeong and Lee, Woojun and Sung, Siyul and Kang, Pilsung},
journal={IEEE Transactions on Automation Science and Engineering},
title={Zero-Shot Anomaly Segmentation With Class-Specific Text Prompts},
year={2026},
volume={23},
number={},
pages={20270-20285},
keywords={Modeling;Training;Visualization;Learning (artificial intelligence);Anomaly detection;Conferences;Computers;Poles and zeros;Computer vision;Transistors;Image anomaly segmentation;zero-shot anomaly segmentation;multimodal large language models},
doi={10.1109/TASE.2026.3752260}}