Update README.md
Browse files
README.md
CHANGED
|
@@ -17,6 +17,12 @@ library_name: transformers
|
|
| 17 |
|
| 18 |
This model detects **defects in metal nuts** using **Vision Transformer (ViT) embeddings + kNN anomaly scoring**.
|
| 19 |
It separates *good* parts from *defective* ones by analyzing the **distribution of anomaly scores**.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
---
|
| 22 |
|
|
@@ -29,10 +35,11 @@ It separates *good* parts from *defective* ones by analyzing the **distribution
|
|
| 29 |
---
|
| 30 |
|
| 31 |
## 🏗️ Model Overview
|
| 32 |
-
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
| 36 |
|
| 37 |
---
|
| 38 |
|
|
|
|
| 17 |
|
| 18 |
This model detects **defects in metal nuts** using **Vision Transformer (ViT) embeddings + kNN anomaly scoring**.
|
| 19 |
It separates *good* parts from *defective* ones by analyzing the **distribution of anomaly scores**.
|
| 20 |
+
This project uses Vision Transformer (ViT, google/vit-base-patch16-224) to extract robust image embeddings.
|
| 21 |
+
Fine-tuned it for anomaly detection with a 4-channel input (RGB + edges).
|
| 22 |
+
Embeddings are scored via k-Nearest Neighbors (kNN), where outliers yield higher anomaly scores.
|
| 23 |
+
Preprocessing includes 224×224 resizing, Canny edge maps, and normalization.
|
| 24 |
+
Evaluation uses anomaly score distribution, thresholding (mean+std), and accuracy metrics.
|
| 25 |
+
Visual results highlight Top-K most normal and most anomalous samples for interpretability.
|
| 26 |
|
| 27 |
---
|
| 28 |
|
|
|
|
| 35 |
---
|
| 36 |
|
| 37 |
## 🏗️ Model Overview
|
| 38 |
+
- This model is a Vision Transformer (ViT) + k-Nearest Neighbors (kNN) anomaly detection pipeline trained and evaluated on the MVTec Anomaly Detection dataset.Unlike standard supervised classification, this approach learns feature embeddings of normal and defective objects, then applies distance-based anomaly scoring with kNN. The model is designed to detect subtle manufacturing defects such as:
|
| 39 |
+
|
| 40 |
+
Scratches, Contamination, Surface defects, Structural anomalies
|
| 41 |
+
|
| 42 |
+
- The core idea is that normal samples cluster closely in embedding space, while defective ones appear as outliers with higher anomaly scores.
|
| 43 |
|
| 44 |
---
|
| 45 |
|