|
|
--- |
|
|
license: mit |
|
|
language: |
|
|
- en |
|
|
tags: |
|
|
- audio-classification |
|
|
- cnn |
|
|
- environmental-sound |
|
|
- anthropogenic-noise |
|
|
- bioacoustics |
|
|
- soundscape-monitoring |
|
|
metrics: |
|
|
- accuracy |
|
|
- precision |
|
|
- recall |
|
|
- auc |
|
|
library_name: keras |
|
|
--- |
|
|
|
|
|
# π QuietHorizon CNN |
|
|
A convolutional neural network for **detecting anthropogenic noise vs natural soundscapes**. |
|
|
|
|
|
QuietHorizon is a lightweight environmental audio classifier that identifies whether a 1β2 second audio clip contains **anthropogenic (human-made)** noise or **natural** sounds. |
|
|
It is designed to support **wildlife monitoring**, **soundscape conservation**, **noise-pollution mapping**, and **bioacoustic filtering pipelines**. |
|
|
|
|
|
--- |
|
|
|
|
|
## π§ Model Summary |
|
|
|
|
|
- **Architecture:** CNN (Mel-spectrogram input β Conv layers β Dense classifier) |
|
|
- **Framework:** TensorFlow / Keras |
|
|
- **Classes:** |
|
|
- `0 = natural` |
|
|
- `1 = anthropogenic` |
|
|
- **Training clips:** ~20,000 samples |
|
|
- ~13k clean nature (birds, frogs, mammals, rain, thunder) |
|
|
- ~7k anthropogenic (vehicles, tools, aircraft, boats, construction, etc.) |
|
|
- **Data augmentation:** |
|
|
- Noise injection |
|
|
- Gain shift |
|
|
- Time stretch |
|
|
- Pitch shift |
|
|
- Synthetic mixtures (25% natural over anthropogenic) |
|
|
|
|
|
--- |
|
|
|
|
|
## π Performance |
|
|
|
|
|
Evaluated on an unseen test set. |
|
|
|
|
|
| Metric | Score | |
|
|
|-------|-------| |
|
|
| **Accuracy** | 0.95 | |
|
|
| **Precision** | 0.95 | |
|
|
| **Recall** | 0.96 | |
|
|
| **ROC-AUC** | 0.99 | |
|
|
|
|
|
This means the model is excellent at **detecting contaminated audio** and **rarely misses anthropogenic noise**. |
|
|
|
|
|
--- |
|
|
|
|
|
## π§ͺ Intended Use |
|
|
|
|
|
**Intended Applications** |
|
|
- Acoustic monitoring systems |
|
|
- Noise pollution detection (roads, aircraft, construction) |
|
|
- Wildlife conservation pipelines |
|
|
- Pre-filtering for bird/frog classifiers |
|
|
- Smart microphones / embedded eco-monitoring |
|
|
|
|
|
**Not Intended For** |
|
|
- Determining exact species |
|
|
- Identifying specific anthropogenic categories (e.g., car vs plane) |
|
|
- Legal, medical, or safety-critical decisions |
|
|
|
|
|
--- |
|
|
|
|
|
## π₯ How to Use |
|
|
|
|
|
### **Python Inference Example** |
|
|
|
|
|
```python |
|
|
import tensorflow as tf |
|
|
import librosa |
|
|
import numpy as np |
|
|
|
|
|
model = tf.keras.models.load_model("quiet_horizon_cnn.keras") |
|
|
|
|
|
def predict(path): |
|
|
y, sr = librosa.load(path, sr=22050, mono=True) |
|
|
mel = librosa.feature.melspectrogram(y=y, sr=sr, n_mels=128) |
|
|
logmel = librosa.power_to_db(mel) |
|
|
logmel = np.expand_dims(logmel, axis=(0, -1)) # shape: (1, H, W, 1) |
|
|
|
|
|
pred = model.predict(logmel)[0][0] |
|
|
return float(pred), "anthro" if pred > 0.5 else "nature" |
|
|
|
|
|
score, label = predict("example.wav") |
|
|
print(score, label) |
|
|
|