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-04 07:31 UTC
Browse files- README.md +9 -7
- bee_cnn_classifier.h5 +2 -2
- best_cnn.h5 +2 -2
- cnn_label_encoder.pkl +2 -2
- config.json +17 -15
- 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,7 +18,7 @@ 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-
|
| 22 |
|
| 23 |
## Classes
|
| 24 |
|
|
@@ -27,6 +27,8 @@ Trained on segmented hive recordings using MFCC-based feature extraction.
|
|
| 27 |
| `active_colony` | — |
|
| 28 |
| `external_noise` | — |
|
| 29 |
| `missing_queen` | — |
|
|
|
|
|
|
|
| 30 |
| `queenbee_present` | — |
|
| 31 |
| `swarming` | — |
|
| 32 |
|
|
@@ -34,17 +36,17 @@ Trained on segmented hive recordings using MFCC-based feature extraction.
|
|
| 34 |
|
| 35 |
| File | Description | Accuracy | F1 (weighted) |
|
| 36 |
|---|---|---|---|
|
| 37 |
-
| `random_forest_model.pkl` | Random Forest | 0.
|
| 38 |
-
| `svm_rbf_model.pkl` | SVM (RBF) | 0.
|
| 39 |
-
| `xgboost_model.pkl` | XGBoost | 0.
|
| 40 |
-
| `gradient_boosting_model.pkl` | Gradient Boosting
|
| 41 |
| `bee_cnn_classifier.h5` | CNN (Mel Spectrogram) | — | — |
|
| 42 |
| `best_cnn.h5` | CNN checkpoint | — | — |
|
| 43 |
|
| 44 |
`label_encoder.pkl` is required by all classical ML models.
|
| 45 |
`cnn_label_encoder.pkl` is required by the CNN models.
|
| 46 |
|
| 47 |
-
## Feature extraction (
|
| 48 |
|
| 49 |
- 40 MFCCs × (mean + std) = 80
|
| 50 |
- 40 delta-MFCCs × mean = 40
|
|
@@ -65,7 +67,7 @@ import joblib
|
|
| 65 |
import librosa
|
| 66 |
import numpy as np
|
| 67 |
|
| 68 |
-
model = joblib.load("
|
| 69 |
le = joblib.load("label_encoder.pkl")
|
| 70 |
|
| 71 |
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-04 07:31 UTC
|
| 22 |
|
| 23 |
## Classes
|
| 24 |
|
|
|
|
| 27 |
| `active_colony` | — |
|
| 28 |
| `external_noise` | — |
|
| 29 |
| `missing_queen` | — |
|
| 30 |
+
| `pest_infestation` | — |
|
| 31 |
+
| `pre_swarm` | — |
|
| 32 |
| `queenbee_present` | — |
|
| 33 |
| `swarming` | — |
|
| 34 |
|
|
|
|
| 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 (172 features per 5-second segment)
|
| 50 |
|
| 51 |
- 40 MFCCs × (mean + std) = 80
|
| 52 |
- 40 delta-MFCCs × mean = 40
|
|
|
|
| 67 |
import librosa
|
| 68 |
import numpy as np
|
| 69 |
|
| 70 |
+
model = joblib.load("xgboost_model.pkl")
|
| 71 |
le = joblib.load("label_encoder.pkl")
|
| 72 |
|
| 73 |
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:7bb2271449a4e3ab0cde7b031d8b715c80e5daf005604c12afcf4d06f9747c89
|
| 3 |
+
size 10338648
|
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:03da19df528e31203779cdd80e7e37a399a3f3386d6323500947a17b02f9a7ff
|
| 3 |
+
size 10339680
|
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:f0210b6f936b52173530a2bcdce5b3579b17505ae11bfe403257509638d2e7ec
|
| 3 |
+
size 775
|
config.json
CHANGED
|
@@ -9,12 +9,14 @@
|
|
| 9 |
"active_colony",
|
| 10 |
"external_noise",
|
| 11 |
"missing_queen",
|
|
|
|
|
|
|
| 12 |
"queenbee_present",
|
| 13 |
"swarming"
|
| 14 |
],
|
| 15 |
-
"num_classes":
|
| 16 |
-
"n_features":
|
| 17 |
-
"best_model": "
|
| 18 |
"uploaded_files": [
|
| 19 |
"random_forest_model.pkl",
|
| 20 |
"svm_rbf_model.pkl",
|
|
@@ -27,24 +29,24 @@
|
|
| 27 |
],
|
| 28 |
"classical_metrics": {
|
| 29 |
"Random Forest": {
|
| 30 |
-
"accuracy": 0.
|
| 31 |
-
"f1_weighted": 0.
|
| 32 |
-
"f1_macro": 0.
|
| 33 |
},
|
| 34 |
"XGBoost": {
|
| 35 |
-
"accuracy": 0.
|
| 36 |
-
"f1_weighted": 0.
|
| 37 |
-
"f1_macro": 0.
|
| 38 |
},
|
| 39 |
"SVM (RBF)": {
|
| 40 |
-
"accuracy": 0.
|
| 41 |
-
"f1_weighted": 0.
|
| 42 |
-
"f1_macro": 0.
|
| 43 |
},
|
| 44 |
"Gradient Boosting": {
|
| 45 |
-
"accuracy": 0.
|
| 46 |
-
"f1_weighted": 0.
|
| 47 |
-
"f1_macro": 0.
|
| 48 |
}
|
| 49 |
},
|
| 50 |
"cnn_metrics": {}
|
|
|
|
| 9 |
"active_colony",
|
| 10 |
"external_noise",
|
| 11 |
"missing_queen",
|
| 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",
|
|
|
|
| 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": {}
|
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:250a29a4d07bcfc201533998e536749ba0b1c9f28fd2decaba0c852154250a20
|
| 3 |
+
size 271893
|
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:e83ea1a0f90dadf6bfff1fcd5a94a8f2a158cc45b8dfa6a5a2c5d44db873ccfc
|
| 3 |
+
size 500
|
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:cec4643dfcd52e5a87b99677efe5cc0232743d08ee3d2ea3d038cbab9dd85b27
|
| 3 |
+
size 341810
|
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:9a65bb125d288e5932202145b7856245d1972d07581dad9d398f8474b01d02ea
|
| 3 |
+
size 41309
|
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:bc9a068ceed83fd9c399618c44164024de4612173081e3db11164d0d72ceaa0e
|
| 3 |
+
size 232497
|