Skip to main content

eris-ketos

CI PyPI Python License: MIT codecov

Geometric analysis of cetacean communication. Hyperbolic embeddings, topological data analysis, and adversarial robustness testing for whale vocalization decoding.

ketos (κῆτος) — Greek for "sea creature," the root of "cetacean."

Part of the ErisML family.


Why geometry?

Sperm whale codas have a combinatorial phonetic system — rhythm, tempo, rubato, and ornamentation combine hierarchically (Sharma et al., Nature Communications 2024). Standard ML treats these as flat feature vectors. But hierarchical structures embed naturally in hyperbolic space with exponentially less distortion than Euclidean space.

eris-ketos provides three geometric analysis methods and an adversarial robustness framework:

Module Method What it captures
poincare_coda Poincaré ball embeddings Hierarchical coda structure, taxonomic relationships
tda_clicks Persistent homology Topological shape of vocal attractors
spd_spectral SPD manifold metrics Spectral covariance ("vowel" patterns)
decoder_robustness Adversarial fuzzing (DRI) Decoder failure modes under acoustic perturbations

Installation

pip install eris-ketos            # core (numpy, scipy, torch, librosa)
pip install eris-ketos[tda]       # + ripser, persim
pip install eris-ketos[ml]        # + timm, torchaudio, scikit-learn
pip install eris-ketos[all]       # everything

Quick start

from eris_ketos import PoincareBall, HyperbolicMLR

# Embed coda features on the Poincaré ball
ball = PoincareBall(c=1.0)
coda_features = torch.randn(100, 32)  # 100 codas, 32-dim features
embeddings = ball.expmap0(coda_features * 0.1)

# Classify with hyperbolic distances to learned prototypes
classifier = HyperbolicMLR(embed_dim=32, num_classes=21, c=1.0)
logits = classifier(embeddings)
from eris_ketos import compute_persistence, tda_feature_vector

# Topological analysis of click patterns
audio = librosa.load("sperm_whale_coda.wav", sr=32000)[0]
persistence = compute_persistence(audio, delay=10, dim=3)
features = tda_feature_vector(persistence)  # fixed-length topological summary
from eris_ketos import DecoderRobustnessIndex, make_acoustic_transform_suite

# Test how robust a decoder is to acoustic perturbations
transforms = make_acoustic_transform_suite()
dri = DecoderRobustnessIndex(transforms)
score = dri.measure(decoder, codas)
print(f"Decoder Robustness Index: {score.dri:.4f}")

Modules

poincare_coda — Hyperbolic embeddings

Poincaré ball operations (exponential/logarithmic maps, Möbius addition, geodesic distance) and HyperbolicMLR for classification via distance to learned prototypes on the ball. Prototypes can be initialized from a taxonomic tree.

tda_clicks — Topological data analysis

Time-delay embedding (Takens' theorem) reconstructs the vocal attractor from click sequences. Persistent homology (via ripser) computes topological features — connected components (H0) and loops (H1) — that distinguish coda types and social units.

spd_spectral — SPD manifold analysis

Frequency-band covariance matrices are symmetric positive definite (SPD). The log-Euclidean Riemannian metric on this manifold is more discriminative than Euclidean distance for spectral patterns, capturing the "vowel-like" formant structure in whale clicks (Begus et al., Open Mind 2025).

acoustic_transforms — Parametric perturbations

Library of acoustic transforms with controllable intensity (0.0–1.0): additive noise, Doppler shift, multipath echo, time stretch, click dropout, conspecific overlay, and more. Supports compositional chains for compound distortion testing.

decoder_robustness — Decoder Robustness Index (DRI)

Adapted from the ErisML Bond Index adversarial fuzzing framework. Measures decoder reliability via graduated semantic distance, adversarial threshold search, sensitivity profiling, and compositional chain analysis.

Data

eris-ketos works with the DSWP dataset (1,501 annotated sperm whale codas, CC BY 4.0) — the same data behind the Sharma et al. 2024 Nature paper.

from eris_ketos.data import load_dswp
codas = load_dswp()  # downloads from HuggingFace on first call

References

  • Sharma, P. et al. "Contextual and combinatorial structure in sperm whale vocalisations." Nature Communications 15, 3617 (2024).
  • Begus, G. et al. "Vowel- and diphthong-like spectral patterns in sperm whale codas." Open Mind (MIT Press, 2025).
  • Project CETI — WhAM. NeurIPS 2025.
  • Bond, A.H. "ErisML: Geometric ethics framework." erisml-lib.

License

MIT

Metadata

Release files for eris-ketos 0.2.0

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

Source distribution (sdist)

Source distribution for eris-ketos 0.2.0
File Size Uploaded Provenance
eris_ketos-0.2.0.tar.gz 9.0 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for eris-ketos 0.2.0
File Interpreter ABI Platform
eris_ketos-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 MB

Release files / eris_ketos-0.2.0.tar.gz

Download URL eris_ketos-0.2.0.tar.gz
Size 9.0 MB
Tags Source
SHA-256 checksum
How to use checksums
4a2962e46f03afef8a7c81116bf0df209e210fb29deaf18801383452fade81a3
BLAKE2b-256 checksum
How to use checksums
7bd627b7e93be49f9a543e915d2a95ba70f53d23eb5bed65947d4e34f0db71cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Release files / eris_ketos-0.2.0-py3-none-any.whl

Download URL eris_ketos-0.2.0-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b2a5257173e9aae5dbc0b727c3ff8e304ee06872d178a57d7f25cadfdf3ca14
BLAKE2b-256 checksum
How to use checksums
600721460b8da32a8dedeabb2a5414c7803d6689bb20a1b467a7221ad47fbff2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Security for eris-ketos 0.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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