Efficient Extraction of Noise-Robust Discrete Units from Self-Supervised Speech Models
Jakob Poncelet Yujun Wang Hugo Van hamme


BMI Prediction from  Handwritten English Characters Using a Convolutional Neural Network





    N. T. Diba1, N. Akter2, S. A. H. Chowdhury3
Dept. of Electronics & Telecommunication Engineering 

Rajshahi University of Engineering & Technology

Rajshahi, Bangladesh

nishattasnimediba09@gmail.com1,
 nasrinmanha123@gmail.com2, arif.1968.ruet@gmail.com3
J. E. Giti4
Dept. of Electrical & Electronic Engineering 

Rajshahi University of Engineering & Technology

Rajshahi, Bangladesh

jishan.e.giti@gmail.com4

    September 9, 2024
===============================================================================================================================================================================================================================================================================================================================================================================================================================



§ ABSTRACT 
Continuous speech can be converted into a discrete sequence by deriving discrete units from the hidden features of self-supervised learned (SSL) speech models.
Although SSL models are becoming larger and trained on more data, they are often sensitive to real-life distortions like additive noise or reverberation, which translates to a shift in discrete units.
We propose a parameter-efficient approach to generate noise-robust discrete units from pre-trained SSL models by training a small encoder-decoder model, with or without adapters, to simultaneously denoise and discretise the hidden features of the SSL model.
The model learns to generate a clean discrete sequence for a noisy utterance, conditioned on the SSL features.
The proposed denoiser outperforms several pre-training methods on the tasks of noisy discretisation and noisy speech recognition, and can be finetuned to the target environment with a few recordings of unlabeled target data.



Discrete units, noise robustness, self-supervised learning, speech recognition




§ INTRODUCTION

FirstPage
Self-supervised learning (SSL) has enabled the development of versatile speech models which have advanced the state-of-the-art on a wide array of speech processing tasks <cit.>. 
Pre-training speech models on large amounts of unlabeled data leads to better generalisation capabilities and an improved robustness against acoustic, speaker and language variations <cit.>. 
Furthermore, within an SSL model, different layers are able to capture various speech attributes without supervision, such as phones, word boundaries and speaker characteristics <cit.>. 
Depending on the application, the hidden states of the most suited layers of the SSL model can be chosen as inputs for a task-specific model <cit.>.
In automatic speech recognition (ASR), great improvements have been observed by self-supervised pre-training of large multi-purpose speech models <cit.>.

Most SSL methods rely on quantisation or clustering to guide the training towards discovering meaningful and distinct speech units <cit.>. 
Recently, there has been a growing interest in extracting discrete units from self-supervised models, as they have several advantages <cit.>. 
First, the conversion from waveforms or feature vectors to discrete units facilitates a strong compression which allows efficient model training, fast inference and low-cost storage.
Second, temporal clustering of granular features aids the discovery of acoustic units which are strongly correlated with the content of spoken language <cit.>. 
Third and finally, discretisation allows the integration with natural language processing techniques and models <cit.>. 
The discrete units can be treated as a pseudo-language to pre-train speech decoders <cit.> and unit language models <cit.> for spoken language processing.

However, despite their impressive performance, SSL models still exhibit sensitivity to shifting domains. 
This effect has been observed for changing acoustic and linguistic conditions <cit.>, unseen speaker accents <cit.>, and noisy environments <cit.>. 
Besides a drop in performance, this has implications for discretisation. 
For example, HuBERT <cit.> was observed to assign clusters given by each noise condition <cit.>. 
As additive noise and reverberation shift the SSL model's features, the extracted discrete sequence is strongly dependent on the acoustic conditions, which impacts the performance of decoders and unit language models that are trained on clean data <cit.>.

This work focuses on the robustness of discrete SSL units to distorted speech in noisy and reverberant environments, which is relevant for many applications in real-world scenarios. 
As SSL foundation models are becoming larger, pre-training noise-robust models from scratch or adapting SSL models to new domains forms a large burden on computing resources. 
Therefore, there is a strong need for small and versatile models that can adapt the SSL features to distortions.

We propose a parameter-efficient denoiser to extract robust discrete units in noisy environments. 
The denoiser generates a clean cluster sequence from the latent features of a pre-trained SSL model for a distorted speech input, similar to a denoising auto-encoder <cit.>. Notice that denoising is not merely mapping one unit to another, but also entails inserting or deleting units.
We investigate an external denoiser and an adapter-based denoiser.
The denoiser approach can be applied to any pre-trained model, and requires a relatively small amount of data to train.
Moreover, it does not require finetuning the SSL model itself on noisy data, and the backbone model (e.g. ASR, voice conversion model, unit language model) can be trained on discrete units extracted from clean data and does not need to be retrained with new clusters.

We evaluate the generated discrete units on a denoised unit prediction task and on a distorted speech recognition task, showing the benefits of the proposed method for several SSL models.
As the model is light-weight, we show that it can be efficiently adapted to new target environments.






§ RELATED WORK

Several works have investigated noise-robust pre-training of speech SSL models with synthesised noisy mixtures, mainly by constraining the outputs <cit.> or the hidden features <cit.> to match the clean outputs or representations. 
For large SSL models, pre-training becomes very costly. This can be circumvented by noise-robust distillation into smaller models <cit.> or by parameter-efficient adaptation through finetuning small adapter blocks, such as Houlsby adapters <cit.>, inserted in the SSL model.

Recent work <cit.> has investigated a technique to improve the augmentation invariance of discrete SSL units in the scope of generative spoken language modeling <cit.>.
The outputs of an SSL model for an augmented input are mapped to the discrete clusters from a K-means teacher on the clean outputs, by training a new quantiser. 
However, their approach has several drawbacks. First, the quantiser is limited to a 3-layer MLP. 
Second, the quantiser that has to denoise the clusters is not conditioned on the acoustics (i.e. lower layer features in an SSL model), as it only uses the features of the K-means layer. 
Therefore, it has no idea of the signal SNR and how much the clean signal was distorted.
Third, iterative re-training with new clusters is necessary.
Finally, their research focuses on the application of small cluster vocabularies and base SSL models for generative spoken language modeling, instead of the applications for ASR.

Our experiments with discretised speech units and the application to efficient ASR model training and inference follow recent success in this field <cit.>.



§ METHOD


We aim to extract noise-robust and reverberation-robust discrete speech units from SSL models by training a denoiser model on top of a frozen pre-trained SSL encoder to generate clean discrete units for an augmented input. 
First, discrete units are computed for a clean speech dataset using a quantisation mechanism of choice, e.g. K-means, as shown in Figure <ref>. 
Second, the denoising task is learned on an augmented dataset created by adding noises and reverberation to a small dataset of clean speech.
The denoiser can be external (Figure <ref>) or contain additional adapter blocks in the SSL encoder (Figure <ref>).
Finally, for ASR applications, a noisy speech sample is discretised using the trained denoiser and fed to the discrete ASR model, depicted in Figure <ref>.



 §.§ Self-Supervised Speech Representation Learning

While SSL is a very broad field spanning many research efforts in speech processing <cit.>, we apply our method to three well-known speech models, namely HuBERT, WavLM and Wav2vec2.
First, HuBERT <cit.> learns speech representations by applying masked language modeling <cit.> to speech features. 
Discrete acoustic units are discovered by offline clustering of MFCC features or the features of a previously pre-trained model. 
Then, these audio tokens are predicted with a bidirectional encoder conditioned on masked latent speech features. 
In WavLM <cit.> this paradigm is further applied to noisy data and overlapping speech, by predicting clean target tokens for a noisy mixture.
Finally, Wav2vec2 <cit.> predicts quantised latent features for masked audio frames with a context network, leveraging contrastive learning techniques.




 §.§ Discrete Speech Units

Quantisation of speech can be part of the SSL training scheme, e.g. in wav2vec models <cit.>. 
However, the codebook during training is often much larger than necessary for downstream tasks.
On the other hand, HuBERT-like models <cit.> have shown that offline clustering of hidden layer features leads to informative discrete speech units.
In this work, we apply K-means clustering to the layer of the SSL model that is most informative for word information and performs best on a downstream ASR task <cit.>.
The clustering model is learned on a small fraction of clean speech and 
the chosen cluster vocabulary size depends on the size and output dimension of the SSL model.
We reduce the cluster sequence length by deduplication, i.e. removing repetitions <cit.>.
Offline clustering is depicted in Figure <ref>.



 §.§ Noise-Aware Model Adaptation

Previous work <cit.> has addressed the domain shift between pre-training and target domains by continual pre-training of the SSL model on target data.
As HuBERT and Wav2vec2 models are trained on clean speech, adaptation to distorted speech data improves performance in noisy and reverberant environments.
To this end, as a baseline, we adapt pre-trained HuBERT and Wav2vec2 models by continuing the pre-training process on augmented data. 
For HuBERT, the K-means quantiser of the pre-trained model is used to generate the target clusters for the augmented dataset.
We denote continual pre-training as COPT.
Moreover, HuBERT can be optimised directly to perform the denoising task, by predicting the clean clusters for an augmented sample (cf. WavLM).
We abbreviate this noise-invariant pre-training as NIPT. 

These methods have two main drawbacks.
First, they require the SSL models to be updated entirely, which is computationally expensive.
Second, the adaptation can shift the hidden features, such that the quantiser of a pre-trained  ASR model, trained on clean data, might be suboptimal.



 §.§ Efficient Learning of Robust Discrete Speech Units

We propose a light-weight external denoiser module that is able to reduce the effects of additive noise and reverberation during discretisation of pre-trained SSL features, without requiring adaptation of the full SSL model. 
The module learns to simultaneously denoise the features and generate discrete units.
Given a mixed speech signal, the denoiser encoder processes the hidden SSL features and an autoregressive decoder predicts the discrete cluster sequence of the clean speech.

In SSL models, the lower layers tend to correlate with acoustic factors (speaker, environment, domain, etc.), while the upper layers are more aligned with phonetic, lexical and semantic features <cit.>.
Therefore, the hidden features of all layers in the SSL encoder are combined with a learnable weighted sum <cit.>, such that the denoising of the discrete clusters is conditioned on the low-level acoustics as well.
The computed weighted sum is then linearly projected to a smaller dimension for efficient modeling.

The encoder processes and denoises the features, and the decoder generates a discrete cluster sequence autoregressively by attending to the encoder outputs.
The decoder has to predict deduplicated cluster units, which makes the model robust against reverberation, compared to an approach with frame-based cluster targets (as in HuBERT adaptation).
Therefore, the sequence lengths of the input and output are not the same, which is why an encoder-decoder approach with CTC <cit.> encoder regularisation is used for the denoiser.

The outlined method is called Denoiser and depicted in Figure <ref>. 
It is a completely external module that only requires the hidden features of the SSL model, which can be extracted before training.
Inspired by wide success in efficient model adaptation <cit.>, we also investigate a denoiser model that additionally has small residual adapter blocks inserted in the layers of the frozen SSL model.
This method, denoted AdaDenoiser and depicted in Figure <ref>, has the advantages that it can adapt the SSL features directly (i.e. before the weighted sum) and the burden of the denoiser encoder is reduced, but it requires loading the SSL model during training.
We use Houlsby adapters <cit.>, consisting of a down-projection to a bottleneck dimension, a non-linearity and an up-projection to the original feature dimension. 
The adapters are inserted after the feed-forward layers in the SSL encoder.



§ EXPERIMENTAL SETUP

We use the train-clean-100, dev-clean and test-clean splits of LibriSpeech <cit.> for the experiments. 
The data configuration and training setup closely follow the clustering and ASR modeling setup from <cit.>, implemented in ESPnet <cit.>.



 §.§ Offline Clustering

The K-means model using pre-trained clean SSL features is trained on a randomly selected 30 percent of LibriSpeech train-clean-100.
Based on previous work <cit.>, for HuBERT and WavLM, we learn K=500 cluster centroids from layer 9 features for base models, and K=2000 centroids from layer 21 features for large models.
For Wav2vec2, we use layer 7 for the base model and layer 12 for the large variant.



 §.§ Data Augmentation
 
For adaptation to noisy data, we use the same 30 hours data split as used to train the K-means model for a fair comparison.
For every utterance, we make 5 different versions: the original clean utterance, a reverberated utterance, and 3 noisy utterances with different noise types. In total this gives a training set of 150 hours or 42k utterances. 
For reverberation, we sample real RIRs from the openSLR28 dataset <cit.> which contains impulse responses from the Aachen IR and RWCP datasets and the REVERB challenge.
For additive noise, for every utterance we sample one noise segment from the DEMAND dataset <cit.>, one from MUSAN <cit.> and one from CHIME <cit.>.
The noises are added to the clean audio with a random SNR between 0 and 20 dB.
For validation, we sample 1000 utterances from dev-clean and create 4 augmentations per sample.
For evaluation, we create test-clean-augmented by sampling 100 utterances from test-clean and generating 13 augmentations per utterance, including 1 reverberated and 12 noisy versions, by mixing with a noise sample from the three noise datasets at SNRs of [5,10,15,20] dB. 
Including the clean samples, this gives 1400 test utterances.
The RIRs and noise types for evaluation are unseen during training.




 §.§ SSL Baselines

The HuBERT and Wav2vec2 base models were pre-trained on 960h LibriSpeech and their large variants on 60kh LibriLight. WavLM was trained on augmented data.
The base models have 12 Transformer layers (95M parameters) and the large models have 24 Transformer layers (316M parameters).
In the adaptation experiments, we continue the pre-training of pre-trained HuBERT models in fairseq <cit.> for 150k steps with 300K tokens per batch and a learning rate of 2e-5 with polynomial decay and 20k warmup steps, on the data from Section <ref>.
In case of training only residual adapters for NIPT adaptation (AdaNIPT), the learning rate is 1e-3, and the bottleneck dimension of the adapters is set to 64 or 1024 <cit.>.



 §.§ Denoiser Setup

The denoiser module is trained on the augmented dataset from Section <ref>. 
The inputs are a learned weighted sum of the hidden features of the (frozen) SSL model <cit.>, which are linearly mapped to a smaller dimension of 256. 
The Denoiser is implemented in ESPnet as a hybrid CTC/Attention encoder-decoder model <cit.>, where the encoder is regularised with a CTC objective and the decoder is trained with a cross-entropy loss on target tokens.
The model consists of an encoder with either 2 Conformer <cit.> layers (Denoiser-S) or 6 Transformer layers (Denoiser-M) and a 3-layer Transformer decoder. 

For the AdaDenoiser method, the encoders are smaller. 
For small SSL models, we use AdaDenoiser-S, which has no additional encoder, but only retains the linear down-projection layer after the weighted sum as encoder.
For large SSL models, the additional encoder consists of 2 Transformer layers (AdaDenoiser-M).
The decoder remains the same as in the Denoiser with 3 Transformer layers.
The adapters have a bottleneck dimension of 64 and GELU non-linearity.

Convolutional subsampling (even with a factor 2) of the input features was found to be disadvantageous for the denoising task.
Temporal input feature masking did not improve the denoiser either.
The denoiser models are trained for 50 epochs with an effective batch size of 256 utterances, and a learning rate of 1e-3 with 5k warmup steps and exponential decay.
The targets for the denoiser models are deduplicated cluster indices.
The predicted clean clusters are decoded with a beam size of 20 and a CTC-weight of 0.3.



 §.§ ASR Modeling

The ASR model follows <cit.> and consists of a hybrid CTC/Attention encoder-decoder model <cit.>, with a 12 layer E-Branchformer <cit.> encoder and 6 layer Transformer <cit.> decoder.
The discrete inputs are deduplicated cluster indices.
The target transcriptions are tokenised with 6000 BPE tokens.
We found that especially for noisy ASR, applying BPE modeling to input cluster units does not improve performance.
The discrete inputs are converted into 512-dimensional embeddings, followed by random temporal masking, convolutional subsampling, and then fed to the encoder.
The ASR model is trained on LibriSpeech train-clean-100 for 300 epochs with a learning rate of 5e-4 with decay and 5K warmup steps.
The model has 38M parameters and requires 12 GPU hours to train.
Decoding is performed with beam size 20 and CTC weight 0.3, without language model.
The ASR model is trained on discrete units extracted from clean data (train-clean-100) and is not retrained after adaptation of the discrete units and SSL models (cf. Section <ref>).




§ RESULTS




 §.§ Robust Discrete Units


Augmentation-invariant discrete speech units should not depend on the presence of noise or reverberation.
In this experiment, we investigate the sensitivity of SSL model discretisation to augmentations by evaluating the Unit Error Rate (UER) between the discrete cluster units extracted from a clean signal with the SSL model and the clusters extracted from distorted versions of the same signal with adapted models.
The UER is computed as the Character Error Rate between the two sequences, treating the discrete units as characters.
We evaluate our approach on HuBERT and Wav2vec2, which were pre-trained on clean data only, and on WavLM, which was pre-trained to perform denoising on augmented data, and compare to the other adaptation strategies.
For all methods, the quantiser is trained on features of the backbone pre-trained SSL model.
Table <ref> shows the results.

The proposed Denoiser and AdaDenoiser reduce the UER for all models and baselines, with only a fraction of the total model parameters, indicating that the shift between noisy discrete units and clean discrete units is reduced for the same spoken sentence. 
Overall, the small Denoiser model is more effective than the larger Denoiser model for UER reduction.
In most cases, for base variants of SSL models the AdaDenoiser outperforms the Denoiser, except for WavLM.
Adapters seem to have less effect for WavLM, which was trained on augmented data. 
For WavLM large, the AdaDenoiser approach did not converge to a useful result and probably requires a different architecture to be optimal.

For HuBERT, the strong improvements on the reverberated test set over the adaptation baselines suggest that the CTC or Attention objective with deduplicated units is more effective than frame-wise denoising for the case of reverberation.
For Wav2vec2, the high UERs in the table indicate that it is the most sensitive to noise-induced feature shifting.






 §.§ Robust ASR
 

In this section, we analyse the effectiveness and robustness of the discrete clusters for ASR in noisy test environments. 
To this end, we train a discrete ASR model on clean data (train-clean-100) with the clusters from an SSL model, and evaluate on augmented data with the clusters from the noise-adapted models.
We found that retraining the ASR model on adapted units does not have a significant benefit over using ASR models trained on clean SSL units, hence the ASR model can be trained on clean data and the adaptation only uses unlabeled data.
Table <ref> shows the Word Error Rates (WER).




For the base SSL models, we observe strong improvements in almost all settings, both clean and noisy, even for WavLM base, which was already trained to perform denoising.
Of all SSL models, Wav2vec2 benefits most from denoising, as was indicated with the UER results.
For the large models, which were pre-trained on much more data, there are still improvements from the proposed adaptation.
Additionally, the proposed approach requires training much fewer parameters than regular SSL adaptation.

For most settings, the AdaDenoiser model outperforms the Denoiser model, especially in very low SNR regimes.
In some cases, the WER is reduced by more than 50% compared to the baseline model.
We experienced that an optimal performance for low SNR data requires either adaptation of the convolutional feature extraction layers of the SSL, or inserting layer-wise adapters such as in the AdaDenoiser, which can have a bigger impact on the convolutional outputs compared to the weighted sum approach in the Denoiser.

For WavLM large, which is already capable of denoising and was pre-trained on augmented data, our method has expectedly less effect besides efficient test-time adaptation.

We remark that in contrast to discrete unit denoising, for noisy speech recognition a denoiser model (Denoiser-M) with a more powerful encoder is beneficial.
The relation between UER and WER is non-monotonic, which is reminiscent of the relation between Phone Error Rate and WER.
However, we still observe a general trend of improvements for both Denoiser architectures compared to the baselines.
The WER shows the optimal model for downstream speech recognition models, but depending on the application (e.g. voice conversion, language modeling) the UER might be preferred.

Finally, Table <ref> details a short ablation study to validate our choice for an encoder-decoder model, which outperforms an encoder-only (with CTC) and a decoder-only variant.





 §.§ Test Time Adaptation


Previous sections have shown the capabilities of the proposed denoiser by pre-training on a varied set of noises and evaluating on a test set with unseen noises.
In practice, if one wants to apply the model in a new setting (e.g. a factory with specific noises which were not well represented in the augmented training set), it could be beneficial to adapt the model to the target environment by recording a few samples and then finetune the model. 
As the denoiser module is a light-weight extension with few parameters, it can be finetuned on the fly with only a limited amount of unlabeled target data.

We simulate this setting by choosing a new noise type with several recordings from the NTT Ambient Noise database <cit.>.
For every recorded noise sample of 30 seconds, we create 100 utterances by combining the noise with clean speech samples from the training set at different SNR levels between 0 and 20 dB.
Only the encoder of the Denoiser is finetuned, the rest is frozen.
Figure <ref> shows the UER of a finetuned Denoiser-S model in function of the amount of recorded noise samples, computed on 100 samples from test-clean augmented with unseen noises of the same noise type.

We observe that finetuning to a new stationary noise source such as an old car or the inside of a train improves the pre-trained denoiser. For non-stationary noises with babbling like shopping mall recordings, finetuning has less effect.





§ CONCLUSION

This paper focuses on reducing the sensitivity of SSL model discretisation in noisy and reverberant environments. We have proposed a small encoder-decoder denoiser model and an adapter-based variant that denoise SSL features and predict clean discrete units for noisy inputs. The method is parameter-efficient and able to improve discretisation of SSL models for noisy data, as shown for denoised unit prediction and noisy speech recognition. Future work could apply this same strategy to other fields using speech discretisation, or delve into alternatives for the bottleneck layer, larger datasets and pre-training of the decoder.
 
IEEEbib


