Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,104 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
tags:
|
| 5 |
+
- anomaly-detection
|
| 6 |
+
- industrial-inspection
|
| 7 |
+
- computer-vision
|
| 8 |
+
- patchcore
|
| 9 |
+
- anomalib
|
| 10 |
+
- mvtec-ad-2
|
| 11 |
+
- defect-detection
|
| 12 |
+
- manufacturing
|
| 13 |
+
- pytorch
|
| 14 |
+
library_name: anomalib
|
| 15 |
+
pipeline_tag: image-classification
|
| 16 |
---
|
| 17 |
+
|
| 18 |
+
# Vial PatchCore β Industrial Anomaly Detection
|
| 19 |
+
|
| 20 |
+
A PatchCore-based industrial anomaly detection model trained for the **Vial** category of the **MVTec AD 2** dataset.
|
| 21 |
+
|
| 22 |
+
The model is designed to distinguish anomalous vial images from normal vial images and provides an anomaly map for visualizing regions that contribute to the detected anomaly.
|
| 23 |
+
|
| 24 |
+
## π Live Demo
|
| 25 |
+
|
| 26 |
+
Try the deployed model through the interactive Gradio application:
|
| 27 |
+
|
| 28 |
+
**[Industrial Vial Defect Detection β Hugging Face Space](https://huggingface.co/spaces/pranamjain/industrial-vial-defect-detection)**
|
| 29 |
+
|
| 30 |
+
Upload a vial image and receive:
|
| 31 |
+
|
| 32 |
+
- Normal / Defective prediction
|
| 33 |
+
- Anomaly score
|
| 34 |
+
- Anomaly heatmap
|
| 35 |
+
- Visual localization of suspicious regions
|
| 36 |
+
|
| 37 |
+
---
|
| 38 |
+
|
| 39 |
+
## π§ Model Overview
|
| 40 |
+
|
| 41 |
+
### Architecture
|
| 42 |
+
|
| 43 |
+
**PatchCore**
|
| 44 |
+
|
| 45 |
+
PatchCore is an industrial anomaly detection approach that represents image patches using deep visual features and compares them against a memory bank representing normal samples.
|
| 46 |
+
|
| 47 |
+
The model is trained to learn the visual characteristics of normal vial images. During inference, deviations from the learned normal representation produce higher anomaly scores.
|
| 48 |
+
|
| 49 |
+
### Model Details
|
| 50 |
+
|
| 51 |
+
| Property | Value |
|
| 52 |
+
|---|---|
|
| 53 |
+
| Architecture | PatchCore |
|
| 54 |
+
| Framework | PyTorch |
|
| 55 |
+
| Library | Anomalib |
|
| 56 |
+
| Dataset | MVTec AD 2 |
|
| 57 |
+
| Category | Vial |
|
| 58 |
+
| Input Resolution | 256 Γ 256 |
|
| 59 |
+
| Task | Industrial Anomaly Detection |
|
| 60 |
+
| Model File | `model.ckpt` |
|
| 61 |
+
|
| 62 |
+
---
|
| 63 |
+
|
| 64 |
+
## π Evaluation
|
| 65 |
+
|
| 66 |
+
The trained Vial model was evaluated on the MVTec AD 2 public test set.
|
| 67 |
+
|
| 68 |
+
| Metric | Score |
|
| 69 |
+
|---|---:|
|
| 70 |
+
| Image AUROC | **0.7578** |
|
| 71 |
+
| Image F1 Score | **0.5315** |
|
| 72 |
+
| Pixel AUROC | **0.9142** |
|
| 73 |
+
| Pixel F1 Score | **0.1197** |
|
| 74 |
+
|
| 75 |
+
### Interpretation
|
| 76 |
+
|
| 77 |
+
**Image AUROC β 0.7578**
|
| 78 |
+
|
| 79 |
+
The model provides useful separation between normal and anomalous vial images at the image level.
|
| 80 |
+
|
| 81 |
+
**Image F1 Score β 0.5315**
|
| 82 |
+
|
| 83 |
+
The F1 score reflects the balance between precision and recall under the evaluation threshold used during the original evaluation.
|
| 84 |
+
|
| 85 |
+
**Pixel AUROC β 0.9142**
|
| 86 |
+
|
| 87 |
+
The high pixel-level AUROC indicates that the model can effectively rank anomalous regions relative to normal regions.
|
| 88 |
+
|
| 89 |
+
**Pixel F1 Score β 0.1197**
|
| 90 |
+
|
| 91 |
+
The lower pixel-level F1 indicates that precise defect segmentation remains challenging, even though the anomaly map provides useful localization information.
|
| 92 |
+
|
| 93 |
+
---
|
| 94 |
+
|
| 95 |
+
## π― Deployment Threshold
|
| 96 |
+
|
| 97 |
+
During development, the default image-level threshold resulted in a relatively high number of false negatives for the Vial model.
|
| 98 |
+
|
| 99 |
+
An additional threshold analysis was performed using the MVTec AD 2 public test set.
|
| 100 |
+
|
| 101 |
+
The experimental deployment threshold selected for the interactive demo is:
|
| 102 |
+
|
| 103 |
+
```text
|
| 104 |
+
0.09
|