
<!-- 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. -->

# vit-finetuned-chest-xray-pneumonia

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 [chest-xray-pneumonia](https://www.kaggle.com/paultimothymooney/chest-xray-pneumonia) dataset.
It achieves the following results on the evaluation set:
- Loss: 0.1271
- Accuracy: 0.9551

## 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: 2e-05
- train_batch_size: 16
- eval_batch_size: 8
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 10

### Training results

| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|:-------------:|:-----:|:----:|:---------------:|:--------:|
| No log        | 1.0   | 326  | 0.2739          | 0.9167   |
| 0.2238        | 2.0   | 652  | 0.2892          | 0.9071   |
| 0.2238        | 3.0   | 978  | 0.2077          | 0.9407   |
| 0.1385        | 4.0   | 1304 | 0.1349          | 0.9535   |
| 0.1347        | 5.0   | 1630 | 0.1271          | 0.9551   |
| 0.1347        | 6.0   | 1956 | 0.1458          | 0.9535   |
| 0.1112        | 7.0   | 2282 | 0.2040          | 0.9375   |
| 0.1063        | 8.0   | 2608 | 0.1423          | 0.9567   |
| 0.1063        | 9.0   | 2934 | 0.1473          | 0.9535   |
| 0.0944        | 10.0  | 3260 | 0.1385          | 0.9583   |

## Example Images
#### Pneumonia Chest X-Ray
![Pneumonia](https://drive.google.com/uc?id=1yqnhD4Wjt4Y_NGLtijTGGaaw9GL497kQ)
#### Normal Chest X-Ray
![Normal](https://drive.google.com/uc?id=1xjcIEDb8kuSd4wF44gCEgsc0PfRvs53m)
### Framework versions

- Transformers 4.17.0
- Pytorch 1.10.0+cu111
- Datasets 1.18.4
- Tokenizers 0.11.6

{"license": "apache-2.0", "tags": ["image-classification", "generated_from_trainer"], "datasets": ["chest X-rays"], "metrics": ["accuracy"], "widget": [{"src": "https://drive.google.com/uc?id=1ygVCyEn6mfsNwpT1ZvWxANg5_DvStA7M", "example_title": "PNEUMONIA"}, {"src": "https://drive.google.com/uc?id=1xjcIEDb8kuSd4wF44gCEgsc0PfRvs53m", "example_title": "NORMAL"}], "model-index": [{"name": "vit-finetuned-chest-xray-pneumonia", "results": []}]}
transformers pytorch tensorboard vit image-classification generated_from_trainer license:apache-2.0 autotrain_compatible endpoints_compatible has_space region:us
TAGS
#transformers #pytorch #tensorboard #vit #image-classification #generated_from_trainer #license-apache-2.0 #autotrain_compatible #endpoints_compatible #has_space #region-us 

vit-finetuned-chest-xray-pneumonia
==================================


This model is a fine-tuned version of google/vit-base-patch16-224-in21k on the chest-xray-pneumonia dataset.
It achieves the following results on the evaluation set:


* Loss: 0.1271
* Accuracy: 0.9551


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: 2e-05
* train\_batch\_size: 16
* eval\_batch\_size: 8
* seed: 42
* optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
* lr\_scheduler\_type: linear
* num\_epochs: 10


### Training results



Example Images
--------------


#### Pneumonia Chest X-Ray


!Pneumonia


#### Normal Chest X-Ray


!Normal


### Framework versions


* Transformers 4.17.0
* Pytorch 1.10.0+cu111
* Datasets 1.18.4
* Tokenizers 0.11.6



### Training hyperparameters


The following hyperparameters were used during training:


* learning\_rate: 2e-05
* train\_batch\_size: 16
* eval\_batch\_size: 8
* seed: 42
* optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
* lr\_scheduler\_type: linear
* num\_epochs: 10 ### Training results



Example Images
-------------- #### Pneumonia Chest X-Ray


!Pneumonia #### Normal Chest X-Ray


!Normal ### Framework versions


* Transformers 4.17.0
* Pytorch 1.10.0+cu111
* Datasets 1.18.4
* Tokenizers 0.11.6
TAGS
#transformers #pytorch #tensorboard #vit #image-classification #generated_from_trainer #license-apache-2.0 #autotrain_compatible #endpoints_compatible #has_space #region-us 
 ### Training hyperparameters


The following hyperparameters were used during training:


* learning\_rate: 2e-05
* train\_batch\_size: 16
* eval\_batch\_size: 8
* seed: 42
* optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
* lr\_scheduler\_type: linear
* num\_epochs: 10 ### Training results



Example Images
-------------- #### Pneumonia Chest X-Ray


!Pneumonia #### Normal Chest X-Ray


!Normal ### Framework versions


* Transformers 4.17.0
* Pytorch 1.10.0+cu111
* Datasets 1.18.4
* Tokenizers 0.11.6
passage: TAGS
#transformers #pytorch #tensorboard #vit #image-classification #generated_from_trainer #license-apache-2.0 #autotrain_compatible #endpoints_compatible #has_space #region-us 
### Training hyperparameters


The following hyperparameters were used during training:


* learning\_rate: 2e-05
* train\_batch\_size: 16
* eval\_batch\_size: 8
* seed: 42
* optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
* lr\_scheduler\_type: linear
* num\_epochs: 10### Training results



Example Images
--------------#### Pneumonia Chest X-Ray


!Pneumonia#### Normal Chest X-Ray


!Normal### Framework versions


* Transformers 4.17.0
* Pytorch 1.10.0+cu111
* Datasets 1.18.4
* Tokenizers 0.11.6