Instructions to use DerrickLegacy256/bee-audio-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use DerrickLegacy256/bee-audio-classifier with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("DerrickLegacy256/bee-audio-classifier", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
Auto-deploy 2026-05-16 21:23 UTC
Browse files- README.md +4 -14
- bee_cnn_classifier.h5 +2 -2
- best_cnn.h5 +2 -2
- cnn_label_encoder.pkl +2 -2
- config.json +5 -34
- gradient_boosting_model.pkl +2 -2
- label_encoder.pkl +2 -2
- random_forest_model.pkl +2 -2
- svm_rbf_model.pkl +2 -2
- xgboost_model.pkl +2 -2
README.md
CHANGED
|
@@ -18,35 +18,25 @@ metrics:
|
|
| 18 |
5-class audio classifier for bee colony health monitoring.
|
| 19 |
Trained on segmented hive recordings using MFCC-based feature extraction.
|
| 20 |
|
| 21 |
-
> Last updated: 2026-05-
|
| 22 |
|
| 23 |
## Classes
|
| 24 |
|
| 25 |
| Label | Description |
|
| 26 |
|---|---|
|
| 27 |
-
|
|
| 28 |
-
| `external_noise` | — |
|
| 29 |
-
| `missing_queen` | — |
|
| 30 |
-
| `pest_infestation` | — |
|
| 31 |
-
| `pre_swarm` | — |
|
| 32 |
-
| `queenbee_present` | — |
|
| 33 |
-
| `swarming` | — |
|
| 34 |
|
| 35 |
## Model performance
|
| 36 |
|
| 37 |
| File | Description | Accuracy | F1 (weighted) |
|
| 38 |
|---|---|---|---|
|
| 39 |
-
| `random_forest_model.pkl` | Random Forest | 0.9444 | 0.9444 |
|
| 40 |
-
| `svm_rbf_model.pkl` | SVM (RBF) | 0.8889 | 0.8880 |
|
| 41 |
-
| `xgboost_model.pkl` | XGBoost **best** | 0.9630 | 0.9630 |
|
| 42 |
-
| `gradient_boosting_model.pkl` | Gradient Boosting | 0.8519 | 0.8514 |
|
| 43 |
| `bee_cnn_classifier.h5` | CNN (Mel Spectrogram) | — | — |
|
| 44 |
| `best_cnn.h5` | CNN checkpoint | — | — |
|
| 45 |
|
| 46 |
`label_encoder.pkl` is required by all classical ML models.
|
| 47 |
`cnn_label_encoder.pkl` is required by the CNN models.
|
| 48 |
|
| 49 |
-
## Feature extraction (
|
| 50 |
|
| 51 |
- 40 MFCCs × (mean + std) = 80
|
| 52 |
- 40 delta-MFCCs × mean = 40
|
|
@@ -67,7 +57,7 @@ import joblib
|
|
| 67 |
import librosa
|
| 68 |
import numpy as np
|
| 69 |
|
| 70 |
-
model = joblib.load("
|
| 71 |
le = joblib.load("label_encoder.pkl")
|
| 72 |
|
| 73 |
def extract_features(y, sr, n_mfcc=40,
|
|
|
|
| 18 |
5-class audio classifier for bee colony health monitoring.
|
| 19 |
Trained on segmented hive recordings using MFCC-based feature extraction.
|
| 20 |
|
| 21 |
+
> Last updated: 2026-05-16 21:23 UTC
|
| 22 |
|
| 23 |
## Classes
|
| 24 |
|
| 25 |
| Label | Description |
|
| 26 |
|---|---|
|
| 27 |
+
| (classes not found) | — |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
## Model performance
|
| 30 |
|
| 31 |
| File | Description | Accuracy | F1 (weighted) |
|
| 32 |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
| `bee_cnn_classifier.h5` | CNN (Mel Spectrogram) | — | — |
|
| 34 |
| `best_cnn.h5` | CNN checkpoint | — | — |
|
| 35 |
|
| 36 |
`label_encoder.pkl` is required by all classical ML models.
|
| 37 |
`cnn_label_encoder.pkl` is required by the CNN models.
|
| 38 |
|
| 39 |
+
## Feature extraction (0 features per 5-second segment)
|
| 40 |
|
| 41 |
- 40 MFCCs × (mean + std) = 80
|
| 42 |
- 40 delta-MFCCs × mean = 40
|
|
|
|
| 57 |
import librosa
|
| 58 |
import numpy as np
|
| 59 |
|
| 60 |
+
model = joblib.load("random_forest_model.pkl")
|
| 61 |
le = joblib.load("label_encoder.pkl")
|
| 62 |
|
| 63 |
def extract_features(y, sr, n_mfcc=40,
|
bee_cnn_classifier.h5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:54f4323ab877076928ed270f75f2546eb33abcd95298945ed46f41c46c00d91d
|
| 3 |
+
size 3511832
|
best_cnn.h5
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:39bc8cb8ced411542b643156a429092656991f33fad925a9d10fd4c5fdad74bb
|
| 3 |
+
size 10311896
|
cnn_label_encoder.pkl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9427afa473640fc6a600a842f24d15123636c39f77d3aae0e9e95b39e5b26637
|
| 3 |
+
size 471
|
config.json
CHANGED
|
@@ -5,18 +5,10 @@
|
|
| 5 |
"hop_length": 512,
|
| 6 |
"n_fft": 2048,
|
| 7 |
"model_type": "bee_audio_classifier",
|
| 8 |
-
"classes": [
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
"pest_infestation",
|
| 13 |
-
"pre_swarm",
|
| 14 |
-
"queenbee_present",
|
| 15 |
-
"swarming"
|
| 16 |
-
],
|
| 17 |
-
"num_classes": 7,
|
| 18 |
-
"n_features": 172,
|
| 19 |
-
"best_model": "xgboost_model.pkl",
|
| 20 |
"uploaded_files": [
|
| 21 |
"random_forest_model.pkl",
|
| 22 |
"svm_rbf_model.pkl",
|
|
@@ -27,27 +19,6 @@
|
|
| 27 |
"label_encoder.pkl",
|
| 28 |
"cnn_label_encoder.pkl"
|
| 29 |
],
|
| 30 |
-
"classical_metrics": {
|
| 31 |
-
"Random Forest": {
|
| 32 |
-
"accuracy": 0.9444,
|
| 33 |
-
"f1_weighted": 0.9444,
|
| 34 |
-
"f1_macro": 0.9444
|
| 35 |
-
},
|
| 36 |
-
"XGBoost": {
|
| 37 |
-
"accuracy": 0.963,
|
| 38 |
-
"f1_weighted": 0.963,
|
| 39 |
-
"f1_macro": 0.963
|
| 40 |
-
},
|
| 41 |
-
"SVM (RBF)": {
|
| 42 |
-
"accuracy": 0.8889,
|
| 43 |
-
"f1_weighted": 0.888,
|
| 44 |
-
"f1_macro": 0.8883
|
| 45 |
-
},
|
| 46 |
-
"Gradient Boosting": {
|
| 47 |
-
"accuracy": 0.8519,
|
| 48 |
-
"f1_weighted": 0.8514,
|
| 49 |
-
"f1_macro": 0.851
|
| 50 |
-
}
|
| 51 |
-
},
|
| 52 |
"cnn_metrics": {}
|
| 53 |
}
|
|
|
|
| 5 |
"hop_length": 512,
|
| 6 |
"n_fft": 2048,
|
| 7 |
"model_type": "bee_audio_classifier",
|
| 8 |
+
"classes": [],
|
| 9 |
+
"num_classes": 0,
|
| 10 |
+
"n_features": 0,
|
| 11 |
+
"best_model": "random_forest_model.pkl",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
"uploaded_files": [
|
| 13 |
"random_forest_model.pkl",
|
| 14 |
"svm_rbf_model.pkl",
|
|
|
|
| 19 |
"label_encoder.pkl",
|
| 20 |
"cnn_label_encoder.pkl"
|
| 21 |
],
|
| 22 |
+
"classical_metrics": {},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
"cnn_metrics": {}
|
| 24 |
}
|
gradient_boosting_model.pkl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ce9f4b17577ffc949f705d0cb21799c901447d7d12e6100f23af3834e16037dd
|
| 3 |
+
size 1118194
|
label_encoder.pkl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4dddda2fe6e0bf3028636b1009af2e9afc4512edc38d1f8480509ba9c5af04af
|
| 3 |
+
size 507
|
random_forest_model.pkl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:634c52c9555976b84f7d092f0b536a7cb77ddb7ed5aee5a019e7424947f9dfdb
|
| 3 |
+
size 251114
|
svm_rbf_model.pkl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:38c075a39756fa3d897d26a0699d83a1c9079704e309cf287525be9d7de508e4
|
| 3 |
+
size 24165
|
xgboost_model.pkl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:65cd2100915a95858c9f66175aee8347508de8a81728bbcbe6f6ea0676b9242f
|
| 3 |
+
size 465140
|