tlemagueresse commited on
Commit
982823f
Β·
1 Parent(s): fead6e3

Modify default parameters. Update README.md

Browse files
Files changed (2) hide show
  1. README.md +8 -11
  2. 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/your_username/your_model_name
28
- cd your_model_name
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**: Extracted from frequencies between 70-1525 Hz.
38
- - **Cepstral Features**: Calculated as the FFT of the log spectrogram in a filtered quefrency range.
39
- - **Time Averaging**: Both feature sets are averaged over the time domain for robustness in noisy settings.
40
 
41
  ### LightGBM Model
42
 
43
- The model is a **binary classifier** (chainsaw vs environment) trained on the `rfcx/frugalai` dataset. Key model parameters are included in `model/lgbm_params.json`.
 
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" # Use 'cpu' if GPU is unavailable
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="zero",
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=True,
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