Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,95 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: gpl-3.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: gpl-3.0
|
| 3 |
+
tags:
|
| 4 |
+
- bird-classification
|
| 5 |
+
- onnx
|
| 6 |
+
- efficientnet
|
| 7 |
+
- raspberry-pi
|
| 8 |
+
- hailo
|
| 9 |
+
- computer-vision
|
| 10 |
+
- real-time
|
| 11 |
+
datasets:
|
| 12 |
+
- duyminhle/nabirds
|
| 13 |
+
model-index:
|
| 14 |
+
- name: EfficientNet-B7 Backyard Feeder Bird Classifier
|
| 15 |
+
results: []
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# π¦ EfficientNet-B7 β Backyard Feeder Bird Classifier
|
| 19 |
+
|
| 20 |
+
Custom ONNX-based bird classification model trained on a filtered subset of the [NABirds dataset](https://dl.allaboutbirds.org/nabirds), optimized for backyard bird feeders.
|
| 21 |
+
|
| 22 |
+
> Designed to run on a Raspberry Pi + Hailo-8 setup in real-time as part of the [Birdwatcher Project](https://github.com/n2b8/birdwatcher)
|
| 23 |
+
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
## π§ Model Details
|
| 27 |
+
|
| 28 |
+
- Architecture: EfficientNet-B7
|
| 29 |
+
- Resolution: `600Γ600`
|
| 30 |
+
- Precision: Mixed (AMP)
|
| 31 |
+
- Format: ONNX
|
| 32 |
+
- Classes: 95 backyard species + `not_a_bird`
|
| 33 |
+
- Validation Accuracy: **93.14%** @ Epoch 23
|
| 34 |
+
- Optimized for inference on edge devices (e.g., Raspberry Pi 5 + Hailo-8)
|
| 35 |
+
|
| 36 |
+
---
|
| 37 |
+
|
| 38 |
+
## π Files
|
| 39 |
+
|
| 40 |
+
- `efficientnet_b7_backyard_feeder_birds.onnx` β Trained ONNX model
|
| 41 |
+
- `class_labels_v3.txt` β One class label per line
|
| 42 |
+
|
| 43 |
+
---
|
| 44 |
+
|
| 45 |
+
## π οΈ Intended Use
|
| 46 |
+
|
| 47 |
+
- **Use Case:** Real-time fine-grained classification of birds visiting backyard feeders
|
| 48 |
+
- **Hardware:** Optimized for Raspberry Pi + Hailo-8 AI accelerator
|
| 49 |
+
- **Pipeline:** Captures images via YOLOv8 detection, then classifies via this model
|
| 50 |
+
|
| 51 |
+
---
|
| 52 |
+
|
| 53 |
+
## π Example Inference Code
|
| 54 |
+
|
| 55 |
+
```python
|
| 56 |
+
import onnxruntime as ort
|
| 57 |
+
import numpy as np
|
| 58 |
+
from PIL import Image
|
| 59 |
+
|
| 60 |
+
# Load model
|
| 61 |
+
session = ort.InferenceSession("efficientnet_b7_backyard_feeder_birds.onnx")
|
| 62 |
+
|
| 63 |
+
# Preprocess
|
| 64 |
+
img = Image.open("bird.jpg").resize((600, 600))
|
| 65 |
+
x = np.array(img).astype(np.float32) / 255.0
|
| 66 |
+
x = np.transpose(x, (2, 0, 1))[np.newaxis, :] # CHW + batch
|
| 67 |
+
|
| 68 |
+
# Predict
|
| 69 |
+
outputs = session.run(None, {"input": x})
|
| 70 |
+
pred_idx = np.argmax(outputs[0])
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
---
|
| 74 |
+
|
| 75 |
+
## π Training
|
| 76 |
+
|
| 77 |
+
- Dataset: Subset of NABirds (filtered for common backyard species)
|
| 78 |
+
- Augmentations: Flip, rotation, brightness
|
| 79 |
+
- Regularization: Dropout, label smoothing
|
| 80 |
+
- Loss: Cross-entropy
|
| 81 |
+
- Optimizer: AdamW
|
| 82 |
+
- Early stopping enabled
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
## π Related Repos
|
| 87 |
+
|
| 88 |
+
- [Birdwatcher Project (GitHub)](https://github.com/n2b8/birdwatcher)
|
| 89 |
+
- [NABirds Dataset (Kaggle)](https://www.kaggle.com/datasets/duyminhle/nabirds)
|
| 90 |
+
|
| 91 |
+
---
|
| 92 |
+
|
| 93 |
+
## π License
|
| 94 |
+
|
| 95 |
+
GPLv3
|