German Bird Classifier v2 🐦
High-accuracy German garden bird species classifier based on EfficientNet-B2.
This is version 2 of the German bird classifier with significantly improved performance:
✅ 99.71% accuracy (vs. 87.69% in v1)
✅ 42× fewer errors (3 vs. 128 misclassifications)
✅ Perfect classification for 5 out of 8 species
Model Description
This model classifies 8 common German garden bird species from images. It was trained using the
vogel-model-trainer toolkit on 4,160 training images extracted from real-world bird feeder camera footage.
Architecture: EfficientNet-B2
Framework: PyTorch + Hugging Face Transformers
Input: RGB images (224×224)
Output: 8 species classes with confidence scores
Supported Species
Blaumeise (Blue Tit) - Cyanistes caeruleus
Grünling (European Greenfinch) - Chloris chloris
Haussperling (House Sparrow) - Passer domesticus
Kernbeißer (Hawfinch) - Coccothraustes coccothraustes
Kleiber (Eurasian Nuthatch) - Sitta europaea
Kohlmeise (Great Tit) - Parus major
Rotkehlchen (European Robin) - Erithacus rubecula
Sumpfmeise (Marsh Tit) - Poecile palustris
Performance
Overall Metrics (Validation Set: 1,040 images)
Metric Value Accuracy 99.71% Macro F1-Score 99.7% Weighted F1-Score 99.7% Correct Classifications 1,037 / 1,040 Misclassifications 3
Per-Species Performance
Species Precision Recall F1-Score Samples Blaumeise 98.5% 100.0% 99.2% 130 Grünling 100.0% 100.0% 100.0% 130 Haussperling 100.0% 100.0% 100.0% 130 Kernbeißer 100.0% 100.0% 100.0% 130 Kleiber 100.0% 100.0% 100.0% 130 Kohlmeise 99.2% 99.2% 99.2% 130 Rotkehlchen 100.0% 99.2% 99.6% 130 Sumpfmeise 100.0% 99.2% 99.6% 130
5 out of 8 species achieve perfect 100% F1-score!
Comparison to v1
Metric v1 v2 Improvement Overall Accuracy 87.69% 99.71% +12.0pp Macro F1-Score 87.3% 99.7% +12.4pp Misclassifications 128 3 -97.7% Error Rate Reduction - - 42.7×
Biggest improvements:
🎯 Grünling: 58.7% → 100.0% F1 (+41.3pp)
🎯 Haussperling: 72.0% → 100.0% F1 (+28.0pp)
🎯 Rotkehlchen: 89.5% → 99.6% F1 (+10.1pp)
Usage
Quick Start
1 from transformers import AutoImageProcessor , AutoModelForImageClassification
2 from PIL import Image
3 import torch
4
5 # Load model and processor
6 model_name = "kamera-linux/german-bird-classifier-v2"
7 processor = AutoImageProcessor . from_pretrained ( model_name )
8 model = AutoModelForImageClassification . from_pretrained ( model_name )
9
10 # Load and preprocess image
11 image = Image . open ( "bird.jpg" )
12 inputs = processor ( images = image , return_tensors = "pt" )
13
14 # Predict
15 with torch . no_grad ( ) :
16 outputs = model ( ** inputs )
17 logits = outputs . logits
18 predicted_class = logits . argmax ( - 1 ) . item ( )
19 confidence = torch . softmax ( logits , dim = - 1 ) [ 0 ] [ predicted_class ] . item ( )
20
21 # Get species name
22 species = model . config . id2label [ predicted_class ]
23 print ( f"Species: { species } (Confidence: { confidence : .2% } )" )
Using vogel-model-trainer CLI
1 # Install the toolkit
2 pip install vogel-model-trainer
3
4 # Classify images
5 vogel-trainer classify \
6 --species-model kamera-linux/german-bird-classifier-v2 \
7 ~/bird-photos/ \
8 --sort-output ~/sorted/ \
9 --min-confidence 0.90 \
10 --csv-report results.csv
11
12 # Evaluate model performance
13 vogel-trainer evaluate \
14 --species-model kamera-linux/german-bird-classifier-v2 \
15 --test-dir ~/test-dataset/ \
16 --export-json metrics.json
Batch Processing
1 from transformers import pipeline
2
3 # Create classifier pipeline
4 classifier = pipeline (
5 "image-classification" ,
6 model = "kamera-linux/german-bird-classifier-v2" ,
7 device = 0 # GPU
8 )
9
10 # Classify multiple images
11 images = [ "bird1.jpg" , "bird2.jpg" , "bird3.jpg" ]
12 results = classifier ( images , top_k = 3 )
13
14 for img , preds in zip ( images , results ) :
15 print ( f"\n { img } :" )
16 for pred in preds :
17 print ( f" { pred [ 'label' ] } : { pred [ 'score' ] : .2% } " )
Training Details
Dataset
Training images: 4,160 (520 per species)
Validation images: 1,040 (130 per species)
Source: Real-world bird feeder camera footage
Image size: 224×224 pixels
Perfectly balanced: Equal samples per class
Training Configuration
Model: google/efficientnet-b2
Epochs: 50 (with early stopping)
Batch Size: 32
Learning Rate: 0.0001
Optimizer: AdamW
Scheduler: Cosine with warmup
Augmentation: Heavy
- Random rotation
- Random horizontal flip
- Color jitter
- Random brightness/contrast
Early Stopping Patience: 15 epochs
Hardware: NVIDIA RTX 2070 SUPER (8GB)
Training Time: ~35 minutes
Framework: PyTorch 2.9.1 + Transformers 4.57.1
Data Processing
Images were extracted from videos using YOLOv8n bird detection:
Detection: Birds detected in video frames
Extraction: Cropped bird regions saved as images
Deduplication: Similar frames removed using perceptual hashing
Organization: Manual verification and species labeling
Split: 80% training, 20% validation
Model Size & Performance
Metric Value Model Size 16 MB (safetensors) Parameters ~9.1M Inference Speed (GPU) ~100 images/sec Inference Speed (CPU) ~10 images/sec Memory Usage (GPU) ~300 MB Memory Usage (CPU) ~200 MB
Limitations & Bias
Known Limitations
Species Scope: Only trained on 8 common German garden birds
Tit Confusion: Occasional confusion between similar tit species (Blaumeise, Kohlmeise, Sumpfmeise)
Image Quality: Best performance on clear, well-lit images
Pose Dependency: Trained primarily on frontal/side views from bird feeders
Juvenile Birds: May struggle with juvenile plumage variations
Seasonal Variations: Limited seasonal plumage data
Potential Biases
Feeder Bias: Trained on bird feeder footage, may not generalize to natural settings
Geographic Bias: German garden birds, regional appearance variations may exist
Equipment Bias: Optimized for similar camera setups and lighting conditions
Error Analysis
The 3 misclassifications on validation set:
Kohlmeise → Blaumeise (91% confidence) - Similar coloring in poor lighting
Rotkehlchen → Blaumeise (23% confidence) - Low confidence, model uncertain
Sumpfmeise → Kohlmeise (76% confidence) - Very similar tit species
Recommendation: Use --min-confidence 0.85 threshold to filter uncertain predictions.
Intended Use
Primary Use Cases
✅ Automated bird feeder monitoring
✅ Citizen science bird counting
✅ Wildlife camera image classification
✅ Educational bird identification apps
✅ Biodiversity research
Out-of-Scope Uses
❌ Classifying non-German bird species
❌ Identifying birds outside the 8 trained species
❌ Medical/diagnostic applications
❌ Legal evidence or regulatory decisions
❌ Security/surveillance applications
Citation
If you use this model in your research, please cite:
1 @misc{german-bird-classifier-v2,
2 title={German Bird Classifier v2: High-Accuracy Garden Bird Species Classification},
3 author={kamera-linux},
4 year={2025},
5 publisher={Hugging Face},
6 url={https://huggingface.co/kamera-linux/german-bird-classifier-v2}
7 }
Related Resources
Training Toolkit: vogel-model-trainer
PyPI Package: vogel-model-trainer
v1 Model (deprecated): german-bird-classifier
Documentation: GitHub README
License
This model is released under the
Apache License 2.0 . See the
LICENSE file for details.
Acknowledgments
Ultralytics for YOLOv8 bird detection
Hugging Face for Transformers library and model hosting
PyTorch Team for the deep learning framework
Google for EfficientNet architecture
Trained with ❤️ using vogel-model-trainer