Home

Awesome

WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentation

<p align="center"><img src="assets/teaser.jpg" alt="outline" width="90%"></p> Unofficial implementation of:

WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentation, CVPR 2023 [Paper]

Citation

If you find the code useful, please consider citing our paper using the following BibTeX entry.

@InProceedings{Jeong_2023_CVPR,
    author    = {Jeong, Jongheon and Zou, Yang and Kim, Taewan and Zhang, Dongqing and Ravichandran, Avinash and Dabeer, Onkar},
    title     = {WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentation},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2023},
    pages     = {19606-19616}
}

Related Research

@misc{cao2023segment,
      title={Segment Any Anomaly without Training via Hybrid Prompt Regularization}, 
      author={Yunkang Cao and Xiaohao Xu and Chen Sun and Yuqi Cheng and Zongwei Du and Liang Gao and Weiming Shen},
      year={2023},
      eprint={2305.10724},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

Related Repo

Prerequisite

Install python dependencies

sh install.sh

Download MVTec-AD dataset

Download Visa dataset

Run run_winclip.py to reproduce the implementation results

python run_winclip.py

Results

MVTec-AD

MVTec-ADReportedRe-implementation
i-aurocp-auroci-max-f1p-max-f1i-aurocp-auroci-max-f1p-max-f1
carpet100.0095.4099.4049.7077.4188.9688.4429.31
grid98.8082.2098.2018.6048.8775.0885.718.40
leather100.0096.70100.0039.7097.3597.3595.7029.60
tile100.0077.6099.4032.6079.8775.8785.2529.30
wood99.4093.4098.3051.5094.7493.0392.6844.65
bottle99.2089.5097.6058.1098.6589.5896.7749.36
cable86.5077.0084.5019.7053.3056.2376.0310.22
capsule72.9086.9091.4021.7062.0388.5690.469.95
hazelnut93.9094.3089.7037.6071.2994.3480.0033.63
metal_nut97.1061.0096.3032.4037.5942.6789.4221.67
pill79.1080.0091.6017.6073.1074.6791.5611.98
screw83.3089.6087.4013.5064.8790.0985.619.09
toothbrush87.5086.9087.9017.1041.9484.0284.519.26
transistor88.0074.7079.5030.5062.2567.4660.8715.95
zipper91.5091.6092.9034.4089.3192.0890.4231.48
Average91.8185.1292.9431.6570.1780.6786.2322.92

VisA

VisAReportedRe-implementation
i-aurocp-auroci-max-f1p-max-f1i-aurocp-auroci-max-f1p-max-f1
candle95.4088.9089.4022.5079.0386.2472.366.32
capsules85.0081.6083.909.2053.5862.0077.221.36
cashew92.1084.7088.4013.2070.6679.5480.996.94
chewinggum96.5093.3094.8041.1084.9497.0183.7636.17
fryum80.3088.5082.7022.1052.6086.7380.3315.17
macaroni176.2070.9074.207.0049.9834.3766.670.07
macaroni263.7059.3069.801.0049.5631.4966.670.06
pcb173.6061.2071.002.4055.9944.0468.970.97
pcb251.2071.6067.104.7061.5864.4769.260.70
pcb373.4085.3071.0010.3051.4268.7166.451.06
pcb479.6094.4074.9032.0078.9491.8674.5622.75
pipe_fryum69.7075.4080.7012.3082.8093.6583.4822.45
Average78.0679.5978.9914.8264.2670.0174.239.50

Acknowledgements

This project borrows some code from OpenCLip and CDO, thanks for their admiring contributions~!