kamera-linux commited on
Commit
9f26f3e
·
verified ·
1 Parent(s): a883c35

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: de
3
+ license: apache-2.0
4
+ tags:
5
+ - image-classification
6
+ - computer-vision
7
+ - birds
8
+ - ornithology
9
+ - wildlife
10
+ - efficientnet
11
+ datasets:
12
+ - custom
13
+ metrics:
14
+ - accuracy
15
+ model-index:
16
+ - name: german-bird-classifier
17
+ results:
18
+ - task:
19
+ type: image-classification
20
+ name: Image Classification
21
+ metrics:
22
+ - type: accuracy
23
+ value: 100.0
24
+ name: Test Accuracy
25
+ ---
26
+
27
+ # German Bird Classifier 🐦
28
+
29
+ A fine-tuned EfficientNet-B0 model for classifying 8 common German garden bird species with **100% validation accuracy**.
30
+
31
+ ## Model Description
32
+
33
+ This model was trained using [vogel-model-trainer](https://github.com/kamera-linux/vogel-model-trainer), a toolkit for creating bird classification models from video footage.
34
+
35
+ **Base Model:** `google/efficientnet-b0` (8.5M parameters)
36
+ **Fine-tuned for:** German garden birds classification
37
+ **Training Framework:** PyTorch + Hugging Face Transformers
38
+
39
+ ## Supported Species
40
+
41
+ The model can classify the following 8 bird species:
42
+
43
+ 1. **Blaumeise** (Blue Tit) - *Cyanistes caeruleus*
44
+ 2. **Grünling** (European Greenfinch) - *Chloris chloris*
45
+ 3. **Haussperling** (House Sparrow) - *Passer domesticus*
46
+ 4. **Kernbeißer** (Hawfinch) - *Coccothraustes coccothraustes*
47
+ 5. **Kleiber** (Eurasian Nuthatch) - *Sitta europaea*
48
+ 6. **Kohlmeise** (Great Tit) - *Parus major*
49
+ 7. **Rotkehlchen** (European Robin) - *Erithacus rubecula*
50
+ 8. **Sumpfmeise** (Marsh Tit) - *Poecile palustris*
51
+
52
+ ## Performance
53
+
54
+ | Species | Validation Accuracy | Samples |
55
+ |---------|---------------------|---------|
56
+ | Blaumeise | 100.0% | 5 |
57
+ | Grünling | 100.0% | 5 |
58
+ | Haussperling | 100.0% | 5 |
59
+ | Kernbeißer | 100.0% | 5 |
60
+ | Kleiber | 100.0% | 5 |
61
+ | Kohlmeise | 100.0% | 5 |
62
+ | Rotkehlchen | 100.0% | 5 |
63
+ | Sumpfmeise | 100.0% | 5 |
64
+ | **Overall** | **100.0%** | **40** |
65
+
66
+ ## Usage
67
+
68
+ ### With vogel-model-trainer
69
+
70
+ ```bash
71
+ # Install the toolkit
72
+ pip install vogel-model-trainer
73
+
74
+ # Extract birds from video using this classifier
75
+ vogel-trainer extract --folder ~/bird-data \
76
+ --species-model kamera-linux/german-bird-classifier \
77
+ --sample-rate 20 --skip-blurry --deduplicate \
78
+ video.mp4
79
+ ```
80
+
81
+ ### With Python
82
+
83
+ ```python
84
+ from transformers import AutoImageProcessor, AutoModelForImageClassification
85
+ from PIL import Image
86
+ import torch
87
+
88
+ # Load model and processor
89
+ model = AutoModelForImageClassification.from_pretrained("kamera-linux/german-bird-classifier")
90
+ processor = AutoImageProcessor.from_pretrained("kamera-linux/german-bird-classifier")
91
+
92
+ # Load and preprocess image
93
+ image = Image.open("bird.jpg")
94
+ inputs = processor(images=image, return_tensors="pt")
95
+
96
+ # Predict
97
+ with torch.no_grad():
98
+ outputs = model(**inputs)
99
+ logits = outputs.logits
100
+ predicted_class = logits.argmax(-1).item()
101
+
102
+ # Get species name
103
+ species = model.config.id2label[predicted_class]
104
+ print(f"Predicted species: {species}")
105
+ ```
106
+
107
+ ## Training Details
108
+
109
+ - **Training Date:** November 13, 2025
110
+ - **Optimizer:** AdamW with cosine LR schedule
111
+ - **Augmentation:** Random rotation, affine, color jitter, gaussian blur
112
+ - **Regularization:** Weight decay 0.01, label smoothing 0.1
113
+ - **Early Stopping:** 7 epochs patience
114
+ - **Input Size:** 224x224 pixels
115
+ - **Batch Size:** 32
116
+ - **Learning Rate:** 2e-5
117
+
118
+ ## Dataset
119
+
120
+ The model was trained on custom-collected video footage of German garden birds using the vogel-model-trainer toolkit:
121
+ - Video sources: Garden bird feeders in Germany
122
+ - Extraction method: YOLO-based bird detection + quality filtering
123
+ - Data split: 80% training / 20% validation
124
+ - Preprocessing: Blur detection, deduplication, class balancing
125
+
126
+ ## Limitations
127
+
128
+ - Trained specifically on German garden birds - may not generalize to other species or regions
129
+ - Best performance on clear, well-lit images similar to training data
130
+ - May struggle with:
131
+ - Juvenile birds with different plumage
132
+ - Birds in flight or unusual poses
133
+ - Heavy occlusion or poor lighting
134
+ - Species not in the 8 training classes
135
+
136
+ ## Ethical Considerations
137
+
138
+ This model is intended for:
139
+ - Wildlife monitoring and conservation
140
+ - Educational purposes
141
+ - Citizen science projects
142
+ - Automated bird feeder cameras
143
+
144
+ **Not recommended for:**
145
+ - Commercial wildlife tracking without proper permits
146
+ - Any use that could harm bird populations
147
+
148
+ ## Citation
149
+
150
+ If you use this model, please cite:
151
+
152
+ ```bibtex
153
+ @software{german_bird_classifier_2025,
154
+ author = {Kamera Linux},
155
+ title = {German Bird Classifier},
156
+ year = {2025},
157
+ url = {https://huggingface.co/kamera-linux/german-bird-classifier},
158
+ note = {Trained with vogel-model-trainer: https://github.com/kamera-linux/vogel-model-trainer}
159
+ }
160
+ ```
161
+
162
+ ## Links
163
+
164
+ - **Training Toolkit:** [vogel-model-trainer on GitHub](https://github.com/kamera-linux/vogel-model-trainer)
165
+ - **PyPI Package:** [vogel-model-trainer](https://pypi.org/project/vogel-model-trainer/)
166
+ - **Model Repository:** [kamera-linux/german-bird-classifier](https://huggingface.co/kamera-linux/german-bird-classifier)
167
+
168
+ ## License
169
+
170
+ Apache 2.0 - See LICENSE file for details.
171
+
172
+ ## Acknowledgments
173
+
174
+ Built with:
175
+ - [Hugging Face Transformers](https://huggingface.co/transformers/)
176
+ - [PyTorch](https://pytorch.org/)
177
+ - [Google EfficientNet](https://github.com/google/automl)
178
+ - [Ultralytics YOLO](https://github.com/ultralytics/ultralytics)
config.json ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "EfficientNetForImageClassification"
4
+ ],
5
+ "batch_norm_eps": 0.001,
6
+ "batch_norm_momentum": 0.99,
7
+ "depth_coefficient": 1.0,
8
+ "depth_divisor": 8,
9
+ "depthwise_padding": [],
10
+ "drop_connect_rate": 0.2,
11
+ "dropout_rate": 0.2,
12
+ "dtype": "float32",
13
+ "expand_ratios": [
14
+ 1,
15
+ 6,
16
+ 6,
17
+ 6,
18
+ 6,
19
+ 6,
20
+ 6
21
+ ],
22
+ "hidden_act": "swish",
23
+ "hidden_dim": 1280,
24
+ "id2label": {
25
+ "0": "blaumeise",
26
+ "1": "gr\u00fcnling",
27
+ "2": "haussperling",
28
+ "3": "kernbei\u00dfer",
29
+ "4": "kleiber",
30
+ "5": "kohlmeise",
31
+ "6": "rotkehlchen",
32
+ "7": "sumpfmeise"
33
+ },
34
+ "image_size": 224,
35
+ "in_channels": [
36
+ 32,
37
+ 16,
38
+ 24,
39
+ 40,
40
+ 80,
41
+ 112,
42
+ 192
43
+ ],
44
+ "initializer_range": 0.02,
45
+ "kernel_sizes": [
46
+ 3,
47
+ 3,
48
+ 5,
49
+ 3,
50
+ 5,
51
+ 5,
52
+ 3
53
+ ],
54
+ "label2id": {
55
+ "blaumeise": 0,
56
+ "gr\u00fcnling": 1,
57
+ "haussperling": 2,
58
+ "kernbei\u00dfer": 3,
59
+ "kleiber": 4,
60
+ "kohlmeise": 5,
61
+ "rotkehlchen": 6,
62
+ "sumpfmeise": 7
63
+ },
64
+ "model_type": "efficientnet",
65
+ "num_block_repeats": [
66
+ 1,
67
+ 2,
68
+ 2,
69
+ 3,
70
+ 3,
71
+ 4,
72
+ 1
73
+ ],
74
+ "num_channels": 3,
75
+ "num_hidden_layers": 64,
76
+ "out_channels": [
77
+ 16,
78
+ 24,
79
+ 40,
80
+ 80,
81
+ 112,
82
+ 192,
83
+ 320
84
+ ],
85
+ "out_features": null,
86
+ "pooling_type": "mean",
87
+ "squeeze_expansion_ratio": 0.25,
88
+ "stage_names": [
89
+ "stem",
90
+ "stage1",
91
+ "stage2",
92
+ "stage3",
93
+ "stage4",
94
+ "stage5",
95
+ "stage6",
96
+ "stage7"
97
+ ],
98
+ "strides": [
99
+ 1,
100
+ 2,
101
+ 2,
102
+ 2,
103
+ 1,
104
+ 2,
105
+ 1
106
+ ],
107
+ "transformers_version": "4.57.1",
108
+ "width_coefficient": 1.0
109
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d9ad0b5329aca20dcff6f0cf65caaaf618285352c3c3ab14a249f8857e3f3a00
3
+ size 16285880
preprocessor_config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": {
3
+ "height": 289,
4
+ "width": 289
5
+ },
6
+ "do_center_crop": false,
7
+ "do_normalize": true,
8
+ "do_rescale": true,
9
+ "do_resize": true,
10
+ "image_mean": [
11
+ 0.485,
12
+ 0.456,
13
+ 0.406
14
+ ],
15
+ "image_processor_type": "EfficientNetImageProcessor",
16
+ "image_std": [
17
+ 0.47853944,
18
+ 0.4732864,
19
+ 0.47434163
20
+ ],
21
+ "include_top": true,
22
+ "resample": 0,
23
+ "rescale_factor": 0.00392156862745098,
24
+ "rescale_offset": false,
25
+ "size": {
26
+ "height": 224,
27
+ "width": 224
28
+ }
29
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98e48fb60c7ffd6a5f286494481d604df4a4fa9942cf6b558c58654f0a099f19
3
+ size 5905
training_config.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_name": "google/efficientnet-b0",
3
+ "species": [
4
+ "blaumeise",
5
+ "gr\u00fcnling",
6
+ "haussperling",
7
+ "kernbei\u00dfer",
8
+ "kleiber",
9
+ "kohlmeise",
10
+ "rotkehlchen",
11
+ "sumpfmeise"
12
+ ],
13
+ "num_classes": 8,
14
+ "timestamp": "20251113_232759",
15
+ "batch_size": 16,
16
+ "num_epochs": 50,
17
+ "learning_rate": 0.0002
18
+ }