Carkaxhia, Rubin
(2025)
Diffusion models for few-shot anomaly detection and classification.
[Laurea magistrale], Università di Bologna, Corso di Studio in
Artificial intelligence [LM-DM270], Documento full-text non disponibile
Il full-text non è disponibile per scelta dell'autore.
(
Contatta l'autore)
Abstract
Due to the rapid technological advancement, automated anomaly inspection has become a crucial aspect in industrial manufacturing. Despite the importance, the methods used to perform these tasks suffer from a data scarcity problem. The lack of anomalous samples limits the performance of tasks such as anomaly detection, classification and localization. Several approaches have been tried in the literature such as training machine learning algorithms only on nominal images, but these methods cannot handle anomaly classification. Some other approaches based on generative models were proposed, but they still suffer from the same data scarcity problem leading to non realistic anomaly generations. In this work a new approach based on a recently proposed framework dubbed AnomalyControl is presented. A Stable Diffusion Inpainting model is fine-tuned to replace nominal parts of an image with other nominal parts, increasing the variance of the good parts of the generated defective images and addressing the data scarcity problem. Three different pipelines are created integrating this new inpainter to the one of AnomalyControl, and are used to generate defective images using the MVTec-AD dataset. The results obtained in the pipelines demonstrate the importance of this new inpainter. It enhances anomaly classification performance when generating from defective images, meaning it not only fulfills its intended function but also improves classification accuracy. However, when generating from nominal images, it results in a slight reduction in anomaly classification performance, an expected outcome given the abundance of nominal samples that do not require additional variance. Interestingly, it demonstrates unexpectedly strong performance in anomaly detection and localization when generating from nominal images, but not when generating from defective images.
Abstract
Due to the rapid technological advancement, automated anomaly inspection has become a crucial aspect in industrial manufacturing. Despite the importance, the methods used to perform these tasks suffer from a data scarcity problem. The lack of anomalous samples limits the performance of tasks such as anomaly detection, classification and localization. Several approaches have been tried in the literature such as training machine learning algorithms only on nominal images, but these methods cannot handle anomaly classification. Some other approaches based on generative models were proposed, but they still suffer from the same data scarcity problem leading to non realistic anomaly generations. In this work a new approach based on a recently proposed framework dubbed AnomalyControl is presented. A Stable Diffusion Inpainting model is fine-tuned to replace nominal parts of an image with other nominal parts, increasing the variance of the good parts of the generated defective images and addressing the data scarcity problem. Three different pipelines are created integrating this new inpainter to the one of AnomalyControl, and are used to generate defective images using the MVTec-AD dataset. The results obtained in the pipelines demonstrate the importance of this new inpainter. It enhances anomaly classification performance when generating from defective images, meaning it not only fulfills its intended function but also improves classification accuracy. However, when generating from nominal images, it results in a slight reduction in anomaly classification performance, an expected outcome given the abundance of nominal samples that do not require additional variance. Interestingly, it demonstrates unexpectedly strong performance in anomaly detection and localization when generating from nominal images, but not when generating from defective images.
Tipologia del documento
Tesi di laurea
(Laurea magistrale)
Autore della tesi
Carkaxhia, Rubin
Relatore della tesi
Correlatore della tesi
Scuola
Corso di studio
Ordinamento Cds
DM270
Parole chiave
Diffusion models,Stable Diffusion,Generative AI,Anomaly Detection,Anomaly Classification
Data di discussione della Tesi
25 Marzo 2025
URI
Altri metadati
Tipologia del documento
Tesi di laurea
(NON SPECIFICATO)
Autore della tesi
Carkaxhia, Rubin
Relatore della tesi
Correlatore della tesi
Scuola
Corso di studio
Ordinamento Cds
DM270
Parole chiave
Diffusion models,Stable Diffusion,Generative AI,Anomaly Detection,Anomaly Classification
Data di discussione della Tesi
25 Marzo 2025
URI
Gestione del documento: