# Unsupervised_Anomaly_Detection_with_segmentation_approach_using_Anomalib **Repository Path**: ctpactwangke/Unsupervised_Anomaly_Detection_with_segmentation_approach_using_Anomalib ## Basic Information - **Project Name**: Unsupervised_Anomaly_Detection_with_segmentation_approach_using_Anomalib - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-10-12 - **Last Updated**: 2025-10-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Unsupervised_Anomaly_Detection_with_segmentation_approach_using_Anomalib Anomalib is a Deep learning library Collection of the state of the art anomaly detection algorithms. The Task was assigned to me during an interview process several images of fabrics with defects were given and was asked to perform unsupervised anomaly detection with segmentation approach. Ensure that your environment is CUDA enabled. refer to notebook **Anomalib_fabric_fault_detection_segmentation_fastflow.ipynb** to walk through the code. ## Project Overview ## Anomalib is a deep learning library that collects state-of-the-art anomaly detection algorithms for benchmarking on various datasets. For this project, I used Anomalib to perform unsupervised anomaly detection on fabric images. The task involved detecting defects in fabric images using a segmentation approach. We're using **Anomalib==0.7.0** for this project. ## Dataset ## The dataset used in this project consists of images of fabrics with defects. The defects were annotated using the **Roboflow** annotation tool [click here](https://roboflow.com/annotate), and the dataset was downloaded in COCO format. Binary masks were generated for each image using a custom Python script. ## Model ## The FastFlow model was used for training. FastFlow is a deep learning model designed for anomaly detection. For more details about the FastFlow model with **resnet15** backbone, please refer to the FastFlow published article [link](https://arxiv.org/abs/2111.07677). ## Training ## The model was trained using the generated binary masks and defect images. The training process was managed using **Weights & Biases** for logging and monitoring. ## Installation ## To set up the environment for this project, follow these steps: 1. ## Clone the Repository: ## ```bash git clone https://github.com/KaustubhK94/Unsupervised_Anomaly_Detection_with_segmentation_approach_using_Anomalib.git cd Unsupervised_Anomaly_Detection_with_segmentation_approach_using_Anomalib ``` 2. ## Create A Virtual Environment(Optional): ## ```bash python -m venv venv ``` 3. ## Install Dependencies: ## ```bash pip install -r requirements.txt ``` ## Running Predictions ## To run predictions on an image using the `predict.py` script, use the following command: ```bash python predict.py --image "/path/to/image.jpg" --weights "/path/to/model_weights.ckpt" ``` ## Sample Binary Mask ## Below are two sample binary mask images used in this project:
|
|
Plot 1: Train Loss Epoch |
Plot 2: PIXEL_AUROC |
Plot 3: Image_AUROC |
Plot 4: Epochs |