基於預訓練穩定擴散模型對於非監督視覺異常檢測之改進
Improving Unsupervised Visual Anomaly Detection Via Pretrained Stable Diffusion Models
摘要
異常檢測是一個重要的研究領域,旨在識別偏離預期規範的實例。由於異常樣本的稀少性,使得監督式學習方法在處理不平衡數據集時面臨挑戰。相較之下,無監督方法專注於對正常樣本進行建模,通過比較輸入數據與預測的無異常重建來檢測異常,顯示出更大的潛力。
近年來,擴散模型在無監督異常檢測領域展現出卓越性能,尤其是在生成高品質、複雜分佈的樣本方面。作為更先進的擴散模型,穩定擴散模型能夠生成更高效率、更高解析度的圖像,這對於精細缺陷檢測特別有利。本研究致力於提升擴散模型在異常檢測中的應用效能。
本研究以 MVTec AD 資料集為基礎,該資料集被廣泛用於評估異常檢測和異常定位任務。採用 image AUROC 作為異常檢測的主要評估指標,並使用 pixel AUROC 和 pixel PRO 來評估異常定位的準確性。在此基礎上,我們對當前將擴散模型運用在 MVTec AD 資料集上,且表現最優異的 DDAD 模型進行了改進。具體而言,我們採用了預訓練的穩定擴散模型作為基礎架構,並結合 DreamBooth 技術進行微調。通過在訓練過程中輸入的文字提示,引導模型學習特定類別的細節特徵,從而顯著提高重建品質。此外,我們還優化了異常分數的計算方法,以獲得更精確的圖像重建誤差。
實驗結果表明,在 image AUROC 方面,我們的方法在 15 個類別中的 13 個超越了DDAD。在 pixel AUROC 和 pixel PRO 方面,我們分別在 6 個和 9 個類別中實現了更優異的性能。值得注意的是,我們將平均 pixel PRO 準確度從 92.3% 提高到 93.0%,凸顯了本方法在異常檢測和定位任務中的有效性。
近年來,擴散模型在無監督異常檢測領域展現出卓越性能,尤其是在生成高品質、複雜分佈的樣本方面。作為更先進的擴散模型,穩定擴散模型能夠生成更高效率、更高解析度的圖像,這對於精細缺陷檢測特別有利。本研究致力於提升擴散模型在異常檢測中的應用效能。
本研究以 MVTec AD 資料集為基礎,該資料集被廣泛用於評估異常檢測和異常定位任務。採用 image AUROC 作為異常檢測的主要評估指標,並使用 pixel AUROC 和 pixel PRO 來評估異常定位的準確性。在此基礎上,我們對當前將擴散模型運用在 MVTec AD 資料集上,且表現最優異的 DDAD 模型進行了改進。具體而言,我們採用了預訓練的穩定擴散模型作為基礎架構,並結合 DreamBooth 技術進行微調。通過在訓練過程中輸入的文字提示,引導模型學習特定類別的細節特徵,從而顯著提高重建品質。此外,我們還優化了異常分數的計算方法,以獲得更精確的圖像重建誤差。
實驗結果表明,在 image AUROC 方面,我們的方法在 15 個類別中的 13 個超越了DDAD。在 pixel AUROC 和 pixel PRO 方面,我們分別在 6 個和 9 個類別中實現了更優異的性能。值得注意的是,我們將平均 pixel PRO 準確度從 92.3% 提高到 93.0%,凸顯了本方法在異常檢測和定位任務中的有效性。
Anomaly detection is a vital field of research focused on identifying instances that significantly deviate from expected norms. The scarcity of anomalous samples poses significant challenges for supervised learning methods in handling imbalanced datasets. In contrast, unsupervised approaches, which concentrate on modeling normal samples and identifying anomalies by contrasting input data with predicted reconstructions that are free of anomalies, demonstrate greater potential.
In recent years, diffusion models have exhibited exceptional performance in unsupervised anomaly detection, particularly in generating high-quality samples from complex distributions. As a more advanced variant, stable diffusion models can produce more efficient, higher-resolution images, which is particularly advantageous for fine-grained defect detection. This study aims to enhance the application efficacy of diffusion models in anomaly detection.
Our research is based on the MVTec AD dataset, a resource commonly employed for assessing tasks related to anomaly detection and localization. We employ image AUROC as the primary evaluation metric for anomaly detection, while using pixel AUROC and pixel PRO to assess the accuracy of anomaly localization. Building upon this foundation, we improve upon the DDAD model, which currently demonstrates the best performance in applying diffusion models to the MVTec AD dataset. Specifically, we adopt a pretrained Stable Diffusion model as the base architecture and incorporate DreamBooth technology for fine-tuning. By inputting text prompts during the training process, we guide the model to learn detailed features specific to each category, thereby significantly enhancing reconstruction quality. Furthermore, we optimize the anomaly score calculation method to obtain more precise image reconstruction errors.
Experimental results indicate that our strategy outperforms DDAD in 13 out of 15 categories with respect to image AUROC. For pixel AUROC and pixel PRO, we achieve superior performance in 6 and 9 categories, respectively. Notably, we increase the average pixel PRO accuracy from 92.3% to 93.0%, highlighting the effectiveness of our method in both anomaly detection and localization tasks.
In recent years, diffusion models have exhibited exceptional performance in unsupervised anomaly detection, particularly in generating high-quality samples from complex distributions. As a more advanced variant, stable diffusion models can produce more efficient, higher-resolution images, which is particularly advantageous for fine-grained defect detection. This study aims to enhance the application efficacy of diffusion models in anomaly detection.
Our research is based on the MVTec AD dataset, a resource commonly employed for assessing tasks related to anomaly detection and localization. We employ image AUROC as the primary evaluation metric for anomaly detection, while using pixel AUROC and pixel PRO to assess the accuracy of anomaly localization. Building upon this foundation, we improve upon the DDAD model, which currently demonstrates the best performance in applying diffusion models to the MVTec AD dataset. Specifically, we adopt a pretrained Stable Diffusion model as the base architecture and incorporate DreamBooth technology for fine-tuning. By inputting text prompts during the training process, we guide the model to learn detailed features specific to each category, thereby significantly enhancing reconstruction quality. Furthermore, we optimize the anomaly score calculation method to obtain more precise image reconstruction errors.
Experimental results indicate that our strategy outperforms DDAD in 13 out of 15 categories with respect to image AUROC. For pixel AUROC and pixel PRO, we achieve superior performance in 6 and 9 categories, respectively. Notably, we increase the average pixel PRO accuracy from 92.3% to 93.0%, highlighting the effectiveness of our method in both anomaly detection and localization tasks.