¶
AI-powered compression for continuous physiological sensing on edge devices.
compressionKIT helps teams reduce memory footprint, wireless bandwidth, and energy spent moving sensor data around edge systems. The current production workflow focuses on PPG compression and reconstruction, with export paths aimed at Ambiq-class embedded deployments and browser-based evaluation tools.
Key Features¶
-
High Compression Ratios
Explore operating points from 2× through 16× for PPG, with clear tradeoffs between fidelity, bandwidth savings, and deployment cost.
-
Edge-Ready
Export encoder artifacts as INT8 LiteRT and C headers for Ambiq hardware and adjacent MCU-class deployment targets.
-
Modular Architecture
Train and evaluate from YAML configs, modular Python components, and reusable preprocessing, model, evaluation, and export stages.
-
Clinically Validated
Measure reconstruction quality with MSE, PRD, cosine similarity, and physiology-aware evaluation paths.
Production Workflow¶
-
1. Understand the signal Start with the PPG pages for frame sizing, preprocessing, filters, and supported metrics.
-
2. Choose an operating point Use the 2×, 4×, 8×, and 16× examples to match fidelity requirements to system constraints.
-
3. Train and export Run config-driven training, then collect checkpoints, summaries, plots, LiteRT artifacts, and headers.
-
4. Review the demo path Use the dedicated demo section when you want to review the browser and hardware evaluation experience.
That production path currently centers on a PPG RVQ codec flow with:
- 64 Hz PPG input, trained on fixed windows and exported for embedded inference.
- Compression operating points spanning 2×, 4×, 8×, and 16×.
- End-to-end outputs that include checkpoints, evaluation summaries, plots, LiteRT artifacts, and deployment headers.
- A separate demo path for browser-based and hardware-backed evaluation when needed.
The documentation below focuses on the supported PPG path first, then branches into methods, exports, and the dedicated demo material.
Supported Signal Types¶
| Signal | Status | Sampling Rate | Description |
|---|---|---|---|
| PPG | Production | 64 Hz (default) | Fully documented training, evaluation, export, and demo flow |
| ECG | In Progress | 250-500 Hz | Early support and legacy experimentation, with ongoing migration into the modular flow |
Compression Methods¶
| Method | Type | Compression | Status |
|---|---|---|---|
| RVQ Autoencoder | Learned | 2×–16× documented | Production |
| Wavelet + SPIHT | Classical | 2×–16× | Experimental |
| Decimation | Baseline | 2×–16× | Baseline |
Quick Start¶
# Install
uv pip install -e .
# Train a PPG RVQ model
train-ppg-rvq --config configs/ppg_rvq_08x.yaml
# Or use the module directly
python -m compressionkit.cli.train_ppg_rvq --config configs/ppg_rvq_08x.yaml
Architecture Overview¶
flowchart LR
A[PPG frame<br/>320 samples at 64 Hz] --> B[Encoder<br/>strided conv blocks]
B --> C[Compressed latent]
C --> D[RVQ codebooks]
D --> E[Compressed code sequence]
E --> F[Decoder]
F --> G[Reconstructed PPG frame]
D -. export .-> H[LiteRT model and C headers]
G -. evaluate .-> I[Quality and efficiency metrics]
The encoder reduces the signal into a smaller representation, the Residual Vector Quantizer maps that representation through a sequence of learned codebooks, and the decoder reconstructs the waveform from the compressed representation. The total compression ratio is:
where \(K\) is the codebook size and \(N\) is the number of encoder stages.
Where To Go Next¶
- Start with signals/ppg-workflow.md for the currently supported production workflow.
- Use signals/ppg-v1-examples.md to compare the four shipped PPG operating points.
- Visit demo/ppg-codec.md for the customer-facing demo overview and hardware setup notes.

