Upload 5 files
Browse files- README.md +78 -0
- config.json +48 -0
- model.safetensors +3 -0
- preprocessor_config.json +22 -0
- training_args.bin +3 -0
README.md
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
base_model: google/vit-base-patch16-224-in21k
|
4 |
+
tags:
|
5 |
+
- generated_from_trainer
|
6 |
+
metrics:
|
7 |
+
- accuracy
|
8 |
+
model-index:
|
9 |
+
- name: Wound-Image-classification
|
10 |
+
results: []
|
11 |
+
---
|
12 |
+
|
13 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
14 |
+
should probably proofread and complete it, then remove this comment. -->
|
15 |
+
|
16 |
+
# Wound-Image-classification
|
17 |
+
|
18 |
+
This model is a fine-tuned version of [google/vit-base-patch16-224-in21k](https://huggingface.co/google/vit-base-patch16-224-in21k) on an unknown dataset.
|
19 |
+
It achieves the following results on the evaluation set:
|
20 |
+
- Loss: 0.1209
|
21 |
+
- Accuracy: 0.965
|
22 |
+
|
23 |
+
## Model description
|
24 |
+
|
25 |
+
More information needed
|
26 |
+
|
27 |
+
## Intended uses & limitations
|
28 |
+
|
29 |
+
More information needed
|
30 |
+
|
31 |
+
## Training and evaluation data
|
32 |
+
|
33 |
+
More information needed
|
34 |
+
|
35 |
+
## Training procedure
|
36 |
+
|
37 |
+
### Training hyperparameters
|
38 |
+
|
39 |
+
The following hyperparameters were used during training:
|
40 |
+
- learning_rate: 0.0002
|
41 |
+
- train_batch_size: 4
|
42 |
+
- eval_batch_size: 4
|
43 |
+
- seed: 42
|
44 |
+
- gradient_accumulation_steps: 2
|
45 |
+
- total_train_batch_size: 8
|
46 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
47 |
+
- lr_scheduler_type: linear
|
48 |
+
- lr_scheduler_warmup_ratio: 0.01
|
49 |
+
- num_epochs: 16
|
50 |
+
|
51 |
+
### Training results
|
52 |
+
|
53 |
+
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|
54 |
+
|:-------------:|:-----:|:----:|:---------------:|:--------:|
|
55 |
+
| 1.0919 | 1.0 | 200 | 0.7780 | 0.76 |
|
56 |
+
| 0.6157 | 2.0 | 400 | 0.5695 | 0.7925 |
|
57 |
+
| 0.4894 | 3.0 | 600 | 0.3667 | 0.8775 |
|
58 |
+
| 0.3786 | 4.0 | 800 | 0.4436 | 0.8625 |
|
59 |
+
| 0.3142 | 5.0 | 1000 | 0.4412 | 0.8625 |
|
60 |
+
| 0.2636 | 6.0 | 1200 | 0.4430 | 0.86 |
|
61 |
+
| 0.198 | 7.0 | 1400 | 0.2760 | 0.9175 |
|
62 |
+
| 0.1456 | 8.0 | 1600 | 0.2211 | 0.93 |
|
63 |
+
| 0.1586 | 9.0 | 1800 | 0.3520 | 0.905 |
|
64 |
+
| 0.1307 | 10.0 | 2000 | 0.3188 | 0.9175 |
|
65 |
+
| 0.106 | 11.0 | 2200 | 0.3167 | 0.925 |
|
66 |
+
| 0.0975 | 12.0 | 2400 | 0.2633 | 0.92 |
|
67 |
+
| 0.0734 | 13.0 | 2600 | 0.1813 | 0.9525 |
|
68 |
+
| 0.0994 | 14.0 | 2800 | 0.2150 | 0.945 |
|
69 |
+
| 0.0622 | 15.0 | 3000 | 0.1757 | 0.955 |
|
70 |
+
| 0.0609 | 16.0 | 3200 | 0.1209 | 0.965 |
|
71 |
+
|
72 |
+
|
73 |
+
### Framework versions
|
74 |
+
|
75 |
+
- Transformers 4.38.2
|
76 |
+
- Pytorch 2.1.0+cu121
|
77 |
+
- Datasets 2.18.0
|
78 |
+
- Tokenizers 0.15.2
|
config.json
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "google/vit-base-patch16-224-in21k",
|
3 |
+
"architectures": [
|
4 |
+
"ViTForImageClassification"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.0,
|
7 |
+
"encoder_stride": 16,
|
8 |
+
"hidden_act": "gelu",
|
9 |
+
"hidden_dropout_prob": 0.0,
|
10 |
+
"hidden_size": 768,
|
11 |
+
"id2label": {
|
12 |
+
"0": "Abrasions",
|
13 |
+
"1": "Bruises",
|
14 |
+
"2": "Burns",
|
15 |
+
"3": "Cut",
|
16 |
+
"4": "Diabetic Wounds",
|
17 |
+
"5": "Laseration",
|
18 |
+
"6": "Normal",
|
19 |
+
"7": "Pressure Wounds",
|
20 |
+
"8": "Surgical Wounds",
|
21 |
+
"9": "Venous Wounds"
|
22 |
+
},
|
23 |
+
"image_size": 224,
|
24 |
+
"initializer_range": 0.02,
|
25 |
+
"intermediate_size": 3072,
|
26 |
+
"label2id": {
|
27 |
+
"Abrasions": "0",
|
28 |
+
"Bruises": "1",
|
29 |
+
"Burns": "2",
|
30 |
+
"Cut": "3",
|
31 |
+
"Diabetic Wounds": "4",
|
32 |
+
"Laseration": "5",
|
33 |
+
"Normal": "6",
|
34 |
+
"Pressure Wounds": "7",
|
35 |
+
"Surgical Wounds": "8",
|
36 |
+
"Venous Wounds": "9"
|
37 |
+
},
|
38 |
+
"layer_norm_eps": 1e-12,
|
39 |
+
"model_type": "vit",
|
40 |
+
"num_attention_heads": 12,
|
41 |
+
"num_channels": 3,
|
42 |
+
"num_hidden_layers": 12,
|
43 |
+
"patch_size": 16,
|
44 |
+
"problem_type": "single_label_classification",
|
45 |
+
"qkv_bias": true,
|
46 |
+
"torch_dtype": "float32",
|
47 |
+
"transformers_version": "4.38.2"
|
48 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:978096c4a7925df8cc207df6bcd7b389bae886e7f932298fcaccf07a89ee6595
|
3 |
+
size 343248584
|
preprocessor_config.json
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"do_normalize": true,
|
3 |
+
"do_rescale": true,
|
4 |
+
"do_resize": true,
|
5 |
+
"image_mean": [
|
6 |
+
0.5,
|
7 |
+
0.5,
|
8 |
+
0.5
|
9 |
+
],
|
10 |
+
"image_processor_type": "ViTImageProcessor",
|
11 |
+
"image_std": [
|
12 |
+
0.5,
|
13 |
+
0.5,
|
14 |
+
0.5
|
15 |
+
],
|
16 |
+
"resample": 2,
|
17 |
+
"rescale_factor": 0.00392156862745098,
|
18 |
+
"size": {
|
19 |
+
"height": 224,
|
20 |
+
"width": 224
|
21 |
+
}
|
22 |
+
}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cf4c360bcd2dd34b1a154e760bb60eae9b7152798ecd407e29e1ed3261ba3f43
|
3 |
+
size 4920
|