File size: 3,797 Bytes
3e2d885
 
 
 
 
616430f
 
3e2d885
 
 
 
616430f
 
 
 
 
 
 
 
 
 
 
 
 
7d0413a
3e2d885
 
 
 
 
 
 
616430f
3e2d885
7d0413a
 
3e2d885
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
616430f
 
3e2d885
 
616430f
3e2d885
 
 
7d0413a
3e2d885
 
 
 
 
7d0413a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3e2d885
 
 
 
616430f
 
 
3e2d885
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
license: apache-2.0
base_model: google/vit-base-patch16-224-in21k
tags:
- generated_from_trainer
datasets:
- chestxrayclassification
metrics:
- accuracy
model-index:
- name: pneumonia-classification-model
  results:
  - task:
      name: Image Classification
      type: image-classification
    dataset:
      name: chestxrayclassification
      type: chestxrayclassification
      config: full
      split: train
      args: full
    metrics:
    - name: Accuracy
      type: accuracy
      value: 0.9656862745098039
---

<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

# pneumonia-classification-model

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 chestxrayclassification dataset.
It achieves the following results on the evaluation set:
- Loss: 0.1143
- Accuracy: 0.9657

## Model description

More information needed

## Intended uses & limitations

More information needed

## Training and evaluation data

More information needed

## Training procedure

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 32
- eval_batch_size: 32
- seed: 42
- gradient_accumulation_steps: 4
- total_train_batch_size: 128
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- lr_scheduler_warmup_ratio: 0.1
- num_epochs: 32

### Training results

| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|:-------------:|:-----:|:----:|:---------------:|:--------:|
| 0.6297        | 0.98  | 25   | 0.5258          | 0.7230   |
| 0.3781        | 2.0   | 51   | 0.3011          | 0.9154   |
| 0.2268        | 2.98  | 76   | 0.1981          | 0.9314   |
| 0.1827        | 4.0   | 102  | 0.1602          | 0.9473   |
| 0.1765        | 4.98  | 127  | 0.1446          | 0.9461   |
| 0.1508        | 6.0   | 153  | 0.1449          | 0.9510   |
| 0.1332        | 6.98  | 178  | 0.1510          | 0.9375   |
| 0.1187        | 8.0   | 204  | 0.1169          | 0.9596   |
| 0.131         | 8.98  | 229  | 0.1315          | 0.9559   |
| 0.1043        | 10.0  | 255  | 0.1114          | 0.9571   |
| 0.1022        | 10.98 | 280  | 0.1633          | 0.9375   |
| 0.0893        | 12.0  | 306  | 0.1167          | 0.9596   |
| 0.0848        | 12.98 | 331  | 0.0936          | 0.9694   |
| 0.0885        | 14.0  | 357  | 0.1074          | 0.9608   |
| 0.0928        | 14.98 | 382  | 0.1052          | 0.9645   |
| 0.0776        | 16.0  | 408  | 0.1116          | 0.9608   |
| 0.0895        | 16.98 | 433  | 0.1060          | 0.9645   |
| 0.0817        | 18.0  | 459  | 0.1107          | 0.9632   |
| 0.0766        | 18.98 | 484  | 0.0993          | 0.9669   |
| 0.0697        | 20.0  | 510  | 0.0938          | 0.9681   |
| 0.0626        | 20.98 | 535  | 0.1199          | 0.9620   |
| 0.0665        | 22.0  | 561  | 0.1100          | 0.9657   |
| 0.0613        | 22.98 | 586  | 0.1246          | 0.9620   |
| 0.054         | 24.0  | 612  | 0.1066          | 0.9645   |
| 0.0474        | 24.98 | 637  | 0.1100          | 0.9669   |
| 0.0456        | 26.0  | 663  | 0.1118          | 0.9645   |
| 0.0473        | 26.98 | 688  | 0.1137          | 0.9645   |
| 0.0543        | 28.0  | 714  | 0.0955          | 0.9632   |
| 0.0493        | 28.98 | 739  | 0.1300          | 0.9559   |
| 0.043         | 30.0  | 765  | 0.1229          | 0.9669   |
| 0.039         | 30.98 | 790  | 0.1125          | 0.9608   |
| 0.0398        | 31.37 | 800  | 0.1143          | 0.9657   |


### Framework versions

- Transformers 4.38.1
- Pytorch 2.1.2
- Datasets 2.1.0
- Tokenizers 0.15.2