LiteRT

E2A2 denoising_speech codec for compressionkit

E2A2 (Encoding Efficient Asymmetric Autoencoders) denoising_speech is a speech codec for 16 kHz mono audio whose decoder outputs an estimate of the clean speech from a coded noisy input. This repository holds its weights in the layout that compressionkit v0.3 reads, with an encoder half and a decoder half that load separately.

Source and permission

The weights are redistributed from their original public release, danjacobellis/E2A2, subfolder denoising_speech/, revision aafe5975, with the permission of the author, Dan Jacobellis. Ambiq did not train this codec. Its description, development and evaluation are documented at the original source and on the codec's page, https://danjacobellis.net/compressors/E2A2_denoising_speech. The entropy coder is GGDLPC (https://danjacobellis.net/GGDLPC/).

Every tensor here equals the tensor of the same name at that revision; this repository divides them into the encoder and decoder halves listed below and adds the files compressionkit uses.

Files

  • encoder/config.json, encoder/weights.safetensors (the merged.{op}.encoders.* tensors) and encoder/entropy.json (the GGDLPC tables): everything needed to encode.
  • decoder/config.json, decoder/weights.safetensors (the merged.{op}.decoder.* tensors): everything needed to decode. Each config.json is the full source configuration, so each half constructs alone.
  • rd.json: the rate–distortion curve of the original release, byte-identical to it. Its validation set is 100 noisy mixtures, and PSNR is against the clean reference. Each noisy input was peak-normalized over its whole length before coding, a scaling a real-time encoder cannot compute within its block latency, so the curve is not a measurement of a configuration deployable in real time.
  • calibrations/<dataset>.json (ami, libritts): fixed input maps, published by Ambiq for compressionkit.calibrate.load, that turn int16 codes of a dataset into the codec's input with two constants (an offset and a scale).
  • web/: the decoder of each operating point that the compressionkit browser demo offers, as LiteRT files (section below). The compressionkit loaders do not download web/.
file bytes SHA-256
calibrations/ami.json 7,431 43d0375486dd34eb8d099937721bd3f7e35cb3ca6aeb8270fcc56b53cd72ce2a
calibrations/libritts.json 7,272 6839c57400db6e783ab9ea03281f5de595f61f359e3e3dcbfcca6f729eaba851
decoder/config.json 1,535 1ca3f4f72d0e5a5581c8e1e45a9373a3b0abe7f7a8e4cc24d81c192effee6f66
decoder/weights.safetensors 2,423,381,384 650c6c2b5fd66e42099573dcd4eb4717e7d524fd72b0242bbc6c3a1691845c6d
encoder/config.json 1,535 1ca3f4f72d0e5a5581c8e1e45a9373a3b0abe7f7a8e4cc24d81c192effee6f66
encoder/entropy.json 8,795 e8a0db2da20bc32c8befe3c9f0e17225b9dacb060c545ae68b3d9a3c28da88f2
encoder/weights.safetensors 38,672 3abf4deb4404718adde63a2f29487c0211cebbc9a302253c26cb5a272a9efcfe
rd.json 695 906761b91915f5804235326f46ac01fc80cce67367ed4bfc9a6b87e59cf8b652

Input, output and operating points

Input: float32 (1, L) samples in [−1, 1] at 16 kHz. Output: a reconstruction in the same form. Operating points (cumulative latent channels): [4, 12, 20, 32]. The stream of a lower operating point is a literal bit-prefix of the stream of the highest, and the rates are entropy-coded bits. compressionkit converts nothing: each codec states its input type and range.

Using it with compressionkit

compressionkit v0.3 is in pre-release; these loaders are part of it.

from compressionkit.e2a2 import hub

# both halves
config, weights, coder, ops = hub.load_split_from_hub('denoising_speech')
model = hub.load_codec(config=config, weights=weights, n_ch=ops[-1])

# one half (encode-only shown; half='decoder' for decode-only)
cfg, w, coder, ops = hub.load_split_from_hub('denoising_speech', half='encoder')
encoder = hub.build_partial(cfg, w, ops[-1])
from compressionkit import calibrate
cal = calibrate.load('denoising_speech', 'ami')   # the published map for that dataset

Status and limitations

  • A reference codec for evaluation and development with compressionkit, redistributed as released; not a production model, and not qualified for any product or regulated use.
  • Its quality on data unlike the data of its original release is not characterized here; measure it on your own data (compressionkit.calibrate fits an input map on your training split).
  • Maintainer for compressionkit: Dan Jacobellis (Ambiq). Questions about the codec itself: the original source.

Browser decoders (web/)

For each operating point the compressionkit browser demo offers, its decoder as a LiteRT .tflite window decoder, which runs in a web browser on LiteRT.js (CPU), with a .json beside it that gives its shapes and windowing. A window decodes chunk output samples (pixels along each side for the image codec) with margin of context on each side; the latent grid is cut into overlapping windows and the outputs joined. The PSNR column is the largest difference between the PSNR of the joined output, decoded in LiteRT.js in Chromium, and that of the full-size PyTorch decode, over the example recordings of the demo. The compressionkit loaders do not download web/.

file operating point chunk margin bytes PSNR difference (dB, rows) decoder weights (SHA-256)
web/denoising_speech_op4_chunk8192_m2048.tflite 4 8192 samples 2048 404,017,292 2.8e-07 (3) 650c6c2b5fd6
web/denoising_speech_op12_chunk8192_m2048.tflite 12 8192 samples 2048 404,115,596 1.5e-06 (3) 650c6c2b5fd6
web/denoising_speech_op20_chunk8192_m2048.tflite 20 8192 samples 2048 807,675,644 2.1e-06 (3) 650c6c2b5fd6
web/denoising_speech_op32_chunk8192_m2048.tflite 32 8192 samples 2048 808,265,468 1.0e-06 (3) 650c6c2b5fd6

Weights fp32, converted from decoder/weights.safetensors with litert-torch 0.10.0. The last column gives the start of the SHA-256 of the decoder/weights.safetensors it was converted from, which is this repository's.

Downloads last month
22
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support