Convolutional Gated Recurrent Neural Network Incorporating Spatial Features for Audio Tagging
Yong Xu Qiuqiang Kong Qiang Huang Wenwu Wang Mark D. Plumbley















	

















































Convolutional Gated Recurrent Neural Network Incorporating Spatial Features for Audio Tagging
    Yong Xu      Qiuqiang Kong      Qiang Huang      Wenwu Wang      Mark D. Plumbley
	Center for Vision, Speech and Sigal Processing
		University of Surrey, Guildford, UK

		Email: {yong.xu, q.kong, q.huang, w.wang, m.plumbley}@surrey.ac.uk
    December 30, 2023
=================================================================================================================================================================================================================================================






Environmental audio tagging is a newly proposed task to predict the presence or absence of a specific audio event in a chunk. Deep neural network (DNN) based methods have been successfully adopted for predicting the audio tags in the domestic audio scene. In this paper, we propose to use a convolutional neural network (CNN) to extract robust features from mel-filter banks (MFBs), spectrograms or even raw waveforms for audio tagging. Gated recurrent unit (GRU) based recurrent neural networks (RNNs) are then cascaded to model the long-term temporal structure of the audio signal. To complement the input information, an auxiliary CNN is designed to learn on the spatial features of stereo recordings. We evaluate our proposed methods on Task 4 (audio tagging) of the Detection and Classification of Acoustic Scenes and Events 2016 (DCASE 2016) challenge. Compared with our recent DNN-based method, the proposed structure can reduce the equal error rate (EER) from 0.13 to 0.11 on the development set. The spatial features can further reduce the EER to 0.10. The performance of the end-to-end learning on raw waveforms is also comparable. Finally, on the evaluation set, we get the state-of-the-art performance with 0.12 EER while the performance of the best existing system is 0.15 EER.






















§ INTRODUCTION

Audio tagging (AT) aims at putting one or several tags on a sound clip. The tags are the sound events that occur in the audio clip, for example, “speech", “television", “percussion", “bird singing", and so on. Audio tagging has many applications in areas such as information retrieval <cit.>, sound classification <cit.> and recommendation system <cit.>. 

Many frequency domain audio features such as mel-frequency cepstrum coefficients (MFCCs) <cit.>, Mel filter banks feature (MFBs) <cit.> and spectrogram <cit.> have been used for speech recognition related tasks <cit.> for many years. However, it is unclear how these features perform on the non-speech audio processing tasks. Recently MFCCs and the MFBs were compared on the audio tagging task <cit.> and the MFBs can get better performance in the framework of deep neural networks. The spectrogram has been suggested to be better than the MFBs in the sound event detection task <cit.>, but has not yet been investigated in the audio tagging task.

Besides the frequency domain audio features, processing sound from the raw time domain waveforms, has attracted a lot of attentions recently <cit.>. However, most of this works are for speech recognition related tasks; there are few works investigating raw waveforms for environmental audio analysis. For common signal processing steps, the short time Fourier transform (STFT) is always adopted to transform raw waveforms into frequency domain features using a set of Fourier basis. Recent research <cit.> suggests that the Fourier basis sets may not be optimal and better basis sets can be learned from raw waveforms directly using a large set of audio data. To learn the basis automatically, convolutional neural network (CNN) is applied on the raw waveforms which is similar to CNN processing on the pixels of the image <cit.>. Processing raw waveforms has seen many promising results on speech recognition <cit.> and generating speech and music <cit.>, with less research in non-speech sound processing.

Most audio tagging systems <cit.> use mono channel recordings, or simply average the multi-channels as the input signal. However, using this kind of merging strategy disregards the spatial information of the stereo audio. This is likely to decrease recognition accuracy because the intensity and phase of the sound received from different channels are different. For example, kitchen sound and television sound from different directions will have different intensities on different channels, depending on the direction of the sources. Multi-channel signals contain spatial information which could be used to help to distinguish different sound sources. Spatial features have been demonstrated to improve results in scene classification <cit.> and sound event detection <cit.>. However, there is little work using multi-channel information for the audio tagging task. 

Our main contribution in this paper includes three parts. First, we show experimental results on different features including MFBs and spectrogram as well as the raw waveforms on the audio tagging task of the DCASE 2016 challenge. Second, we propose a convolutional gated recurrent neural network (CGRNN) which is the combination of the CNN and the gated recurrent unit (GRU) to process non-speech sounds. Third, the spatial features are incorporated in the hidden layer to utilize the location information. The work is organized as follows: in Section <ref>, the proposed CGRNN is presented for audio tagging. In section <ref>, the spatial features will be illustrated and incorporated into the proposed method. The experimental setup and results are shown in Section <ref> and Section <ref>. Section <ref> summarizes the work and foresees the future work. 



§ CONVOLUTIONAL GATED RECURRENT NETWORK FOR AUDIO TAGGING


Neural networks have several types of structures: the most common one is the deep feed-forward neural network. Another popular structure is the convolutional neural network (CNN), which is widely used in image classification <cit.>. CNNs can extract robust features from pixel-level values for images <cit.> or raw waveforms for speech signals <cit.>. Recurrent neural network is the third structure which is often used for sequence modeling, such as language models <cit.> and speech recognition <cit.>. In this section, we will introduce the convolutional neural network and the recurrent neural network with gated recurrent units.





 §.§ One dimension convolutional neural network

Audio or speech signals are one dimensional. Fig. <ref> shows the structure of a one-dimension CNN which consists of one convolutional layer and one max-pooling layer. N filters with a fixed size F are convolved with the one dimensional signal to get outputs p_i^t{i=0,⋯,(N-1)}. Given that the dimension of the input features was M, the activation h of the convolutional layer would have (M-F+1) values. The max-pooling size is also (M-F+1) which means each filter will give one output value. This is similar to speech recognition work <cit.> where CNN has been used to extract features from the raw waveform signal. The way of each filter producing one value can also be explained as a global pooling layer which is a structural regularizer that explicitly enforces feature maps to be confidence maps of meaningful feature channels <cit.>. So N activations are obtained as the robust features from the basic features. As for the input feature size M, a short time window, e.g., 32 ms, was fed into the CNN each time. The long-term pattern will be learned by the following recurrent neural network. As for the filter size or kernel size, a large receptive field is set considering that only one convolutional layer is designed in this work. For example, F=400 and M=512 are set in <cit.>. If the input feature was raw waveforms, each filter of the CNN was actually learned as a finite impulse response (FIR) filter <cit.>. If the spectrograms or mel-filter banks were fed into the CNN, the filtering was operated on the frequency domain <cit.> to reduce the frequency variants, such as the same audio pattern but with different pitches.



 §.§ Gated recurrent unit based RNN

Recurrent neural networks have recently shown promising results in speech recognition <cit.>. Fig. <ref> shows the basic idea of the RNN. The current activation h_t is determined by the current input x_t and the previous activation h_t-1. RNN with the capability to learn the long-term pattern is superior to a feed-forward DNN, because a feed-forward DNN is designed that the input contextual features each time are independent. The hidden activations of RNN are formulated as:

    h_t=φ(W^hx_t+R^hh_t-1+b^h)

However, a simple recurrent neural network with the recurrent connection only on the hidden layer is difficult to train due to the well-known vanishing gradient or exploding gradient problems <cit.>. The long short-term memory (LSTM) structure <cit.> was proposed to overcome this problem by introducing input gate, forget gate, output gate and cell state to control the information stream through the time. The fundamental idea of the LSTM is memory cell which maintains its state through time <cit.>.


As an alternative structure to the LSTM, the gated recurrent unit (GRU) was proposed in <cit.>. The GRU was demonstrated to be better than LSTM in some tasks <cit.>, and is formulated as follows <cit.>:


    r_t=δ(W^rx_t+R^rh_t-1+b^r)
 

    z_t=δ(W^zx_t+R^zh_t-1+b^z)
 

    h̃_t=φ(W^hx_t+r_t⊙(R^hh_t-1)+b^h)


    h_t=z_t⊙h_t-1+(1-z_t)⊙h̃_t
 
where h_t, r_t and z_t are hidden activations, reset gate values and update gate values at frame t, respectively. The weights applied to the input and recurrent hidden units are denoted as W^* and R^*, respectively. The biases are represented by b^*. The functions δ(·) and φ(·) are the sigmoid and tangent activation functions. Compared to the LSTM, there is no separate memory cell in the GRU. The GRU also does not have an output gate, and combines the input and forget gates into an update gate z_t to balance between the previous activation h_t-1 and the update activation h̃_t shown in Eq. (<ref>). The reset gate r_t can decide whether or not to forget the previous activation (shown in Eq. (<ref>)). ⊙ in Eq. (<ref>) and (<ref>) represents the element-wise multiplication.





 §.§ Convolutional Gated Recurrent Network for audio tagging

Fig. <ref> shows the framework of a convolutional gated recurrent neural network for audio tagging. The CNN is regarded as the feature extractor along the short window (e.g., 32ms) from the basic features, e.g., MFBs, spectrograms or raw waveforms. Then the robust features extracted are fed into the GRU-RNN to learn the long-term audio patterns. For the audio tagging task, there is a lot of background noise, and acoustic events may occur repeatedly and randomly along the whole chunk (without knowing the specific frame locations). The CNN can help to extract robust features against the background noise by the max-pooling operation, especially for the raw waveforms. Since the label of the audio tagging task is at the chunk-level rather than the frame-level, a large number of frames of the context were fed into the whole framework. The GRU-RNN can select related information from the long-term context for each audio event. To also utilize the future information, a bi-directional GRU-RNN is designed in this work. Finally the output of GRU-RNN is mapped to the posterior of the target audio events through one feed-forward neural layer, with sigmoid output activation function. This framework is flexible enough to be applied to any kinds of features, especially for raw waveforms. Raw waveforms have lots of values, which leads to a high dimension problem. However the proposed CNN can learn on short windows like the short-time Fourier transform (STFT) process, and the FFT-like basis sets or even mel-like filters can be learned for raw waveforms. Finally, one-layer feed-forward DNN gets the final sequence of GRUs to predict the posterior of tags.


Binary cross-entropy is used as the loss function in our work, since it was demonstrated to be better than the mean squared error in <cit.> for labels with zero or one values. The loss can be defined as:

    E=-∑_n=1^NT_nlogT̂_n+(1-T_n)log(1-T̂_n)


    T̂_n=(1+exp(-O))^-1

where E is the binary cross-entropy, T̂_n and T_n denote the estimated and reference tag vector at sample index n, respectively. The DNN linear output is defined as O before the sigmoid activation function is applied. Adam <cit.> is used as the stochastic optimization method. 





§ SPATIAL FEATURES INCORPORATED FOR AUDIO TAGGING



Spatial features can often offer additional cues to help to solve signal processing problems. Many spatial features can be used for audio tagging, such as interaural phase differences or interaural time differences (IPD or ITD) <cit.>, interaural level differences (ILD) <cit.>. The recordings of the audio tagging task of DCASE 2016 challenge are recorded in the home scenes. There are some TV, child speech, adult speech audio events. The spatial features potentially give additional information to analyze the content of the audio, e.g., recognizing the TV audio event by knowing the specific direction of the TV sound. The IPD and ILD are defined as:

    ILD(t,k)=20log_10|X_left(t,k)/X_right(t,k)|


    IPD(t,k)=∠(X_left(t,k)/X_right(t,k))

where X_left(t,k) and X_right(t,k) denote the left channel and right channel complex spectrum of the stereo audio. The operator |·| takes the absolute of the complex value, and ∠(·) finds the phase angle. In this work, we also define interaural magnitude differences (IMD) which is similar to the ILD. IMD is defined in linear domain while ILD is defined in logarithmic domain.

    IMD(t,k)=|X_left(t,k)|-|X_right(t,k)|

Fig. <ref> shows the structure of incorporating the spatial features (IMD/ILD/IPD, etc.) using an additional CNN. Then the activations learned from the basic features and the activations learned from the spatial features are concatenated to be fed into the GRU-RNN plotted in Fig. <ref>.

The audio files of the audio tagging task of the DCASE 2016 challenge are recorded in a domestic home environment. There are severe reverberation, high-level background noise and multiple acoustic sources. These factors might influence the effectiveness of IPD and ILD. Fig. <ref> shows the spectrogram, IMD, ILD and IMD of one recording from the audio tagging task of DCASE 2016 challenge. The IMD appears to have some meaningful patterns while the ILD and the IPD seem to be random which would lead to the training difficulties of the classifier. From our empirical experiments, IPD and ILD do not appear to help to improve the classifier performance while IMD is beneficial. Similar results were reported in <cit.> where IPD was found not to be helpful for the sound event detection in home scenes but helpful for the event detection of residential areas. This may be because residential areas are open areas with less reverberation than indoor home environments. Hence we will use IMD as our spatial features in this work. The filter size of CNNs learned on the IMD is set the same with the related configuration for the spectrogram.



§ DATA SET AND EXPERIMENTAL SETUP




 §.§ DCASE 2016 audio tagging challenge


We conducted our experiments based on the DCASE 2016 audio tagging challenge <cit.>. This audio tagging task consists of the five-fold development set and the evaluation set, which are built based on the CHiME-home dataset <cit.>. The audio recordings were made in a domestic environment <cit.>. The audio data are provided as 4-second chunks at 48kHz sampling rates in stereo mode. We downsampled them into 16kHz sampling rate.











For each chunk, three annotators gave three labels, namely multi-label annotations. Then the discrepancies among annotators are reduced by conducting a majority vote. The annotations are based on a set of seven audio events as presented in Table <ref>.
A detailed description of the annotation procedure is provided in <cit.>.









 §.§ Experimental setup


In the experiments below, we follow the standard specification of the DCASE 2016 audio tagging task <cit.>,
On the development set, we use the official five folds for cross-validation.
Table <ref> shows 
the number of chunks in the training and test set used for each fold. The number of final evaluation configuration is also listed.

The parameters of the networks are tuned based on the heuristic experience. All of the CNNs have 128 filters or feature maps. Following <cit.>, the filter size for MFBs, spectrograms and raw waveforms are 30, 200, and 400, respectively. These parameters can form a large receptive field for each type of basic features considering that only one convolutional layer was designed. The CNN layer is followed by three RNN layers with 128 GRU blocks. One feed-forward layer with 500 ReLU units is finally connected to the 7 sigmoid output units. We pre-process each audio chunk by segmenting them using a 32ms sliding window with a 16ms hop size, and converting each segment into 40-dimension MFBs, 257-dimension spectrograms and 512-dimension raw waveforms. For performance evaluation, we use equal error rate (EER) as the main metric which is also suggested by the DCASE 2016 audio tagging challenge. EER is defined as the point of equal false negative (FN) rate and false positive (FP) rate <cit.>. The source codes for this paper can be downloaded from Github[<https://github.com/yongxuUSTC/cnn_rnn_spatial_audio_tagging>].



 §.§ Compared methods

We compared our methods with the state-of-the-art systems. Lidy-CQT-CNN <cit.> and Cakir-MFCC-CNN <cit.> won the first and the second prize of the DCASE2016 audio tagging challenge <cit.>. They both used convolutional neural networks (CNN) as the classifier. We also compare to our previous method <cit.> which demonstrated the state-of-the-art performance using de-noising auto-encoder (DAE) to learn robust features.



§ EXPERIMENTAL RESULTS AND ANALYSIS


In this section, the IMD effectiveness will be firstly evaluated on the development set of Task 4 of the DCASE 2016 challenge among the different features, i.e., spectrograms, MFBs and raw waveforms. Then the final evaluation will be presented by comparing with the state-of-the-art methods on the evaluation set of Task 4 of the DCASE 2016 challenge.


 §.§ The effectiveness of the IMD

Table <ref> shows the EER comparisons on seven labels among the spectrogram, the raw waveform and the MFB systems with or without the IMD information, which are evaluated on the development set of the DCASE 2016 audio tagging challenge. Firstly, we can compare the proposed convolutional gated recurrent neural networks on spectrograms, raw waveforms and MFBs. Spectrograms are better than the MFBs perhaps because the spectrogram has more detailed frequency information compared with the MFB. For example, spectrograms are much better than MFBs on child speech (denoted as `c') and female speech (denoted as `f') where a lot of high frequency information exists. The raw waveforms are worse than the spectrograms and the MFBs. One possible reason is that the learned FIR filters are not stable when the whole training set is small (about 3.5 hours of audio in this work). The same explanation was given in <cit.> on the speech recognition task. <cit.> shows that raw waveforms can get better recognition accuracy with the mel-spectra on 2000 hours Google voice search data.

With the help of the IMD spatial features, the EER are improved compared to all of the corresponding basic features alone. The raw waveforms with IMD can even get comparable results with the spectrograms and the MFBs. The MFB-IMD combination is slightly better than Spec-IMD, which may be because the IMD is calculated from the left and right spectrograms. The IMD has some common information with the spectrograms which can be seen from Fig. <ref>. However, the IMD is more complementary for the MFBs and the raw waveforms. The previous best performance on the development set of the DCASE 2016 audio tagging challenge was obtained in our recent work using denoising auto-encoder <cit.> with 0.126 EER, but here we get better performance with 0.10 EER.



 §.§ Overall evaluations

Table <ref> presents the EER comparisons on seven labels among Lidy-CQT-CNN <cit.>, Cakir-MFCC-CNN <cit.>, our previous DAE-DNN <cit.>, and the proposed systems on the spectrogram, the raw waveform and the MFB systems with the IMD information, which are evaluated on the final evaluation set of the DCASE 2016 audio tagging challenge. The de-noising auto-encoder <cit.> was our recent work which can outperform the leading system in the DCASE 2016 audio tagging challenge, namely Lidy-CQT-CNN <cit.>. Our proposed convolutional gated recurrent neural network incorporating the IMD features in this work gives further improved performance. The MFB-IMD obtains the best performance with 0.123 EER which is the state-of-the-art performance on the evaluation set of the DCASE 2016 audio tagging challenge.








































































































§ CONCLUSION


In this paper, we propose a convolutional gated recurrent neural network (CGRNN) to learn on the mel-filter banks (MFBs), the spectrograms and even the raw waveforms. The spatial features, namely the interaural magnitude difference (IMDs), are incorporated into the framework and are demonstrated to be effective to further improve the performance. Spectrogram gives better performance than MFBs without the spatial features. However the MFBs with the IMDs can get the minimal EER, namely 0.102, on the development set of the DCASE 2016 audio tagging challenge. Raw waveforms give comparable performance on the development set. Finally, on the evaluation set of the DCASE 2016 audio tagging challenge, our proposed MFB-IMD system can get the state-of-the-art performance with 0.l23 EER. It is still interesting to further explore why the MFB-IMD system is better than the Spec-IMD system in our future work. In addition, we will also investigate the proposed framework to model raw waveforms on larger training datasets to learn more robust filters.










§ ACKNOWLEDGMENT

This work was supported by the Engineering and Physical Sciences Research Council (EPSRC) of the UK under the grant EP/N014111/1. Qiuqiang Kong is partially supported by the China Scholarship Council (CSC).



























IEEEtran


















