tlmk22 commited on
Commit
fead6e3
Β·
verified Β·
1 Parent(s): 275d8d6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +105 -91
README.md CHANGED
@@ -1,92 +1,106 @@
1
- ---
2
- license: cc-by-nc-4.0
3
- ---
4
- # Quefrency Guardian: Chainsaw Noise Detector
5
-
6
- An efficient model to detect chainsaw activity in forest soundscapes using spectral and cepstral audio features. The model is designed for environmental conservation and is based on a LightGBM classifier, capable of low-energy inference on both CPU and GPU devices. This repository provides the complete code and configuration for feature extraction, model implementation, and deployment.
7
-
8
- ## Installation
9
-
10
- To use the model, clone the repository and install the dependencies:
11
-
12
- ```bash
13
- git clone https://huggingface.co/your_username/your_model_name
14
- cd your_model_name
15
- pip install -r requirements.txt
16
- ```
17
-
18
- ## Model Overview
19
-
20
- ### Features
21
-
22
- The model uses:
23
- - **Spectrogram Features**: Extracted from frequencies between 70-1525 Hz.
24
- - **Cepstral Features**: Calculated as the FFT of the log spectrogram in a filtered quefrency range.
25
- - **Time Averaging**: Both feature sets are averaged over the time domain for robustness in noisy settings.
26
-
27
- ### LightGBM Model
28
-
29
- 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`.
30
-
31
- ## Usage
32
-
33
- ### Load the Model and Parameters
34
-
35
- ```python
36
- import json
37
- from fast_model import FastModel
38
-
39
- # Load parameters
40
- with open("model/features.json", "r") as f:
41
- features = json.load(f)
42
-
43
- with open("model/lgbm_params.json", "r") as f:
44
- lgbm_params = json.load(f)
45
-
46
- # Initialize the model
47
- model = FastModel(
48
- feature_params=features,
49
- lgbm_params=lgbm_params,
50
- model_file="model/model.txt", # Path to the serialized model file
51
- device="cuda" # Use 'cpu' if GPU is unavailable
52
- )
53
-
54
- # Predict on a Dataset
55
- from datasets import load_dataset
56
- dataset = load_dataset("rfcx/frugalai")
57
- predictions = model.predict(dataset["test"])
58
- print(predictions)
59
- ```
60
-
61
- ### Performance
62
-
63
- - **Accuracy**: 95% on the test set with a 4.5% FPR at the default threshold.
64
- - **Low-Energy Mode**: Using only 1 second of audio inference reduces energy consumption by 50%, at the cost of ~1% accuracy.
65
- - **Environmental Impact**: Inference energy consumption is **0.21 Wh**, tracked using CodeCarbon.
66
-
67
- ### License
68
-
69
- This project is licensed under the [Creative Commons Attribution Non-Commercial 4.0 International](https://creativecommons.org/licenses/by-nc/4.0/). You are free to share and adapt the work for non-commercial purposes, provided attribution is given.
70
-
71
- ---
72
-
73
- ## File Structure
74
- πŸ“‚ 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
75
-
76
-
77
- ## Dataset
78
-
79
- The model was trained and evaluated on the [Rainforest Connection (RFCx) Frugal AI](https://huggingface.co/datasets/rfcx/frugalai) dataset.
80
-
81
- #### Labels:
82
- - `0`: Chainsaw
83
- - `1`: Environment
84
-
85
- ## Limitations
86
-
87
- - **Audio Length**: The classifier is designed for 1 to 3 seconds of audio sampled at either 12 kHz or 24 kHz.
88
- - **Environmental Noise**: The model might misclassify if recordings are noisy or machinery similar to chainsaws is present.
89
-
90
- ---
91
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  This README serves as the primary documentation for Hugging Face and provides an overview of the model's purpose, data requirements, and usage.
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ datasets:
4
+ - rfcx/frugalai
5
+ language:
6
+ - en
7
+ metrics:
8
+ - accuracy
9
+ pipeline_tag: audio-classification
10
+ tags:
11
+ - acoustics
12
+ - lgbm
13
+ - frugality
14
+ - signal-processing
15
+ - climate
16
+ - chainsaw
17
+ ---
18
+ # Quefrency Guardian: Chainsaw Noise Detector
19
+
20
+ An efficient model to detect chainsaw activity in forest soundscapes using spectral and cepstral audio features. The model is designed for environmental conservation and is based on a LightGBM classifier, capable of low-energy inference on both CPU and GPU devices. This repository provides the complete code and configuration for feature extraction, model implementation, and deployment.
21
+
22
+ ## Installation
23
+
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
+
32
+ ## Model Overview
33
+
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
+
47
+ ### Load the Model and Parameters
48
+
49
+ ```python
50
+ import json
51
+ from fast_model import FastModel
52
+
53
+ # Load parameters
54
+ with open("model/features.json", "r") as f:
55
+ features = json.load(f)
56
+
57
+ with open("model/lgbm_params.json", "r") as f:
58
+ lgbm_params = json.load(f)
59
+
60
+ # Initialize the model
61
+ 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
69
+ from datasets import load_dataset
70
+ dataset = load_dataset("rfcx/frugalai")
71
+ predictions = model.predict(dataset["test"])
72
+ print(predictions)
73
+ ```
74
+
75
+ ### Performance
76
+
77
+ - **Accuracy**: 95% on the test set with a 4.5% FPR at the default threshold.
78
+ - **Low-Energy Mode**: Using only 1 second of audio inference reduces energy consumption by 50%, at the cost of ~1% accuracy.
79
+ - **Environmental Impact**: Inference energy consumption is **0.21 Wh**, tracked using CodeCarbon.
80
+
81
+ ### License
82
+
83
+ This project is licensed under the [Creative Commons Attribution Non-Commercial 4.0 International](https://creativecommons.org/licenses/by-nc/4.0/). You are free to share and adapt the work for non-commercial purposes, provided attribution is given.
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.
94
+
95
+ #### Labels:
96
+ - `0`: Chainsaw
97
+ - `1`: Environment
98
+
99
+ ## Limitations
100
+
101
+ - **Audio Length**: The classifier is designed for 1 to 3 seconds of audio sampled at either 12 kHz or 24 kHz.
102
+ - **Environmental Noise**: The model might misclassify if recordings are noisy or machinery similar to chainsaws is present.
103
+
104
+ ---
105
+
106
  This README serves as the primary documentation for Hugging Face and provides an overview of the model's purpose, data requirements, and usage.