|
Download README.md from pengowray/oversample-denoise: direct link, hf CLI and curl.
- Browser
- Download file 3.31 kB
-
https://huggingface.co/pengowray/oversample-denoise/resolve/main/README.md
- Command line
-
hf download hf://pengowray/oversample-denoise/README.md
-
curl -L -o README.md https://huggingface.co/pengowray/oversample-denoise/resolve/main/README.md
3.31 kB
| tags: | |
| - audio | |
| - denoising | |
| - bioacoustics | |
| - bats | |
| - birds | |
| - onnx | |
| # Oversample denoiser, v2 | |
| A small convolution network that lowers the background noise in recordings of | |
| bats and birds. [Oversample](https://app.oversample.com) downloads this file | |
| when you press Make Denoised Copy in its Noise menu. | |
| It replaces | |
| [oversample-bat-denoise v1](https://huggingface.co/pengowray/oversample-bat-denoise), | |
| which was trained on bat recordings only. The network's shape and size are the | |
| same; only the weights differ. | |
| - File: `oversample-denoise-v2.onnx` (264 KB, 64,513 weights, opset 17) | |
| - Input `feat`: shape (1, 1, 257, frames), float32 | |
| - Output `logit`: the same shape | |
| ## How it is used | |
| The model gives a gain for every bin of a 512-point STFT (hop 128, periodic Hann | |
| window). The audio is used sample for sample at its own rate, with no | |
| resampling, so one bin is 43 Hz wide at 22.05 kHz and 750 Hz wide at 384 kHz. | |
| 1. Divide the audio by a noise scale: the square root of the median STFT power | |
| over every frame and every bin from 20 up, divided by 11.536. | |
| 2. Take the STFT. Features are `log(|Z| + 0.1)` minus each bin's median over | |
| time, in blocks of 1,024 frames with 64 frames of context on each side. | |
| 3. Raw gain = `2 * sigmoid(logit) - 1`. | |
| 4. Smooth the gain: each cell becomes the median of the 5 bins by 9 frames | |
| round it, and is then capped at the largest raw gain among its 3 by 3 | |
| neighbours, so a kept sound does not spread. For recordings above 96 kHz | |
| the median takes 5 bins by 3 frames, because 9 frames is longer than a | |
| short bat call. | |
| 5. Gain = `max(smoothed gain, 0.1)`. Multiply the STFT by the gain, invert, and | |
| multiply by the noise scale again. | |
| The gain floor of 0.1 keeps 10% of the input everywhere, so noise is lowered by | |
| at most 20 dB. | |
| ## Training | |
| Trained on 203 bat recordings at 250 to 500 kHz and 461 bird recordings at 22 | |
| to 96 kHz (nearly all at 44.1 or 48 kHz), all from xeno-canto, each used at | |
| its own rate. Some recordings of each kind were held out for testing. Loud sounds, turned | |
| down so their own noise is far below the added noise, were pasted into noise | |
| and the network learned to give back the pasted sounds. For bats the noise is | |
| call-free stretches of other recordings. For birds it is random noise shaped | |
| to a recording's own noise floor. An estimate quieter than the clean sound | |
| counted 8 times over in the loss for bats and 16 times for birds, so quiet | |
| sounds are kept better. | |
| Two things were added for low-pitched noise. Each pasted bird sound has its | |
| lowest 4 bins emptied, because the recordings' own rumble was teaching the | |
| network to keep low noise. And 3 in 10 pasted bird sounds are slowed down 1.5 | |
| to 4 times, so that low-pitched calls are still in the training set. | |
| ## Limits | |
| - In bird recordings everything under about 180 Hz is removed (at 44.1 and | |
| 48 kHz): no bird sound in training reaches the lowest two bins. | |
| - Sounds near the noise level lose about 3 to 4 dB for bats and more for birds. | |
| - Faint sounds that are barely over the noise can cut in and out, most of all | |
| with the Heavy setting. | |
| - Handling noise, footsteps, speech and other sounds that come and go are | |
| mostly kept, not removed. | |
| - BirdNET and Perch score lower on a denoised copy than on the original | |
| recording. Identify species from the original. | |