Skip to main content

acophen-streams

Deep acoustic feature streams behind one interface — install only the ones you need.

acophen-streams provides the three learned streams of the acoustic phenotyping suite, each producing a named, schema-versioned feature vector that plugs straight into acophen-fusion:

Stream Import name Backbone → pooling Dim
SSL / embeddings ssl Whisper-small high layer → VLAD (16 clusters) 12288
Vision vision linear spectrogram → ResNet50 → temporal pyramid (levels 3) 14336
Emotion emotion WavLM 3LOI categorical SER → 15-statistic pooling 120

⚠️ Research use only. Not a medical device.

Install

The core (registry, schemas, pooling) is light and torch-free. Backbones are optional extras — install only the streams you need:

pip install acophen-streams              # core: registry + schemas + pooling
pip install "acophen-streams[ssl]"       # + Whisper (torch, transformers)
pip install "acophen-streams[vision]"    # + ResNet50 (torch, torchvision)
pip install "acophen-streams[emotion]"   # + WavLM SER (torch, torchaudio, transformers)
pip install "acophen-streams[all]"       # everything

Importing the package does not import torch; each backbone loads lazily on first extract.

Quick start

from acophen_streams import get_stream, available

available()                        # ['ssl', 'vision', 'emotion']

ssl = get_stream("ssl")            # backbone loads on first use
vec = ssl.extract("recording.wav") # named pandas Series, len 12288, schema-versioned
ssl.schema.version                 # '1.0'

emo = get_stream("emotion")
emo.extract("recording.wav")       # 120 named features: angry_mean, ..., neutral_cv

Every stream implements the same interface — extract(wav_or_array) -> named Series and a frozen schema. That is what lets the fusion layer consume them by name.

Feed straight into fusion:

import acophen_fusion, acophen_streams as A
streams = {name.replace("ssl", "embeddings"): A.get_stream(name).extract("rec.wav")
           for name in ("ssl", "vision", "emotion")}
# add the biomarkers stream from voxmarkers, then score with acophen_fusion.Scorer

CLI:

acophen-streams list                 # streams and their dimensions
acophen-streams schema emotion       # print the 120 frozen column names
acophen-streams extract ssl rec.wav  # needs the [ssl] extra

The SSL VLAD codebook

The ssl stream needs a fitted VLAD codebook (kmeans .pkl, 16 clusters × 768). Point to it via the ACOPHEN_STREAMS_VLAD_CODEBOOK environment variable, pass get_stream("ssl", codebook_path=...), or let auto-discovery find feature_fusion/reference/vlad_codebook.pkl. Ship the codebook with the model bundle (Zenodo/HF), not inside the wheel.

Frozen schemas

Stream output columns and order are a versioned contract (SCHEMA_VERSION), verified against the trained fusion models (dims 12288 / 14336 / 120, and the emotion column names {emotion}_{stat}, match exactly). Changing them is a breaking change for fusion — bump the version.

Notes

  • The pooling functions (vlad_pool, temporal_pyramid_pool, statistical_pool) are pure NumPy ports of the thesis flattening scripts and are tested directly.
  • Licensing: Whisper (MIT) and torchvision ResNet (BSD) are fine to build on; verify the WavLM SER model's license before redistributing its weights.
  • The torch extraction paths are faithful ports of the source pipelines but require a torch environment (and, ideally, a GPU) to run.

License

MIT for the code. Pretrained backbones carry their own licenses.

Metadata

Release files for acophen-streams 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for acophen-streams 0.1.1
File Size Uploaded
acophen_streams-0.1.1.tar.gz 16.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for acophen-streams 0.1.1
File Interpreter ABI Platform
acophen_streams-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 35.6 kB

Release files / acophen_streams-0.1.1.tar.gz

Download URL acophen_streams-0.1.1.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
487ec318bd2547381f451346b8ba94b80a202ae0a1b8715cdcd8813e8c1bca8a
BLAKE2b-256 checksum
How to use checksums
c30f9631867bbda5e8f821c29c767c3fb4f33cd70b1f32493c9b581510d23fa4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / acophen_streams-0.1.1-py3-none-any.whl

Download URL acophen_streams-0.1.1-py3-none-any.whl
Size 19.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0feed01394612c0e9b7cad71878cf3c949f12c78614ac22316f6549794fa912
BLAKE2b-256 checksum
How to use checksums
86a808a8a01356214d4c0bac65e17f352d7cbf16f830cf5f748f15cccc08e896
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page