Johnyquest7 commited on
Commit
94a12ca
·
verified ·
1 Parent(s): e0fc64c

End of training

Browse files
README.md CHANGED
@@ -1,27 +1,119 @@
1
  ---
2
- license: mit
 
 
3
  tags:
4
- - ml-intern
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  ---
6
 
7
- # Johnyquest7/TN5000_model
 
8
 
9
- <!-- ml-intern-provenance -->
10
- ## Generated by ML Intern
11
 
12
- This model repository was generated by [ML Intern](https://github.com/huggingface/ml-intern), an agent for machine learning research and development on the Hugging Face Hub.
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
- - Try ML Intern: https://smolagents-ml-intern.hf.space
15
- - Source code: https://github.com/huggingface/ml-intern
16
 
17
- ## Usage
18
 
19
- ```python
20
- from transformers import AutoModelForCausalLM, AutoTokenizer
21
 
22
- model_id = 'Johnyquest7/TN5000_model'
23
- tokenizer = AutoTokenizer.from_pretrained(model_id)
24
- model = AutoModelForCausalLM.from_pretrained(model_id)
25
- ```
26
 
27
- For non-causal architectures, replace `AutoModelForCausalLM` with the appropriate `AutoModel` class.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ library_name: transformers
3
+ license: apache-2.0
4
+ base_model: microsoft/swinv2-base-patch4-window8-256
5
  tags:
6
+ - generated_from_trainer
7
+ datasets:
8
+ - generator
9
+ metrics:
10
+ - accuracy
11
+ - f1
12
+ model-index:
13
+ - name: TN5000_model
14
+ results:
15
+ - task:
16
+ name: Image Classification
17
+ type: image-classification
18
+ dataset:
19
+ name: generator
20
+ type: generator
21
+ config: default
22
+ split: train
23
+ args: default
24
+ metrics:
25
+ - name: Accuracy
26
+ type: accuracy
27
+ value: 0.872
28
+ - name: F1
29
+ type: f1
30
+ value: 0.9080459770114943
31
  ---
32
 
33
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
34
+ should probably proofread and complete it, then remove this comment. -->
35
 
36
+ # TN5000_model
 
37
 
38
+ This model is a fine-tuned version of [microsoft/swinv2-base-patch4-window8-256](https://huggingface.co/microsoft/swinv2-base-patch4-window8-256) on the generator dataset.
39
+ It achieves the following results on the evaluation set:
40
+ - Loss: 0.1293
41
+ - Accuracy: 0.872
42
+ - F1: 0.9080
43
+ - Sensitivity: 0.8745
44
+ - Specificity: 0.8654
45
+ - Ppv: 0.9442
46
+ - Npv: 0.7258
47
+ - Auc Roc: 0.9367
48
+ - Tp: 474
49
+ - Tn: 180
50
+ - Fp: 28
51
+ - Fn: 68
52
 
53
+ ## Model description
 
54
 
55
+ More information needed
56
 
57
+ ## Intended uses & limitations
 
58
 
59
+ More information needed
 
 
 
60
 
61
+ ## Training and evaluation data
62
+
63
+ More information needed
64
+
65
+ ## Training procedure
66
+
67
+ ### Training hyperparameters
68
+
69
+ The following hyperparameters were used during training:
70
+ - learning_rate: 2e-05
71
+ - train_batch_size: 16
72
+ - eval_batch_size: 16
73
+ - seed: 42
74
+ - gradient_accumulation_steps: 2
75
+ - total_train_batch_size: 32
76
+ - optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
77
+ - lr_scheduler_type: linear
78
+ - lr_scheduler_warmup_steps: 0.1
79
+ - num_epochs: 30
80
+
81
+ ### Training results
82
+
83
+ | Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 | Sensitivity | Specificity | Ppv | Npv | Auc Roc | Tp | Tn | Fp | Fn |
84
+ |:-------------:|:-----:|:----:|:---------------:|:--------:|:------:|:-----------:|:-----------:|:------:|:------:|:-------:|:---:|:---:|:--:|:---:|
85
+ | 0.3555 | 1.0 | 88 | 0.2034 | 0.6786 | 0.7604 | 0.714 | 0.59 | 0.8132 | 0.4521 | 0.7130 | 357 | 118 | 82 | 143 |
86
+ | 0.2755 | 2.0 | 176 | 0.1604 | 0.7314 | 0.7920 | 0.716 | 0.77 | 0.8861 | 0.5203 | 0.8209 | 358 | 154 | 46 | 142 |
87
+ | 0.2580 | 3.0 | 264 | 0.1648 | 0.8143 | 0.8684 | 0.858 | 0.705 | 0.8791 | 0.6651 | 0.8609 | 429 | 141 | 59 | 71 |
88
+ | 0.2399 | 4.0 | 352 | 0.1343 | 0.7686 | 0.8208 | 0.742 | 0.835 | 0.9183 | 0.5642 | 0.8774 | 371 | 167 | 33 | 129 |
89
+ | 0.2292 | 5.0 | 440 | 0.1547 | 0.8757 | 0.9153 | 0.94 | 0.715 | 0.8918 | 0.8266 | 0.9116 | 470 | 143 | 57 | 30 |
90
+ | 0.2285 | 6.0 | 528 | 0.1153 | 0.8186 | 0.8656 | 0.818 | 0.82 | 0.9191 | 0.6431 | 0.9161 | 409 | 164 | 36 | 91 |
91
+ | 0.2417 | 7.0 | 616 | 0.1111 | 0.8171 | 0.8621 | 0.8 | 0.86 | 0.9346 | 0.6324 | 0.9171 | 400 | 172 | 28 | 100 |
92
+ | 0.1748 | 8.0 | 704 | 0.1145 | 0.8514 | 0.8919 | 0.858 | 0.835 | 0.9286 | 0.7017 | 0.9271 | 429 | 167 | 33 | 71 |
93
+ | 0.1901 | 9.0 | 792 | 0.1489 | 0.8857 | 0.9206 | 0.928 | 0.78 | 0.9134 | 0.8125 | 0.9208 | 464 | 156 | 44 | 36 |
94
+ | 0.1872 | 10.0 | 880 | 0.1162 | 0.8514 | 0.8919 | 0.858 | 0.835 | 0.9286 | 0.7017 | 0.9218 | 429 | 167 | 33 | 71 |
95
+ | 0.1439 | 11.0 | 968 | 0.1108 | 0.8014 | 0.8478 | 0.774 | 0.87 | 0.9370 | 0.6063 | 0.9259 | 387 | 174 | 26 | 113 |
96
+ | 0.1868 | 12.0 | 1056 | 0.1185 | 0.8714 | 0.9076 | 0.884 | 0.84 | 0.9325 | 0.7434 | 0.9320 | 442 | 168 | 32 | 58 |
97
+ | 0.2002 | 13.0 | 1144 | 0.1376 | 0.8857 | 0.9205 | 0.926 | 0.785 | 0.9150 | 0.8093 | 0.9317 | 463 | 157 | 43 | 37 |
98
+ | 0.2023 | 14.0 | 1232 | 0.1339 | 0.8857 | 0.9195 | 0.914 | 0.815 | 0.9251 | 0.7913 | 0.9350 | 457 | 163 | 37 | 43 |
99
+ | 0.1582 | 15.0 | 1320 | 0.1346 | 0.8929 | 0.9252 | 0.928 | 0.805 | 0.9225 | 0.8173 | 0.9338 | 464 | 161 | 39 | 36 |
100
+ | 0.1488 | 16.0 | 1408 | 0.1319 | 0.8957 | 0.9266 | 0.922 | 0.83 | 0.9313 | 0.8098 | 0.9366 | 461 | 166 | 34 | 39 |
101
+ | 0.1249 | 17.0 | 1496 | 0.1280 | 0.87 | 0.9061 | 0.878 | 0.85 | 0.9360 | 0.7359 | 0.9370 | 439 | 170 | 30 | 61 |
102
+ | 0.1553 | 18.0 | 1584 | 0.1121 | 0.8571 | 0.8943 | 0.846 | 0.885 | 0.9484 | 0.6969 | 0.9390 | 423 | 177 | 23 | 77 |
103
+ | 0.1083 | 19.0 | 1672 | 0.1675 | 0.9029 | 0.9331 | 0.948 | 0.79 | 0.9186 | 0.8587 | 0.9381 | 474 | 158 | 42 | 26 |
104
+ | 0.1379 | 20.0 | 1760 | 0.1535 | 0.9 | 0.9308 | 0.942 | 0.795 | 0.9199 | 0.8457 | 0.9340 | 471 | 159 | 41 | 29 |
105
+ | 0.1458 | 21.0 | 1848 | 0.1915 | 0.9043 | 0.9344 | 0.954 | 0.78 | 0.9155 | 0.8715 | 0.9345 | 477 | 156 | 44 | 23 |
106
+ | 0.1322 | 22.0 | 1936 | 0.1244 | 0.8786 | 0.9126 | 0.888 | 0.855 | 0.9387 | 0.7533 | 0.9399 | 444 | 171 | 29 | 56 |
107
+ | 0.1438 | 23.0 | 2024 | 0.1519 | 0.8757 | 0.9122 | 0.904 | 0.805 | 0.9206 | 0.7703 | 0.9356 | 452 | 161 | 39 | 48 |
108
+ | 0.1265 | 24.0 | 2112 | 0.1421 | 0.8871 | 0.9204 | 0.914 | 0.82 | 0.9270 | 0.7923 | 0.9378 | 457 | 164 | 36 | 43 |
109
+ | 0.1118 | 25.0 | 2200 | 0.2165 | 0.9057 | 0.9358 | 0.962 | 0.765 | 0.9110 | 0.8895 | 0.9380 | 481 | 153 | 47 | 19 |
110
+ | 0.0971 | 26.0 | 2288 | 0.1557 | 0.8857 | 0.9194 | 0.912 | 0.82 | 0.9268 | 0.7885 | 0.9342 | 456 | 164 | 36 | 44 |
111
+ | 0.1235 | 27.0 | 2376 | 0.1394 | 0.88 | 0.9143 | 0.896 | 0.84 | 0.9333 | 0.7636 | 0.9376 | 448 | 168 | 32 | 52 |
112
+
113
+
114
+ ### Framework versions
115
+
116
+ - Transformers 5.8.0
117
+ - Pytorch 2.11.0+cu130
118
+ - Datasets 4.8.5
119
+ - Tokenizers 0.22.2
config.json ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Swinv2ForImageClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.0,
6
+ "depths": [
7
+ 2,
8
+ 2,
9
+ 18,
10
+ 2
11
+ ],
12
+ "drop_path_rate": 0.1,
13
+ "dtype": "float32",
14
+ "embed_dim": 128,
15
+ "encoder_stride": 32,
16
+ "hidden_act": "gelu",
17
+ "hidden_dropout_prob": 0.0,
18
+ "hidden_size": 768,
19
+ "id2label": {
20
+ "0": "benign",
21
+ "1": "malignant"
22
+ },
23
+ "image_size": 256,
24
+ "initializer_range": 0.02,
25
+ "label2id": {
26
+ "benign": "0",
27
+ "malignant": "1"
28
+ },
29
+ "layer_norm_eps": 1e-05,
30
+ "mlp_ratio": 4.0,
31
+ "model_type": "swinv2",
32
+ "num_channels": 3,
33
+ "num_heads": [
34
+ 4,
35
+ 8,
36
+ 16,
37
+ 32
38
+ ],
39
+ "num_layers": 4,
40
+ "out_features": [
41
+ "stage4"
42
+ ],
43
+ "out_indices": [
44
+ 4
45
+ ],
46
+ "patch_size": 4,
47
+ "path_norm": true,
48
+ "pretrained_window_sizes": [
49
+ 0,
50
+ 0,
51
+ 0,
52
+ 0
53
+ ],
54
+ "problem_type": "single_label_classification",
55
+ "qkv_bias": true,
56
+ "stage_names": [
57
+ "stem",
58
+ "stage1",
59
+ "stage2",
60
+ "stage3",
61
+ "stage4"
62
+ ],
63
+ "transformers_version": "5.8.0",
64
+ "use_absolute_embeddings": false,
65
+ "use_cache": false,
66
+ "window_size": 8
67
+ }
metrics_summary.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model": "microsoft/swinv2-base-patch4-window8-256",
3
+ "dataset": "TN5000",
4
+ "validation": {
5
+ "loss": 0.12442023307085037,
6
+ "accuracy": 0.8785714285714286,
7
+ "f1": 0.9126413155190134,
8
+ "sensitivity": 0.888,
9
+ "specificity": 0.855,
10
+ "ppv": 0.9386892177589852,
11
+ "npv": 0.7533039647577092,
12
+ "auc_roc": 0.93988,
13
+ "tp": 444,
14
+ "tn": 171,
15
+ "fp": 29,
16
+ "fn": 56,
17
+ "runtime": 4.4047,
18
+ "samples_per_second": 158.921,
19
+ "steps_per_second": 9.989
20
+ },
21
+ "test": {
22
+ "loss": 0.12932181358337402,
23
+ "accuracy": 0.872,
24
+ "f1": 0.9080459770114943,
25
+ "sensitivity": 0.8745387453874539,
26
+ "specificity": 0.8653846153846154,
27
+ "ppv": 0.9442231075697212,
28
+ "npv": 0.7258064516129032,
29
+ "auc_roc": 0.9366839341470338,
30
+ "tp": 474,
31
+ "tn": 180,
32
+ "fp": 28,
33
+ "fn": 68,
34
+ "runtime": 4.6692,
35
+ "samples_per_second": 160.627,
36
+ "steps_per_second": 10.066
37
+ },
38
+ "confusion_matrix_validation": {
39
+ "tp": 444,
40
+ "tn": 171,
41
+ "fp": 29,
42
+ "fn": 56
43
+ },
44
+ "confusion_matrix_test": {
45
+ "tp": 474,
46
+ "tn": 180,
47
+ "fp": 28,
48
+ "fn": 68
49
+ },
50
+ "class_weights": [
51
+ 1.7543859649122806,
52
+ 0.6993006993006993
53
+ ],
54
+ "label_names": [
55
+ "benign",
56
+ "malignant"
57
+ ]
58
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:848fd08c904c3ffdde5f8916e673d8fd20494447fd62252f701688f5e676a959
3
+ size 347645480
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.485,
7
+ 0.456,
8
+ 0.406
9
+ ],
10
+ "image_processor_type": "ViTImageProcessor",
11
+ "image_std": [
12
+ 0.229,
13
+ 0.224,
14
+ 0.225
15
+ ],
16
+ "resample": 3,
17
+ "rescale_factor": 0.00392156862745098,
18
+ "size": {
19
+ "height": 256,
20
+ "width": 256
21
+ }
22
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:99e019474217bd8f6d365c6a402d0c1894dd278aa90b944e298a801a48c66957
3
+ size 5329