Dual Attention in Time and Frequency Domain for Voice Activity Detection
Joohyung Lee Youngmoon Jung Hoirin Kim
eess.AS


Controllable Person Image Synthesis with Attribute-Decomposed GAN
    Yifang Men^1, Yiming Mao^2, Yuning Jiang^2, Wei-Ying Ma^2, Zhouhui Lian^1Corresponding author. E-mail: lianzhouhui@pku.edu.cn

^1Wangxuan Institute of Computer Technology, Peking University, China

^2Bytedance AI Lab

    December 30, 2023. .../latex/6he-sdm-2/6he-sdm-2-3.tex
=============================================================================================================================================================================================================================



Voice activity detection (VAD) is a challenging task in low signal-to-noise ratio (SNR) environment, especially in non-stationary noise. To deal with this issue, we propose a novel attention module that can be integrated in Long Short-Term Memory (LSTM). Our proposed attention module refines each LSTM layer's hidden states so as to make it possible to adaptively focus on both time and frequency domain. Experiments are conducted on various noisy conditions using Aurora 4 database. Our proposed method obtains the 95.58 % area under the ROC curve (AUC), achieving 22.05 % relative improvement compared to baseline, with only 2.44 % increase in the number of parameters. Besides, we utilize focal loss for alleviating the performance degradation caused by imbalance between speech and non-speech sections in training sets. The results show that the focal loss can improve the performance in various imbalance situations compared to the cross entropy loss, a commonly used loss function in VAD.

Index Terms: voice activity detection, long short-term memory, attention, class imbalance, focal loss



§ INTRODUCTION


Voice activity detection (VAD) is a kind of binary classification which classifies a frame into speech or non-speech. VAD is an important pre-processing step in speech applications such as automatic speech recognition (ASR), speaker recognition, speech enhancement, and speech coding, etc. The early approaches to VAD were based on signal processing-based approaches using time-domain power <cit.>, zero crossing rate (ZCR) <cit.>, cepstral features <cit.>, or spectral entropy <cit.>. Besides, statistical model-based approaches have been widely adopted using Gaussian models for speech and noise signals <cit.>.

Recently as deep learning has been on the rise, it has shown its effectiveness on finding the optimal VAD models such as fully-connected deep neural networks (FCDNNs) <cit.>, convolutional neural networks (CNNs) <cit.>, Long Short-Term Memories (LSTMs) <cit.>, and the combination of deep neural networks <cit.>. However, although those deep learning-based VAD models have achieved marked improvements, VAD is still a challenging task in low signal-to-noise ratio (SNR) environments. 

To improve the robustness in noisy environments, we propose a novel VAD model based on attention method. Our architecture is motivated by the attention module integrated to CNN architecture used in computer vision <cit.>. These attention modules squeeze the intermediate feature map and increase representation power of networks. They substantially improve the performance with small overhead. Motivated by them, several studies have been conducted in speech signal processing <cit.>. However, to our best knowledge, there has been no attempt to apply them for VAD. Our proposed attention module squeezes the feature map by statistical pooling and adaptively focuses on important speech frames and frequency components in time and frequency domain, respectively.

Meanwhile, in supervised learning-based classification problem, class imbalance of training data can bring about deterioration since easily classified samples dominate the training procedure <cit.>. In case of VAD as well, audio samples in database usually show the imbalance between speech and non-speech sections. Indeed, cross entropy loss, broadly used in VAD, is not suitable for handling the class imbalance. On the other hand, a focal loss proposed in <cit.> has a modulating term which is able to focus learning on minor samples in class imbalance situations. In the experiment, we utilize the focal loss in various class imbalance situations and demonstrate that it is conducive to class imbalance situations for VAD.

The remaining part of paper is organized as follows. Section 2 describes 4 types of proposed attention modules. Section 3 indicates problems about class imbalance in VAD and compares focal loss with cross entropy loss. Section 4 describes the experimental setup and Section 5 shows the results and analysis of experiments. Then, we conclude this work in Section 6.



§ ATTENTION MODULE

Unlike original attention modules <cit.>, we change the backbone architecture from CNN to LSTM. The reason of using LSTM instead of CNN is that LSTM shows the best performance among FCDNN, CNN, and LSTM in VAD with a similar number of parameters <cit.>.




The structure of proposed attention-based LSTM model is shown in Figure <ref>. X∈ℝ^T × I is input acoustic features for model. T denotes the length of time steps (sequence length) and I denotes the dimension of acoustic features. When X is fed into the first LSTM layer (LSTM 1), then hidden states H ∈ℝ^T × D with D hidden nodes are drawn. In basic LSTM, hidden states H are fed to the next LSTM layer (LSTM 2) directly <cit.>. But in this paper, hidden states are refined as H' ∈ℝ^T × D by proposed attention module before being fed to the next LSTM layer (LSTM 2). For refining hidden states, we regard hidden states H as a kind of 2-dimensional hidden feature map. In following subsections, we propose 4 kinds of attention modules.



 §.§ Temporal Attention (TA)



The temporal attention (TA) exploits temporal information and concentrates on important time steps for improving model's ability to discriminate speech frames from non-speech frames. Figure <ref> illustrates the process to obtain h_temp, output of TA module. The hidden feature map H is pooled in three ways: max, average, and standard deviation pooling along the frequency axis, resulting h_temp^max, h_temp^avg, h_temp^std∈ℝ^T × 1, respectively (step .5pt-.9pt 1). These 3 pooled feature vectors are concatenated and convolved by 1-dimensional convolution layers (step .5pt-.9pt 2 - .5pt-.9pt 4). h_temp, the output of last convolution layer, is expanded (copied) as original hidden feature map H (denoted as H_temp) and activated by sigmoid function. Finally, it is merged to H by element-wise summation, then refined hidden feature map H' is obtained. TA can be represented as below.

    h_temp = f_temp([h_temp^max;h_temp^avg;h_temp^std])
    H' = H ⊕σ(H_temp)   for   H_temp∈ℝ^T × D ,

where f_temp denotes the 1-dimensional convolution with 11 of kernel size in TA module. It consists of 4 layers and the number of filters is 3, 5, 5 and 1, respectively. σ denotes the sigmoid function and ⊕ denotes the element-wise summation.



 §.§ Frequential Attention (FA)



The frequential attention (FA) is same with TA but for pooling direction and kernel size of convolution layer. Figure <ref> illustrates the process to obtain h_freq, output of FA module. h_freq^max, h_freq^avg, h_freq^std∈ℝ^1 × D are the max, average, and standard deviation pooling results of hidden feature map H along the time axis (step .5pt-.9pt 1). Like in TA, these 3 feature vectors are concatenated, and then passed to convolution layers (step .5pt-.9pt 2 - .5pt-.9pt 4) and sigmoid function. Also, after being expanded as H (denoted as H_freq), it is merged to H by element-wise summation for obtaining refined hidden feature map H'. FA can be represented as below.

    h_freq = f_freq([h_freq^max;h_freq^avg;h_freq^std])
    H' = H ⊕σ(H_freq)   for   H_freq∈ℝ^T × D ,

where f_freq denotes the 1-dimensional convolution with 21 of kernel size in FA module. Sequence length T in training steps is fixed by pre-defined value to build the mini-batch for training. But in testing steps, the value of T changes according to the length of audio sample. This mismatch of sequence length causes the disparate tendency of pooled values in both steps with degradation of performance. To circumvent this problem, in testing steps, utterances are divided by T, which is defined in training steps, then FA is applied to each divided segments. For example, if T in training steps is 50 time steps, FA is applied every 50 time steps in test data, e.g. 1-50 time steps, 51-100 time steps, etc. The last left over steps are pooled by themselves.



 §.§ Dual Attention 1 (DA-1)


To exploit both temporal and frequential information simultaneously, the dual attention 1 (DA-1) is suggested. The process of DA-1 is illustrated in Figure <ref>.

DA-1 uses hidden feature map H directly and convolves it by 2-dimensional convolution layers (step .5pt-.9pt 1 - .5pt-.9pt 3). Merging method is element-wise summation like in TA and FA. 

    H_dual = f_dual(H)
    
    H' = H ⊕σ(H_dual)   for   H_dual∈ℝ^T × D ,

where f_dual denotes the 2-dimensional convolution in the DA-1 module with kernel size of 7. It consists of 3 layers and the number of filters is 1, 3 and 1, respectively.



 §.§ Dual Attention 2 (DA-2)



The other way for exploiting both temporal and frequential information is using H_temp and H_freq at once in summation, called dual attention 2 (DA-2). It takes advantages of both TA and FA modules by combining them. It shows the best performance in 4 kinds of proposed attention modules. The activation function and merging method are same as in TA and FA.

    H' = H ⊕σ(H_temp⊕ H_freq)  .

Computations for obtaining H_temp (h_temp) and H_freq (h_freq), in Eq. (<ref>) and Eq. (<ref>), are executed in parallel.

Every convolution operation in proposed attention modules is followed by batch normalization <cit.> and ReLU activation function. However, in the very last layer of attention module, batch normalization and activation function are not used because of using sigmoid function before merging. Attention modules are applied after every hidden feature map, even for hidden feature map from last LSTM layer. Also, same attention module is shared across all hidden feature maps from different LSTM layers. It means there is no need to train several attention modules as many as the number of hidden layers in LSTM.



§ LOSS FUNCTIONS

Since it is hard to record audio samples in equal or similar ratio of speech to non-speech, imbalance between speech and non-speech sections can be found easily in lots of datasets. To balance the ratio of speech to non-speech for VAD tasks, many researchers manipulate the data by artificially appending silence segments at the beginning and the end of audio samples in training datasets <cit.>. To avoid this inconvenience, we utilize the focal loss, revised version of cross entropy loss <cit.>.



 §.§ Cross Entropy Loss

Cross entropy loss is represented as below.

    l_CE(y_t) = - log (y_t)
     y_t={[   ŷ    ; 1-ŷ     ]. ,

where y is label and ŷ is model's predicted probability for label y=1. Thanks to its convexity in optimization, it is widely used in deep learning-based task. In spite of its usefulness, cross entropy loss is hard to naturally handle the inefficient training caused by class imbalance.



 §.§ Focal Loss

To mitigate the inefficient training in class-imbalanced environment, focal loss is suggested and described as below.

    l_FL(y_t)=-(1-y_t)^γlog (y_t) ,

where γ is tunable parameter named focusing parameter and y_t is same with in cross entropy loss, Eq. (<ref>). In focal loss, the modulating factor (1-y_t)^γ is multiplied to cross entropy loss. Modulating factor is increased when the difference between target and predicted value is increased (misclassified case). Otherwise, when the difference is decreased, modulating factor is also decreased (well-classified case). From this mechanism, it strengthens the significance of correcting misclassified examples and alleviates the bias oriented to dominating class.






§ EXPERIMENTAL SETUP




 §.§ Datasets

The experiments were conducted on Aurora 4 <cit.> which contains 7,138 and 330 clean utterances for training and testing, respectively. All the clean utterances of training data were corrupted by the public 100 noise types [web.cse.ohio-state.edu/pnl/corpus/HuNonspeech/HuCorpus.html] at SNR from -10 to 15 dB in 5 dB steps. Noise types and SNRs were selected randomly. This procedure was repeated until training sets reached about 60 hours long. To evaluate the performance in mismatched noisy conditions, we added 5 unseen noises (babble, destroyer-engine, F16 cockpit, factory, and street) with 4 SNRs (-5, 0, 5, and 10 dB) to all of testing data. Because Aurora 4 data show speech dominated class imbalance, 1 second of silence were inserted at back and forth of each utterance in training sets (1 sec padding). 

To do experimental work for focal loss, we used training sets without silence padding (no padding) and manipulated them for making various imbalance situations. At first, a kind of endpoint detection was executed based on ground-truth (EPD). That is to say, the front part before first speech frame and the latter part after last speech frame were deleted. For making opposite condition, we inserted the silence at back and forth of audio samples for 2 seconds and 3 seconds (2 sec padding and 3 sec padding, respectively). The focusing parameter γ of focal loss in Eq. (<ref>) was set as 0.2, 0.4, 0.6, 0.8, 1.0, 2.0, and 3.0.



 §.§ Setting

40-dimensional log Mel-filterbanks were used as acoustic features with 25-ms frame length and 10-ms shift length. The ground-truth of noisy speech was extracted by applying Sohn VAD <cit.> to corresponding clean speech. For proving effectiveness of proposed attention module, we used 2 basic LSTM models (LSTM_64 and LSTM_96) and 2 CLDNN (Convolutional, Long Short-Term Memory, Deep Neural Networks) models (CLDNN_64 and CLDNN_80), the combination of CNN and LSTM, proposed in <cit.>. Model details about LSTM can be seen in Table <ref> and remaining details of CLDNNs were same with <cit.>. For finding the best attention module, all of proposed attention modules were integrated to LSTM_64. After finding the best attention module, the rest of baseline models were compared. All models were trained using stochastic gradient descent (SGD) for 20 epochs with an initial learning rate lr=10^-1 using a batch-size of 128. lr is reduced by a factor of 10^-1 with 10^-5 of lower bound. The LSTM is unrolled for 50 time steps in training to include long-term dependency with truncated backpropagation through time (BPTT).




§ RESULTS






 §.§ Comparison of different attention modules

Table <ref> represents the results of the baseline (LSTM_64) and baselines integrated with all of proposed attention modules. Evaluation metric is the area under the ROC curve (AUC) <cit.>. The results of 5 noises are averaged along same SNR level and the number of parameters is also compared. 

From this table, we can observe that all of attention-based models outperform the baseline. Also, the increase in number of parameters in all of attention-based models is under 2.5 %, which is negligible. First of all, the attention even only for single domain, the frequential attention (FA) or temporal attention (TA), can help LSTM model to be optimized in VAD. In -5 dB SNR, FA outperforms the TA. However, both show similar results in other SNR levels. It implies that attention in frequency domain is more effective than in time domain especially in desperately noisy environment, under 0 dB SNR.




Although both of the dual attention 1 (DA-1) and the dual attention 2 (DA-2) utilize temporal and frequential information, DA-1 based model shows the lowest results among the attention modules in averaged AUC while DA-2 based model shows the best results in whole SNR levels. It is because DA-1 only focuses on local information by using 2-dimensional convolution on hidden states directly. On the other hand, in DA-2, statistically pooled vectors contain overall information of hidden states. In addition, DA-2 uses both information more precisely by using 1-dimensional convolution separately in each domain. However, DA-1 outperforms baseline as well and uses the least number of parameters among the attention modules. 

For showing effectiveness of DA-2, test waveform sample 446c0201.wav, corrupted by F16 cockpit with 0 dB SNR, was selected. Afterward, consecutive 20 frames were selected randomly from this sample. The above 2 graphs of Figure <ref> represent ground-truth and predicted results of selected 20 frames (1:speech / 0:non-speech). The left column of below color map shows the hidden feature map of last LSTM layer from baseline. The color map of right column shows the refined hidden feature map of last LSTM layer from DA-2 based model. The darker the color, the greater the activation value. DA-2 based model concentrates on time steps of speech frame and suppress time steps of non-speech frame by TA (indicated by the red rectangular). In addition, unlike the values of each hidden units are similar in baseline, the differences of values are distinct in DA-2 based model (indicated by the blue rectangular). It means FA strengthens the specific hidden units in helpful way to improve the model's ability. In DA-2 based model, the hidden feature map is adaptively refined by TA and FA. As a result, DA-2 based model shows more accurate prediction rather than baseline.

The results of extended experiments to other 3 baseline models (LSTM_96, CLDNN_64, and CLDNN_80) are reported in Table <ref>. We find that DA-2 module improves the performance in all of baselines, even in CLDNN. It means DA-2 module can be flexibly integrated to LSTM and CLDNN-based models with a small increase in number of parameters.



 §.§ Focal loss for various imbalance situations


Table <ref> describes the results of experiment about focal loss. LSTM_64 was used as baseline and compared with DA-2 based model. The bottom row of table represents the ratio of speech to non-speech in each situation. Ratio of speech is decreased as column of table is moved from left to right. It can be found that focal loss is effective in all of situations, even in balanced situation (1 sec padding). In speech dominated situations (EPD and no padding), focal loss shows more improved results than in opposite situations (2 sec padding and 3 sec padding). When γ=0.2, result of no padding in baseline is 93.30 %, the 7.59 % relative improvement above cross entropy loss. Whereas, result of 3 sec padding in baseline is 94.53 %, only the 2.67 % relative improvement above cross entropy loss. Also, the effect of focal loss is less remarkable in DA-2 based model generally.

Table <ref> represents the mean and standard deviation of cross entropy-based results (the top row in Table <ref>) from 5 different padding situations. For comparing baseline and DA-2 based model in imbalance situations, mean and standard deviation are obtained along same model. DA-2 based model shows superior result with 21.85 % of relative improvement on average. It means proposed attention module also takes effect in imbalance situations. Standard deviation is decreased with 30.97 % in DA-2 based model. It implies that DA-2 based model is more stable than baseline in various imbalance situations.





§ CONCLUSION

This paper proposed a novel VAD model applying dual attention module which exploits the time and frequency information and infers optimal attention vectors for each domain adaptively. As a result, the proposed attention module improves the performance compared to baseline in unseen noise environment with a slight increase in number of parameters. In addition, the proposed attention module can be flexibly integrated to other LSTM-based baselines for better performance. Additionally, by using focal loss in diverse imbalance situations, performance degradation is alleviated compared to using cross entropy loss.



§ ACKNOWLEDGEMENTS


This work was conducted by Center for Applied Research in Artificial Intelligence (CARAI) grant funded by DAPA and ADD (UD190031RD).

IEEEtran



