On Data Sampling Strategies for Training Neural Network Speech
  Separation Models
Speech separation remains an important area of multi-speaker signal
processing. Deep neural network (DNN) models have attained the best performance
on many speech separation benchmarks. Some of these models can take significant
time to train and have high memory requirements. Previous work has proposed
shortening training examples to address these issues but the impact of this on
model performance is not yet well understood. In this work, the impact of
applying these training signal length (TSL) limits is analysed for two speech
separation models: SepFormer, a transformer model, and Conv-TasNet, a
convolutional model. The WJS0-2Mix, WHAMR and Libri2Mix datasets are analysed
in terms of signal length distribution and its impact on training efficiency.
It is demonstrated that, for specific distributions, applying specific TSL
limits results in better performance. This is shown to be mainly due to
randomly sampling the start index of the waveforms resulting in more unique
examples for training. A SepFormer model trained using a TSL limit of 4.42s and
dynamic mixing (DM) is shown to match the best-performing SepFormer model
trained with DM and unlimited signal lengths. Furthermore, the 4.42s TSL limit
results in a 44% reduction in training time with WHAMR.
William Ravenscroft, Stefan Goetze, Thomas Hain
# On Data Sampling Strategies for Training Neural Network Speech Separation Models

###### Abstract

Speech separation remains an important area of multi-speaker signal processing. Deep neural network (DNN) models have attained the best performance on many speech separation benchmarks. Some of these models can take significant time to train and have high memory requirements. Previous work has proposed shortening training examples to address these issues but the impact of this on model performance is not yet well understood. In this work, the impact of applying these training signal length (TSL) limits is analysed for two speech separation models: SepFormer, a transformer model, and Conv-TasNet, a convolutional model. The WJS0-2Mix, WHAMR and Libri2Mix datasets are analysed in terms of signal length distribution and its impact on training efficiency. It is demonstrated that, for specific distributions, applying specific TSL limits results in better performance. This is shown to be mainly due to randomly sampling the start index of the waveforms resulting in more unique examples for training. A SepFormer model trained using a TSL limit of 4.42s and dynamic mixing (DM) is shown to match the best-performing SepFormer model trained with DM and unlimited signal lengths. Furthermore, the 4.42s TSL limit results in a 44% reduction in training time with WHAMR.

 speech separation, context modelling, data sampling, speech enhancement, transformer

## I Introduction

Speech separation models are used in a number of downstream speech processing tasks, from meeting transcription to assistive hearing [1, 2, 3, 4]. Often, speakers are at a far-field distance from the microphone, which creates additional challenges for speech separation due to interference from noise and reverberation in the signal [5, 6, 7].

DNN separation models have led to significant improvements on anechoic data but there is a performance gap when these models are used for more distorted speech data [8, 9, 10]. Many of these models use Transformer or bidirectional long short term memory (BLSTM) layers [9, 10, 11] which can consume large amounts of memory and have quadratic time-complexity, i.e. for \(L\) input frames of data the model performs at least \(L^{2}\) operations [12]. This is a particular concern in training when memory requirements are higher due to storing gradients for each operation required in the back-propagation stage [13]. This increased computational load also means longer training times. One way to compensate for the memory requirements is to use a batch size of 1 [9] which leads to even longer training times as more parameter updates are performed. Another approach that reduces memory requirements and allows for larger batch sizes is to reduce the mixture signal length [14]. This reduces the training time but potentially at the expense of performance.

In this work, the first aim is to address if there are TSL limits at which no additional performance gain can be attained by DNN speech separation models. It is shown that, depending on model and dataset selection, there is a TSL limit at which not only no additional performance gain is attained but actually limiting the TSL to a specific value can lead to notably improved performance. This effect is demonstrated to be due to a random sampling of the start index when using TSL limits. Further evaluations show the benefit of having more unique training examples than using the full signal lengths. Finally, the application of TSL limits used with DM [15] is evaluated.

The remainder of this paper is structured as follows. In Section II, the signal model is introduced. The separation networks and datasets used are described in Section III, and Section IV, respectively. Section V presents evaluations for varying TSL limit for each separation network and dataset. Section VI explores splitting signals to generate more train examples and whether DM mitigates the effects gains found using TSL limits. Final conclusions are provided in Section VII.

## II Signal Model

The noisy reverberant speech separation problem is defined as aiming to estimate \(C\) speech signals \(\hat{s}_{c}[i]\) for sample index \(i\) and speaker number \(c\in\{1,\ldots,C\}\) from the discrete time-domain mixture

\[x[i]=\sum_{c=1}^{C}s_{c}[i]*h_{c}[i]+\nu[i] \tag{1}\]

of length \(L_{x}\). The \(*\) operator denotes convolution, \(h_{c}[i]\) is a room impulse response (RIR) corresponding to speaker \(c\) and \(\nu[i]\) denotes additive background noise.

## III Separation Models

The SepFormer [9] and Conv-TasNet [14] models are both widely researched time-domain audio separation networks (TasNets). The structure for these TasNets is to have a time-domain neural encoder which encodes a mixture signal block \(\mathbf{x}_{\ell}\) of size \(L_{\mathrm{BL}}\) to \(\mathbf{w}_{\ell}\) followed by a mask estimation network which estimates a series of masks \(\mathbf{m}_{\ell}\) for each of \(C\) speakers. These masks are used to separate the encoded features
which are then decoded back in to a time domain signal \(\mathbf{s}_{\ell,c}\) using a neural decoder. An example of the architecture for \(C=2\) speakers can be seen in Figure 1.

Both Conv-TasNet and SepFormer are trained using the utterance-level permutation-invariant scale-invariant signal-to-distortion ratio (SIDR) objective function [9, 14, 16, 17]. Models are trained according to the best performing models in each of their original papers [9, 14] unless stated otherwise. Batch sizes of \(2\) and \(4\) are used for SepFormer and Conv-TasNet respectively except where otherwise stated.

### _SepFormer Network_

The SepFormer model is briefly introduced in this section. SepFormer is chosen because it is a large transformer model that is among the state-of-the-art models on several speech separation benchmarks [9, 18]. The SepFormer uses a 1D convolutional layer for encoding the signal proceeded by a rectified linear unit (ReLU) activation function. The decoder is a single transposed 1D convolutional layer. The mask estimation network uses a dual-path structure [11] whereby a series of Transformer layers are stacked such that each alternating layer computes a multihead attention layer on either the local or global context of the sequence. The local processing is achieved by first splitting the input signal into overlapping chunks of a predetermined size \(K\) turning a batched 3D tensor into a 4D tensor. The output of the local Transformer layer is a 4D tensor which is then reshaped by swapping the axes of encoded chunks and the number of chunks before being fed into the global Transformer layer. The final stage is to reconstruct a 3D tensor using the overlap-add method to produce \(C\) sequences of masks. The encoded features are then masked and decoded back into the time domain.

### _Conv-TasNet_

The Conv-TasNet model contrasts the SepFormer in that it is a much smaller model (25.8M vs. 3.5M parameters in the implementations used here) and the only global information it processes is the overall signal energy, whereas the SepFormer model has global access to all information in the input signal due to the transformer layers used. Conv-TasNet uses a temporal convolutional network (TCN) sequence model for the mask estimator in Figure 1. The encoder and decoder of the network are the same as those used for the SepFormer model but with a different number of output channels in the configuration used in this paper. The mask estimation network is composed of a 1D pointwise convolution (P-Conv) bottleneck layer, a TCN and a 1D P-Conv projection layer with a ReLU activation function to produce the sequence of masks. The TCN is composed of a series of convolutional blocks consisting of P-Conv and depthwise-separable convolution (DS-Conv) layers with kernel size \(P\). The convolutional blocks are configured in stacks of \(X\) blocks with increasing dilation factors \(f\in\{2^{0},2^{1},\ldots,2^{X-1}\}\). Stack are repeated \(R\) times with the dilation factor reset at the start of each stack [14].

## IV Datasets

Three corpora of 2-speaker mixtures are analysed in this work. The trends demonstrated later in Sections V and VI for the 2-speaker scenario are assumed to generalize to higher \(C\) values. For all corpora, the \(8\)kHz _min_ configuration is used. The _min_ configuration refers to mixtures being truncated to the shortest utterance in a mixture as opposed to padding shorter utterances to the longest utterances.

### _WSJ0-2Mix and WHAMR_

WSJ0-2Mix and WHAMR are both simulated 2-speaker corpora derived from the WSJ0 corpus [19, 20]. WSJ0-2Mix takes speech samples from WSJ0 and overlaps them at speech-to-speech ratios (SSRs) between \(0\) and \(5\) dB. WHAMR is a noisy reverberant extension of WSJ0-2Mix with noise from the WHAM [21] dataset mixed with the loudest speaker at signal-to-noise ratios (SNRs) between \(-6\) and \(3\) dB.

### _Libri2Mix_

Libri2Mix is a simulated 2-speaker mixture corpus derived from the LibriSpeech and WHAM corpora [22]. Speech samples come from the LibriSpeech corpus [23] and noise samples come from the WHAM corpus. Instead of SSRs, LibriMix uses loudness units relative to full scale (LUFS) measured in dB to set the loudness of speakers and noise in the mixtures. Speakers have a loudness between -25 and -33 LUFS and noise has a loudness between \(-38\) and \(-30\) LUFS. For training, the _train-100_ dataset was chosen as it has a very similar TSL distribution to the alternate _train-360_ dataset but with less examples, meaning shorter training times.

### _Signal Length Distributions_

The distribution, density estimation (DE) and the mean and standard deviation of the mixture signal length in the WHAMR train _tr_ and test _tt_ sets can be seen in Figure 2. WSJ0-2Mix and WHAMR have identical signal distributions as WHAMR is derived from the former. These distributions are shown in the left panel. The train and test sets in WHAMR have similar distributions of signal length with mean values within 0.3s of one another and standard deviations within 0.1s of one another. This contrasts the distributions of the Libri2Mix dataset [22] also shown in Figure 2 where the _train-100_ and _test_ sets have a difference in mean value of \(6.2\)s and difference in standard deviation of \(1.79\)s.

Figure 1: Architecture of the SepFormer and Conv-TasNet models, exemplary for \(C=2\) speakers. The \(\odot\) symbol denotes the Hadamard product.
## V Training Signal Length Analysis

Evaluations of varying the TSL limit are presented in this section. For all evaluations, the improvement in SISDR over the input mixture signal, denoted by \(\Delta\) SISDR, is used as the evaluation metric. SISDR measures the energy of distortions in the estimated speech signals and is one of the most common metrics used in recent monaural speech separation literature [9, 10, 11].

### _Initial TSL Limit Evaluations_

As a first experiment, twelve SepFormer models are trained and evaluated on WSJ0-2Mix, WHAMR and Libri2Mix, each with a different TSL limit. Twelve logarithmically spaced signal limits \(T_{\mathrm{lim}}\) are selected between \(0.5\)s and \(10\)s:

\[T_{\mathrm{lim}}\in\{0.5,0.66,0.86,1.13,1.49,1.95,\] \[2.56,3.36,4.42,5.8,7.62,10\}\text{s}. \tag{2}\]

The notation \(L_{\mathrm{lim}}\) is used for the respective discrete sample index, i.e. \(L_{\mathrm{lim}}=T_{\mathrm{lim}}f_{\mathrm{s}}\) for sampling rate \(f_{\mathrm{s}}\). When cutting the training signal lengths such that \(L_{x}\leq L_{\mathrm{lim}}\) the starting sample index of the signal is randomly selected from the uniform distribution \(\mathcal{U}\left(0,1+max\left(0,L_{x}-L_{\mathrm{lim}}\right)\right)\). Performance for SepFormer models trained and evaluated on all three datasets is compared in Figure 3. For the WHAMR corpus, an increase in overall \(\Delta\) SISDR performance from the \(0.5\)s to \(1.95\)s limit can be observed. The optimal TSL is at \(3.36\)s. Between \(3.36\)s and \(10\)s performance decreases again by \(-1.4\)dB. This may seem surprising as the general convention with training DNNs is that more data normally results in improved overall performance. A similar trend is observed for WSJ0-2Mix where there is a notable increase between 0.5s and \(3.36\)s and then a drop in performance of \(0.8\)dB between \(4.4\)s and \(10\)s. For Libri2Mix, the performance saturates before a TSL limit of \(4.42\)s. There is no drop in performance as the TSL limit approaches \(10\)s which is likely due to the Libri2Mix training set having a more uniform distribution below signal lengths of \(10\)s than the WHAMR or WSJ0-2Mix datasets, cf. Figure 2.

The results for the WHAMR evaluation set are separated into quartiles of mixture signal length for the following experiment. \(\Delta\) SISDR results for each quartile are shown in Figure 4. Comparing Q1 to Q4 shows that, with a sufficiently large TSL (\(\geq 1.95\)s), the best separation performance in SISDR is found on the longest signal lengths, regardless of TSL. A loss in SISDR performance is still observed from \(3.36\)s to 10s regardless of which quartile is evaluated.

### _Training Time Evaluation_

The average training epoch duration (ED) for the SepFormer model on WHAMR and Libri2Mix training sets are shown in Figure 5. Note the ED for WSJ0-2Mix is omitted for brevity but is similar to WHAMR due to having the same TSL distribution (cf. Figure 2). All models were trained on the same hardware to control any impact this has on speed. The average EDs for the WHAMR dataset have a sigmoidal shape due to the majority of the signal lengths being concentrated around the mean signal length of the training set (\(5.6\)s, cf. Figure 2). Libri2Mix has a more linear relationship between TSL limit and ED due to the more uniform shape of the signal length distribution below \(10\)s in the _train-100_ set, cf. Figure 2. Reducing the TSL limit has more benefit in terms of ED for the Libri2Mix dataset when iterating over all training examples.

Figure 4: Training signal length (TSL) analysis of the \(1\)st to \(4\)th signal length quartiles in the WHAMR evaluation set.

Figure 3: SepFormer results for varying the TSL limit for the anechoic WSJ0-2Mix (top), Libri2Mix (middle) and WHAMR (bottom) test sets.

Figure 2: Distributions of mixture signal lengths in WSJ0-2Mix/WHAMR (left) and Libri2Mix (right) for both train (top) and test (bottom) sets. Density estimation (DE) is shown by solid green lines, mean values are indicated by dashed red lines and standard deviation values by dash-dotted blue lines.
### _Fixed vs. Random Start Index_

In Section V-A, the start index of each shortened signal was randomly sampled from a uniform distribution. In this section, this is compared to using a fixed start sample. A start sample of 1999 (\(=0.25\)s at 8kHz) was used for signals where the original mixture signal length was larger than \(L_{\mathrm{lim}}\), else the entire signal length was used. The motivation for this was that many training examples contain silence at the beginning of clips. It was considered desirable to omit as much silence to make for a fairer comparison with the randomly sampled clips which are assumed to have a lower likelihood of beginning with silence. Results in Figure 6 confirm that the loss in performance from a TSL limit of \(3.36\)s to \(10\)s with WHAMR is due to randomly sampling the start index.

The performance saturates at a TSL limit of \(5.8\)s when using a fixed start index. This is similar to the performance saturation point of Libri2Mix in Figure 3 demonstrating the performance drop in higher TSLs seen before on WHAMR (cf. Figure 3) is related to both a non-uniform TSL distribution and the random sampling used.

### _Transformer vs. Convolutional Model_

Results comparing the Conv-TasNet model (cf. Section III-B) to the SepFormer model are shown in Figure 7. The loss in performance above \(3.36\)s is not observed for the Conv-TasNet model. All SISDR results above \(T_{\mathrm{lim}}=1.95\)s are within \(0.5\)dB of each other suggesting Conv-TasNet is more invariant to the TSL limit if the limit is sufficiently large. This is possibly due to the \(1.53\)s receptive field of the Conv-TasNet models being smaller than these particular TSLs limits [24].

## VI Signal Splitting and Dynamic Mixing

Next, two sampling strategies are evaluated to (i) investigate whether the performance gained by TSL with random sampling on shorter sequences still holds when the same quantity of audio data in terms of length in seconds is used and (ii) whether using TSL limits still result in performance gains with DM, i.e. simulating new speech mixtures for each epoch [15].

### _Signal Splitting_

A signal splitting strategy was designed such that a batch of inputs \(\mathbf{X}\in\mathbb{R}^{M\times L_{x}}\) was reshaped to \(\mathbf{X}^{\prime}\in\mathbb{R}^{MD\times\frac{L_{x}}{L}}\) for batch size \(M\). Signal length \(L_{x}\) is still limited such that \(L_{x}\leq L_{\mathrm{lim}}\). The motivation of this method is to evaluate the importance of training on the entire sequence length compared to the raw data quantity used in seconds. Computational complexity in training is also reduced. TSLs for \(T_{\mathrm{lim}}\in[4.42,10]\)s are analysed for \(D=2\). Figure 8 shows that \(D=2\) improves performance for shorter TSL limits (\(T_{\mathrm{lim}}\leq 5.8\)s) compared to \(D=1\) (the original shape). However for \(T_{\mathrm{lim}}\geq 7.62\)s the performance is similar to \(D=1\). As in Figure 3 this is likely due to the TSL distribution of WHAMR.

### _Dynamic Mixing_

DM was proposed to improve performance of various speech separation models [15]. DM often results in a \(1.0\) to \(1.5\)dB SISDR performance improvement dependant upon the model and dataset [15, 25]. The random start index sampling used in Section V is similar to DM in that it provides, the model with unique training examples each epoch but without simulating new mixtures. In this section using DM and TSL limits is compared against just using TSL limits to see if further performance gains can be attained using both approaches. The DM results for the WHAMR corpus are

Figure 5: Comparison of average epoch duration (in mins) for the SepFormer model on the Libri2Mix and WHAMR training sets.

Figure 8: Comparison of split signal and batch reshape training \(D=2\) against full signal training \(D=1\) for the SepFormer model.

Figure 6: Comparison of TSL variation for the SepFormer model trained and evaluated on the WHAMR datasets on a subset of TSL limits in the range \([1.95,7.62]\)s.

Figure 7: Comparison of SepFormer and Conv-TasNet across TSL limits \(T_{\mathrm{lim}}\in[4.42,7.62]\) using the WHAMR corpus.
shown in Figure 9. It can be seen that with DM the drop in performance is less (at \(7.62\)s) than without DM.

The best performing model \(T_{\mathrm{lim}}=4.4\)s is compared to the Sepformer model with no TSL limit in Table I. The batch size reported for the model with no TSL is the largest it was found possible to train on a \(32\)GB Nvidia V\(100\) GPU. It can be seen that using the TSL limited model is able to match its performance with an average ED reduction of \(44\)%, highlighting the benefit of this approach.

## VII Conclusion

In this paper it was shown that TSL limits can affect the overall performance for speech separation models in a number of ways. For WSJ0 derived speech separation benchmarks, i.e. WSJ0-2Mix and WHAMR, it is optimal to use shortened training examples randomly sampled from the original examples due to the signal length distribution of these corpora. For the Libri2Mix dataset, the same method led to shorter training times with no notable loss in performance. The SepFormer model was compared to the Conv-TasNet model and it was shown that the Conv-TasNet performance has less variation. Using dynamic mixing and TSL limits with random sampling was shown to be able to match the performance of the SepFormer model trained DM using full sequence lengths on WHAMR with a 44% reduction in training time. With some previous literature opting to limit TSLs [11, 14] and others not [9, 10] on the same benchmarks, the results in this paper suggest that this is not a fair comparison and that TSL limiting is important to factor in when analysing results, particularly for the WSJ0-2Mix and WHAMR benchmarks.
