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

# swin-base-patch4-window7-224-in22k-finetuned-brain-tumor-final_04

This model is a fine-tuned version of [microsoft/swin-base-patch4-window7-224-in22k](https://huggingface.co/microsoft/swin-base-patch4-window7-224-in22k) on the imagefolder dataset.
It achieves the following results on the evaluation set:
- Loss: 0.1011
- Accuracy: 0.9675
- F1 Score: 0.9673
- Precision: 0.9675

## 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: 64
- eval_batch_size: 64
- seed: 42
- gradient_accumulation_steps: 4
- total_train_batch_size: 256
- 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 | F1 Score | Precision |
|:-------------:|:-----:|:----:|:---------------:|:--------:|:--------:|:---------:|
| 0.8612        | 0.96  | 20   | 0.5617          | 0.8041   | 0.7839   | 0.8166    |
| 0.2544        | 1.98  | 41   | 0.3496          | 0.8759   | 0.8723   | 0.8858    |
| 0.1305        | 2.99  | 62   | 0.1768          | 0.9294   | 0.9285   | 0.9323    |
| 0.0766        | 4.0   | 83   | 0.1201          | 0.9510   | 0.9503   | 0.9507    |
| 0.0651        | 4.96  | 103  | 0.1046          | 0.9636   | 0.9633   | 0.9641    |
| 0.0532        | 5.98  | 124  | 0.1001          | 0.9664   | 0.9660   | 0.9663    |
| 0.0374        | 6.99  | 145  | 0.1416          | 0.9505   | 0.9498   | 0.9515    |
| 0.0263        | 8.0   | 166  | 0.1032          | 0.9630   | 0.9626   | 0.9628    |
| 0.0234        | 8.96  | 186  | 0.1011          | 0.9675   | 0.9673   | 0.9675    |
| 0.0207        | 9.64  | 200  | 0.1026          | 0.9647   | 0.9644   | 0.9647    |


### Framework versions

- Transformers 4.29.2
- Pytorch 2.0.1+cu117
- Datasets 2.12.0
- Tokenizers 0.13.3

glioma meningioma notumor pituitary