File size: 3,039 Bytes
8446214
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7f51d9e
8446214
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7f51d9e
8446214
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
55
56
57
58
59
60
61
62
63
64
65
66
67
---
license: apache-2.0
library_name: coreml
tags:
- coreml
- audio
- speech-enhancement
- noise-suppression
- streaming
- deepfilternet
---

# DeepFilterNet3 Streaming Core ML

A stateful, fixed-shape Core ML conversion of **DeepFilterNet3** for real-time 48 kHz speech enhancement on Apple platforms. It consumes one 480-sample (10 ms) hop at a time and exposes all recurrent state explicitly.

This repository is the default model source for the [`DeepFilterNetCoreML`](https://github.com/kylehowells/DeepFilterNet-mlx) Swift product. It is self-contained: the Core ML graph, matching MLX weights/configuration, and normalization state are versioned together.

## Origin

- Original project: [Rikorose/DeepFilterNet](https://github.com/Rikorose/DeepFilterNet)
- Paper: [DeepFilterNet: Perceptually Motivated Real-Time Speech Enhancement](https://arxiv.org/abs/2305.08227)
- Swift runtime and conversion: [kylehowells/DeepFilterNet-mlx](https://github.com/kylehowells/DeepFilterNet-mlx)
- Conversion script: [`Scripts/Conversion/convert_deepfilternet_to_coreml.py`](https://github.com/kylehowells/DeepFilterNet-mlx/blob/feature/deepfilternet4/Scripts/Conversion/convert_deepfilternet_to_coreml.py)

## Runtime contract

| Property | Value |
|---|---:|
| Sample rate | 48,000 Hz |
| Input hop | 480 samples / 10 ms |
| Fixed algorithmic delay | 1,440 samples / 30 ms |
| Core ML graph | `DeepFilterNet3-Streaming.mlpackage` |
| Recurrent state | Explicit inputs and outputs |

The fixed 30 ms delay is separate from model execution time and application audio buffering.

## Validation

The validated Swift streaming path measured 0.999993 correlation to the official PyTorch CLI output. A fresh end-to-end run from the original stereo source, including Swift downmix/resampling, measured 0.999969 correlation and 42.13 dB signal-to-error ratio. On the development Apple Silicon Mac, unpaced steady per-hop Core ML compute was 0.264 ms and the 52.13-second validation clip processed in 1.494 seconds (34.9x real time). Performance and paced callback latency vary by device, operating system, and concurrent load.

## Swift usage

```swift
import DeepFilterNetCoreML

let enhancer = try await DeepFilterNetCoreMLStreamer.load(
    configuration: .init(variant: .deepFilterNet3)
)

let enhancedHop = try enhancer.processHop(input480Samples)
let tail = try enhancer.flush()
```

The default loader downloads this repository through `swift-huggingface`. Applications can instead provide `.local(...)` or `.bundle(...)` as the model source.

## Files

- `DeepFilterNet3-Streaming.mlpackage`: stateful one-hop Core ML graph.
- `auxiliary.npz`: validated normalization state.
- `config.json` and `model.safetensors`: matching model configuration and DSP/filterbank data used by the Swift runtime.
- `LICENSE-APACHE` and `LICENSE-MIT`: upstream dual-license terms.

## License

DeepFilterNet is available under Apache-2.0 or MIT at your option. This repository preserves both upstream license files. See the original project for full attribution.