AI Logic

Evaluation Metrics

UTMOS

Updated:

The structure of UTMOS. Left: the strong learner, which concatenates the frame-wise features obtained by passing speech through an SSL model with the embeddings of the listener ID and domain ID and the BLSTM outputs for the phoneme sequence and reference sequence, then outputs frame-wise scores with a BLSTM and linear layer and averages them. Right: the stacking flow, in which the strong learners and weak learners (Ridge, SVM, decision trees, Gaussian processes) predict scores from wav2vec2, HuBERT, and WavLM features, and stages 2 and 3 combine them to predict the MOS

Background and overview

UTMOS is a system that predicts, from audio alone, the score (the MOS, 1–5) that people give when listening to synthesized or converted speech. It was built in 2022 by Saeki et al. of the Saruwatari Lab at the University of Tokyo for the VoiceMOS Challenge 2022, a competition in MOS prediction. It does not need reference (ground-truth) speech.

Listening tests, in which people listen and rate, are the most reliable way to evaluate speech synthesis quality, but they take time and money. Neural networks such as MOSNet were therefore built to learn from listening test results and predict MOS. Later it became clear that fine-tuning models such as wav2vec 2.0, pretrained on large amounts of speech with self-supervised learning (SSL, learning representations from unlabeled data), greatly improves MOS prediction (SSL-MOS, the competition baseline).

UTMOS combines a "strong learner", which adds the following four ideas to SSL-MOS, with "weak learners", which are simple regression models, through an ensemble method called stacking.

  • Frame-level prediction and contrastive loss: train by outputting a score per frame, and also match the score differences between pairs of utterances
  • Listener and domain dependence: add who rated the speech and which listening test it came from as inputs
  • Phoneme information: add the phoneme sequence estimated by speech recognition as an input
  • Data augmentation: slightly change speaking rate and pitch to increase the training data

In the competition it took first place on several evaluation metrics in both the main track of English speech and the out-of-domain (OOD) track of Chinese speech with little data.

Model and training

The left of the header figure is the strong learner and the right is the overall stacking. The strong learner predicts MOS as follows.

  1. Resample speech to 16 kHz, normalize the level, and pass it through an SSL model (in the submission, the base wav2vec 2.0 pretrained on LibriSpeech) to obtain frame-wise features. Unlike SSL-MOS, the frame features are not averaged but passed on as is.
  2. Map the listener ID and the domain ID (which listening test) to 128-dimensional embeddings each.
  3. Estimate the phoneme sequence with a speech recognition model and pass it, together with a representative phoneme sequence (the reference sequence) built from utterances thought to read the same sentence, through a 3-layer BLSTM (256 hidden units). The first and last hidden states are concatenated and replicated for the number of frames.
  4. Concatenate 1–3 per frame and output frame-wise scores with a BLSTM and a linear layer. During training, the ground-truth score is stretched to the number of frames for comparison.
  5. At prediction time, the ID of a "mean listener" is used instead of a listener ID, and the frame-wise scores are averaged to give the utterance MOS.

The training loss is a weighted sum of a regression loss and a contrastive loss (Ξ²=1\beta = 1 and Ξ³=0.5\gamma = 0.5 in the paper).

L=Ξ²Lreg+Ξ³LconL = \beta L_{\mathrm{reg}} + \gamma L_{\mathrm{con}}

The regression loss is a clipped MSE that is 0 when the error is at most Ο„\tau (Ο„=0.25\tau = 0.25; scores are mapped to [βˆ’1,1][-1, 1] before training).

Lreg(y,y^)=1(∣yβˆ’y^∣>Ο„)(yβˆ’y^)2L_{\mathrm{reg}}(y, \hat{y}) = \mathbb{1}\left( |y - \hat{y}| > \tau \right) \left( y - \hat{y} \right)^2

The contrastive loss compares the ground-truth score difference d=s1βˆ’s2d = s_1 - s_2 of two utterances x1x_1 and x2x_2 with the predicted difference d^=s^1βˆ’s^2\hat{d} = \hat{s}_1 - \hat{s}_2, and penalizes only the part of the discrepancy beyond a margin Ξ±\alpha (0.5 in the paper). It is summed over all pairs in the mini-batch.

Lcon=βˆ‘iβ‰ jmax⁑(0,∣dxi,xjβˆ’d^xi,xjβˆ£βˆ’Ξ±)L_{\mathrm{con}} = \sum_{i \neq j} \max\left( 0, \left| d_{x_i, x_j} - \hat{d}_{x_i, x_j} \right| - \alpha \right)

The contrastive loss matches "which is better and by how much" rather than the scores themselves. It penalizes heavily when "A is better, but B was predicted to be better", so it suits raising rank correlation (SRCC). It is close to the idea that as long as the ranking is right, it does not matter whether judges' scoring habits (lenient or strict) agree. Adding the listener ID has the same motivation: the model learns that each listener has different scoring habits, and at prediction time it scores as a habit-free "mean listener".

Data augmentation randomly changes speaking rate within [0.9,1.1][0.9, 1.1] times and pitch within Β±300 cents, keeping the changes within a range where MOS hardly changes.

Stacking builds up predictions in four stages.

  1. Stage 0: eight SSL models (four wav2vec 2.0, two HuBERT, and two WavLM) extract the mean of the frame features for each utterance.
  2. Stage 1: strong learners (up to 17 in the main track, 6 in OOD) and weak learners each predict scores with cross-validation. The weak learners are 48 combinations of the 8 features and 6 regression models (ridge regression, linear SVR, random forest, LightGBM, kernel SVR, and Gaussian process regression).
  3. Stage 2: train regression models (meta-learners) with the stage-1 scores as input.
  4. Stage 3: combine the stage-2 scores with ridge regression into the final score.

What it measures and its limitations

UTMOS predicts what score the listeners of a listening test would give for the naturalness of a synthesized utterance. Pretrained speech models have learned pronunciation and voice characteristics from large amounts of speech, so they readily notice unnaturalness in synthesized speech and reach high accuracy even with little MOS data.

It has the following limitations.

  • Depends on the standard of the listening test it was trained on: the standard of MOS changes with the conditions of the listening test (the listeners and the range of speech compared). UTMOS predicts scores on the standard of the listening test used for training (BVCC, in English, for the main track), which are not necessarily the same as MOS from another test. The paper also adds the domain ID to handle per-domain biases.
  • Domains with little data need extra work: the OOD track (Chinese) had only 136 scored training utterances, so the authors ran their own listening test on 540 unscored utterances to collect scores (32 Chinese listeners, an average of 2 per utterance). Without this external data, results got worse.
  • Absolute scores may not match well: a single strong learner had high rank correlation but a relatively large error (MSE); combining many models through stacking lowered the MSE. When using a single model, it is safer to use it for comparing rankings.
  • The setup is large: the system submitted to the competition combines many SSL models and regression models, and reproducing it as is takes a lot of computation.

What is often used in research and development as "the UTMOS score" is the single released strong-learner model, not the full stacking submitted to the competition. When reporting values, state which model (checkpoint) was used, and be aware that for speech very different from the training data (English synthesized speech), such as other languages or noisy audio, it may diverge from human ratings.

Validation in the original paper

The VoiceMOS Challenge 2022 evaluated predictions at the utterance level and the system level with MSE, LCC (Pearson's correlation coefficient), SRCC (Spearman's rank correlation coefficient), and KTAU (Kendall's rank correlation coefficient). The main track had 21 teams and 3 baselines and the OOD track had 15 teams and 3 baselines; UTMOS's main results were as follows (rank in parentheses).

TrackUtterance MSEUtterance SRCCSystem MSESystem SRCC
Main (English)0.165 (1st)0.897 (1st)0.090 (1st)0.936 (3rd)
OOD (Chinese)0.162 (1st)0.893 (2nd)0.030 (1st)0.988 (1st)

In an ablation removing the strong learner's ideas one at a time (each the mean of 5 runs), on the main track the strong learner improved over SSL-MOS from 0.380 to 0.276 in utterance-level MSE and from 0.918 to 0.925 in system-level SRCC. The effect of each idea differed by track: on the data-rich main track, some metrics were actually better without data augmentation or phoneme information. On the data-poor OOD track, by contrast, the model with all ideas was best on several metrics, including system-level SRCC. Removing the listener ID caused large degradation in most cases on both tracks, and on OOD the utterance-level MSE rose sharply from 0.378 to 0.636.

For stacking on the main track, combining 17 strong learners and 48 weak learners lowered the utterance-level MSE to 0.165, compared with 0.216 for a single strong learner. The error became smaller while rank correlation was mostly preserved.

Where it is used

UTMOS is mainly used in the following situations.

  • Comparing speech synthesis and voice conversion models: the released strong learner is used to compare the naturalness of generated speech automatically. It helps narrow down candidates before human listening tests, and is reported alongside MOS in papers.
  • Checking progress during training: apply UTMOS to the outputs of a model in training to easily check whether naturalness is improving.
  • Data filtering: find low-scoring audio as a guide for removing it from training data (taking the prediction error into account).

When ground-truth speech exists, as in noise reduction or speech separation, full-reference metrics such as PESQ, STOI, and SI-SDR can also be used. For models that generate music or sound effects, FAD is used to compare whole collections of audio.

Comparison with similar metrics

The table compares metrics of speech quality from the same viewpoints.

MetricReference speechWhat it measuresRange and directionHow it is computed
MOSNot required (for ACR, where listeners rate one sample at a time)Subjective quality (impression of human listeners)1–5; higher is betterMean of listeners' ratings
MOSNetNot requiredPrediction of human MOS (naturalness of voice conversion)Roughly 1–5; higher is betterPredicted from magnitude spectrograms with a CNN-BLSTM (trained on VCC 2018)
UTMOSNot requiredPrediction of human MOS (naturalness of synthesized speech)Roughly 1–5; higher is betterEnsemble of predictions from fine-tuned pretrained speech models (trained on BVCC)
PESQRequired (full reference)Perceived quality (degradation as heard over a telephone)About 1.0–4.6 when mapped to MOS-LQO; higher is betterCompared through an auditory model
STOIRequired (full reference)Intelligibility (whether words can be understood)Almost always 0–1; higher is betterCorrelation of envelopes in short segments
FADNot per sample (needs a set of clean audio)Distance between embedding distributions of two audio sets0 or more; lower is betterFrΓ©chet distance of VGGish embeddings

MOSNet and UTMOS are both "models that predict human MOS", but they differ in the following ways.

AspectMOSNetUTMOS
InputMagnitude spectrogramWaveform (features extracted by an SSL model), listener and domain IDs, phoneme sequence
PretrainingNone (trained from scratch)Fine-tunes a self-supervised speech model
LossUtterance and frame MSEClipped MSE and contrastive loss
Listener differencesNot handled (the mean of 4 listeners is the target)Listener ID as input; a "mean listener" at prediction time

Rough guidelines for choosing:

  • Comparing the naturalness of synthesized speech without a reference: today, UTMOS, which uses pretrained models, often agrees better with human ratings. It is more reliable for speech closer to its training data (English synthesized speech).
  • Showing final quality: predictions cannot fully replace human ratings, so measure human MOS.
  • Evaluating enhancement or separation with ground-truth speech: use PESQ, STOI, and SI-SDR.

PyTorch example

Show code
python
import torch

# Example of loading the released strong learner (UTMOS22 strong) from torch.hub (port by SpeechMOS).
# Input is a waveform of shape (batch, samples) and its sampling rate. Output is the predicted MOS per utterance
predictor = torch.hub.load("tarepan/SpeechMOS:v1.2.0", "utmos22_strong", trust_repo=True)
predictor.eval()
wave = torch.randn(1, 16000 * 3)  # example: 3 s of audio (in practice, load the synthesized speech)
with torch.no_grad():
  score = predictor(wave, 16000)  # tensor([...]): roughly 1-5


# losses as in the paper (scores are mapped to [-1, 1] before use)
def clipped_mse(pred, target, tau=0.25):
  """L_reg = 1(|y - y_hat| > tau) (y - y_hat)^2. Errors of at most tau are not penalized."""
  err = target - pred
  return ((err.abs() > tau).float() * err ** 2).mean()


def contrastive_loss(pred, target, margin=0.5):
  """L_con = sum_{i != j} max(0, |d_ij - d_hat_ij| - margin). d is the score difference between two utterances."""
  d = target[:, None] - target[None, :]
  d_hat = pred[:, None] - pred[None, :]
  loss = torch.clamp((d - d_hat).abs() - margin, min=0)
  off_diag = ~torch.eye(len(pred), dtype=torch.bool, device=pred.device)
  return loss[off_diag].sum()


def utmos_loss(pred, target, beta=1.0, gamma=0.5):
  """Eq. (1): L = beta * L_reg + gamma * L_con"""
  return beta * clipped_mse(pred, target) + gamma * contrastive_loss(pred, target)

FAQ

Q. Does the UTMOS score equal human MOS?
A.

Not necessarily. UTMOS predicts scores on the standard of the listening test it was trained on (BVCC, with English synthesized speech). The standard of MOS changes with the conditions of the listening test, so do not compare values directly with MOS from another test; compare values computed with the same UTMOS model.

Q. What is the difference between the "strong learner" and the "weak learners"?
A.

The strong learner is a neural network that fine-tunes a pretrained speech model from the waveform. The weak learners average the features of pretrained models per utterance and predict scores with simple regression models such as ridge regression or decision trees. Combining many models with different properties reduces the prediction error.

Q. What improved over MOSNet?
A.

Using models pretrained on large amounts of speech lets it capture speech characteristics well even with little MOS data. It also handles each listener's scoring habits through IDs and adds a contrastive loss that matches rankings. MOSNet was trained from scratch on voice conversion data and reached an utterance-level correlation coefficient of 0.642, whereas UTMOS reaches an utterance-level SRCC of 0.897 on a different dataset (BVCC) (the datasets differ, so the values cannot be compared directly).

References

  1. Saeki, T., Xin, D., Nakata, W., Koriyama, T., Takamichi, S., & Saruwatari, H. (2022). UTMOS: UTokyo-SaruLab System for VoiceMOS Challenge 2022. Interspeech 2022. arXiv:2204.02152.
  2. sarulab-speech. UTMOS22 (GitHub repository).
  3. Huang, W.-C., Cooper, E., Tsao, Y., Wang, H.-M., Toda, T., & Yamagishi, J. (2022). The VoiceMOS Challenge 2022. arXiv:2203.11389.
  4. Lo, C.-C., Fu, S.-W., Huang, W.-C., Wang, X., Yamagishi, J., Tsao, Y., & Wang, H.-M. (2019). MOSNet: Deep Learning-based Objective Assessment for Voice Conversion. Interspeech 2019. arXiv:1904.08352.
  5. tarepan. SpeechMOS: Easy-to-use speech MOS predictors (GitHub repository).