tlemagueresse commited on
Commit Β·
982823f
1
Parent(s): fead6e3
Modify default parameters. Update README.md
Browse files- README.md +8 -11
- fast_model.py +2 -2
README.md
CHANGED
|
@@ -24,8 +24,8 @@ An efficient model to detect chainsaw activity in forest soundscapes using spect
|
|
| 24 |
To use the model, clone the repository and install the dependencies:
|
| 25 |
|
| 26 |
```bash
|
| 27 |
-
git clone https://huggingface.co/
|
| 28 |
-
cd
|
| 29 |
pip install -r requirements.txt
|
| 30 |
```
|
| 31 |
|
|
@@ -34,13 +34,14 @@ pip install -r requirements.txt
|
|
| 34 |
### Features
|
| 35 |
|
| 36 |
The model uses:
|
| 37 |
-
- **Spectrogram Features**
|
| 38 |
-
- **Cepstral Features**: Calculated as the FFT of the log spectrogram in a filtered quefrency range.
|
| 39 |
-
- **Time Averaging**: Both feature sets are averaged
|
| 40 |
|
| 41 |
### LightGBM Model
|
| 42 |
|
| 43 |
-
The model is a **binary classifier** (chainsaw vs environment) trained on the `rfcx/frugalai` dataset.
|
|
|
|
| 44 |
|
| 45 |
## Usage
|
| 46 |
|
|
@@ -62,7 +63,7 @@ model = FastModel(
|
|
| 62 |
feature_params=features,
|
| 63 |
lgbm_params=lgbm_params,
|
| 64 |
model_file="model/model.txt", # Path to the serialized model file
|
| 65 |
-
device="cuda"
|
| 66 |
)
|
| 67 |
|
| 68 |
# Predict on a Dataset
|
|
@@ -84,10 +85,6 @@ This project is licensed under the [Creative Commons Attribution Non-Commercial
|
|
| 84 |
|
| 85 |
---
|
| 86 |
|
| 87 |
-
## File Structure
|
| 88 |
-
π your_model_name/ βββ π model/ β βββ model.txt # Pre-trained LightGBM model β βββ features.json # Feature extraction parameters β βββ lgbm_params.json # LightGBM parameters βββ π README.md # Documentation βββ π LICENSE.md # CC BY-NC 4.0 license βββ π requirements.txt # Python dependencies βββ π fast_model.py # Model implementation
|
| 89 |
-
|
| 90 |
-
|
| 91 |
## Dataset
|
| 92 |
|
| 93 |
The model was trained and evaluated on the [Rainforest Connection (RFCx) Frugal AI](https://huggingface.co/datasets/rfcx/frugalai) dataset.
|
|
|
|
| 24 |
To use the model, clone the repository and install the dependencies:
|
| 25 |
|
| 26 |
```bash
|
| 27 |
+
git clone https://huggingface.co/tlmk22/QuefrencyGuardian
|
| 28 |
+
cd QuefrencyGuardian
|
| 29 |
pip install -r requirements.txt
|
| 30 |
```
|
| 31 |
|
|
|
|
| 34 |
### Features
|
| 35 |
|
| 36 |
The model uses:
|
| 37 |
+
- **Spectrogram Features**
|
| 38 |
+
- **Cepstral Features**: Calculated as the FFT of the log spectrogram between [`f_min`-`f_max`] in a filtered quefrency range [`fc_min`-`fc_max`].
|
| 39 |
+
- **Time Averaging**: Both feature sets are averaged along the whole audio clip for robustness in noisy settings (Welch methodology)
|
| 40 |
|
| 41 |
### LightGBM Model
|
| 42 |
|
| 43 |
+
The model is a **binary classifier** (chainsaw vs environment) trained on the `rfcx/frugalai` dataset.
|
| 44 |
+
Key model parameters are included in `model/lgbm_params.json`.
|
| 45 |
|
| 46 |
## Usage
|
| 47 |
|
|
|
|
| 63 |
feature_params=features,
|
| 64 |
lgbm_params=lgbm_params,
|
| 65 |
model_file="model/model.txt", # Path to the serialized model file
|
| 66 |
+
device="cuda",
|
| 67 |
)
|
| 68 |
|
| 69 |
# Predict on a Dataset
|
|
|
|
| 85 |
|
| 86 |
---
|
| 87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
## Dataset
|
| 89 |
|
| 90 |
The model was trained and evaluated on the [Rainforest Connection (RFCx) Frugal AI](https://huggingface.co/datasets/rfcx/frugalai) dataset.
|
fast_model.py
CHANGED
|
@@ -87,14 +87,14 @@ class FastModel:
|
|
| 87 |
self,
|
| 88 |
feature_params,
|
| 89 |
lgbm_params=None,
|
| 90 |
-
padding_method="
|
| 91 |
waveform_duration=3,
|
| 92 |
model_file=None,
|
| 93 |
mask_features=False,
|
| 94 |
mask_file="feature_mask.pkl",
|
| 95 |
mask_ratio=0.25,
|
| 96 |
batch_size=5000,
|
| 97 |
-
apply_offset_on_fit=
|
| 98 |
device="cpu",
|
| 99 |
):
|
| 100 |
self.feature_params = feature_params
|
|
|
|
| 87 |
self,
|
| 88 |
feature_params,
|
| 89 |
lgbm_params=None,
|
| 90 |
+
padding_method="reflect",
|
| 91 |
waveform_duration=3,
|
| 92 |
model_file=None,
|
| 93 |
mask_features=False,
|
| 94 |
mask_file="feature_mask.pkl",
|
| 95 |
mask_ratio=0.25,
|
| 96 |
batch_size=5000,
|
| 97 |
+
apply_offset_on_fit=False,
|
| 98 |
device="cpu",
|
| 99 |
):
|
| 100 |
self.feature_params = feature_params
|