tadabur-embedding

Tadabur Embedding Use Cases

tadabur-embedding is an audio embedding model pretrained on the tadabur dataset. It maps audio into compact vector representations β€” at the clip level or the frame level β€” that can power a wide range of downstream tasks.

The model is an EAT (Efficient Audio Transformer) base encoder (12 Transformer blocks, 768-dim) pretrained from scratch on Quranic recitation audio, then trained with a multi-axis contrastive objective that produces two specialized embedding spaces on top of the shared encoder:

  • Semantic space (384-dim) β€” captures what is being recited (ayah content). Use for retrieval, search, and deduplication.
  • Speaker space (128-dim) β€” captures who is reciting (voice identity). Use for reciter similarity and clustering.

Use cases

  • Retrieval / semantic search β€” find the most similar recitations to a query clip.
  • Deduplication β€” detect near-duplicate audio across large collections.
  • Clustering β€” group recordings by reciter, style, or acoustic similarity.
  • Classification β€” use embeddings as features for downstream classifiers.
  • Frame analysis β€” use the per-frame embedding sequence (before pooling) for tasks that need temporal detail: localizing acoustic events within a clip, aligning or segmenting recitations, and detecting variations over time.

Quick start

import torch
import torchaudio
from transformers import AutoModel

model = AutoModel.from_pretrained("FaisaI/tadabur-embedding", trust_remote_code=True).eval()

# --- Load audio (16 kHz mono) ---
waveform, sr = torchaudio.load("recitation.wav")
waveform = waveform.mean(dim=0, keepdim=True)  # mono
if sr != 16000:
    waveform = torchaudio.functional.resample(waveform, sr, 16000)

# --- Log-mel spectrogram (EAT preprocessing) ---
waveform = waveform - waveform.mean()
mel = torchaudio.compliance.kaldi.fbank(
    waveform,
    htk_compat=True,
    sample_frequency=16000,
    use_energy=False,
    window_type="hanning",
    num_mel_bins=128,
    dither=0.0,
    frame_shift=10,
)  # (n_frames, 128)

# Pad or truncate to 1024 frames (= 10.24 s)
target_length = 1024
n_frames = mel.shape[0]
if n_frames < target_length:
    mel = torch.nn.functional.pad(mel, (0, 0, 0, target_length - n_frames))
else:
    mel = mel[:target_length]

# Normalize with tadabur dataset statistics
norm_mean, norm_std = -4.381, 3.628
mel = (mel - norm_mean) / (norm_std * 2)
mel = mel[None, None]  # (1, 1, 1024, 128)

# --- Extract embeddings ---
with torch.no_grad():
    semantic = model.semantic_embedding(mel)  # (1, 384)
    speaker = model.speaker_embedding(mel)    # (1, 128) 

    features = model.extract_features(mel)    # (1, 513, 768) = CLS + 512 frame patches
    frame_embeddings = features[:, 1:]        # (1, 512, 768) frame-level (~50 Hz)
    global_embeddings = features[:, 0]        # (1, 768) general clip embeddings - useful for generic tasks

For retrieval / search / deduplication, compare semantic_embedding vectors with a dot product (they are L2-normalized, so this is cosine similarity). For reciter similarity, use speaker_embedding the same way. The raw encoder features from extract_features are best for frame-level temporal tasks and as input to downstream models.

For longer audio, split into 10.24 s segments and embed each one. Frame-level embeddings (features[:, 1:]) preserve temporal order and can be used directly for alignment and localization tasks.

Training data

Trained on FaisaI/tadabur, a dataset of Quranic recitation audio, in two stages: EAT self-supervised pretraining of the encoder, followed by multi-axis contrastive training (semantic axis aligned to ayah text embeddings, speaker axis trained on reciter identity with guaranteed same-reciter pairs). Spectrogram normalization statistics (norm_mean = -4.381, norm_std = 3.628) were computed on this dataset β€” use them (not the AudioSet defaults) when preprocessing.

Intended use & limitations

  • Best suited for recitation-style Arabic speech audio; performance on unrelated audio domains is not guaranteed.
  • Input is expected as 16 kHz mono audio converted to 128-bin log-mel spectrograms, in windows of up to 10.24 s.

License

Released under CC BY-NC 4.0 β€” free for non-commercial use with attribution.

Acknowledgements

The model architecture and pretraining recipe follow EAT: Self-Supervised Pre-Training with Efficient Audio Transformer (Chen et al., 2024). The Hugging Face wrapper code is adapted from worstchan/EAT-base_epoch30_pretrain.

Citation

@misc{tadabur-embedding,
  title  = {tadabur-embedding: audio embeddings for Quranic recitation},
  author = {Faisal},
  year   = {2026},
  url    = {https://huggingface.co/FaisaI/tadabur-embedding}
}
Downloads last month
45
Safetensors
Model size
91.5M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Dataset used to train FaisaI/tadabur-embedding

Paper for FaisaI/tadabur-embedding