talafek96 / Diffusion-AD-Project

In this project we will attempt to develop a POC for detecting anomalies in images based on the ability or inability of a DDM to reconstruct them.
1 stars 1 forks source link

Introduction

Anomaly-detection (AD): is a task where the goal is to find anomalous samples at inference time while during training, only positive (good) samples are given.

Denoising Diffusion Model (DDM): DDMs are models trained to recover images from noisy versions of the same image; they have recently been proven useful for many tasks (with a focus on generative models).

Our Objective

Goal: In this project we will attempt to develop a POC for detecting anomalies in images based on the ability or inability of a DDM to reconstruct them.

Example: Inspection of a product in a factory may take images of all products on the product line. The goal may be to find scratched or damaged products, while during training no such samples were given.

image

High Level Methodology

Setup and Execution

Download the 256x256 class unconditional model from here: 256x256_diffusion_uncond.pt

Place it in the path models/256x256x_diffusion_uncond.pt (relative path from the root directory of the repository).

Execution

Run all the cells of main_experiment.ipynb.
You can see the output in the following paths: