
<!-- 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-tiny-patch4-window7-224_ft_mango_leaf_disease

This model was trained from scratch on the imagefolder dataset.
It achieves the following results on the evaluation set:
- Loss: 0.0089
- Accuracy: 0.9986

## Model description
Multiclass image classification model based on [swin-tiny-patch4-window7-224](https://huggingface.co/microsoft/swin-tiny-patch4-window7-224) and fine-tuned with Mango🥭 Leaf🍃🍂 Disease Dataset.
Model was trained on 8 classes based on mango leaves health : 
Anthracnose, Bacterial Canker, Cutting Weevil, Die Back, Gall Midge, Powdery Mildew, Sooty Mould, Healthy

## Intended uses & limitations

More information needed

## Training and evaluation data
Traning and evaluation data are from this Kaggle dataset [Mango🥭 Leaf🍃🍂 Disease Dataset](https://www.kaggle.com/datasets/aryashah2k/mango-leaf-disease-dataset).
Amount of images used was 90% of total images (3600 of 4000, 450 images from each class).

## Training procedure
Dataset split : 75% train set, 20% validation set, 5% test set.

### Training hyperparameters

The following hyperparameters were used during training:
- learning_rate: 1e-05
- train_batch_size: 64
- eval_batch_size: 64
- seed: 143
- 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 |
|:-------------:|:-----:|:----:|:---------------:|:--------:|
| No log        | 0.93  | 10   | 0.1208          | 0.9931   |
| 0.1082        | 1.95  | 21   | 0.0551          | 0.9958   |
| 0.1082        | 2.98  | 32   | 0.0297          | 0.9958   |
| 0.0342        | 4.0   | 43   | 0.0189          | 0.9986   |
| 0.0342        | 4.93  | 53   | 0.0156          | 0.9972   |
| 0.0164        | 5.95  | 64   | 0.0122          | 0.9972   |
| 0.0164        | 6.98  | 75   | 0.0100          | 0.9986   |
| 0.0099        | 8.0   | 86   | 0.0096          | 0.9986   |
| 0.0099        | 8.93  | 96   | 0.0090          | 0.9986   |
| 0.0085        | 9.3   | 100  | 0.0089          | 0.9986   |


### Framework versions

- Transformers 4.33.3
- Pytorch 2.0.1+cu118
- Datasets 2.14.5
- Tokenizers 0.13.3

{"tags": ["generated_from_trainer"], "datasets": ["imagefolder"], "metrics": ["accuracy"], "model-index": [{"name": "swin-tiny-patch4-window7-224_ft_mango_leaf_disease", "results": [{"task": {"type": "image-classification", "name": "Image Classification"}, "dataset": {"name": "imagefolder", "type": "imagefolder", "config": "default", "split": "train", "args": "default"}, "metrics": [{"type": "accuracy", "value": 0.9986111111111111, "name": "Accuracy"}]}]}]}
transformers pytorch swin image-classification generated_from_trainer dataset:imagefolder model-index autotrain_compatible endpoints_compatible region:us