--- license: apache-2.0 base_model: google/vit-base-patch16-224 datasets: - meganariley/inat-wildflowers-25 tags: - image-classification - wildflowers - plants - inaturalist - vit - vision metrics: - accuracy pipeline_tag: image-classification model-index: - name: wildflower-classifier-vit results: - task: type: image-classification name: Image Classification dataset: name: inat-wildflowers-25 type: meganariley/inat-wildflowers-25 split: test metrics: - name: Accuracy type: accuracy value: 0.979 --- # ๐ŸŒธ Wildflower Classifier โ€” ViT Base A **Vision Transformer (ViT)** fine-tuned to identify **25 North American wildflower species** from photographs, achieving **97.9% test accuracy**. ## Model Details - **Base model**: [google/vit-base-patch16-224](https://huggingface.co/google/vit-base-patch16-224) - **Architecture**: ViT-Base (86.6M params, patch size 16, input 224ร—224) - **Task**: Multi-class image classification (25 classes) - **Training data**: [meganariley/inat-wildflowers-25](https://huggingface.co/datasets/meganariley/inat-wildflowers-25) โ€” 10,000 research-grade iNaturalist photos ## Performance | Split | Accuracy | Loss | |-------|----------|------| | Validation | 97.1% | 0.098 | | **Test** | **97.9%** | **0.082** | ### Per-Class Test Accuracy | Species | Accuracy | Species | Accuracy | |---------|----------|---------|----------| | Blazing Star | 95.0% | Marsh Marigold | 97.5% | | Blue Flag Iris | 100.0% | Ox-eye Daisy | 95.0% | | California Poppy | 97.5% | Queen Anne's Lace | 95.0% | | Canada Goldenrod | 100.0% | Spring Beauty | 100.0% | | Cardinal Flower | 100.0% | Trout Lily | 100.0% | | Colorado Columbine | 97.5% | Virginia Bluebells | 97.5% | | Common Milkweed | 97.5% | White Trillium | 97.5% | | Common Yarrow | 100.0% | Wild Bergamot | 97.5% | | Dutchman's Breeches | 100.0% | Wild Columbine | 100.0% | | Fireweed | 95.0% | Wild Lupine | 100.0% | | Indian Blanket | 97.5% | Wild Rose | 100.0% | | Indian Paintbrush | 95.0% | Joe-Pye Weed | 95.0% | | Jack-in-the-Pulpit | 97.5% | | | **10 species at 100% accuracy** ยท All species โ‰ฅ 95% ## Training - **Epochs**: 5 - **Optimizer**: AdamW (lr=5e-5, weight_decay=0.01) - **Batch size**: 16 ร— 4 gradient accumulation = effective 64 - **Warmup**: 10% linear - **Augmentation**: RandomResizedCrop, HorizontalFlip, ColorJitter - **Hardware**: CPU (8 vCPU / 32GB RAM) - **Training time**: ~2 hours ### Training Curve | Epoch | Val Accuracy | Val Loss | |-------|-------------|----------| | 1 | 93.5% | 0.255 | | 2 | 95.2% | 0.146 | | 3 | 96.3% | 0.114 | | 4 | 97.0% | 0.104 | | 5 | 97.1% | 0.098 | ## Usage ```python from transformers import pipeline classifier = pipeline("image-classification", model="meganariley/wildflower-classifier-vit") results = classifier("path/to/wildflower.jpg", top_k=5) for r in results: print(f"{r['label']}: {r['score']:.3f}") ``` ## Demo Try it live: [๐ŸŒธ Wildflower Identifier Space](https://huggingface.co/spaces/meganariley/wildflower-identifier) ## License Apache 2.0 (base model license). Training data from iNaturalist under CC BY-NC 4.0.