Fast Dynamic Prototypes for Unsupervised Anomaly Detection and Localization
Abstract
Unsupervised Anomaly Detection (UAD) excels in real-worldapplications especially with rare anomalies due to the elimination of la-beled defective samples. Most existing UAD algorithms adopt a compar-ison process where the features of the test image are compared againsttheir normal “prototypes”. Such a paradigm relies primarily on raw fea-tures from pre-trained models and is inefficient due to the excessive num-ber of prototypes. To enhance UAD performance, recent algorithms aimto establish a mapping from the test features to their respective proto-types . However, the proposed mapping models, typically based on distil-lation or attention mechanisms, perform the “reconstruction” implicitly,making the process unnecessarily complex and difficult to explain. In thispaper, we propose a simple yet effective scheme, termed Fast DynamicPrototype (FDP), to rapidly generate high-quality reconstructed proto-types for Multi-class UAD. First, a raw prototype bank is obtained viasimply clustering the deep features of normal samples. Secondly, withinthe proposed Dynamic Bank Adapter module, the raw bank is dynam-ically condensed and adapted based on the information of the currenttest image. The reconstructed prototype of a given test feature is thendefined as the weighted average of its nearest bank members. Finally,an auxiliary FDP utilizing a different backbone model is introduced tosuccessfully mitigate the impact of artifacts present in the primary FDP.The study’s extensive experiments demonstrate the superiority of theproposed algorithm, which outperforms all compared SOTA methods onthree well-known UAD datasets (MVTec-AD, MVTec-3D, and ViSA),while attaining a speed up to 477 fps. Our implementation is publiclyavailable at https://github.com/lmlpy/FDP.git.