casting-defect-vit / README.md
gfichetdc's picture
Initial Gradio space
0959301
|
Raw
History Blame Contribute Delete
1.12 kB
---
title: Casting Defect Detection
emoji: 🔍
colorFrom: green
colorTo: gray
sdk: gradio
sdk_version: 5.33.0
app_file: app.py
pinned: false
license: mit
models:
- gfichetdc/casting-defect-vit
---
# Casting Defect Detection (ViT)
Fine-tuned **ViT-B/16** on 6,633 casting surface images to classify parts as **defective** or **ok**.
| Metric | Value |
|--------|-------|
| Macro F1 | 0.995 |
| Accuracy | 99.6% |
| Base model | google/vit-base-patch16-224 |
| Training images | 6,633 |
| Test images | 715 |
| Epochs | 3 |
## Usage
```python
from transformers import pipeline
classifier = pipeline("image-classification", model="gfichetdc/casting-defect-vit")
result = classifier("path/to/casting_image.jpeg")
```
## Dataset
[Kaggle — Casting Product Image Data for Quality Inspection](https://www.kaggle.com/datasets/ravirajsinh45/real-life-industrial-dataset-of-casting-product): 7,348 grayscale images of submersible pump impellers.
## Training
- Fine-tuned `google/vit-base-patch16-224` with HuggingFace Trainer
- lr=2e-5, batch size 16, 3 epochs on RTX 3060 (~10 min)
- Experiment tracking with MLflow