Image Classification
Transformers
Safetensors
English
swin
vision
Inference Endpoints
NeuronZero commited on
Commit
8917a83
1 Parent(s): c40f5db

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+ tags:
4
+ - autotrain
5
+ - image-classification
6
+ widget:
7
+ - src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/tiger.jpg
8
+ example_title: Tiger
9
+ - src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/teapot.jpg
10
+ example_title: Teapot
11
+ - src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/palace.jpg
12
+ example_title: Palace
13
+ datasets:
14
+ - sartajbhuvaji/Brain-Tumor-Classification
15
+ ---
16
+
17
+ # Model Trained Using AutoTrain
18
+
19
+ - Problem type: Image Classification
20
+
21
+ ## Validation Metrics
22
+ No validation metrics available
checkpoint-450/config.json ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "microsoft/swin-base-patch4-window7-224-in22k",
3
+ "_num_labels": 4,
4
+ "architectures": [
5
+ "SwinForImageClassification"
6
+ ],
7
+ "attention_probs_dropout_prob": 0.0,
8
+ "depths": [
9
+ 2,
10
+ 2,
11
+ 18,
12
+ 2
13
+ ],
14
+ "drop_path_rate": 0.1,
15
+ "embed_dim": 128,
16
+ "encoder_stride": 32,
17
+ "hidden_act": "gelu",
18
+ "hidden_dropout_prob": 0.0,
19
+ "hidden_size": 1024,
20
+ "id2label": {
21
+ "0": "glioma_tumor",
22
+ "1": "meningioma_tumor",
23
+ "2": "no_tumor",
24
+ "3": "pituitary_tumor"
25
+ },
26
+ "image_size": 224,
27
+ "initializer_range": 0.02,
28
+ "label2id": {
29
+ "glioma_tumor": 0,
30
+ "meningioma_tumor": 1,
31
+ "no_tumor": 2,
32
+ "pituitary_tumor": 3
33
+ },
34
+ "layer_norm_eps": 1e-05,
35
+ "mlp_ratio": 4.0,
36
+ "model_type": "swin",
37
+ "num_channels": 3,
38
+ "num_heads": [
39
+ 4,
40
+ 8,
41
+ 16,
42
+ 32
43
+ ],
44
+ "num_layers": 4,
45
+ "out_features": [
46
+ "stage4"
47
+ ],
48
+ "out_indices": [
49
+ 4
50
+ ],
51
+ "patch_size": 4,
52
+ "path_norm": true,
53
+ "problem_type": "single_label_classification",
54
+ "qkv_bias": true,
55
+ "stage_names": [
56
+ "stem",
57
+ "stage1",
58
+ "stage2",
59
+ "stage3",
60
+ "stage4"
61
+ ],
62
+ "torch_dtype": "float32",
63
+ "transformers_version": "4.39.0",
64
+ "use_absolute_embeddings": false,
65
+ "window_size": 7
66
+ }
checkpoint-450/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8350bae2d69a0f757abcec1eb625852f70158166c989f9418b0c6ee529bea0f4
3
+ size 347507016
checkpoint-450/optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b93891904bfdc8aab433a805eb9820687a4c09d851945fef6c3d3ac8b9fc3278
3
+ size 694322125
checkpoint-450/rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84293e35d03a603a6d01e01e41f9934374bf7ca96b7984c1399cf6683b873292
3
+ size 13990
checkpoint-450/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f2295262c8b0cd31776d8d5f370bfd4d7da47a787dc53758a73b3dbb54b80f3
3
+ size 1064
checkpoint-450/trainer_state.json ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 5.0,
5
+ "eval_steps": 500,
6
+ "global_step": 450,
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.19,
13
+ "grad_norm": 8.953761100769043,
14
+ "learning_rate": 1.888888888888889e-05,
15
+ "loss": 1.3623,
16
+ "step": 17
17
+ },
18
+ {
19
+ "epoch": 0.38,
20
+ "grad_norm": 10.632478713989258,
21
+ "learning_rate": 3.777777777777778e-05,
22
+ "loss": 1.0225,
23
+ "step": 34
24
+ },
25
+ {
26
+ "epoch": 0.57,
27
+ "grad_norm": 16.316967010498047,
28
+ "learning_rate": 4.925925925925926e-05,
29
+ "loss": 0.6166,
30
+ "step": 51
31
+ },
32
+ {
33
+ "epoch": 0.76,
34
+ "grad_norm": 21.347354888916016,
35
+ "learning_rate": 4.7160493827160495e-05,
36
+ "loss": 0.5825,
37
+ "step": 68
38
+ },
39
+ {
40
+ "epoch": 0.94,
41
+ "grad_norm": 8.19096565246582,
42
+ "learning_rate": 4.506172839506173e-05,
43
+ "loss": 0.4259,
44
+ "step": 85
45
+ },
46
+ {
47
+ "epoch": 1.13,
48
+ "grad_norm": 12.711194038391113,
49
+ "learning_rate": 4.296296296296296e-05,
50
+ "loss": 0.2901,
51
+ "step": 102
52
+ },
53
+ {
54
+ "epoch": 1.32,
55
+ "grad_norm": 18.733543395996094,
56
+ "learning_rate": 4.0864197530864204e-05,
57
+ "loss": 0.2684,
58
+ "step": 119
59
+ },
60
+ {
61
+ "epoch": 1.51,
62
+ "grad_norm": 6.416273593902588,
63
+ "learning_rate": 3.876543209876544e-05,
64
+ "loss": 0.2797,
65
+ "step": 136
66
+ },
67
+ {
68
+ "epoch": 1.7,
69
+ "grad_norm": 4.896417617797852,
70
+ "learning_rate": 3.6666666666666666e-05,
71
+ "loss": 0.3023,
72
+ "step": 153
73
+ },
74
+ {
75
+ "epoch": 1.89,
76
+ "grad_norm": 17.5325984954834,
77
+ "learning_rate": 3.45679012345679e-05,
78
+ "loss": 0.2397,
79
+ "step": 170
80
+ },
81
+ {
82
+ "epoch": 2.08,
83
+ "grad_norm": 9.514878273010254,
84
+ "learning_rate": 3.2469135802469134e-05,
85
+ "loss": 0.2499,
86
+ "step": 187
87
+ },
88
+ {
89
+ "epoch": 2.27,
90
+ "grad_norm": 6.783230304718018,
91
+ "learning_rate": 3.037037037037037e-05,
92
+ "loss": 0.2137,
93
+ "step": 204
94
+ },
95
+ {
96
+ "epoch": 2.46,
97
+ "grad_norm": 9.813042640686035,
98
+ "learning_rate": 2.8271604938271606e-05,
99
+ "loss": 0.1946,
100
+ "step": 221
101
+ },
102
+ {
103
+ "epoch": 2.64,
104
+ "grad_norm": 4.386660099029541,
105
+ "learning_rate": 2.617283950617284e-05,
106
+ "loss": 0.2326,
107
+ "step": 238
108
+ },
109
+ {
110
+ "epoch": 2.83,
111
+ "grad_norm": 13.430244445800781,
112
+ "learning_rate": 2.4074074074074074e-05,
113
+ "loss": 0.1931,
114
+ "step": 255
115
+ },
116
+ {
117
+ "epoch": 3.02,
118
+ "grad_norm": 10.026385307312012,
119
+ "learning_rate": 2.1975308641975308e-05,
120
+ "loss": 0.1584,
121
+ "step": 272
122
+ },
123
+ {
124
+ "epoch": 3.21,
125
+ "grad_norm": 5.96959924697876,
126
+ "learning_rate": 1.9876543209876546e-05,
127
+ "loss": 0.1612,
128
+ "step": 289
129
+ },
130
+ {
131
+ "epoch": 3.4,
132
+ "grad_norm": 8.849898338317871,
133
+ "learning_rate": 1.777777777777778e-05,
134
+ "loss": 0.1843,
135
+ "step": 306
136
+ },
137
+ {
138
+ "epoch": 3.59,
139
+ "grad_norm": 4.787600517272949,
140
+ "learning_rate": 1.5679012345679014e-05,
141
+ "loss": 0.1395,
142
+ "step": 323
143
+ },
144
+ {
145
+ "epoch": 3.78,
146
+ "grad_norm": 5.98640251159668,
147
+ "learning_rate": 1.3580246913580247e-05,
148
+ "loss": 0.1351,
149
+ "step": 340
150
+ },
151
+ {
152
+ "epoch": 3.97,
153
+ "grad_norm": 8.119280815124512,
154
+ "learning_rate": 1.1481481481481482e-05,
155
+ "loss": 0.1626,
156
+ "step": 357
157
+ },
158
+ {
159
+ "epoch": 4.16,
160
+ "grad_norm": 7.947086334228516,
161
+ "learning_rate": 9.382716049382717e-06,
162
+ "loss": 0.1658,
163
+ "step": 374
164
+ },
165
+ {
166
+ "epoch": 4.34,
167
+ "grad_norm": 2.4981260299682617,
168
+ "learning_rate": 7.283950617283951e-06,
169
+ "loss": 0.1147,
170
+ "step": 391
171
+ },
172
+ {
173
+ "epoch": 4.53,
174
+ "grad_norm": 5.954956531524658,
175
+ "learning_rate": 5.185185185185185e-06,
176
+ "loss": 0.1295,
177
+ "step": 408
178
+ },
179
+ {
180
+ "epoch": 4.72,
181
+ "grad_norm": 9.320396423339844,
182
+ "learning_rate": 3.0864197530864196e-06,
183
+ "loss": 0.1309,
184
+ "step": 425
185
+ },
186
+ {
187
+ "epoch": 4.91,
188
+ "grad_norm": 9.413307189941406,
189
+ "learning_rate": 9.876543209876544e-07,
190
+ "loss": 0.095,
191
+ "step": 442
192
+ }
193
+ ],
194
+ "logging_steps": 17,
195
+ "max_steps": 450,
196
+ "num_input_tokens_seen": 0,
197
+ "num_train_epochs": 5,
198
+ "save_steps": 500,
199
+ "total_flos": 1.1242852922068992e+18,
200
+ "train_batch_size": 32,
201
+ "trial_name": null,
202
+ "trial_params": null
203
+ }
checkpoint-450/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6cdb2f8f71607f374787e1fc5dc2a41f9ec2a880d55f5b0c5941c750740c9946
3
+ size 4920
config.json ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "microsoft/swin-base-patch4-window7-224-in22k",
3
+ "_num_labels": 4,
4
+ "architectures": [
5
+ "SwinForImageClassification"
6
+ ],
7
+ "attention_probs_dropout_prob": 0.0,
8
+ "depths": [
9
+ 2,
10
+ 2,
11
+ 18,
12
+ 2
13
+ ],
14
+ "drop_path_rate": 0.1,
15
+ "embed_dim": 128,
16
+ "encoder_stride": 32,
17
+ "hidden_act": "gelu",
18
+ "hidden_dropout_prob": 0.0,
19
+ "hidden_size": 1024,
20
+ "id2label": {
21
+ "0": "glioma_tumor",
22
+ "1": "meningioma_tumor",
23
+ "2": "no_tumor",
24
+ "3": "pituitary_tumor"
25
+ },
26
+ "image_size": 224,
27
+ "initializer_range": 0.02,
28
+ "label2id": {
29
+ "glioma_tumor": 0,
30
+ "meningioma_tumor": 1,
31
+ "no_tumor": 2,
32
+ "pituitary_tumor": 3
33
+ },
34
+ "layer_norm_eps": 1e-05,
35
+ "mlp_ratio": 4.0,
36
+ "model_type": "swin",
37
+ "num_channels": 3,
38
+ "num_heads": [
39
+ 4,
40
+ 8,
41
+ 16,
42
+ 32
43
+ ],
44
+ "num_layers": 4,
45
+ "out_features": [
46
+ "stage4"
47
+ ],
48
+ "out_indices": [
49
+ 4
50
+ ],
51
+ "patch_size": 4,
52
+ "path_norm": true,
53
+ "problem_type": "single_label_classification",
54
+ "qkv_bias": true,
55
+ "stage_names": [
56
+ "stem",
57
+ "stage1",
58
+ "stage2",
59
+ "stage3",
60
+ "stage4"
61
+ ],
62
+ "torch_dtype": "float32",
63
+ "transformers_version": "4.39.0",
64
+ "use_absolute_embeddings": false,
65
+ "window_size": 7
66
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8350bae2d69a0f757abcec1eb625852f70158166c989f9418b0c6ee529bea0f4
3
+ size 347507016
preprocessor_config.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_valid_processor_keys": [
3
+ "images",
4
+ "do_resize",
5
+ "size",
6
+ "resample",
7
+ "do_rescale",
8
+ "rescale_factor",
9
+ "do_normalize",
10
+ "image_mean",
11
+ "image_std",
12
+ "return_tensors",
13
+ "data_format",
14
+ "input_data_format"
15
+ ],
16
+ "do_normalize": true,
17
+ "do_rescale": true,
18
+ "do_resize": true,
19
+ "image_mean": [
20
+ 0.485,
21
+ 0.456,
22
+ 0.406
23
+ ],
24
+ "image_processor_type": "ViTImageProcessor",
25
+ "image_std": [
26
+ 0.229,
27
+ 0.224,
28
+ 0.225
29
+ ],
30
+ "resample": 3,
31
+ "rescale_factor": 0.00392156862745098,
32
+ "size": {
33
+ "height": 224,
34
+ "width": 224
35
+ }
36
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6cdb2f8f71607f374787e1fc5dc2a41f9ec2a880d55f5b0c5941c750740c9946
3
+ size 4920
training_params.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "data_path": "sartajbhuvaji/Brain-Tumor-Classification",
3
+ "model": "microsoft/swin-base-patch4-window7-224-in22k",
4
+ "username": "NeuronZero",
5
+ "lr": 5e-05,
6
+ "epochs": 5,
7
+ "batch_size": 32,
8
+ "warmup_ratio": 0.1,
9
+ "gradient_accumulation": 1,
10
+ "optimizer": "adamw_torch",
11
+ "scheduler": "linear",
12
+ "weight_decay": 0.0,
13
+ "max_grad_norm": 1.0,
14
+ "seed": 42,
15
+ "train_split": "Training",
16
+ "valid_split": null,
17
+ "logging_steps": -1,
18
+ "project_name": "MRI-Reader",
19
+ "auto_find_batch_size": false,
20
+ "mixed_precision": "fp4",
21
+ "save_total_limit": 1,
22
+ "save_strategy": "epoch",
23
+ "push_to_hub": true,
24
+ "repo_id": "NeuronZero/MRI-Reader",
25
+ "evaluation_strategy": "epoch",
26
+ "image_column": "image",
27
+ "target_column": "label",
28
+ "log": "none"
29
+ }