File size: 1,229 Bytes
8509766
 
2cde4ba
 
 
 
 
 
 
 
 
8509766
 
2cde4ba
8509766
2cde4ba
 
8509766
2cde4ba
8509766
2cde4ba
8509766
2cde4ba
 
8509766
2cde4ba
 
fbfb42b
 
2cde4ba
8509766
2cde4ba
8509766
2cde4ba
8509766
fbfb42b
2cde4ba
8509766
2cde4ba
8509766
2cde4ba
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
library_name: transformers
pipeline_tag: image-classification
base_model: google/vit-base-patch16-224
datasets:
- AI-Lab-Makerere/beans
metrics:
- accuracy
tags:
- vision
- image-classification
---

# beans-vit

`google/vit-base-patch16-224` fine-tuned on [`AI-Lab-Makerere/beans`](https://huggingface.co/datasets/AI-Lab-Makerere/beans)
(bean-leaf disease classification) for Lab 1 of *Przetwarzanie Danych w Chmurze*.

**Classes:** angular_leaf_spot, bean_rust, healthy

## Results (test split)

- Accuracy: **0.9688**
- Macro F1: **0.9691**

| class             |   precision |   recall |   f1-score |   support |
|:------------------|------------:|---------:|-----------:|----------:|
| angular_leaf_spot |      1      |   0.9302 |     0.9639 |        43 |
| bean_rust         |      0.9149 |   1      |     0.9556 |        43 |
| healthy           |      1      |   0.9762 |     0.988  |        42 |

![confusion matrix](assets/confusion_matrix.png)

## Training

Epochs: 3, learning rate: 5e-05, batch size: 32, fp16 on a Colab T4.
Experiments tracked with MLflow.

## Usage

```python
from transformers import pipeline
clf = pipeline("image-classification", model="lustachowicz/beans-vit")
clf("leaf.jpg", top_k=3)
```