lossprint v0.7
Lossprint detects whether WAV, FLAC, or AIFF audio was lossy-encoded and
decoded to PCM—for example, an MP3 re-wrapped as FLAC. For flagged files, it
estimates the encoder and effective spectral bandwidth. The 942,636-parameter
model uses native-rate mid/side spectrograms.
Results
All results use a 0.5 threshold and up to sixteen 0.5-second windows
from the first 20 seconds.
| False-positive rate (FPR) on untouched source files |
|---|
| 0.17% (17 of 9,752) |
FPR is the share of 9,752 untouched source files wrongly labeled as previously
lossy. The files came from music releases excluded from training.
Detection rates combine 9,752 deliberately encoded test files with
3,838 lossy audio files from real releases. Each cell is the percentage detected
(number tested). Because the real-release collection has no untouched source
files, it cannot provide a typical-library FPR. AAC combines encoder
implementations whose identity is unknown. Bitrate bands use measured averages.
Common formats
| encoder | <112 kbps | 112–159 | 160–223 | 224–287 | ≥288 |
|---|
| MP3 | 99.8% (408) | 100.0% (297) | 100.0% (456) | 100.0% (827) | 99.9% (1,114) |
| AAC | 99.7% (1,326) | 99.4% (344) | 97.2% (598) | 96.0% (652) | 92.0% (687) |
Less common formats
| encoder | <112 kbps | 112–159 | 160–223 | 224–287 | ≥288 |
|---|
| MP2 | 100.0% (96) | 100.0% (84) | 100.0% (143) | 99.2% (127) | 99.2% (126) |
| Vorbis | 99.7% (333) | 100.0% (270) | 100.0% (367) | 97.3% (259) | 97.6% (850) |
| Opus | 97.4% (941) | 100.0% (412) | 100.0% (388) | 100.0% (703) | 100.0% (16) |
| WMA | 100.0% (180) | 99.8% (551) | 100.0% (255) | 100.0% (205) | 100.0% (73) |
| Musepack | 100.0% (63) | 100.0% (68) | 98.9% (94) | 100.0% (92) | 94.6% (185) |
Use
The
lossprint Rust library and CLI
provides a ready-to-use implementation of the audio frontend and transcode
classifier.
Decode up to 20 seconds at the native sample rate, bit depth, and channel count.
Do not resample, downmix, normalize, requantize, or clip. Select up to sixteen
evenly spaced 0.5-second windows. Mono and stereo are supported. Per window:
- Compute mid
(L + R) / 2 and side L - R; mono uses a zero side channel.
- Compute a centered periodic-Hann STFT with
n_fft = round(sample_rate / 43.06640625) and hop = n_fft // 2.
- Keep bins 0–512, zero-pad above Nyquist, then take
log(magnitude + 1e-6) without normalization.
model.onnx accepts float32 [windows, 2, 513, 44] and returns:
transcode_probability: [windows]
encoder_probability: [windows, 9], ordered mp3, aac, aac_at,
fdk_aac, vorbis, opus, mp2, wma, musepack
bandwidth_khz: [windows]
Pool classification probabilities with the normalized geometric mean; for the
transcode head this is sigmoid(mean(logit(p))). Average bandwidth
arithmetically. Preserve decoded float samples outside [-1, 1].
Data
The training corpus contains 93,974 matched pairs grouped by release. Each pair
has an untouched 20-second source segment and its delay-corrected version after
lossy encoding and decoding; no normalization, band limit, mix, or container
transform is applied.
Training covers the nine encoder classes in the output head and includes mono,
low-rate Opus, and low-rate speech examples. Manifest SHA-256:
a43a70e82705b936d28849292c991d90f2b1d9c14949a73006820de0f3c72ba0.
Limits
- Only mono and stereo are supported.
- Unseen encoders, repeated transcoding, remastering, EQ, resampling, and
adversarial processing may behave differently.
Files
model.safetensors SHA-256:
291253ba6caad783535be673f3aae6108d10ef51bdfb7319f5a28455bea1e27a
model.onnx SHA-256:
33c74bde418b8330f7e67222afb2ab53706c136281bddd19ec0870b81ddce89a