# Attention-Based LSTM Algorithm for Audio Replay Detection in Noisy Environments
## 5 Experiments and Results
### Results and Discussion  
#### 5.3.1 Experiments in Clean Environments  
In this part of the experiment, we used three different frame length segments (100, 200, and 300) as inputs of the network, and calculated the EERs of detection. The architecture of AB-LSTM utilized in the experiments consisted of five recurrent layers with a size of \(128\times 256\times 256\times 256\times 128\). The size of the attention layer was the same as the dimensions of the CQCC features. The last two layers of the model were fully-connected layers with a size of \(256\times 256\). The total number of parameters in the network was 1.86 million. As for the traditional LSTM, except for the absence of the attention layer, the remaining parts were the same as those in AB-LSTM. The loss functions of these two methods are binary cross-entropy,  
\[\text{loss}=-\sum\
olimits_{i=1}^{n}\hat{y}_{i}\log y_{i}+(1-\hat{y}_{i})\log( 1-\hat{y}_{i}), \tag{13}\]  
where \(n\) is the number of samples, \(y_{i}\) is the true category, and \(\hat{y}_{i}\) is the predicted classification result.  
After processing all the utterances from the three segment length subsets, using the split/padding method, we used the resultant segments from the training set to train the model, and then used the trained model to perform classification on the development and evaluation subsets.  
The detailed EERs of traditional LSTM, AB-LSTM, and other baseline methods from the ASVspoof 2017 challenge [3] are presented in Table 2. As can be seen from the experiments under clean background conditions, the AB-LSTM achieved an EER of 16.86% in the evaluation subset, which ranked among the top submissions of the ASVspoof 2017 challenge [3]. As shown in Table 2, AB-LSTM performed better than traditional LSTM, where the EER of AB-LSTM was reduced by 17.0% when compared to traditional LSTM for the cases with 100 frames. For both traditional LSTM and AB-LSTM, the best EER resulted from the settings with 100 frames.  
Figure 7 shows the loss curves of traditional LSTM and AB-LSTM methods observed during training. We can see that the decrease in the loss values was faster with the attention mechanism than without it. Although AB-LSTM had an additional attention layer, the convergence speed of the whole model was significantly higher than that of traditional LSTM. This demonstrated that the attention layer accelerated the optimization of the model by making the network concentrate on frames necessary for genuine and spoof utterance detection.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Methods** & _dev_** **ER** & _eval_ **ER** \\ \hline
**LCNNFFT, SVMi-vect,** & & & \\
**CNNFFT+RNN**[11] & & 3.95 & 6.73 \\ \hline
**VESA-IFCC+CFCCIF**[12] & 0.12 & 18.33 \\ \hline
**LCNN**[24] & 6.47 & 16.08 \\ \hline
**Evolving RNN**[25] & 18.70 & 18.20 \\ \hline
**Traditional LSTM** & Frame = 100 & **13.24** & **20.32** \\  & Frame = 200 & 14.18 & 21.59 \\  & Frame = 300 & 13.83 & 20.97 \\  & Average & 13.75 & 20.96 \\ \hline
**AB-LSTM** & Frame = 100 & **9.75** & **16.86** \\  & Frame = 200 & 10.69 & 17.69 \\  & Frame = 300 & 11.94 & 18.84 \\  & Average & 10.79 & 17.80 \\ \hline
**CQCC-GMM (baseline)** & 12.08 & 29.35 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Performance of our algorithm and other algorithms used in the ASVspoof 2017 challenge. Results are in terms of the replay/non-replay EER (%).  
In order to explore the influence of the network's architecture, another group of experiments were conducted using the 100 frame length segments, combined with the split/padding and bagging methods. All three networks were trained on the training set and evaluated using the evaluation set. Detailed experimental results are shown in Table 3.