
<!-- 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-xray-pneumonia-classification

This model is a fine-tuned version of [google/vit-base-patch16-224-in21k](https://huggingface.co/google/vit-base-patch16-224-in21k) on an unknown dataset.
It achieves the following results on the evaluation set:
- Loss: 0.0867
- Accuracy: 0.9700

## 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: 16
- eval_batch_size: 16
- seed: 42
- gradient_accumulation_steps: 4
- total_train_batch_size: 64
- optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: linear
- lr_scheduler_warmup_ratio: 0.1
- num_epochs: 15
- mixed_precision_training: Native AMP

### Training results

| Training Loss | Epoch   | Step | Validation Loss | Accuracy |
|:-------------:|:-------:|:----:|:---------------:|:--------:|
| 2.0067        | 0.9882  | 63   | 0.2101          | 0.9313   |
| 0.8054        | 1.9882  | 126  | 0.1542          | 0.9519   |
| 0.7482        | 2.9882  | 189  | 0.1328          | 0.9451   |
| 0.6           | 3.9882  | 252  | 0.1121          | 0.9588   |
| 0.5436        | 4.9882  | 315  | 0.1295          | 0.9494   |
| 0.4978        | 5.9882  | 378  | 0.1167          | 0.9605   |
| 0.4683        | 6.9882  | 441  | 0.1033          | 0.9622   |
| 0.4701        | 7.9882  | 504  | 0.1176          | 0.9579   |
| 0.3527        | 8.9882  | 567  | 0.1119          | 0.9571   |
| 0.3545        | 9.9882  | 630  | 0.0990          | 0.9639   |
| 0.3264        | 10.9882 | 693  | 0.0838          | 0.9717   |
| 0.3305        | 11.9882 | 756  | 0.0733          | 0.9734   |
| 0.2702        | 12.9882 | 819  | 0.0834          | 0.9717   |
| 0.2764        | 13.9882 | 882  | 0.0763          | 0.9734   |
| 0.286         | 14.9882 | 945  | 0.0867          | 0.9700   |


### Framework versions

- Transformers 4.47.1
- Pytorch 2.5.1+cu121
- Datasets 3.2.0
- Tokenizers 0.21.0

normal pneumonia