The official implementation of the paper LiZAD: A Lightweight Zero-Shot Anomaly Detection Framework for Industrial Manufacturing accepted at the IEEE International Conference on Omni-Layer Intelligent Systems (COINS 2026).
In modern high-throughput industrial production lines, product configurations and visual characteristics frequently change, making it impractical to collect and annotate data for every new scenario. This dynamic setting makes Zero-Shot Anomaly Detection (ZSAD) particularly suitable, as it enables defect detection without requiring training on target-specific samples. Although recent ZSAD approaches show promising results, they are computationally intensive and thus unsuitable for deployment on resource-constrained devices. We propose LiZAD: a first lightweight framework designed for real-time ZSAD specifically tailored for use on edge devices. The proposed approach pairs the dense and spatially aware visual features of DINOv3, crucial for precise pixel-level localization, with the highly computationally efficient text embeddings of MobileCLIP2, mapping them into a shared latent space via low-memory trainable projection heads. Compared to six state- of-the-art ZSAD models, LiZAD achieves an average memory reduction of 61.5%, a parameter reduction of 74.6%, and a speedup of 3.02× in terms of latency. Despite substantial reductions in computational and memory costs, our approach maintains competitive anomaly detection performance, dropping the average P-AUROC by just 6.4% relative to the best state- of-the-art model across the VisA, BTAD, MPDD, and MVTec- AD datasets. Finally, it is successfully deployed on the NVIDIA Jetson NX and Jetson AGX edge devices, and tested on the real production line of the omitted due to double-blind peer review.
Create a new Conda environment and install the required dependencies:
conda create -n LiZAD python=3.12
conda activate LiZAD
pip install -r requirements.txtTo install MobileCLIP2, follow the steps below (see the official MobileCLIP repository for more details).
Clone the MobileCLIP repository and install it:
git clone https://github.com/apple/ml-mobileclip.git
cd ml-mobileclip
pip install .Download the pretrained MobileCLIP2-S0 checkpoint from Hugging Face:
hf download apple/MobileCLIP2-S0 --local-dir ./pretrainedWe follow the standard dataset preprocessing pipeline. The framework requires a meta.json file in the root directory of each dataset.
To generate the required meta.json files, please follow the instructions provided in the AdaCLIP repository.
Update the base_dir variable in datasets/__init__.py to point to your dataset root directory.
Use the following command to train the model:
bash train.shUse the following command to evaluate the trained model:
bash test.shUzair Khan1, Luigi Capogrosso2, Muhammad Aqeel1, Francesco Setti1, Michele Magno3,2, Marco Cristani1
1 University of Verona
2 Interdisciplinary Transformation University of Austria
3 ETH Zurich