Hem commited on
Commit
e9142db
·
verified ·
1 Parent(s): 5b76987

Upload 5 files

Browse files
Files changed (5) hide show
  1. README.md +78 -0
  2. config.json +36 -0
  3. model.safetensors +3 -0
  4. preprocessor_config.json +22 -0
  5. 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: Brain-Tumor-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
+ # Brain-Tumor-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.0872
21
+ - Accuracy: 0.9758
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: 5e-05
41
+ - train_batch_size: 32
42
+ - eval_batch_size: 32
43
+ - seed: 42
44
+ - gradient_accumulation_steps: 4
45
+ - total_train_batch_size: 128
46
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
47
+ - lr_scheduler_type: linear
48
+ - lr_scheduler_warmup_ratio: 0.1
49
+ - num_epochs: 16
50
+
51
+ ### Training results
52
+
53
+ | Training Loss | Epoch | Step | Validation Loss | Accuracy |
54
+ |:-------------:|:-----:|:----:|:---------------:|:--------:|
55
+ | 1.2074 | 1.0 | 44 | 0.8060 | 0.8128 |
56
+ | 0.4897 | 2.0 | 88 | 0.3008 | 0.9274 |
57
+ | 0.2462 | 3.0 | 132 | 0.2464 | 0.9331 |
58
+ | 0.1937 | 4.0 | 176 | 0.1918 | 0.9502 |
59
+ | 0.1523 | 5.0 | 220 | 0.1699 | 0.9502 |
60
+ | 0.1371 | 6.0 | 264 | 0.1372 | 0.9644 |
61
+ | 0.1104 | 7.0 | 308 | 0.1121 | 0.9708 |
62
+ | 0.1097 | 8.0 | 352 | 0.1220 | 0.9651 |
63
+ | 0.1015 | 9.0 | 396 | 0.1053 | 0.9737 |
64
+ | 0.0841 | 10.0 | 440 | 0.1142 | 0.9708 |
65
+ | 0.0839 | 11.0 | 484 | 0.1073 | 0.9708 |
66
+ | 0.0771 | 12.0 | 528 | 0.1156 | 0.9665 |
67
+ | 0.074 | 13.0 | 572 | 0.1203 | 0.9644 |
68
+ | 0.0652 | 14.0 | 616 | 0.0706 | 0.9858 |
69
+ | 0.0694 | 15.0 | 660 | 0.0984 | 0.9744 |
70
+ | 0.0596 | 16.0 | 704 | 0.0872 | 0.9758 |
71
+
72
+
73
+ ### Framework versions
74
+
75
+ - Transformers 4.38.1
76
+ - Pytorch 2.1.2
77
+ - Datasets 2.18.0
78
+ - Tokenizers 0.15.2
config.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": "glioma",
13
+ "1": "meningioma",
14
+ "2": "notumor",
15
+ "3": "pituitary"
16
+ },
17
+ "image_size": 224,
18
+ "initializer_range": 0.02,
19
+ "intermediate_size": 3072,
20
+ "label2id": {
21
+ "glioma": "0",
22
+ "meningioma": "1",
23
+ "notumor": "2",
24
+ "pituitary": "3"
25
+ },
26
+ "layer_norm_eps": 1e-12,
27
+ "model_type": "vit",
28
+ "num_attention_heads": 12,
29
+ "num_channels": 3,
30
+ "num_hidden_layers": 12,
31
+ "patch_size": 16,
32
+ "problem_type": "single_label_classification",
33
+ "qkv_bias": true,
34
+ "torch_dtype": "float32",
35
+ "transformers_version": "4.38.1"
36
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:51d06d0a5fc79184da94f8badd53f513dda7f8f5ae8d9d9a53aa55d9bd87481b
3
+ size 343230128
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:b0387d6fdefac581146a46fc3993f1b29959e150329308ab065a0b697676c4a9
3
+ size 4920