essam24 commited on
Commit
b21d4d0
1 Parent(s): 4489ec4

initial commit

Browse files
README.md ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: google/vit-base-patch16-224-in21k
4
+ tags:
5
+ - image-classification
6
+ - generated_from_trainer
7
+ datasets:
8
+ - imagefolder
9
+ metrics:
10
+ - accuracy
11
+ model-index:
12
+ - name: vit-brain-tumour-v1
13
+ results:
14
+ - task:
15
+ name: Image Classification
16
+ type: image-classification
17
+ dataset:
18
+ name: essam24/brain-tumour-v1
19
+ type: imagefolder
20
+ config: default
21
+ split: test
22
+ args: default
23
+ metrics:
24
+ - name: Accuracy
25
+ type: accuracy
26
+ value: 1.0
27
+ ---
28
+
29
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
30
+ should probably proofread and complete it, then remove this comment. -->
31
+
32
+ # vit-brain-tumour-v1
33
+
34
+ This model is a fine-tuned version of [google/vit-base-patch16-224-in21k](https://huggingface.co/google/vit-base-patch16-224-in21k) on the essam24/brain-tumour-v1 dataset.
35
+ It achieves the following results on the evaluation set:
36
+ - Loss: 0.0044
37
+ - Accuracy: 1.0
38
+
39
+ ## Model description
40
+
41
+ More information needed
42
+
43
+ ## Intended uses & limitations
44
+
45
+ More information needed
46
+
47
+ ## Training and evaluation data
48
+
49
+ More information needed
50
+
51
+ ## Training procedure
52
+
53
+ ### Training hyperparameters
54
+
55
+ The following hyperparameters were used during training:
56
+ - learning_rate: 0.0002
57
+ - train_batch_size: 16
58
+ - eval_batch_size: 8
59
+ - seed: 42
60
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
61
+ - lr_scheduler_type: linear
62
+ - num_epochs: 4
63
+ - mixed_precision_training: Native AMP
64
+
65
+ ### Training results
66
+
67
+ | Training Loss | Epoch | Step | Validation Loss | Accuracy |
68
+ |:-------------:|:------:|:----:|:---------------:|:--------:|
69
+ | 0.0043 | 2.7027 | 100 | 0.0044 | 1.0 |
70
+
71
+
72
+ ### Framework versions
73
+
74
+ - Transformers 4.42.4
75
+ - Pytorch 2.4.0+cu121
76
+ - Datasets 2.21.0
77
+ - Tokenizers 0.19.1
all_results.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 4.0,
3
+ "eval_accuracy": 1.0,
4
+ "eval_loss": 0.004365460481494665,
5
+ "eval_runtime": 3.862,
6
+ "eval_samples_per_second": 37.545,
7
+ "eval_steps_per_second": 4.92,
8
+ "total_flos": 1.800913838643118e+17,
9
+ "train_loss": 0.06353814376367105,
10
+ "train_runtime": 74.4207,
11
+ "train_samples_per_second": 31.228,
12
+ "train_steps_per_second": 1.989
13
+ }
config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": "glioblastoma",
13
+ "1": "normal"
14
+ },
15
+ "image_size": 224,
16
+ "initializer_range": 0.02,
17
+ "intermediate_size": 3072,
18
+ "label2id": {
19
+ "glioblastoma": "0",
20
+ "normal": "1"
21
+ },
22
+ "layer_norm_eps": 1e-12,
23
+ "model_type": "vit",
24
+ "num_attention_heads": 12,
25
+ "num_channels": 3,
26
+ "num_hidden_layers": 12,
27
+ "patch_size": 16,
28
+ "problem_type": "single_label_classification",
29
+ "qkv_bias": true,
30
+ "torch_dtype": "float32",
31
+ "transformers_version": "4.42.4"
32
+ }
eval_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 4.0,
3
+ "eval_accuracy": 1.0,
4
+ "eval_loss": 0.004365460481494665,
5
+ "eval_runtime": 3.862,
6
+ "eval_samples_per_second": 37.545,
7
+ "eval_steps_per_second": 4.92
8
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed2e20dd7e12eea67f170575fb1883d8483461104274623754ddcbe86c5f1b27
3
+ size 343223968
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
+ }
runs/Aug29_17-06-13_74a2be035470/events.out.tfevents.1724951185.74a2be035470.902.3 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5706c3435f239f66df29ac221e001595078c1b4933495a9f0b63dfdc5bbb2575
3
+ size 8429
runs/Aug29_17-06-13_74a2be035470/events.out.tfevents.1724951271.74a2be035470.902.4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eaea0ea0d8bb30dba756a2355071300551aa4ba81d7b62a21549eae4632f1989
3
+ size 411
train_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 4.0,
3
+ "total_flos": 1.800913838643118e+17,
4
+ "train_loss": 0.06353814376367105,
5
+ "train_runtime": 74.4207,
6
+ "train_samples_per_second": 31.228,
7
+ "train_steps_per_second": 1.989
8
+ }
trainer_state.json ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": 0.004365460481494665,
3
+ "best_model_checkpoint": "./vit-brain-tumour-v1/checkpoint-100",
4
+ "epoch": 4.0,
5
+ "eval_steps": 100,
6
+ "global_step": 148,
7
+ "is_hyper_param_search": false,
8
+ "is_local_process_zero": true,
9
+ "is_world_process_zero": true,
10
+ "log_history": [
11
+ {
12
+ "epoch": 0.2702702702702703,
13
+ "grad_norm": 2.4590463638305664,
14
+ "learning_rate": 0.0001864864864864865,
15
+ "loss": 0.4827,
16
+ "step": 10
17
+ },
18
+ {
19
+ "epoch": 0.5405405405405406,
20
+ "grad_norm": 2.9085402488708496,
21
+ "learning_rate": 0.000172972972972973,
22
+ "loss": 0.221,
23
+ "step": 20
24
+ },
25
+ {
26
+ "epoch": 0.8108108108108109,
27
+ "grad_norm": 0.13484928011894226,
28
+ "learning_rate": 0.00015945945945945947,
29
+ "loss": 0.0573,
30
+ "step": 30
31
+ },
32
+ {
33
+ "epoch": 1.0810810810810811,
34
+ "grad_norm": 3.143681287765503,
35
+ "learning_rate": 0.00014594594594594595,
36
+ "loss": 0.0655,
37
+ "step": 40
38
+ },
39
+ {
40
+ "epoch": 1.3513513513513513,
41
+ "grad_norm": 1.2873934507369995,
42
+ "learning_rate": 0.00013243243243243243,
43
+ "loss": 0.066,
44
+ "step": 50
45
+ },
46
+ {
47
+ "epoch": 1.6216216216216215,
48
+ "grad_norm": 0.05828818306326866,
49
+ "learning_rate": 0.00011891891891891893,
50
+ "loss": 0.009,
51
+ "step": 60
52
+ },
53
+ {
54
+ "epoch": 1.8918918918918919,
55
+ "grad_norm": 0.04554607346653938,
56
+ "learning_rate": 0.0001054054054054054,
57
+ "loss": 0.0063,
58
+ "step": 70
59
+ },
60
+ {
61
+ "epoch": 2.1621621621621623,
62
+ "grad_norm": 0.0411420576274395,
63
+ "learning_rate": 9.18918918918919e-05,
64
+ "loss": 0.0053,
65
+ "step": 80
66
+ },
67
+ {
68
+ "epoch": 2.4324324324324325,
69
+ "grad_norm": 0.03753970190882683,
70
+ "learning_rate": 7.837837837837838e-05,
71
+ "loss": 0.0048,
72
+ "step": 90
73
+ },
74
+ {
75
+ "epoch": 2.7027027027027026,
76
+ "grad_norm": 0.03439953923225403,
77
+ "learning_rate": 6.486486486486487e-05,
78
+ "loss": 0.0043,
79
+ "step": 100
80
+ },
81
+ {
82
+ "epoch": 2.7027027027027026,
83
+ "eval_accuracy": 1.0,
84
+ "eval_loss": 0.004365460481494665,
85
+ "eval_runtime": 2.8872,
86
+ "eval_samples_per_second": 50.222,
87
+ "eval_steps_per_second": 6.581,
88
+ "step": 100
89
+ },
90
+ {
91
+ "epoch": 2.972972972972973,
92
+ "grad_norm": 0.032108623534440994,
93
+ "learning_rate": 5.135135135135135e-05,
94
+ "loss": 0.0041,
95
+ "step": 110
96
+ },
97
+ {
98
+ "epoch": 3.2432432432432434,
99
+ "grad_norm": 0.03147277981042862,
100
+ "learning_rate": 3.783783783783784e-05,
101
+ "loss": 0.0038,
102
+ "step": 120
103
+ },
104
+ {
105
+ "epoch": 3.5135135135135136,
106
+ "grad_norm": 0.02981223724782467,
107
+ "learning_rate": 2.4324324324324327e-05,
108
+ "loss": 0.0037,
109
+ "step": 130
110
+ },
111
+ {
112
+ "epoch": 3.7837837837837838,
113
+ "grad_norm": 0.03125371038913727,
114
+ "learning_rate": 1.0810810810810812e-05,
115
+ "loss": 0.0037,
116
+ "step": 140
117
+ },
118
+ {
119
+ "epoch": 4.0,
120
+ "step": 148,
121
+ "total_flos": 1.800913838643118e+17,
122
+ "train_loss": 0.06353814376367105,
123
+ "train_runtime": 74.4207,
124
+ "train_samples_per_second": 31.228,
125
+ "train_steps_per_second": 1.989
126
+ }
127
+ ],
128
+ "logging_steps": 10,
129
+ "max_steps": 148,
130
+ "num_input_tokens_seen": 0,
131
+ "num_train_epochs": 4,
132
+ "save_steps": 100,
133
+ "stateful_callbacks": {
134
+ "TrainerControl": {
135
+ "args": {
136
+ "should_epoch_stop": false,
137
+ "should_evaluate": false,
138
+ "should_log": false,
139
+ "should_save": true,
140
+ "should_training_stop": true
141
+ },
142
+ "attributes": {}
143
+ }
144
+ },
145
+ "total_flos": 1.800913838643118e+17,
146
+ "train_batch_size": 16,
147
+ "trial_name": null,
148
+ "trial_params": null
149
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec3c6906e79516bb436143f5f87786d3f02e5ea3acfeb64f8655ac2e1d877701
3
+ size 5112