File size: 2,511 Bytes
17f9d82
dce4de8
 
 
17f9d82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dce4de8
17f9d82
 
 
 
 
 
 
 
 
 
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
license: other
license_name: ambiq-model-weights-license
license_link: https://github.com/AmbiqAI/compressionkit/blob/main/LICENSE-MODEL-WEIGHTS.md
library_name: compressionkit
pipeline_tag: other
tags:
  - compressionkit
  - signal-compression
  - ppg
  - rvq
  - tflite
  - edge-ai
---

# compressionkit-ppg-4x

A **PPG** signal compression codec using Residual Vector Quantization (RVQ), optimized for edge and wearable devices.

## Model Details

- **Modality:** PPG
- **Sample Rate:** 64 Hz
- **Compression Ratio:** 4x
- **Quantization:** INT8
- **RVQ Levels:** 4
- **Codebook Size:** 256 entries × 16D
- **Encoder Input:** `[None, 1, 320, 1]`
- **Encoder Output:** `[None, 1, 80, 16]`

## Quality Metrics

### Time Domain

| Metric | Mean | Median | P90 |
|--------|------|--------|-----|
| PRD (%) | 7.4052 | 2.7741 | 14.4301 |
| RMSE | 0.0306 | 0.0245 | 0.0499 |
| Cosine Similarity | 0.9869 | 0.9996 | 0.9998 |

### Spectral

- **Band Total Relative Error (median):** 0.0357

### Bitrate

- **Codec CR (uniform):** 4.0x
- **Codec CR (learned prior):** 4.55x

## Usage

### Python (compressionkit runtime)

```python
from compressionkit.runtime import RVQCodec

codec = RVQCodec.from_pretrained("Ambiq/compressionkit-ppg-4x")

# Encode: float32 signal → RVQ indices
indices = codec.encode(signal)

# Decode: RVQ indices → reconstructed signal
recon = codec.decode(indices)
```

### Local deployment directory

```python
codec = RVQCodec("path/to/deploy/")
```

## Files

| File | Description |
|------|-------------|
| `encoder_int8.tflite` | INT8 quantized encoder (on-device) |
| `encoder.h` | C header for encoder |
| `decoder_float32.tflite` | Float32 decoder (server-side evaluation) |
| `decoder_int8.tflite` | INT8 decoder (optional, on-device) |
| `codebook.npz` | RVQ codebook tables |
| `codebook.h` | C header for codebook |
| `config.json` | Deployment manifest |
| `sample_stimulus.npz` | Synthetic test data |
| `quality_scorecard.json` | Full evaluation metrics |

## Dataset & License

Training data: MESA (NSRR restricted). Sample data uses synthetic physiokit waveforms only — no patient data is redistributed.

Model weights are released under the **Ambiq Model Weights License** — deployment is restricted to Ambiq silicon devices. See `LICENSE-MODEL-WEIGHTS.md` for full terms.

## Citation

```bibtex
@software{compressionkit,
  author = {Ambiq AI},
  title = {compressionKIT: Signal Compression for Edge AI},
  url = {https://github.com/AmbiqAI/compressionkit}
}
```