Image Classification
Transformers
TensorBoard
Safetensors
vit
Generated from Trainer
Eval Results (legacy)
Instructions to use Schram03/fruits-classification with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Schram03/fruits-classification with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="Schram03/fruits-classification") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("Schram03/fruits-classification") model = AutoModelForImageClassification.from_pretrained("Schram03/fruits-classification", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from Schram03/fruits-classification: direct link, hf CLI and curl.
- Browser
- Download file 2.33 kB
-
https://huggingface.co/Schram03/fruits-classification/resolve/main/README.md
- Command line
-
hf download hf://Schram03/fruits-classification/README.md
-
curl -L -o README.md https://huggingface.co/Schram03/fruits-classification/resolve/main/README.md
2.33 kB
| library_name: transformers | |
| license: apache-2.0 | |
| base_model: google/vit-base-patch16-224 | |
| tags: | |
| - image-classification | |
| - generated_from_trainer | |
| datasets: | |
| - imagefolder | |
| metrics: | |
| - accuracy | |
| model-index: | |
| - name: fruits-classification | |
| results: | |
| - task: | |
| name: Image Classification | |
| type: image-classification | |
| dataset: | |
| name: Schram03/fruits | |
| type: imagefolder | |
| config: default | |
| split: train | |
| args: default | |
| metrics: | |
| - name: Accuracy | |
| type: accuracy | |
| value: 0.9280373831775701 | |
| <!-- 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. --> | |
| # fruits-classification | |
| This model is a fine-tuned version of [google/vit-base-patch16-224](https://huggingface.co/google/vit-base-patch16-224) on the augmented Schram03/fruits dataset. | |
| It achieves the following results on the evaluation set: | |
| - Loss: 0.3039 | |
| - Accuracy: 0.9280 | |
| ## Model description | |
| This model classifies the 33 different types of fruit in the Schram03/fruits dataset. | |
| ## Intended uses & limitations | |
| With further developement it could be possible to differentiat foul fruits or specific subtypes of fruit. This however would need an extensive Dataset. | |
| Currently the model is able to differentiat the trained 33 types of fruit. However, there are limitations especially when using similar fruits like peaches and nectarines. | |
| ## Training and evaluation data | |
| 80 % Train, 20 % Evaluation | |
| ## Training procedure | |
| ### Training hyperparameters | |
| The following hyperparameters were used during training: | |
| - learning_rate: 0.0003 | |
| - train_batch_size: 16 | |
| - eval_batch_size: 8 | |
| - seed: 42 | |
| - lr_scheduler_type: linear | |
| - num_epochs: 5 | |
| ### Training results | |
| | Training Loss | Epoch | Step | Validation Loss | Accuracy | | |
| |:-------------:|:-----:|:----:|:---------------:|:--------:| | |
| | 0.5816 | 1.0 | 1070 | 0.5238 | 0.8887 | | |
| | 0.3761 | 2.0 | 2140 | 0.3568 | 0.9182 | | |
| | 0.2934 | 3.0 | 3210 | 0.2852 | 0.9322 | | |
| | 0.2719 | 4.0 | 4280 | 0.2681 | 0.9388 | | |
| | 0.253 | 5.0 | 5350 | 0.2705 | 0.9388 | | |
| ### Framework versions | |
| - Transformers 4.52.3 | |
| - Pytorch 2.7.0+cu128 | |
| - Datasets 3.6.0 | |
| - Tokenizers 0.21.1 | |