Hanhpt23 commited on
Commit
6f46fae
·
verified ·
1 Parent(s): c41fad5

End of training

Browse files
README.md ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: microsoft/swin-large-patch4-window12-384-in22k
4
+ tags:
5
+ - generated_from_trainer
6
+ datasets:
7
+ - imagefolder
8
+ metrics:
9
+ - accuracy
10
+ model-index:
11
+ - name: microsoft/swin-large-patch4-window12-384-in22k
12
+ results:
13
+ - task:
14
+ name: Image Classification
15
+ type: image-classification
16
+ dataset:
17
+ name: NIH-Xray
18
+ type: imagefolder
19
+ config: default
20
+ split: train
21
+ args: default
22
+ metrics:
23
+ - name: Accuracy
24
+ type: accuracy
25
+ value: 0.7
26
+ ---
27
+
28
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
29
+ should probably proofread and complete it, then remove this comment. -->
30
+
31
+ # microsoft/swin-large-patch4-window12-384-in22k
32
+
33
+ This model is a fine-tuned version of [microsoft/swin-large-patch4-window12-384-in22k](https://huggingface.co/microsoft/swin-large-patch4-window12-384-in22k) on the NIH-Xray dataset.
34
+ It achieves the following results on the evaluation set:
35
+ - Loss: 2.2480
36
+ - Accuracy: 0.7
37
+
38
+ ## Model description
39
+
40
+ More information needed
41
+
42
+ ## Intended uses & limitations
43
+
44
+ More information needed
45
+
46
+ ## Training and evaluation data
47
+
48
+ More information needed
49
+
50
+ ## Training procedure
51
+
52
+ ### Training hyperparameters
53
+
54
+ The following hyperparameters were used during training:
55
+ - learning_rate: 5e-05
56
+ - train_batch_size: 4
57
+ - eval_batch_size: 4
58
+ - seed: 42
59
+ - gradient_accumulation_steps: 4
60
+ - total_train_batch_size: 16
61
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
62
+ - lr_scheduler_type: linear
63
+ - lr_scheduler_warmup_ratio: 0.1
64
+ - num_epochs: 2
65
+
66
+ ### Training results
67
+
68
+ | Training Loss | Epoch | Step | Validation Loss | Accuracy |
69
+ |:-------------:|:------:|:----:|:---------------:|:--------:|
70
+ | No log | 1.0 | 1 | 2.6591 | 0.0 |
71
+ | No log | 1.3333 | 2 | 2.2480 | 0.7 |
72
+
73
+
74
+ ### Framework versions
75
+
76
+ - Transformers 4.41.1
77
+ - Pytorch 2.3.0
78
+ - Datasets 2.19.1
79
+ - Tokenizers 0.19.1
all_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 1.3333333333333333,
3
+ "total_flos": 7254221177290752.0,
4
+ "train_loss": 1.3116413354873657,
5
+ "train_runtime": 24.7689,
6
+ "train_samples_per_second": 0.807,
7
+ "train_steps_per_second": 0.081
8
+ }
config.json ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "microsoft/swin-large-patch4-window12-384-in22k",
3
+ "architectures": [
4
+ "SwinForImageClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.0,
7
+ "depths": [
8
+ 2,
9
+ 2,
10
+ 18,
11
+ 2
12
+ ],
13
+ "drop_path_rate": 0.1,
14
+ "embed_dim": 192,
15
+ "encoder_stride": 32,
16
+ "hidden_act": "gelu",
17
+ "hidden_dropout_prob": 0.0,
18
+ "hidden_size": 1536,
19
+ "id2label": {
20
+ "0": "Pneumonia",
21
+ "1": "Emphysema",
22
+ "2": "Fibrosis",
23
+ "3": "No Finding",
24
+ "4": "Pleural_Thickening",
25
+ "5": "Cardiomegaly",
26
+ "6": "Consolidation",
27
+ "7": "Hernia",
28
+ "8": "Effusion",
29
+ "9": "Nodule",
30
+ "10": "Pneumothorax",
31
+ "11": "Edema",
32
+ "12": "Mass",
33
+ "13": "Infiltration",
34
+ "14": "Atelectasis"
35
+ },
36
+ "image_size": 384,
37
+ "initializer_range": 0.02,
38
+ "label2id": {
39
+ "Atelectasis": 14,
40
+ "Cardiomegaly": 5,
41
+ "Consolidation": 6,
42
+ "Edema": 11,
43
+ "Effusion": 8,
44
+ "Emphysema": 1,
45
+ "Fibrosis": 2,
46
+ "Hernia": 7,
47
+ "Infiltration": 13,
48
+ "Mass": 12,
49
+ "No Finding": 3,
50
+ "Nodule": 9,
51
+ "Pleural_Thickening": 4,
52
+ "Pneumonia": 0,
53
+ "Pneumothorax": 10
54
+ },
55
+ "layer_norm_eps": 1e-05,
56
+ "mlp_ratio": 4.0,
57
+ "model_type": "swin",
58
+ "num_channels": 3,
59
+ "num_heads": [
60
+ 6,
61
+ 12,
62
+ 24,
63
+ 48
64
+ ],
65
+ "num_layers": 4,
66
+ "out_features": [
67
+ "stage4"
68
+ ],
69
+ "out_indices": [
70
+ 4
71
+ ],
72
+ "patch_size": 4,
73
+ "path_norm": true,
74
+ "problem_type": "single_label_classification",
75
+ "qkv_bias": true,
76
+ "stage_names": [
77
+ "stem",
78
+ "stage1",
79
+ "stage2",
80
+ "stage3",
81
+ "stage4"
82
+ ],
83
+ "torch_dtype": "float32",
84
+ "transformers_version": "4.41.1",
85
+ "use_absolute_embeddings": false,
86
+ "window_size": 12
87
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:01cd6b4dc77846366ae16e29d21e641d56c9ef171537227f9ecbfc83c8a1ceb9
3
+ size 784924668
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": 384,
34
+ "width": 384
35
+ }
36
+ }
train_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 1.3333333333333333,
3
+ "total_flos": 7254221177290752.0,
4
+ "train_loss": 1.3116413354873657,
5
+ "train_runtime": 24.7689,
6
+ "train_samples_per_second": 0.807,
7
+ "train_steps_per_second": 0.081
8
+ }
trainer_state.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": 0.7,
3
+ "best_model_checkpoint": "SwinLarge/checkpoint-2",
4
+ "epoch": 1.3333333333333333,
5
+ "eval_steps": 500,
6
+ "global_step": 2,
7
+ "is_hyper_param_search": false,
8
+ "is_local_process_zero": true,
9
+ "is_world_process_zero": true,
10
+ "log_history": [
11
+ {
12
+ "epoch": 1.0,
13
+ "eval_accuracy": 0.0,
14
+ "eval_loss": 2.659140110015869,
15
+ "eval_runtime": 2.803,
16
+ "eval_samples_per_second": 3.568,
17
+ "eval_steps_per_second": 1.07,
18
+ "step": 1
19
+ },
20
+ {
21
+ "epoch": 1.3333333333333333,
22
+ "eval_accuracy": 0.7,
23
+ "eval_loss": 2.24800443649292,
24
+ "eval_runtime": 2.8186,
25
+ "eval_samples_per_second": 3.548,
26
+ "eval_steps_per_second": 1.064,
27
+ "step": 2
28
+ },
29
+ {
30
+ "epoch": 1.3333333333333333,
31
+ "step": 2,
32
+ "total_flos": 7254221177290752.0,
33
+ "train_loss": 1.3116413354873657,
34
+ "train_runtime": 24.7689,
35
+ "train_samples_per_second": 0.807,
36
+ "train_steps_per_second": 0.081
37
+ }
38
+ ],
39
+ "logging_steps": 10,
40
+ "max_steps": 2,
41
+ "num_input_tokens_seen": 0,
42
+ "num_train_epochs": 2,
43
+ "save_steps": 500,
44
+ "stateful_callbacks": {
45
+ "TrainerControl": {
46
+ "args": {
47
+ "should_epoch_stop": false,
48
+ "should_evaluate": false,
49
+ "should_log": false,
50
+ "should_save": true,
51
+ "should_training_stop": true
52
+ },
53
+ "attributes": {}
54
+ }
55
+ },
56
+ "total_flos": 7254221177290752.0,
57
+ "train_batch_size": 4,
58
+ "trial_name": null,
59
+ "trial_params": null
60
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:69a161edef4abfeba776ab18049d518fbe4234534be4e111ea1e2354c2ae2204
3
+ size 5112