Contrastive Learning for Audio Embeddings
1. Key Principles of Contrastive Learning
Key Principles of Contrastive Learning
Contrastive learning operates on the principle of learning representations by maximizing agreement between differently augmented views of the same data instance while minimizing agreement with other instances. For audio embeddings, this translates to pulling together representations of similar acoustic events and pushing apart dissimilar ones in a latent space.
InfoNCE Loss Formulation
The core objective function in contrastive learning is the InfoNCE (Noise Contrastive Estimation) loss, which formalizes this intuition mathematically. Given a batch of N audio samples, we generate two augmented views for each sample, resulting in 2N total examples. The loss for a positive pair (i,j) is:
where z represents the learned embeddings, sim is a similarity metric (typically cosine similarity), and τ is a temperature hyperparameter controlling the sharpness of the distribution.
Augmentation Strategies for Audio
Effective contrastive learning requires carefully designed augmentation pipelines that preserve semantic content while introducing sufficient variability. For audio embeddings, common transformations include:
- Time masking: Randomly zeroing out segments of the spectrogram
- Frequency masking: Removing contiguous frequency bands
- Pitch shifting: Modulating frequency content without altering tempo
- Background noise addition: Injecting controlled amounts of Gaussian or environmental noise
Embedding Space Properties
The learned embedding space exhibits several desirable properties:
where x and x+ are positive pairs, x- is a negative sample, and f is the embedding function. These properties ensure that similar sounds cluster together while dissimilar ones are evenly distributed on the unit hypersphere.
Practical Implementation Considerations
Effective implementation requires attention to several technical details:
- Batch size: Larger batches provide more negative samples but increase memory requirements
- Projection head: A non-linear projection network often improves performance before computing the contrastive loss
- Normalization: L2 normalization of embeddings stabilizes training
- Temperature: τ typically ranges from 0.05 to 0.2 for optimal performance

Similarity Metrics and Loss Functions
Cosine Similarity
Given two audio embeddings u and v in a d-dimensional space, cosine similarity measures the angle between them:
where θ is the angle between the vectors. This metric ranges from -1 (perfectly dissimilar) to 1 (identical). In practice, embeddings are often L2-normalized before comparison, reducing the computation to a simple dot product.
Euclidean Distance
For some applications, the straight-line distance between embeddings provides a more intuitive measure:
However, Euclidean distance is sensitive to the scale of embeddings, making normalization critical. Some architectures use squared Euclidean distance to avoid the computational cost of the square root operation.
Contrastive Loss
The contrastive loss function pulls positive pairs (similar samples) closer while pushing negative pairs apart. Given a margin m, the loss for a pair is:
where y is 1 for positive pairs and 0 for negatives. The margin m defines the minimum desired separation between dissimilar samples.
Triplet Loss
Triplet loss operates on three samples: an anchor a, a positive p, and a negative n. The loss enforces:
where α is a margin hyperparameter. The complete loss function becomes:
Hard negative mining—selecting challenging negatives—is crucial for effective triplet learning.
InfoNCE Loss
Originating from noise-contrastive estimation, InfoNCE loss is widely used in self-supervised audio representation learning:
where τ is a temperature parameter controlling the sharpness of the distribution. The denominator includes one positive and K negatives, making the task a K+1-way classification problem.
SupCon Loss
Supervised Contrastive (SupCon) loss extends self-supervised contrastive learning to labeled data by incorporating multiple positives per anchor:
where P(i) is the set of positives for anchor i, and A(i) contains all samples in the batch except i itself.
Practical Considerations
Choosing the right similarity metric and loss function depends on several factors:
- Embedding dimensionality: High-dimensional spaces exhibit different distance concentration properties
- Batch size: InfoNCE benefits from large batch sizes to provide more negative samples
- Hardware constraints: Some losses have higher memory requirements than others
- Task objectives: Retrieval tasks may favor different metrics than classification tasks
Recent work in audio representation learning has shown that combining multiple loss functions (e.g., mixing contrastive and reconstruction losses) can yield more robust embeddings. The temperature parameter τ in contrastive losses requires careful tuning, as it controls how strongly to penalize hard negatives.

1.3 Positive and Negative Sample Selection
The efficacy of contrastive learning hinges critically on the selection of positive and negative samples. For audio embeddings, this process must account for both temporal structure and semantic similarity in the input space. Given an anchor audio clip xi, we define:
Positive Pair Construction
Positive pairs (xi, xj+) are derived through data augmentation techniques that preserve semantic content while introducing controlled variability. Common transformations for audio include:
- Time stretching (5-20% speed variation)
- Pitch shifting (±2 semitones)
- Background noise injection (SNR ≥ 15dB)
- Random cropping (75-100% of original duration)
where 𝒜 represents the augmentation function space. The similarity metric between positives should satisfy:
with τ+ typically set to 0.8-0.9 for normalized embeddings.
Negative Sampling Strategies
Negative samples xk- must be sufficiently dissimilar to anchor xi while remaining challenging enough to prevent trivial solutions. Three principal approaches exist:
1. In-batch Negatives
Leverage other examples in the same mini-batch as negatives:
Computationally efficient but risks false negatives when batch diversity is low.
2. Hard Negative Mining
Select negatives from the embedding space that are close but not identical to the anchor:
where τ- defines the hardness threshold (typically 0.4-0.6).
3. Memory Bank Negatives
Maintain a queue of embeddings from previous batches to increase negative diversity:
where T controls the memory window size. Momentum encoders help maintain consistency in the memory bank.
Dynamic Sampling Considerations
Advanced implementations often combine these strategies with dynamic weighting:
where λ is a temperature parameter controlling the hardness distribution. This approach automatically emphasizes more challenging negatives as training progresses.
For audio-specific applications, domain knowledge can further refine sampling. In speech tasks, negatives might exclude phonemically similar segments, while in environmental sound classification, acoustically distinct but semantically related classes (e.g., different bird species) may require careful handling.

2. Preprocessing Audio Signals
2.1 Preprocessing Audio Signals
Raw audio signals require careful preprocessing to extract meaningful representations for contrastive learning. The process involves several key steps to ensure robustness and invariance to irrelevant variations while preserving discriminative features.
Time-Domain Normalization
Audio waveforms are typically normalized to a consistent amplitude range to mitigate variations in recording levels. Given a raw audio signal x(t), peak normalization scales the signal by its maximum absolute amplitude:
For batch processing, mean-variance normalization may be applied instead:
where μx and σx are the mean and standard deviation of the signal.
Framing and Windowing
Audio signals are divided into short, overlapping frames (typically 20-40 ms) to capture local spectral features. A Hamming window w(n) is applied to each frame to reduce spectral leakage:
where N is the window length. The overlap between consecutive frames is usually set to 50-75% to ensure temporal continuity.
Short-Time Fourier Transform (STFT)
The STFT converts each windowed frame into its frequency-domain representation:
where m is the frame index, k is the frequency bin, and H is the hop size. The magnitude spectrogram |X(m,k)| is then used for further processing.
Log-Mel Spectrogram Extraction
The human auditory system perceives frequency on a logarithmic scale. A Mel filterbank M(l,k) is applied to the power spectrogram to approximate this behavior:
where l indexes the Mel bands (typically 40-128). This yields a compact, perceptually relevant representation that is robust to pitch variations.
Delta Features and Temporal Context
To capture dynamic spectral changes, delta and delta-delta coefficients are computed as first and second-order temporal derivatives of the log-Mel features. A context window of 5-9 frames is often concatenated to provide temporal context, forming a 3D tensor of shape (time, frequency, channels).
Data Augmentation Strategies
Contrastive learning benefits from strong augmentations that preserve semantic content while altering nuisance factors. Common audio augmentations include:
- Time stretching (±10-20% speed variation)
- Pitch shifting (±2-4 semitones)
- Background noise addition (SNR ≥ 10dB)
- Time-frequency masking (randomly zeroing frequency bands or time segments)
These transformations create positive pairs for contrastive learning while maintaining the underlying audio semantics.

Feature Extraction Techniques
Effective feature extraction is critical for contrastive learning in audio embeddings, as it determines the quality of the latent representations learned by the model. The following techniques are widely used in state-of-the-art audio embedding systems.
Log-Mel Spectrograms
The log-Mel spectrogram is a time-frequency representation that mimics human auditory perception. Given a raw audio signal x(t), the process involves:
where w(t) is the window function (typically Hann or Hamming), Δt is the hop size, and ℱ denotes the Fourier transform. The Mel filterbank M is then applied:
followed by logarithmic compression to obtain the final representation:
where C is a compression constant (typically 10,000). This representation provides robustness to amplitude variations while preserving perceptually relevant features.
MFCCs and Delta Features
Mel-frequency cepstral coefficients (MFCCs) extend log-Mel spectrograms by applying the discrete cosine transform (DCT) to decorrelate the filterbank energies:
where cn are the cepstral coefficients. Delta (Δ) and delta-delta (ΔΔ) features capture temporal dynamics by computing first and second derivatives of the static coefficients:
These features are particularly effective for speech applications where temporal patterns carry discriminative information.
Learned Filterbanks
Modern approaches replace fixed filterbanks with learnable convolutional layers. A 1D convolutional neural network with kernel size k and stride s operates directly on raw waveforms:
where W and b are learned parameters. This approach, used in models like Wav2Vec and SincNet, adapts the feature extraction to the specific task through gradient descent.
Self-Attention for Temporal Aggregation
Transformer-based architectures employ self-attention to capture long-range dependencies in audio sequences. The attention weights A between time steps i and j are computed as:
where Q, K are learned query and key matrices, and dk is the dimension of the key vectors. The output is a weighted sum of value vectors V:
This mechanism allows the model to dynamically focus on relevant temporal regions when constructing the embedding.
Data Augmentation Strategies
Contrastive learning benefits heavily from carefully designed audio augmentations that preserve semantic content while creating diverse positive pairs. Common techniques include:
- Time masking: Randomly zeroing out contiguous time steps (typically 10-100ms)
- Frequency masking: Dropping random frequency bands (usually 5-20 Mel bins)
- Pitch shifting: Modulating frequency content by ±2 semitones
- Speed perturbation: Time-stretching by factors of 0.9-1.1 without pitch modification
These transformations force the model to learn invariant representations to superficial variations in the input signal.

2.3 Spectrogram Representations and Augmentations
Spectrograms provide a time-frequency representation of audio signals, making them indispensable for contrastive learning in audio embedding tasks. Given an input waveform x(t), the Short-Time Fourier Transform (STFT) decomposes it into its frequency components over time:
where w(t - τ) is a window function centered at time τ, and ω represents angular frequency. The magnitude spectrogram S(τ, ω) is then computed as |X(τ, ω)|, often converted to a logarithmic scale (dB) to match human auditory perception:
with ε as a small constant for numerical stability. Mel-scale spectrograms further warp the frequency axis to approximate the nonlinear human hearing response:
Augmentation Strategies for Contrastive Learning
Effective augmentations for spectrograms must preserve semantic content while introducing plausible variations. Common techniques include:
- Time Masking: Randomly zeros contiguous time steps (e.g., 10-50 ms) to simulate temporal dropout.
- Frequency Masking: Erases contiguous frequency bands (e.g., 5-20 Mel bins) to mimic channel distortions.
- Time Warping: Applies smooth non-linear distortions along the time axis via spline interpolation.
- SpecAugment: Combines time/frequency masking with optional time warping, originally proposed for ASR.
For contrastive frameworks, augmentations should satisfy the invariance-diversity tradeoff: pairs from the same source audio (via different augmentations) must remain semantically similar, while maintaining sufficient diversity across the batch. The augmentation pipeline can be formalized as:
where Ti is sampled from a family of augmentations 𝒯. Optimal parameters (mask sizes, warp factors) are typically tuned via ablation studies.
Implementation Considerations
On-the-fly spectrogram computation during training requires careful GPU memory management. A hybrid approach often works best:
- Pre-compute STFTs for fixed-length segments
- Apply augmentations stochastically during batch generation
- Normalize per-batch statistics or use global normalization
For 16kHz audio with 25ms windows (10ms hop), a 1-second clip yields a 96×64 spectrogram (time×frequency). Typical CNN architectures then downsample this to 6×4 spatial dimensions before projection heads.

3. CNN-Based Models for Audio
3.1 CNN-Based Models for Audio
Convolutional Neural Networks (CNNs) have become a dominant architecture for learning audio representations due to their ability to capture local spectral and temporal patterns. Unlike traditional spectrogram-based approaches that rely on handcrafted features, CNNs automatically learn hierarchical representations directly from raw or time-frequency transformed audio signals.
Architecture Design Considerations
The design of CNN architectures for audio involves several key considerations:
- Input Representation: Most approaches use time-frequency representations like log-mel spectrograms or constant-Q transforms as input, though some recent work operates directly on raw waveforms.
- Kernel Shapes: 2D convolutions typically use rectangular kernels (e.g., 3×3 or 5×5) to capture local spectro-temporal patterns, while 1D convolutions on waveforms use longer temporal kernels.
- Pooling Strategies: Max pooling is commonly used to achieve translation invariance, though learnable pooling and attention mechanisms are gaining traction.
Mathematical Formulation
The core operation in a CNN layer can be expressed as:
where wm,n are the learnable filter weights, x is the input feature map, b is the bias term, and σ is the activation function (typically ReLU). For audio applications, the input x is often a 2D spectrogram with dimensions (time × frequency).
Popular CNN Architectures for Audio
Several CNN architectures have proven particularly effective for audio tasks:
- VGG-style: Stacked 3×3 convolutions with max pooling, adapted from computer vision but with modified channel dimensions for audio.
- ResNet: Residual connections help train deeper networks by alleviating vanishing gradients.
- TDNN: Time-delay neural networks use dilated convolutions to capture longer temporal contexts.
Case Study: Audio Spectrogram Transformer
A hybrid approach combines CNNs with attention mechanisms. The CNN first extracts local features which are then processed by transformer layers to capture global dependencies. The feature extraction can be formulated as:
where X is the input spectrogram, Z are the CNN-extracted features, and Q, K, V are the query, key, and value matrices in the attention mechanism.
Practical Implementation Considerations
When implementing CNN-based audio models:
- Data Augmentation: Time stretching, pitch shifting, and additive noise improve robustness.
- Normalization: Batch normalization or layer normalization stabilizes training.
- Regularization: Dropout and weight decay prevent overfitting, especially with limited labeled data.

3.2 Transformer-Based Approaches
Transformer architectures have revolutionized audio representation learning by leveraging self-attention mechanisms to capture long-range dependencies in spectrograms or raw waveforms. Unlike convolutional approaches, transformers treat the input as a sequence of patches or tokens, enabling dynamic weighting of relevant temporal and spectral features. The core innovation lies in the multi-head attention mechanism, which computes pairwise affinities between all positions in the sequence.
Self-Attention for Audio Sequences
Given an input sequence of audio embeddings X ∈ ℝN×d (where N is sequence length and d is embedding dimension), the self-attention operation computes:
where Q, K, and V are learned linear projections of X. For audio, this allows the model to attend to phonetically similar segments across time, even when separated by long intervals. The scaling factor √dk prevents gradient saturation in the softmax.
Positional Encoding in Audio Transformers
Since transformers lack inherent positional awareness, sinusoidal positional encodings are added to input embeddings:
For audio applications, learned relative positional embeddings often outperform fixed sinusoidal patterns, as they better model the hierarchical nature of speech (e.g., phoneme → syllable → word).
Contrastive Learning Objectives
When applied to contrastive learning, transformer encoders are trained using variants of the InfoNCE loss:
where zi and zj are positive pairs (e.g., different augmentations of the same audio clip), and τ is a temperature hyperparameter. Transformer architectures excel at this task because their attention mechanisms can identify semantically invariant features across augmentations.
Architectural Variants
Recent adaptations for audio include:
- Conformer: Combines convolution operators with self-attention to capture both local and global patterns
- Wav2Vec 2.0: Uses a transformer on quantized latent representations with contrastive predictive coding
- AST (Audio Spectrogram Transformer): Treats spectrogram patches as visual tokens, inspired by ViT
These models typically employ patch embeddings—splitting spectrograms into 16×16 patches or waveforms into overlapping windows—before transformer processing. The choice between raw waveform and spectrogram inputs involves tradeoffs: waveforms preserve phase information but require longer attention spans, while spectrograms provide compressed time-frequency representations at the cost of potential information loss.

3.3 Hybrid Architectures
Hybrid architectures in contrastive learning for audio embeddings combine the strengths of multiple neural network topologies to optimize feature extraction and representation learning. These models often integrate convolutional neural networks (CNNs) for local pattern detection with transformer-based architectures for capturing long-range dependencies, leveraging the inductive biases of each component. The fusion occurs either through late-stage feature concatenation or intermediate cross-attention mechanisms, depending on the desired trade-off between computational efficiency and representational capacity.
Architectural Variants
Two dominant hybrid approaches have emerged in audio contrastive learning:
- Parallel Hybrids: Process input spectrograms simultaneously through separate CNN and transformer pathways, then combine features via learned projection matrices. The InfoNCE loss operates on the joint embedding space:
where f(x) represents the hybrid encoder output and τ is a temperature hyperparameter.
- Sequential Hybrids: Employ CNNs as front-end feature extractors, feeding flattened patch embeddings into transformer layers. This architecture benefits from the CNN's translation equivariance for low-level features while using self-attention for high-level temporal relationships.
Gradient Flow Considerations
The interaction between architectural components introduces unique gradient dynamics during backpropagation. For a hybrid model with CNN block C and transformer block T, the gradient through the composition T∘C decomposes via the chain rule:
Practical implementations often employ gradient clipping or layer-wise adaptive rates to prevent instability arising from differing convergence speeds between components. Recent work by Wang et al. (2023) demonstrates that scaling transformer gradients by a factor of √d (where d is the embedding dimension) relative to CNN gradients improves training dynamics.
Case Study: Conformer-Based Audio Embeddings
The Conformer architecture—originally developed for speech recognition—has shown particular promise in audio contrastive learning. Its key innovation lies in interleaving convolutional modules with multi-head self-attention:
For a 128-band Mel-spectrogram input X∈ℝT×F, the Conformer first applies strided convolution along the time axis, then processes sequences through N hybrid blocks. Each block computes:
where FFN denotes a feedforward network, MHSA is multi-head self-attention, and Conv represents a depthwise separable convolution. The contrastive loss operates on the final layer's [CLS] token embedding.
Computational Trade-offs
Hybrid models achieve superior performance at the cost of increased complexity. For a 3-second audio clip at 16kHz sampling rate:
| Architecture | Params (M) | FLOPs (G) | Linear Probe Acc (%) |
|---|---|---|---|
| CNN-only | 23.4 | 5.2 | 68.3 |
| Transformer-only | 41.7 | 18.6 | 72.1 |
| Hybrid | 37.2 | 12.4 | 76.9 |
The 8.6% accuracy gain of hybrids over pure CNNs comes at a 2.4× FLOPs increase, though recent techniques like dynamic token reduction mitigate this overhead. Pruning transformer heads in shallow layers while maintaining dense attention in deeper blocks has shown particular promise, preserving 95% of accuracy while reducing FLOPs by 35%.

4. Batch Construction Strategies
4.1 Batch Construction Strategies
Positive and Negative Pair Sampling
In contrastive learning, the quality of learned embeddings depends critically on how positive and negative pairs are constructed within each batch. For audio applications, a positive pair consists of two different augmented views of the same audio sample, while negative pairs are formed from different samples. The InfoNCE loss function maximizes agreement between positive pairs while pushing negative pairs apart:
where zi and zj are embeddings of positive pairs, τ is a temperature parameter, and the denominator sums over all negative pairs in the batch.
Hard Negative Mining
Random negative sampling often leads to trivial solutions where negatives are already well-separated in embedding space. Hard negative mining selects challenging negatives that are acoustically similar but semantically distinct. For audio, this can be implemented by:
- Computing pairwise cosine similarities between all embeddings in the batch
- Selecting the top-K most similar samples from different classes as hard negatives
- Adjusting the mining ratio dynamically during training
Curriculum Learning Strategies
Gradually increasing the difficulty of negative samples improves model robustness. A three-phase curriculum works well for audio:
where T1 and T2 are transition epochs determined through validation performance.
Batch Size Considerations
Larger batches provide more negative samples but face diminishing returns due to:
- Memory constraints in GPU training
- Reduced gradient diversity
- Increased risk of false negatives in audio datasets
For typical audio embedding tasks, batch sizes between 256-1024 offer the best trade-off, with gradient accumulation used when memory is limited.
Multi-Resolution Batching
Audio signals contain information at multiple timescales. Effective batching strategies should:
- Include variable-length clips (e.g., 1s to 10s durations)
- Apply synchronized time-frequency augmentations
- Use dynamic padding rather than fixed-length cropping
This approach captures both local acoustic features and global structural patterns in the learned embeddings.

4.2 Handling Class Imbalance
Class imbalance is a pervasive challenge in contrastive learning for audio embeddings, where certain classes dominate the dataset while others are underrepresented. This skew biases the model toward majority classes, degrading performance on minority classes. Several advanced techniques mitigate this issue, each with distinct trade-offs in computational overhead and effectiveness.
Loss Function Modifications
Traditional contrastive loss functions, such as InfoNCE, assume balanced class distributions. To counteract imbalance, weighted variants rebalance gradients during optimization. The modified InfoNCE loss for class-imbalanced datasets is:
Here, wyi is a class-specific weight, typically inversely proportional to class frequency. For a class c with frequency pc, weights can be set as wc = 1 / pcα, where α controls the rebalancing intensity. Empirical studies suggest α = 0.5 strikes a balance between stability and performance.
Hard Negative Mining
Imbalanced datasets often yield trivial negatives, reducing the discriminative power of embeddings. Hard negative mining prioritizes challenging samples from majority classes. For a batch B, the hardest negatives are selected based on similarity scores:
This forces the model to distinguish between acoustically similar but semantically distinct samples, improving minority class separation. However, excessive hard negative mining risks destabilizing training—adaptive strategies like semi-hard mining mitigate this by excluding outliers.
Data Resampling Strategies
Resampling adjusts class frequencies directly in the data pipeline. Two dominant approaches are:
- Oversampling: Duplicates or synthesizes minority-class samples using techniques like SpecAugment for audio, which applies time/frequency masking to existing samples.
- Undersampling: Discards majority-class samples randomly or via clustering (e.g., retaining centroids from k-means).
Hybrid methods like SMOTE generate synthetic samples in latent space. For audio, diffusion models can create realistic minority-class samples by perturbing mel-spectrograms while preserving class identity.
Curriculum Learning
Gradually introducing harder samples avoids early overfitting to majority classes. A cosine schedule adjusts the mix of easy/hard negatives:
where t is the current step, T the total steps, and λ controls the hardness ratio. This aligns with observations that models learn coarse-grained features before fine-grained distinctions.
Evaluation Metrics for Imbalanced Settings
Standard accuracy is misleading under imbalance. Instead, use:
- Balanced Accuracy: Mean recall across classes.
- Area Under Precision-Recall Curve (AUPRC): More informative than ROC for skewed distributions.
- Fβ-Score: Weighted harmonic mean of precision/recall, where β prioritizes minority classes.
For embedding quality, measure Mean Average Precision (mAP) per class and compare variance across classes to detect bias.
4.3 Multi-Task Learning Approaches
Multi-task learning (MTL) enhances contrastive learning for audio embeddings by jointly optimizing multiple related objectives, improving generalization and robustness. In audio representation learning, MTL frameworks often combine contrastive loss with auxiliary tasks such as classification, reconstruction, or temporal prediction. The underlying principle is that shared representations learned across tasks capture more discriminative and transferable features.
Mathematical Formulation
The joint objective function in MTL for contrastive learning is a weighted sum of individual task losses. For a model with K tasks, the total loss Ltotal is:
where λk is a task-specific weighting coefficient, and Lk is the loss for task k. For contrastive audio embeddings, a common setup includes:
- Contrastive loss (Lcontrastive): Minimizes distance between positive pairs (augmented versions of the same audio clip) while maximizing separation from negative pairs.
- Cross-entropy loss (Lclass): Supervised classification loss for labeled data, enforcing semantic discriminability.
- Reconstruction loss (Lrecon): An autoencoder-style loss (e.g., mean squared error) to preserve fine-grained acoustic details.
Architectural Design
MTL architectures for audio embeddings typically employ:
- Shared encoder: A deep neural network (e.g., CNN, Transformer) extracting a shared latent representation from raw waveforms or spectrograms.
- Task-specific heads: Lightweight subnetworks (e.g., MLPs) branching from the shared encoder to compute task-specific outputs.
For example, a joint contrastive-classification model processes input x as:
where fθ is the shared encoder, and gϕ, gψ are projection heads for contrastive learning and classification, respectively.
Dynamic Weighting Strategies
Balancing task weights (λk) is critical. Common approaches include:
- Uncertainty weighting: Automatically adjusts λk based on task-specific homoscedastic uncertainty. The loss becomes:
where σk is a learnable parameter representing task uncertainty.
- Gradient normalization: Scales gradients so all tasks contribute equally to updates, preventing dominance by high-magnitude losses.
Case Study: Audio2Vec with MTL
Audio2Vec (Chung et al., 2019) combines contrastive learning with phonetic classification and speaker identification. The shared encoder is a 1D CNN processing log-Mel spectrograms, while task heads include:
- A Noise Contrastive Estimation (NCE) loss for contrastive learning.
- Cross-entropy losses for phoneme and speaker classification.
Experiments on LibriSpeech show that the MTL model outperforms single-task baselines by 12% in ABX phonetic discrimination and 8% in speaker verification EER.
Challenges and Mitigations
Key challenges in MTL for audio embeddings include:
- Negative transfer: Conflicting gradients from unrelated tasks degrade performance. Mitigated via task grouping or gradient surgery.
- Computational cost: Multiple task heads increase memory and inference time. Solved through weight sharing or modular architectures.

5. Downstream Task Performance
5.1 Downstream Task Performance
Evaluating the quality of learned audio embeddings requires assessing their generalization capability on downstream tasks. Unlike supervised learning, where performance is measured directly on a labeled dataset, contrastive learning necessitates transfer learning evaluations to validate the embeddings' utility. Common downstream tasks include audio classification, speaker identification, emotion recognition, and audio retrieval.
Key Metrics for Evaluation
The effectiveness of audio embeddings is typically quantified using:
- Linear Evaluation Protocol: A linear classifier is trained on top of frozen embeddings, and accuracy is measured. This isolates the embedding quality from the classifier's capacity.
- Fine-Tuning Performance: The entire model (including the encoder) is fine-tuned on the downstream task, measuring the improvement over random initialization.
- k-Nearest Neighbors (k-NN) Accuracy: Measures the embeddings' clustering quality without any additional training.
Mathematical Formulation of Linear Evaluation
Given a pretrained encoder f and a labeled dataset {(x_i, y_i)}, the linear evaluation protocol trains a weight matrix W to minimize the cross-entropy loss:
where N is the number of samples, and W is optimized while f remains frozen. The test accuracy reflects the embedding's discriminative power.
Case Study: Speech Command Recognition
In speech command recognition, contrastive learning embeddings have demonstrated strong performance on datasets like Google Speech Commands. A ResNet-50 encoder pretrained using SimCLR achieves ~97% accuracy with linear evaluation, compared to ~95% for supervised baselines. The key advantage lies in the embeddings' ability to generalize to unseen speakers and noise conditions.
Impact of Pretraining Data Scale
The relationship between pretraining dataset size and downstream accuracy follows a logarithmic scaling law:
where N is the number of pretraining samples, and a, b are task-dependent constants. This suggests diminishing returns but persistent improvements with larger datasets.
Cross-Domain Generalization
Contrastive audio embeddings exhibit strong cross-domain transferability. For instance, embeddings pretrained on environmental sounds (e.g., AudioSet) achieve competitive performance on speech tasks, indicating that high-level acoustic features are shared across domains. This property is particularly valuable in low-resource settings where labeled data is scarce.
5.2 Embedding Quality Metrics
Evaluating the quality of learned audio embeddings is critical for assessing the effectiveness of contrastive learning. Unlike supervised tasks where accuracy or F1-score suffices, unsupervised embedding spaces require specialized metrics that measure structural properties like cluster separation, uniformity, and alignment.
Alignment and Uniformity
The alignment metric quantifies how close positive pairs (augmented versions of the same sample) are in the embedding space, while uniformity measures how well the embeddings cover the hypersphere without collapsing. These are formally defined as:
where ppos is the distribution of positive pairs and pdata is the data distribution. Optimal embeddings minimize alignment while maximizing uniformity.
Neighborhood Hit Rate
For labeled datasets, the neighborhood hit rate (NHR) evaluates local cluster purity by measuring the fraction of k-nearest neighbors sharing the same class label:
where NNk(i) denotes the k-nearest neighbors of embedding i. Values closer to 1 indicate better class separation.
Topological Metrics
Persistent homology provides a rigorous framework for assessing topological features like connected components and holes in the embedding space. The bottleneck distance between persistence diagrams of the original data and its embeddings quantifies preservation of global structure:
where D1 and D2 are persistence diagrams. Smaller distances indicate better topological fidelity.
Downstream Task Performance
While intrinsic metrics are useful, the ultimate validation comes from downstream task performance. Common audio benchmarks include:
- Speaker verification (Equal Error Rate on VoxCeleb)
- Music tagging (AUC on MagnaTagATune)
- Sound event detection (F1-score on AudioSet)
Embeddings should achieve comparable performance to supervised baselines when used as fixed features in linear evaluation protocols.
Dimensionality Assessment
The intrinsic dimensionality (ID) of embeddings can reveal over- or under-parameterization. The Grassberger-Procaccia estimator calculates ID from the correlation sum:
where r is the neighborhood radius. A sudden plateau in ID versus embedding dimension suggests optimal representation capacity.
5.3 Standard Audio Datasets for Benchmarking
Large-Scale General-Purpose Audio Datasets
The AudioSet dataset, released by Google in 2017, remains the most comprehensive benchmark for audio representation learning. It consists of over 2 million 10-second YouTube clips annotated with 527 sound classes using a hierarchical ontology. The unbalanced training set contains 1,789,621 samples, while the balanced evaluation set has 20,383 samples. AudioSet's multi-label nature and real-world acoustic variability make it ideal for testing the generalization capabilities of contrastive learning frameworks.
FSD50K (Freesound Dataset 50K) provides a more controlled alternative with 51,197 audio clips spanning 200 classes. Each sample is human-verified and comes with rich metadata including tags, titles, and descriptions. The dataset is explicitly split into training (38,116 clips), validation (5,458 clips), and test (7,623 clips) sets, with evaluation focusing on both coarse-grained and fine-grained acoustic event detection.
Speech-Centric Benchmark Datasets
For speech representation learning, LibriSpeech serves as the de facto standard with 1,000 hours of read English speech from 2,484 speakers. The clean-100, clean-360, and other-500 subsets allow controlled experiments on varying noise conditions. Contrastive methods often use the speaker identity labels (2,484 classes) as natural positive pairs when applying instance discrimination techniques.
The VoxCeleb datasets (1 and 2) provide over 1 million utterances from 7,363 speakers in real-world noisy conditions. VoxCeleb2 in particular contains speech segments extracted from YouTube videos, exhibiting challenging variations in background noise, recording equipment, and room acoustics. The datasets are commonly used to evaluate speaker verification and disentangled speech representation learning.
Music Information Retrieval Benchmarks
The MagnaTagATune dataset contains 25,877 music clips (each 29.1s long) annotated with 188 tags covering genres, instruments, and moods. Its relatively small size makes it suitable for few-shot transfer learning evaluations after pre-training on larger datasets. The MTG-Jamendo dataset extends this with 55,701 full-track recordings and hierarchical multi-label annotations.
For fine-grained music analysis, the NSynth dataset provides 305,979 musical notes from 1,006 instruments, each with precise pitch, velocity, and timbre annotations. This controlled synthesis dataset enables rigorous ablation studies on how contrastive learning captures different acoustic properties.
Environmental Sound Datasets
ESC-50 (Environmental Sound Classification) contains 2,000 5-second clips evenly distributed across 50 environmental classes. Its small size and balanced nature make it ideal for rapid prototyping. The UrbanSound8K dataset provides 8,732 labeled sound excerpts (<=4s) from urban environments, with the predefined 10-fold cross-validation split enabling standardized comparisons.
For more challenging real-world conditions, the DCASE (Detection and Classification of Acoustic Scenes and Events) challenge datasets provide multi-microphone recordings with spatial information. The 2023 Task 4 dataset includes 14,000 weakly labeled sound events and 1,500 strongly labeled segments across 10 classes, recorded with 4-channel microphone arrays.
Multimodal Audio-Visual Datasets
The VGGSound dataset contains 200,000 10-second YouTube clips covering 309 sound classes, with synchronized audio and video streams. This enables research into cross-modal contrastive learning where audio embeddings can be grounded in visual information. Similarly, the AudioCaps dataset provides 46,000 audio clips paired with human-written captions, facilitating evaluation of semantically-aware audio representations.
When benchmarking on these datasets, researchers typically report both linear evaluation performance (training a classifier on frozen embeddings) and end-to-end fine-tuning results. The choice of evaluation protocol significantly impacts reported metrics - for AudioSet, mean average precision (mAP) is standard, while for speech tasks, equal error rate (EER) or accuracy dominate.
6. Speaker Identification
Speaker Identification
Speaker identification in contrastive learning frameworks leverages the principle of maximizing agreement between embeddings of the same speaker while minimizing similarity across different speakers. Given a dataset of audio samples X = {x1, x2, ..., xN}, where each xi is associated with a speaker label yi, the objective is to learn an embedding function fθ: X → ℝd that maps input audio to a d-dimensional space where speaker-specific features are discriminative.
Contrastive Loss Formulation
The contrastive loss for speaker identification is derived from the InfoNCE objective, which treats samples from the same speaker as positive pairs and all others as negatives. For a batch of N samples, the loss for a given anchor xi is:
where zi = fθ(xi) is the normalized embedding, τ is a temperature hyperparameter, and sim(·,·) is typically cosine similarity. The indicator function 𝕀k≠i excludes the anchor from the denominator.
Architectural Components
Modern systems employ a dual-encoder architecture:
- Frontend: A CNN or transformer processes spectrograms or raw waveforms to extract frame-level features.
- Aggregation: Temporal pooling (e.g., attentive or statistical) produces utterance-level embeddings.
- Projection Head: A shallow MLP maps embeddings to the contrastive space, often discarded post-training.
Data Augmentation Strategies
Effective augmentation is critical for learning invariant representations. Common audio transformations include:
- Time-domain: Speed perturbation (±10%), additive noise (SNR ≥ 20dB), and room impulse simulation.
- Frequency-domain: SpecAugment (time/freq masking), pitch shifting (±2 semitones).
Evaluation Metrics
Performance is quantified using:
where FAR (False Acceptance Rate) and FRR (False Rejection Rate) are computed from cosine similarity thresholds. State-of-the-art systems achieve EER < 1% on VoxCeleb.
Practical Considerations
Key implementation challenges include:
- Batch Sampling: Balanced batches with P speakers and K utterances per speaker (PK ≤ batch size).
- Hard Negative Mining: Prioritizing acoustically similar impostor pairs during training.
- Embedding Dimensionality: Typical d = 256–512 balances discriminability and computational cost.

6.2 Music Recommendation Systems
Contrastive Learning in Music Recommendation
Music recommendation systems leverage contrastive learning to map audio tracks into a high-dimensional embedding space where similar songs are clustered together. Given a dataset of tracks X, the goal is to learn an encoder fθ that transforms raw audio spectrograms into embeddings z = fθ(x) such that:
where zi and zj are embeddings of similar tracks (positive pairs), and zk is an embedding of a dissimilar track (negative sample). The similarity metric is typically cosine similarity:
Constructing Positive and Negative Pairs
Positive pairs can be derived from:
- Within-track augmentation: Random time masking, pitch shifting, or noise addition applied to the same audio clip.
- Cross-track metadata: Tracks from the same artist, album, or playlist.
Negative pairs are sampled uniformly from tracks outside the positive set. For large-scale systems, hard negative mining is critical:
where α is a similarity threshold and y denotes class labels.
Loss Functions for Music Embeddings
The InfoNCE loss is commonly used for training:
where τ is a temperature hyperparameter. For music, the NT-Xent variant often performs better by normalizing embeddings before similarity computation.
Architectural Considerations
State-of-the-art systems use:
- Spectrogram encoders: CNN or Vision Transformer (ViT) backbones processing Mel-spectrograms.
- Temporal modeling: Transformer or LSTM layers to capture sequential patterns.
- Projection heads: MLPs that map encoder outputs to the embedding space.
Evaluation Metrics
Performance is measured through:
- Recall@k: Percentage of relevant tracks in top-k recommendations.
- Normalized Discounted Cumulative Gain (NDCG): Accounts for ranking position of relevant items.
- Coverage: Fraction of catalog that can be recommended.
Case Study: Large-Scale Deployment
Spotify's system processes 60M+ tracks using two-stage retrieval:
- Contrastive embeddings reduce candidate pool from millions to thousands.
- Lightweight ranking models refine recommendations based on user history.
The embedding space exhibits emergent properties where:
allowing linear combinations of seed tracks to guide recommendations.

6.3 Environmental Sound Classification
Environmental sound classification (ESC) leverages contrastive learning to distinguish between diverse acoustic scenes, such as urban noise, animal sounds, or industrial machinery. Unlike speech or music, environmental sounds exhibit high variability in spectral and temporal characteristics, making them challenging to model with traditional supervised approaches. Contrastive learning addresses this by learning invariant representations from weakly labeled or unlabeled audio data.
Feature Extraction for Environmental Sounds
Mel-frequency cepstral coefficients (MFCCs) and log-Mel spectrograms are commonly used as input features, but contrastive frameworks often employ learnable front-ends. A trainable 1D convolutional neural network (CNN) can replace fixed feature extractors, optimizing the time-frequency representation for the downstream task:
where fCNN processes raw waveform x into a latent representation X. This approach outperforms fixed feature extractors by adapting to the spectral properties of environmental sounds.
Contrastive Loss Adaptation
The Noise Contrastive Estimation (NCE) loss is modified to handle the high intra-class variance of environmental sounds. Given an anchor sample xi, positive pairs are generated via data augmentation (e.g., time masking, pitch shifting), while negatives are drawn from different acoustic classes:
where s(·,·) measures cosine similarity between embeddings, and τ is a temperature parameter. This formulation forces the model to discriminate between semantically distinct sounds while remaining invariant to nuisance variations.
Architectural Considerations
Transformer-based architectures have shown promise for ESC due to their ability to model long-range dependencies in spectrograms. A hybrid CNN-Transformer model processes local patterns via convolutional layers before applying self-attention to global structures:
The multi-head attention mechanism computes:
where dk is the dimension of the key vectors. This allows the model to attend to discriminative time-frequency regions, such as transient events in machinery sounds or harmonic patterns in animal vocalizations.
Practical Applications
Real-world implementations must address several challenges:
- Class imbalance: Urban sound datasets often exhibit long-tail distributions. Contrastive learning benefits from hard negative mining strategies that prioritize rare classes.
- Background noise: Data augmentation techniques like additive noise mixing improve robustness to real-world recording conditions.
- Temporal resolution: Environmental sounds may require variable-length attention windows to capture both short events (e.g., glass breaking) and sustained noises (e.g., air conditioning).
State-of-the-art systems achieve >90% accuracy on benchmark datasets like UrbanSound8K by combining contrastive pretraining with supervised fine-tuning. The learned embeddings also enable few-shot learning for novel sound classes with limited labeled examples.

7. Handling Noisy Audio Data
Handling Noisy Audio Data
Noise robustness is critical for contrastive learning in audio embeddings, as real-world recordings often contain background interference, reverberation, or distortions. The InfoNCE loss, commonly used in contrastive frameworks, assumes clean positive pairs, but noise can disrupt the alignment of similar samples. To mitigate this, several strategies can be employed at both the data and model levels.
Preprocessing Techniques
Spectral subtraction and Wiener filtering are classical approaches for noise reduction. Given a noisy signal y(t) = x(t) + n(t), where x(t) is the clean signal and n(t) is additive noise, spectral subtraction estimates the clean signal magnitude spectrum:
where λ is an over-subtraction factor to account for noise variance underestimation. Modern variants use deep neural networks to predict noise masks, outperforming traditional statistical estimators.
Data Augmentation for Noise Robustness
Contrastive learning benefits from aggressive data augmentation to simulate noisy conditions. Effective audio augmentations include:
- Additive noise injection: Mixing in background noise from databases like DEMAND or AudioSet at varying SNR levels.
- Time-frequency masking: Randomly zeroing out frequency bands (SpecAugment) or time segments to simulate dropouts.
- Reverberation: Convolving with room impulse responses to mimic acoustic environments.
These augmentations create diverse positive pairs that force the model to learn noise-invariant features. The key is maintaining semantic similarity while varying nuisance factors.
Architectural Adaptations
Model architectures can be modified to improve noise robustness. Temporal convolutional networks (TCNs) with large receptive fields can integrate contextual information to suppress transient noise. Alternatively, attention mechanisms can learn to weight clean segments more heavily. The transformer-based COLA model, for instance, uses self-attention to focus on phonetically rich regions while attenuating noise-dominated frames.
where the query Q, key K, and value V matrices are derived from the input sequence, allowing dynamic reweighting of noisy time steps.
Loss Function Modifications
The standard InfoNCE loss can be made more noise-tolerant through:
- Soft contrastive learning: Replacing hard binary contrast with continuous similarity scores that account for partial matches.
- Noise-aware negative sampling: Downweighting negatives likely contaminated by similar noise patterns to prevent false negatives.
- Multi-task learning: Jointly optimizing for contrastive loss and auxiliary noise prediction tasks.
For example, the noise-robust contrastive loss (NRCL) modifies InfoNCE by incorporating estimated noise levels:
where n_i, n_j are noise confidence scores and β controls their influence.
Evaluation Under Noise
Benchmarking should use both clean and noisy test sets. Standard protocols include:
- Noise-injected versions of clean evaluation sets (e.g., LibriSpeech with added noise)
- Real-world noisy datasets like CHiME or VOiCES
- Progressive SNR testing from 20dB to -5dB to measure graceful degradation
Metrics should track both absolute performance (accuracy, EER) and relative degradation compared to clean conditions. Noise-robust models show flatter performance curves as SNR decreases.

7.2 Scaling to Large-Scale Datasets
Training contrastive learning models on large-scale audio datasets presents unique computational and algorithmic challenges. The quadratic complexity of pairwise similarity calculations in traditional contrastive loss formulations becomes prohibitively expensive as dataset sizes grow. For a dataset with N samples, the memory and computational requirements scale as O(N²), making naive implementations infeasible for N > 10⁵.
Memory-Efficient Implementations
Distributed training frameworks leverage gradient checkpointing and mixed-precision training to reduce memory overhead. Gradient checkpointing recomputes intermediate activations during the backward pass rather than storing them, trading compute for memory. Mixed-precision training using FP16 or BF16 formats cuts memory usage by half while maintaining model stability through loss scaling:
Approximate Nearest Neighbor Search
For large batch sizes, exact pairwise similarity calculations are replaced with approximate methods. Locality-Sensitive Hashing (LSH) projects high-dimensional embeddings into lower-dimensional buckets where similar items collide with high probability. The LSH similarity approximation for audio embeddings x_i, x_j uses random projections:
where W is a random Gaussian matrix and b is a uniform random vector. Multiple hash functions are combined to reduce false positives.
Negative Sample Mining
Hard negative mining strategies improve training efficiency by focusing computation on informative pairs. Dynamic queue-based approaches maintain a memory bank of recent embeddings, allowing access to a diverse set of negatives without recomputation. The momentum encoder technique from MoCo stabilizes training with this approach:
where θ_q and θ_k are the query and key encoder parameters, and m is the momentum coefficient (typically 0.999).
Distributed Training Strategies
Data parallelism across multiple GPUs requires careful synchronization of embedding norms to prevent gradient explosion. All-reduce operations are optimized using ring-based communication patterns, while gradient accumulation enables effective batch sizes exceeding GPU memory limits. The effective batch size B_eff with K GPUs and G gradient steps is:
Pipeline parallelism further scales training by partitioning the model across devices, with careful placement of synchronization barriers to maintain training stability.

Interpretability of Audio Embeddings
Interpretability in contrastive learning for audio embeddings refers to the ability to understand and explain how the learned representations encode meaningful acoustic features. Unlike supervised models where class labels provide direct interpretability, contrastive learning relies on self-supervised objectives, making the embeddings more opaque. However, several techniques can be employed to probe and visualize these embeddings.
Feature Attribution Methods
Feature attribution techniques identify which input components (e.g., time-frequency bins in a spectrogram) contribute most to the embedding. Gradient-based methods, such as saliency maps, compute the gradient of the embedding vector with respect to the input:
where X(t, f) is the spectrogram at time t and frequency f, and z is the embedding vector. Higher values of S(t, f) indicate regions of the spectrogram that strongly influence the embedding.
Dimensionality Reduction for Visualization
High-dimensional embeddings (e.g., 512 or 1024 dimensions) can be projected into 2D or 3D space using techniques like t-SNE or UMAP. These methods preserve local neighborhoods, allowing clusters of similar audio samples to be visually identified. The t-SNE objective minimizes the Kullback-Leibler divergence between high-dimensional and low-dimensional distributions:
where P(i, j) and Q(i, j) are similarity probabilities in the original and reduced spaces, respectively.
Probing Tasks
Linear probing trains a simple classifier on top of frozen embeddings to predict auxiliary labels (e.g., instrument classes, pitch, or speech content). High accuracy indicates that the embeddings encode relevant features for the task. The probing classifier minimizes:
where W and b are learnable parameters, and y_i is the label for embedding z_i.
Case Study: Speech vs. Music Discrimination
In a contrastive learning setup using the LibriSpeech and MUSDB datasets, t-SNE visualization revealed distinct clusters for speech and music. Linear probing achieved 98% accuracy, confirming that the embeddings inherently separate these modalities without explicit supervision. Gradient-based attribution highlighted that speech embeddings focused on formant regions, while music embeddings attended to harmonic structures.
Challenges in Interpretability
- Nonlinearity: Contrastive loss functions optimize for relative distances rather than human-understandable features.
- Dependency on Pretext Task: The choice of positive/negative pairs biases what the embeddings encode.
- High Dimensionality: Direct interpretation of individual embedding dimensions is rarely meaningful.

8. Key Research Papers
8.1 Key Research Papers
- [2009.09805] Active Contrastive Learning of Audio-Visual Video ... — In this paper, we focus on learning audio-visual representations of video data by leveraging the natural correspondence between the two modalities, which serves as a useful self-supervisory signal (Owens & Efros, 2018; Owens et al., 2016; Alwassel et al., 2019).Our starting point is contrastive learning (Gutmann & Hyvärinen, 2010; Oord et al., 2018) with momentum updates (He et al., 2020).
- Audio Deepfake Detection Using Deep Learning - Shaaban - 2025 ... — The study highlights the effectiveness of deep learning models in distinguishing between genuine and fake audio. This research contributes to the field of audio forensics and cybersecurity. ... the authors in propose CLAD (Contrastive Learning-based Audio deepfake Detector) to learn robust audio representations for manipulations in audio ...
- GitHub - malteos/scincl: Neighborhood Contrastive Learning for ... — Supplemental materials for Neighborhood Contrastive Learning for Scientific Document Representations with Citation Embeddings (EMNLP2022 paper, PDF available on ArXiv).Trained models and datasets are available as GitHub release files and on Huggingface model hub.. Learning scientific document representations can be substantially improved through contrastive learning objectives, where the ...
- Audio-visual self-supervised representation learning: A survey — The McGurk effect [54], where mismatched audio and visual cues affect perception, spurred early research in Multimodal Machine Learning (MML) in 1989 with audio-visual speech recognition studies [55]. This section delves into key aspects of audio and visual modalities and their classifications, as shown in Fig. 1.
- Learning Music Audio Representations With Limited Data — CLMR is an adaptation of the SimCLR contrastive learning approach to self-supervised music audio representation learning. It uses an existing convolutional encoder [ 21 ] that operates on raw audio waveforms, consisting of 9 1D convolutional layers with a kernel size of 3, and learns representations by building invariance to musically relevant ...
- PDF Audio-text retrieval based on contrastive learning and ... - Springer — Existing research on audio-text retrieval is limited by the size of the dataset and the structure of the network, making it dif-cult to learn the ideal features of audio and text resulting in low retrieval accuracy. In this paper, we construct an audio-text retrieval model based on contrastive learning and collaborative attention mechanism.
- Sequential Contrastive Audio-Visual Learning - arXiv.org — visual retrieval setting with music videos. Key information, such as a riff's tempo or the hand movements of a guitarist, would be mostly lost due to the compression into a single non-temporal embedding. In this paper, we propose sequential contrastive audio-visual learning (SCAV), which utilizes sequential distances to
- Sequential Contrastive Audio-Visual Learning - arXiv.org — In this paper, we propose sequential contrastive audio-visual learning (SCAV), which utilizes sequential distances to contrast directly on the natural and non-aggregated representation space, taking advantage of the fine-grained temporal and semantic information of the sequences (Fig. 1, right).We experiment with different sequential distances and find that a Euclidean-based distance with ...
- (PDF) Audio-Text Retrieval Based on Contrastive Learning and ... — In this paper, we c onstruct an audio-text r etrie val model based o n contrastive learning and collaborative attention mec hanism . We rst r educe mo del over tting by implementing audio ...
- (PDF) Contrastive Audio-Visual Masked Autoencoder - ResearchGate — In this paper, we first extend the recent Masked Auto-Encoder (MAE) model from a single modality to audio-visual multi-modalities. Subsequently, we propose the Contrastive Audio-Visual Masked Auto ...
8.2 Open-Source Implementations
- PDF Zero-Shot Audio Captioning Using Soft and Hard Prompts — audio captioning methods. A. Contrastive Language-Audio Pre-training (CLAP) CLAP [11], [15]-[17] utilizes contrastive learning to pre-train language-audio models, which map both audio and text into the same semantic space on large-scale audio-text pairs. CLAP contains two encoders: an audio encoder and a text en-coder. The audio encoder fAudio
- PDF wav2vec 2.0: A Framework for Self-Supervised Learning of ... - NeurIPS — We show for the first time that learning powerful representations from speech audio alone followed by fine-tuning on transcribed speech can outperform the best semi-supervised methods while being conceptually simpler. wav2vec 2.0 masks the speech input in the latent space and solves a contrastive task defined over a
- PDF Audio-text retrieval based on contrastive learning and ... - Springer — tive learning. In the audio-text retrieval, the introduction of audio augmentation not only solves the problem of insucient sample data, but we also apply contrastive learning between the augmented audio and the original audio, and this self-supervision within the same modality eectively learns a richer set of features. We also evalu-
- Audio-visual self-supervised representation learning: A survey — Yuan et al. [107] integrated masked-autoencoder and contrastive learning for audio-visual SSL, training on AudioSet, yielding (65.9% accuracy) in VGG Sound event classification and (49.3% recall) in audio-visual retrieval. However, insufficient representation (10 frames, 1 Hz) limited the model's capacity to capture motion information.
- Learning Music Audio Representations With Limited Data — CLMR is an adaptation of the SimCLR contrastive learning approach to self-supervised music audio representation learning. It uses an existing convolutional encoder [ 21 ] that operates on raw audio waveforms, consisting of 9 1D convolutional layers with a kernel size of 3, and learns representations by building invariance to musically relevant ...
- Audio Deepfake Detection Using Deep Learning - Shaaban - 2025 ... — The data is then fed into three different deep learning models: First, the difference between an original audio file and its spectrogram is directly fed into a CNN model to train the system; then, the transfer learning approach which utilizes state-of-the-art computer vision models; After that, the audio embeddings using pre-trained models such ...
- PDF AVLnet: Learning Audio-Visual Language Representations from ... — The audio branch consists of a trainable CNN with residual layers [3] to process the raw audio in videos. The model takes in audio spectrograms and outputs a temporal feature map, which is temporally mean-pooled to obtain a 1024-dimensional feature vector a. In contrast to text-video models that require pretrained word embeddings to
- (PDF) Audio-Text Retrieval Based on Contrastive Learning and ... — of audio a ugmentation, collaborative atte ntive mechanism and inter-mo dal contrastive learning re moved from our mode l. 4 . 4 . 1 E f f e c t o f a u d i o a u g m e n t a t i o n
- PDF and Collaborative Attention Mechanism Audio-Text Retrieval Based on ... — the contrastive learning methods between the augmented audio data and the original audio, allowing the model to effectively learn a richer set of audio features. The retrieval accuracy of our ...
- CLAP - Hugging Face — Overview. The CLAP model was proposed in Large Scale Contrastive Language-Audio pretraining with feature fusion and keyword-to-caption augmentation by Yusong Wu, Ke Chen, Tianyu Zhang, Yuchen Hui, Taylor Berg-Kirkpatrick, Shlomo Dubnov.. CLAP (Contrastive Language-Audio Pretraining) is a neural network trained on a variety of (audio, text) pairs.
8.3 Recommended Books and Surveys
- Sequential Contrastive Audio-Visual Learning - arXiv.org — Audio-visual representation learning plays a central role in several recent advancements such as multimodal LLMs [1], [2] and audio-visual generative models [3]-[6]. Contrastive learning [7], [8] has emerged as an effective methodology for learning audio-visual representations by relying on the co-occurrence of the two modalities in unlabeled ...
- PDF Complete lecture notes - Massachusetts Institute of Technology — 1.5. The Training of an Audio Engineer • Listening and ear training • Musical knowledge and performance experience • Practical, hands-on experience with hardware and software • Knowledge of historical and current trends • Theoretical knowledge of sound, psychoacoustics, and electronics • Experience working with changing and limited resources
- PDF CrossCLR: Cross-Modal Contrastive Learning for Multi-Modal Video ... — 2.1. Sample Selection in Contrastive Learning Different from the recent research [3, 16, 6, 5, 13, 2], our work addresses multi-modal contrastive learning. We propose inter- and intra-modality loss objectives to ensure that samples with similar content stay close in the joint embedding space, regardless of the modality. However,
- A Review of Recent Advances on Deep Learning Methods for Audio ... - MDPI — This article provides a detailed review of recent advances in audio-visual speech recognition (AVSR) methods that have been developed over the last decade (2013-2023). Despite the recent success of audio speech recognition systems, the problem of audio-visual (AV) speech decoding remains challenging. In comparison to the previous surveys, we mainly focus on the important progress brought ...
- Supervised contrastive learning for graph ... - ScienceDirect — Contrastive learning, as discussed by [20], constitutes a class of self-supervised methods that train an encoder to generate distinct embeddings for dissimilar input pairs while producing similar embeddings in the embedding space for similar input pairs. To establish similarity between pairs from the same input, augmentation methods are employed.
- Decoupled Contrastive Learning - SpringerLink — Contrastive Learning. Contrastive learning (CL) constructs positive and negative sample pairs to extract information from the data itself. In CL, each anchor image in a batch has only one positive sample to construct a positive sample pair [7, 14, 15].CPC [] predicts the future output of sequential data by using current output as prior knowledge, which can improve the feature representing the ...
- Foundations & Trends in Multimodal Machine Learning: Principles ... — This article is designed to complement other surveys that belong broadly to the study of multiple modalities or views: multi-view learning [241, 315, 384] is concerned with settings where different views (e.g., camera views) typically provide overlapping (redundant) information but not the other core challenges we cover, surveys on multimodal ...
- Learning Lip-Based Audio-Visual Speaker Embeddings with AV-HuBERT — on contrastive learning, which constructs positive samples by either augmenting the same speech segment or assuming a sin-gle speaker is recorded per utterance [9, 10, 11]. ... explore learning audio-visual speaker embeddings from a pre-trained AV-HuBERT model with emphasis on the noise robust-ness aspect strengthened by the addition of visual ...
- Deep-Learning-book-part3 | PDF | Deep Learning | Variance - Scribd — Deep-Learning-book-part3 - Free download as PDF File (.pdf), Text File (.txt) or read online for free. 200-300
- A arXiv:2009.09805v2 [cs.LG] 16 Apr 2021 — Contrastive learning of audio and visual representations has delivered impressive results on various downstream scenarios (Oord et al., 2018; H´enaff et al., 2019; Schneider et al., 2019; Chen et al., 2020). This self-supervised training process can be understood as building a dynamic dictionary per







