AI Logic

Evaluation Metrics

Fréchet Audio Distance (FAD)

Updated:

Computing FAD. Left: the clean music set and the audio under evaluation are each cut into 1-second windows and passed through the same VGGish, and the Fréchet distance is computed from the mean and covariance of the 128-dimensional embeddings. Right: the paper's listening test, a table of human ratings, FAD and SDR for music with five kinds of distortion

Background and overview

FAD (Fréchet Audio Distance) is an evaluation metric that compares a set of audio to be evaluated with a large set of clean music in the embedding space of a pretrained audio classification model, and measures how far apart the two distributions are. It is non-negative, and smaller values mean the evaluated audio is closer to clean music.

F(Nb,Ne)=∥μb−μe∥2+tr(Σb+Σe−2ΣbΣe)F(\mathcal{N}_b, \mathcal{N}_e) = \lVert \mu_b - \mu_e \rVert^2 + \mathrm{tr}\left( \Sigma_b + \Sigma_e - 2\sqrt{\Sigma_b \Sigma_e} \right)

μb\mu_b and Σb\Sigma_b are the mean and covariance of the embeddings of clean music (the background set), and μe\mu_e and Σe\Sigma_e are those of the evaluated audio. The embeddings are the 128-dimensional outputs of VGGish (a model based on the image recognition network VGG) trained for audio classification. The formula is exactly the same as the image metric FID; only the feature extractor changes from Inception-v3 to VGGish.

FAD was proposed in 2019 by Kilgour et al. at Google to evaluate music enhancement (removing noise and bringing a recording closer to a studio-quality sound). Earlier metrics such as SDR (signal-to-distortion ratio) compare each enhanced clip with its ground-truth recording, so they can disagree with what listeners perceive, and they also require the ground truth (the original studio recording). FAD avoids both problems by comparing against the statistics of clean music instead of a one-to-one ground truth. Today it is also widely used to evaluate generative models for music and sound effects.

Definition and computation

FAD is computed in the following steps.

  1. Cut a large set of clean music (the background set; 540 hours of Magnatagatune in the paper) into 1-second windows. The windows are shifted by 0.5 seconds, so consecutive windows overlap by half.
  2. Convert each window into 96 frames of 64-dimensional log-mel features (a log spectrum on the mel scale) and pass them through VGGish. The 128-dimensional output just before the final classification layer is taken as the embedding.
  3. Compute the mean μb\mu_b and covariance matrix Σb\Sigma_b from all embeddings of the background set.
  4. Cut the evaluated audio (the output of an enhancement or generative model) into 1-second windows in the same way, pass them through VGGish, and compute the mean μe\mu_e and covariance matrix Σe\Sigma_e.
  5. Treat each embedding distribution as a multivariate normal distribution with that mean and covariance, and compute the Fréchet distance between them with the formula above.

The first term measures the shift between the centers of the distributions, and the second term measures the difference in their spread. When comparing models, the background embeddings and the evaluation inputs fed to the models (noisy audio, for enhancement) are fixed, and only the outputs are swapped.

VGGish is a CNN trained to classify more than 3,000 sound classes on a large dataset of YouTube videos. Its input is 1 second long, so longer pieces are cut into windows before being embedded. Regarding the window hop, the paper's appendix reports that a smaller hop barely changes FAD, but non-overlapping windows changed the value slightly for some distortions, so it recommends 0.5 seconds.

"No reference needed" means no ground-truth recording is needed for each evaluated clip. A large set of clean music is still required as the comparison target. As an analogy, instead of checking an exam answer against the model answer question by question, FAD checks whether a set of answers has the same feel as a set of answers written by skilled people.

What it measures and its limitations

FAD measures whether the evaluated set of audio sounds like the set of clean music, as seen by an audio classification model. VGGish embeddings represent what kind of sound is present rather than raw waveform values, so audio whose waveform is slightly shifted but which sounds the same yields a close value. The paper applied more than ten kinds of distortion at varying strengths: Gaussian noise, pops (setting some samples to the maximum value), high-pass and low-pass filters, quantization, Griffin-Lim phase reconstruction, mel-scale filtering, speed changes, pitch shifts and reverberation. It showed that stronger distortion generally gives a larger FAD. Undistorted music had an FAD of 0.2, about the same as very weak Gaussian noise (0.2 to 0.3).

FAD also has the following limitations.

  • It says nothing about individual clips: it compares set statistics, so it does not show which clip is bad.
  • The value depends on the number of clips: the mean and covariance are estimated from a finite number of embeddings, so the value fluctuates when there are few. In the paper's appendix, 100 five-second clips (about 8 minutes) were not stable, results became usable from about 300 clips (25 minutes), and the ideal was about 5,000 clips (about 7 hours). Gui et al. (2024) showed that, as with FID, FAD is biased toward smaller values as the number of clips grows, and that the bias differs across models and embeddings.
  • It depends on the embedding model: VGGish was trained to classify sound types, not to measure quality. Its input is log-mel features, which discard phase, so some distortions can go unnoticed. In an experiment that predicted music quality labels (quality of composition and performance) from per-song FAD, Gui et al. (2024) reported that VGGish was only slightly better than chance, while embeddings such as CLAP, trained to link audio and text, predicted them better.
  • It depends on the quality of the background set: FAD measures closeness to the background set, so if the background set contains many low-quality recordings, a small FAD does not guarantee good audio.
  • It ignores long-term structure: the embeddings are per 1-second window, so unnatural development across a whole piece cannot be measured (the paper also lists this as future work).

FAD values are comparable only when computed with the same embedding model, the same background set, the same number of clips and the same windowing. In papers on generative models, the background set and the embedding model (models other than VGGish are also used) often differ from paper to paper, so the values cannot be placed side by side as they are. When comparing with prior work, recompute under the same conditions or confirm that the conditions match.

Validation in the original paper

In the paper, 20 raters listened to distorted music in pairwise comparisons ("Which one sounds closer to the studio recording?"), and a Plackett-Luce model was fitted to the results to estimate a "human rating" (worth; larger is better) for each condition. The test covered 21 conditions of 10 kinds of distortion, 300 five-second clips and 69,300 comparisons. The correlation coefficients between these human ratings and each metric were as follows.

MetricGround-truth audioCorrelation with human rating
FADNot needed0.52
SDRNeeded0.39
Cosine distanceNeeded−0.15
L2 distance of magnitude spectraNeeded−0.01

FAD was the closest to human ratings, while cosine distance and L2 distance, which compare waveforms directly, could hardly compare across different kinds of distortion. Even so, FAD's correlation is far from perfect.

The right side of the figure at the top shows examples taken from a table in the paper's appendix. Audio played back at 0.95× speed received a relatively good human rating and a small FAD of 0.19, while SDR gave it the worst value, −21 dB. When the waveform shifts in time, the clip-by-clip comparison underlying SDR breaks down. Conversely, the low-pass filter (1500 Hz) has a high SDR of 48 dB and is barely penalized. The paper notes that for high-pass and low-pass filters, FAD was also an outlier that deviated from human ratings.

Where it is used

FAD is mainly used in the following settings.

  • Music enhancement and audio restoration: the use case the paper had in mind. It can also evaluate enhanced versions of real recordings that have no ground truth (such as a performance recorded on a smartphone).
  • Comparing generative models for music and sound effects: it is often used to compare the quality of a set of generated audio as a single number, for example in text-to-music or text-to-audio models. It plays the same role as FID in image generation.
  • Monitoring training progress: FAD is computed at regular intervals during training and used as a cue to stop when it no longer decreases.

For speech enhancement or separation, where a ground-truth recording exists for each clip and the goal is to know speech intelligibility or waveform accuracy, metrics that compare with the ground truth, such as SI-SDR, PESQ and STOI, are a better fit.

Comparison with similar metrics

The table compares FAD with other metrics of audio and generation quality from the same viewpoints.

MetricGround truth (reference)What it measuresDirectionMain constraints
FADNot needed per clip (a set of clean audio is needed)Distance between the embedding distributions of the evaluated set and a set of clean audioLower is betterDepends on the number of clips, the embedding model and the background set. Cannot evaluate individual clips
FIDNot needed per image (a set of real images is needed)Distance between the feature distributions of generated images and real imagesLower is betterImage metric. Depends on the number of images and preprocessing
SI-SDRNeeded (per clip)Waveform distortion (energy ratio of the target signal component to the rest)Higher is betterBreaks down when the waveform shifts in time. Ignores perception
PESQ / STOINeeded (per clip)Perceived quality as telephone speech / speech intelligibilityHigher is betterDesigned for speech, not directly applicable to music
MOSNot needed (when listeners rate each clip)Human listening impressionHigher is betterTakes time and money

Rough guidelines for choosing:

  • Comparing models that generate music or sound effects: compute FAD with the same embedding, background set and number of clips as prior work. For the final judgment, also use human evaluation (MOS or pairwise comparisons).
  • Speech enhancement or separation with ground-truth audio: use metrics that compare each clip with its ground truth, such as SI-SDR, PESQ and STOI.
  • Finding out which clips are bad: FAD is a set-level metric and is not suited to per-clip evaluation. Use human evaluation or a metric that can be computed per clip.

PyTorch example

Show code
python
import numpy as np
from scipy import linalg


def frechet_distance(mu_b, sigma_b, mu_e, sigma_e, eps=1e-6):
  """Eq. (1) of Kilgour et al. (2019): ||mu_b - mu_e||^2 + tr(sigma_b + sigma_e - 2 sqrt(sigma_b sigma_e)).
  mu and sigma are the mean and covariance of the 128-dimensional VGGish embeddings."""
  diff = mu_b - mu_e
  covmean, _ = linalg.sqrtm(sigma_b @ sigma_e, disp=False)
  if not np.isfinite(covmean).all():  # when the covariance is nearly singular (e.g. too few clips), add a small value to the diagonal
    offset = np.eye(sigma_b.shape[0]) * eps
    covmean = linalg.sqrtm((sigma_b + offset) @ (sigma_e + offset))
  covmean = covmean.real  # drop the small imaginary part caused by numerical error
  return diff @ diff + np.trace(sigma_b) + np.trace(sigma_e) - 2 * np.trace(covmean)


def windows(wave, sr=16000, win_sec=1.0, hop_sec=0.5):
  """Windowing from the paper: cut 1-second windows shifted by 0.5 seconds. wave is a 16 kHz waveform of shape (num_samples,)."""
  win, hop = int(sr * win_sec), int(sr * hop_sec)
  return np.stack([wave[s:s + win] for s in range(0, len(wave) - win + 1, hop)])


def stats(clips, embed_fn):
  """clips: list of waveforms. embed_fn: pretrained VGGish mapping waveforms of shape (num_windows, 16000) to embeddings of shape (num_windows, 128).
  Pools the embeddings of all windows and returns their mean and covariance."""
  emb = np.concatenate([embed_fn(windows(w)) for w in clips], axis=0)
  return emb.mean(axis=0), np.cov(emb, rowvar=False)


# Usage: compute the background statistics once, save them, and reuse them when comparing models
# mu_b, sigma_b = stats(clean_music_clips, embed_fn)   # clean music set
# mu_e, sigma_e = stats(model_outputs, embed_fn)       # outputs of the model under evaluation (made from the same inputs)
# print(frechet_distance(mu_b, sigma_b, mu_e, sigma_e))

FAQ

Q. What FAD value counts as good?
A.

There is no fixed threshold, because the value changes greatly with the embedding model, the background set and the number of clips. Under the original paper's conditions (VGGish, Magnatagatune), undistorted music had an FAD of 0.2 and music with added Gaussian noise (standard deviation 0.031) had 2.93. Judge a value by comparing it with existing models computed under the same conditions.

Q. FAD is called a "reference-free" metric. Can it be computed without comparing against anything?
A.

No. It means no ground-truth recording is needed for each evaluated clip, but a large set of clean audio (the background set) is still needed as the comparison target. It sits between metrics such as SI-SDR and PESQ, which compare each clip with its ground truth, and MOS, where listeners rate each clip.

Q. How do FAD and FID differ?
A.

The formula is the same; the feature extractor differs. FID maps images to 2048-dimensional features of Inception-v3 trained on ImageNet, while FAD passes audio through VGGish one second at a time to get 128-dimensional embeddings. Because audio clips vary in length, FAD also cuts them into windows and pools the embeddings of all windows to compute the statistics.

References

  1. Kilgour, K., Zuluaga, M., Roblek, D., & Sharifi, M. (2019). Fréchet Audio Distance: A Reference-Free Metric for Evaluating Music Enhancement Algorithms. Interspeech 2019. arXiv:1812.08466.
  2. Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., & Hochreiter, S. (2017). GANs Trained by a Two Time-Scale Update Rule Converge to a Local Nash Equilibrium. NeurIPS 2017. arXiv:1706.08500.
  3. Gui, A., Gamper, H., Braun, S., & Emmanouilidou, D. (2024). Adapting Frechet Audio Distance for Generative Music Evaluation. ICASSP 2024. arXiv:2311.01616.
  4. Microsoft. fadtk: Frechet Audio Distance Toolkit (GitHub repository).