File size: 2,063 Bytes
bb824d1 255fe1b bb824d1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | ---
tags:
- audio
- denoising
- bioacoustics
- bats
- onnx
---
# Oversample bat-call denoiser, v1
**Superseded.** [oversample-denoise](https://huggingface.co/pengowray/oversample-denoise)
replaces this model. It has the same network shape and size, and was trained on
bat and bird recordings. Versions of Oversample from before the change still
download the file here, so it stays in place.
A small convolution network that lowers the noise in ultrasonic recordings of
bat echolocation calls. [Oversample](https://app.oversample.com) downloads this
file when you press Make Denoised Copy in its Noise menu.
- File: `oversample-bat-denoise-v1.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.
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. Gain = `max(2 * sigmoid(logit) - 1, 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 bat recordings from xeno-canto at 250 to 500 kHz. Loud calls,
turned down so their own noise is far below the added noise, were pasted into
noise taken from call-free stretches of other recordings. The network learned
to give back the pasted calls. An estimate quieter than the clean call counted
8 times over in the loss, so quiet calls are kept better.
## Limits
- Checked by eye at 192, 256, 384 and 500 kHz. Not tried below 192 kHz.
- Calls near the noise level lose about 2 to 3 dB.
- Insects and other sounds that come and go are mostly kept, not removed.
|