
<!-- 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-base-patch16-224-finetuned-brain-tumor-classification

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

## 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: 10

### Training results

| Training Loss | Epoch  | Step | Validation Loss | Accuracy |
|:-------------:|:------:|:----:|:---------------:|:--------:|
| 3.1659        | 0.9897 | 48   | 2.4060          | 0.4086   |
| 1.8381        | 2.0    | 97   | 1.2904          | 0.6772   |
| 1.0781        | 2.9897 | 145  | 0.9211          | 0.7573   |
| 0.8049        | 4.0    | 194  | 0.7274          | 0.8036   |
| 0.6091        | 4.9897 | 242  | 0.6427          | 0.8330   |
| 0.4985        | 6.0    | 291  | 0.5519          | 0.8510   |
| 0.4077        | 6.9897 | 339  | 0.4921          | 0.8792   |
| 0.3583        | 8.0    | 388  | 0.4756          | 0.8826   |
| 0.3292        | 8.9897 | 436  | 0.4472          | 0.8883   |
| 0.338         | 9.8969 | 480  | 0.4348          | 0.8905   |


### Framework versions

- Transformers 4.42.4
- Pytorch 2.3.1+cu121
- Datasets 2.20.0
- Tokenizers 0.19.1

astrocitoma t1 astrocitoma t1c+ astrocitoma t2 carcinoma t1 carcinoma t1c+ carcinoma t2 ependimoma t1 ependimoma t1c+ ependimoma t2 ganglioglioma t1 ganglioglioma t1c+ ganglioglioma t2 germinoma t1 germinoma t1c+ germinoma t2 glioblastoma t1 glioblastoma t1c+ glioblastoma t2 granuloma t1 granuloma t1c+ granuloma t2 meduloblastoma t1 meduloblastoma t1c+ meduloblastoma t2 meningioma t1 meningioma t1c+ meningioma t2 neurocitoma t1 neurocitoma t1c+ neurocitoma t2 oligodendroglioma t1 oligodendroglioma t1c+ oligodendroglioma t2 papiloma t1 papiloma t1c+ papiloma t2 schwannoma t1 schwannoma t1c+ schwannoma t2 t1 tuberculoma t1 _normal t1c+ tuberculoma t2 tuberculoma t2 _normal