# A Deep Neural Network Model for Speaker Identification
## 2 Materials and Methods
### Model Overview  
Deep GRU Architecture  
In this study, we proposed a DNN model which combines 2-D CNN and GRU. The structure of our network model is summarized in Figure 4. In our proposed model, we first preprocess the speech to obtain the spectrogram. Then input the spectrogram into the convolutional layer and perform feature extraction. After the convolutional layer, GRU layers are stacked and times-series feature learning is performed in these GRU networks. Next, we obtain the unique voiceprint features of each speaker through the embedding operation, and finally the softmax layer [47] in the model will study and score the extracted features. Figure 3: Gated recurrent unit (GRU) architecture (a single memory block is shown for clarity). In our model, the input of the convolutional layer is a four-dimensional tensor which is a shape four-dimensional tensor in the form of \((batch\_size,filters,cols,channel)\), where \(batch\_size\) is the number of samples selected for one epoch training, \(filters\) represent the number of filters in the Mel filterbank, \(cols\) represents the relevant features of each frame of speech, and \(channel\) is the dimension of extracted features. Then, there is a \(5\times 5\) convolution kernel size, \(2\times 2\) stride of the convolution along the height and width. An average pooling layer is connected with the convolutional layer, its pooling size and stride are set as \(2\times 2\). It is worth noting that we use batch normalization (BN) [48] between the convolutional layer and average pooling layer, and it accelerates model training. The BN transform is shown in Equations (13) and (14). In the algorithm, \(\epsilon\) is a constant added to the mini-batch variance for numerical stability:  
\[\mu_{\beta}\leftarrow\frac{1}{m}\sum_{i=1}^{m}x_{i}\sigma_{\beta}^{2} \leftarrow\frac{1}{m}\sum_{i=1}^{m}\left(x_{i}-\mu_{\beta}\right)^{2} \tag{13}\]  
\[\widehat{x_{i}}\leftarrow\frac{x_{i}-\mu_{\beta}}{\sqrt{\sigma_{\beta}^{2}+ \epsilon}};y_{i}\leftarrow\gamma\widehat{x_{i}}+\beta\equiv BN_{\gamma,\beta} (x_{i}). \tag{14}\]  
Here, \(\mu_{\beta}\) is the mini-batch mean, \(\sigma_{\beta}^{2}\) is the mini-batch variance, \(\widehat{x_{i}}\) is the result of the normalization operation, \(y_{i}\) is the result of scaling and shifting operations, and \(\gamma\) and \(\beta\) are parameters to be learned. Values of \(x\) over a mini-batch: \(\beta=\{x_{1...m}\}\) is the input, and \(\{y_{i}=BN_{\gamma,\beta}(x_{i})\}\) is the output. Training DNN is complicated by the fact that the distribution of each layer's inputs changes during training, as the parameters of the previous layers change [48]. This slows down the backpropagation training, due to the nonlinearity caused by deep network and parameter saturation. BN normalizes the inputs and reduces nonlinearity of the system. As the result, BN stabilizes the distribution of activation values throughout training. The recurrent network layer is built by stacking three GRU layers, their parameters settings for each layer are the same, and layer normalization (LN) is used between GRU layers. Unlike BN, LN [49] normalizes the input of all neurons in a certain layer of the deep network according to the following explanation. In a traditional RNN, the summed inputs in the recurrent layer are computed from the current input \(x^{t}\) and previous vector of hidden states \(h^{t-1}\) which are computed as \(a^{t}=W_{hh}h^{t-1}+W_{xh}x^{t}\). The layer normalized recurrent layer re-centers and re-centers its activations using Formula (15):  
\[h^{t}=f[\frac{g}{\sigma^{t}}\odot(a^{t}-\mu^{t})+b];\mu^{t}=\frac{1}{H}\sum_{ i=1}^{H}a_{i}^{t};\sigma^{t}=\sqrt{\frac{1}{H}\sum_{i=1}^{H}\left(a_{i}^{t}- \mu^{t}\right)^{2}}. \tag{15}\]  
Here, \(W_{hh}\) is the recurrent hidden to hidden weights and \(W_{xh}\) are the bottom up input to hidden weights. \(\odot\) is the element-wise multiplication between two vectors. \(b\) and \(g\) are defined as the bias and gain parameters of the same dimension as \(h^{t}\).