Babel: baseline of bilingual LID	As the first step, we build three baseline LID systems, one based on the i-vector model, and the other two based on LSTM-RNN, using the speech data of two languages from Babel: Assamese and Georgian (AG). For the i-vector baseline, the UBM involves $2,048$ Gaussian components and the dimensionality of the i-vectors is 400. The static acoustic features consists of 12-dimensional MFCCs and the log energy. These static features are augmented by their first and second order derivatives, resulting in 39-dimensional feature vectors. In our experiment, we train an SVM for each language to determine the score of a test i-vector belonging to that language. The SVMs are trained on the i-vectors of all training segments, following the one-versus-rest strategy. The two RNN LID baselines are: a standard RNN LID system (AG-RNN-LID) that discriminates between the two languages in its output, and a multi-task system (AG-RNN-MLT) that was trained to discriminate between the two languages as well as the phones.

Babel: PTN on seven languages	We evaluate various LID models on the seven languages of the Babel database. First, the i-vector and LSTM-RNN LID baselines are presented. For the i-vector system, linear discriminative analysis (LDA) is employed to promote language-related information before training SVMs. The dimensionality of the LDA projection space is set to 6. For the phonetically aware RNN and the PTN systems, two phonetic DNNs are evaluated, AG-TDNN-MLT and SWB-TDNN-ASR. For the phonetically aware system, the $g$ function of the LSTM-RNN LID model is chosen as the receiver. The results are shown in Table 6 . It can be seen that both the phonetically aware and the PTN systems outperform the i-vector baseline and the acoustic RNN LID baseline, and that the PTN system with the AG-TDNN-MLT phonetic DNN performs the best. The SWB-TDNN-ASR performs slightly worse than AG-TDNN-MLT, indicating that familiarity with the language and the environment is beneficial when discriminating between languages.

The other is also a TDNN, but is taken from an industry project, trained on a speech database involving $10,000$ hours of Chinese speech signals with 40 dimensional Fbanks. The network contains 7 rectifier TDNN layers, each containing $1,200$ hidden units. This model is denoted by `CH-TDNN-ASR'. The weight matrix of the last hidden layer in CH-TDNN-ASR is decomposed by SVD, where the low rank is set to 400. The 400-dimensional activations are read from the low-rank layer and are used as the phonetic feature. The test results on the seven languages in the database are shown in Table 7 . It can be seen that the phonetic RNN LID models, either the phonetically aware RNN or the PTN approach, significantly outperform the acoustic RNN baseline system. The PTN system seems much more effective, which differs from the Babel database results. This may be attributed to the limited training data, so the simpler PTN architecture is preferred. Comparing the WSJ-based phonetic DNN and the Chinese phonetic DNN, the Chinese model is better.

Babel: Phonetic knowledge or deep structure?	The good performance using only the phonetic features (i.e. the PTN approach) leads to the question of how this performance advantage in comparison to the RNN LID baseline is obtained. This paper has discussed the phonetic and transfer learning perspectives, which jointly state that the main advantage of PTN is the phonetic knowledge learned through transfer learning. However, another possible reason is that the deeper architecture consisting of both the phonetic DNN and the LID RNN may help to learn more abstract features. If the latter reason is more important, than a similar deep structure with only the LID labels can work similarly well. To answer this question, we design the following three experiments to test the contributions to the results from phonetic information (transfer learning) and deep architecture (deep learning): TDNN-LSTM. The phonetic DNN, TDNN in the experiment, is initialized randomly and trained together with the LID RNN. This means that the TDNN is not trained with ASR labels, but as part of the LID neural model, and is trained end-to-end. Pre-trained TDNN-LSTM.

This database involves 317 hours of telephone speech signals in English, recorded from $4,870$ speakers. The ASR performance (WER) of SWB-TDNN-ASR is $20.8\%$ on the Eval2000 dataset. Another design decision that had to be made was to choose which component in the LID RNN will receive the phonetic information. After a series of preliminary experiments, it was found that the $g$ function is the best receiver. With this choice and the two TDNN phonetic DNNs, we therefore build the phonetically aware LID system. The results are shown in Table 3 . Several conclusions can be obtained from the results. The phonetically aware system significantly outperforms the baseline RNN LID system (second row of the results in Table 2 ). This suggests that involving phonetic information with RNN LID has clear benefits. The phonetically aware system significantly outperforms the multi-task RNN LID (third row of the results in Table 2 ).

The results indicate that both the LID RNN and the multi-task LID RNN are capable of language discrimination, and the multi-task RNN significantly outperforms both the LID RNN and the i-vector baseline. This indicates that the phone information is very useful for neural LID, even if simply used as an auxiliary objective in the model training, hence supporting our transfer learning perspective, as described in Section "Phonetic neural modelling for LID" . The multi-task learning approach is an interesting way to involve phonetic information in LID. However, it has the limitation of requiring the training data to be labelled in both languages and words/phones. This is very costly and not feasible in most scenarios. The phonetic neural models (the phonetically aware model and the PTN model) do not suffer from this problem.

More precisely, the output units of the AG-RNN-MLT are separated into two groups: an LID group that involves two units corresponding to Assamese and Georgian respectively, and an ASR group that involves $3,349$ bilingual senones that are inherited from an HMM/GMM ASR system trained with the speech data of Assamese and Georgian, following the standard WSJ s5 HMM/GMM recipe of Kaldi. The WSJ s5 nnet3 recipe of Kaldi is then used to train the AG-RNN-LID and AG-RNN-MLT systems. The LID task can be conducted by either AG-RNN-LID or AG-RNN-MLT (using the LID output group) at the frame-level (denoted as `Fr.'), using the frame-level language posteriors they produce. To evaluate the utterance-level (denoted as `Utt.') performance, the frame-level posteriors are averaged to form the utterance-level posterior, by which the language decision can be made. The performance results with the three baseline systems, in terms of $C_{avg}$ and equal error rate (EER), are shown in Table 2 .

The same as TDNN-LSTM, except that the TDNN is initialized by AG-TDNN-MLT. 3-layer LSTM-RNN. The 1-layer LSTM-RNN LID model may be not strong enough to learn useful information from acoustic features, hence leading to the suboptimal performance in Table 2 . We experiment with a 3-layer LSTM-RNN LID system to test if a simple deeper network can obtain the same performance as with the phonetic feature. The results of these three deep models are shown in Table 5 . The TDNN-LSTM model completely fails. Using the phonetic TDNN as the initialization helps the training, but the results are worse than directly using the phonetic model. This means that the phonetic feature is almost optimal, and does not require any further LID-oriented end-to-end training. Finally, involving more LSTM layers (3-layer LSTM-RNN) does improve the performance a little when compared to the one-layer LSTM baseline ( $7.70$ vs $9.20$ , ref. to Table 2 ).

Model structure	This section presents the details of the phonetic neural LID models, including both the phonetically aware model and the PTN model. The phonetic DNN can be implemented in various DNN structures, and here we choose the TDNN  which can learn long-term phonetic patterns and performed well in our experiments. For the LID neural model, we choose the LSTM-RNN. One reason for this choice is that LSTM-RNN has been demonstrated to perform well in both the pure neural LID approach  and the neural-probabilistic hybrid LID approach  . Another reason is that the RNN model can learn the temporal properties of speech signals, which is in accordance with our motivation to model the phonetic dynamics, as in the conventional PRLM approach  . We first describe the LSTM-RNN structure used for LID, and then present the model structures of the phonetically aware acoustic RNN model and PTN model.

Understanding the PTN approach	The rationality of the PTN approach can be understood from two perspectives: the phonetic perspective, which relates to what information is important, and the transfer learning perspective, which relates to how this information is learned. Phonetic perspective: The PTN approach adopts the long-standing hypothesis (as used by the PRLM model) that languages should be discriminated by phonetic rather than spectral properties. However this has been largely overlooked since the success of the i-vector approach, which achieved good performance using only raw acoustic features. However, Song et al.  recently rediscovered the value of phonetic features in the i-vector model. The PTN approach proposed here follows the same idea and rediscovers the value of phonetic features in the neural model. We argue that this value is more important for the neural model than for the probabilistic model (e.g., i-vector), as its decision is based on only a small number of frames, and thus requires that the feature involves more language-related information and less noise and uncertainties. The i-vector model, in contrast, can utilize more speech signals, hence can discover language-related information from the distributional patterns even with raw acoustic features.

Paper organization	The remainder of the paper is organized as follows: the model structures of the PTN approach will be presented in Section "Phonetic neural modelling for LID" , which is followed by the implementation details in Section "Model structure" . The experiments and results are reported in Section "Experiments" , and some conclusions and future work will be presented in Section "Conclusions" .

Phonetic temporal neural model	The second model, which we call the PTN model, completely replaces the acoustic feature with the phonetic feature, and thus entirely relies on the properties of the phonetic representation. This learning is based on the RNN model, therefore the temporal patterns of the phonetic features can be learned. This PTN system is shown in Fig. 1 (b). Although the PTN model is a special, `aggressive' case of the phonetically aware approach, the success of this model offers a deeper insight into the LID task as it rediscovers the importance of the temporal properties of phonetic representations.

We also attempted to use the TDNN as the LID model (replacing the RNN) to learn static (rather than temporal) patterns of the phonetic features. We found that this model failed to converge. The same phenomenon was also observed in the AP16-OLR experiment (which will be discussed later in the paper). This is an important observation and it suggests that, with the phonetic feature, only the temporal properties are informative for language discrimination.

The recently emerging deep learning approach solves this problem by using various deep neural networks (DNNs) to produce frame-level LID decisions. An early successful deep neural model was developed by Lopez-Moreno et al.  , who proposed an approach based on a feed-forward deep neural network (FFDNN), which accepts raw acoustic features and produces frame-level LID decisions. The score for utterance-based decision is calculated by averaging the scores of the frame-level decisions. This was extended by others with the use of various neural model structures, e.g., CNN  ,  and TDNN  ,  . These DNN models are feature-based, but they consider a large context window, and can therefore learn the feature's temporal information, which is not possible with conventional feature-based models (such as the i-vector model), that only learn distributional information. The temporal information can be better learned by recurrent neural networks (RNNs), as proposed by Gonzalez-Dominguez et al.  . Using an RNN structure based on the long-short term memory unit (LSTM), the authors reported better performance with fewer parameters. This RNN approach was further developed by others, e.g.,  ,  .

Conclusions	This paper proposed a phonetic temporal neural (PTN) approach for language identification. In this approach, acoustic features are substituted for phonetic features to build an RNN LID model. Our experiments conducted on the Babel and AP16-OLR databases demonstrated that the PTN approach can provide dramatic performance improvement over the baseline RNN LID system, with even better results than a phonetically aware approach that treats the phonetic feature as additional auxiliary information. This demonstrated that phonetic temporal information is much more informative than raw acoustic information for discriminating between languages. This was a long-standing belief of LID researchers in the PRLM era, but has been doubted since the increased popularity and utilization of the i-vector approach in recent years. Future work will improve the performance of the neural LID approach on long sentences, by enabling the LSTM-RNN to learn long-time patterns, e.g., by multi-scale RNNs  .

This is the hypothesis behind conventional acoustic RNN LID methods: if the neural model is successfully trained, it can learn any useful information from the raw acoustic features layer by layer, including the phonetic information. It therefore initially seems unnecessary to design our PTN phonetic feature learning and modelling architecture. However, we argue that using the language labels alone to learn LID-related information from raw acoustic features is highly ineffective, because these labels are too coarse to provide sufficient supervision. With the PTN model, feature extraction is trained on speech data labelled with phones or words which are highly informative and fine-grained (compared to language labels), leading to a strong DNN model for phonetic feature extraction. Importantly, phone discrimination and language identification are naturally correlated (from our phonetic perspective), which means that the phonetic features learned with the strong phone/word supervision involves rich information suitable for LID. This is an example of transfer learning, where a related task (i.e., phone discrimination) is used to learn features for another task (LID). The PTN approach also involves another two transfer learning schemes: cross language and cross condition (databases).

Phonetically aware acoustic neural model	The instinctive idea for utilizing phonetic information in the RNN LID system is to treat it as auxiliary knowledge, which we call a phonetically aware approach. Intuitively, this can be regarded as a knowledge-fusion method that uses both the phonetic and acoustic features to learn LID models. Fig. 1 (a) shows this model. A phonetic DNN model (this may be in any structure, such as FFDNN, RNN, TDNN) is used to produce frame-level phonetic features. These can be read from anywhere in the phonetic DNN, such as the output, or the last hidden layer, and then be propagated to the LID model, an LSTM-RNN in our study. This propagated phonetic information can be accepted by the LID model in different ways. For example, it can be part of the input, or as an additional term of the gate or non-linear activation functions.

The PTN approach is also correlated to the neural-probabilistic hybrid approach, where the phonetic DNN is used to produce phonetic features, from which the GMM or i-vector model is constructed. The PTN approach uses the same phonetic features, but employs an RNN model to describe the dynamic property of the feature, instead of modelling the distributional property using GMM or i-vector models. As will be discussed in the next section, temporal modelling is very important for phonetic neural models. Finally, compared to the conventional acoustic RNN LID model, the PTN model uses phonetic features rather than acoustic features. Since the phonetic features can be learned with a very large speech database, they are much more robust against noise and uncertainties (e.g., speaker traits and channel distortions) than the raw acoustic features. This suggests that the PTN approach is more robust against noise than the conventional acoustic RNN approach.

Phonetic Temporal Neural Model for Language Identification	Deep neural models, particularly the LSTM-RNN model, have shown great potential for language identification (LID). However, the use of phonetic information has been largely overlooked by most existing neural LID methods, although this information has been used very successfully in conventional phonetic LID systems. We present a phonetic temporal neural model for LID, which is an LSTM-RNN LID system that accepts phonetic features produced by a phone-discriminative DNN as the input, rather than raw acoustic features. This new model is similar to traditional phonetic LID methods, but the phonetic knowledge here is much richer: it is at the frame level and involves compacted information of all phones. Our experiments conducted on the Babel database and the AP16-OLR database demonstrate that the temporal phonetic neural approach is very effective, and significantly outperforms existing acoustic neural models. It also outperforms the conventional i-vector approach on short utterances and in noisy conditions.

modeled pure prosodic features by GMMs and found that their system worked well on read speech, but could not deal with the complexity of spontaneous speech prosody. Muthusamy  used pitch variation, duration and syllable rate. Duration and pitch patterns were also used by Hazen  . In most cases, the prosodic information is used as additional knowledge to improve feature or token-based LID. Most of the above methods, no matter what information is used, heavily rely on probabilistic models to accumulate evidence from a long speech segment. For example, the PRLM method requires an n-gram probability of the phonetic sequence, and the GMM/i-vector method requires the distribution of the acoustic feature. Therefore, these approaches require long test utterances, leading to inevitable latency in the LID decision. This latency is a serious problem for many practical applications, e.g., code-switching ASR, where multiple languages may be contained within a single block of speech. For quick LID, frame-level decision is highly desirable, which therefore cannot rely on probabilistic models.

AP16-OLR: noise robustness	Finally, we test the hypothesis that the RNN system is more robust against noise. Firstly white noise is added to the AP16-OLR test set at different SNR levels, and the noise-augmented data are tested on two systems: the i-vector baseline and the best performing PTN system from Table 7 , i.e. with CH-TDNN-ASR as the phonetic DNN. The results of these two systems with different levels of white noise are shown in Table 8 . It can be seen that the PTN system is more noise-robust: with more noise corruption, the gap between the i-vector system and the PTN system becomes less significant, and the PTN system is better than the i-vector system in terms of $C_{avg}$ when the noise level is high (SNR=10). This can be observed more clearly in Fig. 6 , where the performance degradation rates compared to the noise-free condition are shown. The figure shows that when the noise increases, the performance degradation with the PTN system is less significant compared to the degradation with the i-vector system.

This means that the phonetic DNN can be learned with any speech data in any language. This property was identified in token-based LID  , however it is more important for the phonetic neural models, as training the phonetic DNN requires a large amount of speech data which is often not available for the target languages and the operating conditions under test. Moreover, it is also possible to train the phonetic DNN with multilingual, multi-conditional data  , resulting in robust and reliable phonetic feature extraction. In summary, the PTN approach utilizes a detailed phonetic representation (DNN phonetic feature), and a powerful temporal model (LSTM-RNN) to capture the phonetic temporal properties of a language with a high temporal resolution. It also utilizes three types of transfer learning to ensure that the phonetic feature is representative and robust. Our PTN approach is therefore very powerful and flexible, and reconfirms the belief of many LID researchers that phonetic temporal information is highly valuable in language discrimination, not only for humans but also for machines.

Both the PTN approach and the historical token-based approach share the same idea of utilizing phonetic information and modelling the temporal patterns, but they are fundamentally different. Firstly, the phonetic information in the PTN approach is frame-level, while in conventional token-based methods this information is unit-level. Therefore, the PTN approach can represent phonetic properties at a higher temporal resolution. Secondly, conventional token-based methods represent phonetic information as sequences derived from phone recognition, while the PTN approach represents phonetic information as a feature vector that involves information contributed by all phones, and thus more detailed phonetic information is represented. Finally, the back-end model of the conventional token-based approach is an n-gram LM based on discrete tokens and trained with the maximum likelihood (ML) criterion, while the back-end model of the PTN approach is an RNN, which functions similarly to an RNN LM, but is based on continuous phonetic features, and trained with a task-oriented criterion that discriminates the target languages. Transfer learning perspective: The second perspective to understand the PTN approach is from the transfer learning perspective  . It is well known that DNNs perform very well at learning task-oriented features from raw data.

Databases and configurations	The experiments were conducted on two databases: the Babel database and the AP16-OLR database. The Babel database was collected as part of the IARPA (Intelligence Advanced Research Projects Activity) Babel program, which aimed to develop speech technologies for low-resource languages. The sampling rate is 8 kHz and the sample size is 16 bits. In this paper, we chose speech data from seven languages in the Babel database: Assamese, Bengali, Cantonese, Georgian, Pashto Tagalog and Turkish. For each language, an official training and development dataset were provided. The training datasets contain both conversational and scripted speech, and the development datasets only contain conversational speech. We used the entire training set of each language for model training, but randomly selected $2,000$ utterances from the development set of each language to perform testing. The training data sets from the seven languages are as follows: Assamese 75 hours, Bengali 87 hours, Cantonese 175 hours, Georgian 64 hours, Pashto 111 hours, Tagalog 116 hours and Turkish 107 hours.

Note that in the multi-task RNN LID, the phonetic knowledge is used as an auxiliary task to assist the LID RNN training and has shown great benefits. The advantages of the phonetically aware system demonstrated that using the phonetic knowledge to produce phonetic features seems to be a better method than using the knowledge to directly assist model training. The phonetic DNN trained with Assamese and Georgian data (AG-TDNN-MLT) shows better performance than the one trained with the Switchboard dataset (SWB-TDNN-ASR). This is not surprising as Assamese and Georgian are the two languages chosen to discriminate between in the experiments presented in this section, so AG-TDNN-MLT is more consistent with this LID task. Nevertheless, it is still highly interesting to observe that clear benefits can be obtained by using phonetic features produced by SWB-TDNN-ASR, which is trained with a completely irrelevant dataset, in terms of both languages and environmental conditions. This confirmed our transfer learning perspective theory (as discussed previously), and demonstrated that phonetic features are largely portable and the phonetic DNN can be trained with any data in any languages.

This may be attributed to several reasons: (1) the Chinese database contains a larger volume of training data; (2) Chinese is one of the seven languages in AP16-OLR; (3) Chinese is more similar to the remaining 6 target languages in comparison to English, as most of the languages in AP16-OLR are oriental languages. Another observation is that the i-vector system outperforms the phonetic RNN systems in the AP16-OLR experiment, which is inconsistent with the observations in the Babel experiment, where both the phonetic systems, significantly outperform the i-vector system. This discrepancy can be attributed to the different data profiles of the two databases, with two possible key factors: (1) the utterances of AP16-OLR are longer than Babel, making the i-vector system more effective; (2) the speech signals of AP16-OLR are cleaner than those of Babel. The RNN system is more robust against noise, and this advantage is less prominent with clean data. We will examine the two conjectures in the following experiments.

LID approaches	Based on the different types of cues, multiple LID approaches have been proposed. Early work generally focused on feature-level cues. Feature-based methods use strong statistical models built on raw acoustic features to make the LID decision. For instance, Cimarusti used LPC features  , and Foil et al.  investigated formant features. Dynamic features that involve temporal information were also demonstrated to be effective  . The statistical models used include Gaussian mixture models (GMMs)  ,  , hidden Markov models (HMMs)  ,  , neural networks (NNs)  ,  , and support vector machines (SVMs)  . More recently, a low-rank GMM model known as the i-vector model was proposed and achieved significant success  ,  . This model constrains the mean vectors of the GMM components in a low-dimensional space to improve the statistical strength for model training, and uses a task-oriented discriminative model (e.g., linear discriminative analysis, LDA) to improve the decision quality at run-time, leading to improved LID performance.

Babel: phonetically aware bilingual LID	The phonetically aware architecture uses phonetic features as auxiliary information to improve the RNN LID. We experimented with various architectures for the phonetic DNN, and found that the TDNN structure is a good choice. In this experiment, the TDNN structure is composed of 6 time-delay layers, with each followed by a p-norm layer that reduces the dimensionality of the activation from $2,048$ to 256, the same dimension as the recurrent layer of the LID LSTM-RNN. The activations of the last hidden layer in the TDNN are read out as the phonetic feature. Two TDNN models are trained. The AG-TDNN-MLT model is a multi-task model trained with the Assamese and Georgian data, and there are two groups of output targets, phone labels and language labels. The ASR performance (WER) of the AG-TDNN-MLT model is $66.4\%$ and $64.2\%$ for Assamese and Georgian respectively. The SWB-TDNN-ASR model is an ASR model trained with the Switchboard database.

Phonetic neural modelling for LID	In this section, we present the models that employ phonetic information for RNN LID. Although the phonetically aware approach treats phonetic information as auxiliary knowledge, the PTN approach uses phonetic information as the only input into the RNN LID system. Both are depicted in Fig. 1 .

Phonetically aware neural LID	In the phonetically aware model, the phonetic feature is read from the phonetic DNN and is propagated to the LID RNN as additional information to assist the acoustic neural LID. The phonetic feature can be read either from the output (phone posterior) or the last hidden layer (logits), and can be propagated to different components of the RNN LID model, e.g., the input/forget/output gates and/or the non-linear activation functions. Fig. 3 (a) illustrates a simple configuration, where the phonetic DNN is a TDNN model, and the feature is read from the last hidden layer. The phonetic feature is propagated to the non-linear function $g(\cdot )$ .

The initial step is therefore feature combination, with the phonetic feature used as auxiliary information to assist acoustic RNN LID. This is improved further, as additional research identified that a simpler model using only the phonetic feature as the RNN LID input provides even better performance. We call this RNN model based on phonetic features the phonetic temporal neural LID approach, or PTN LID. As well as having a simplified model structure, the PTN offers deeper insight into the LID task by rediscovering the value of the phonetic temporal property in language discrimination. This property was historically widely and successfully applied in token-based approaches, e.g., PRLM  , but has been largely overlooked due to the popularity of the i-vector approach. Table 1 summarizes different systems that use deep neural models in LID. The probabilistic approach uses DNNs as part of a probabilistic system, e.g., GMM or i-vector, while the neural approach uses various types of DNNs as the decision architecture. Both approaches may use either acoustic features or phonetic features. The proposed PTN approach is at the bottom-right of the table.

AP16-OLR: PTN on seven languages 	In this section, we test the phonetic RNN LID approach on the AP16-OLR database. Compared to the Babel database, the speech signals in AP16-OLR are broadband (sampling rate of 16k Hz), and the acoustic environment is less noisy. Additionally, the speech data of each language is much more limited (10 hours per language), so we assume that training a phonetic DNN model is not feasible with the data of the target languages. We therefore utilize transfer learning, i.e., using phonetic DNNs trained on data in other languages. All the test conditions are the same as in the 7 language Babel experiment. We trained two phonetic DNNs: one is a TDNN model of the same size as the AG-TDNN-ASR model in Section "Babel: phonetically aware bilingual LID" , but trained on the WSJ database, denoted by `WSJ-TDNN-ASR'.

Due to the short-time property of the features, most feature-based methods model the distributional characters rather than the temporal characters of speech signals. The token-based approach is based on the characters of high-level tokens. Since the dynamic properties of adjacent tokens are more stable than adjacent raw features, temporal characters can be learned with the token-based approach, in additional to the distributional characters. A typical approach is to convert speech signals into phone sequences, and then build an n-gram language model (LM) for each target language to evaluate the confidence that the input speech matches that language. This is the famous phone recognition and language modelling (PRLM) approach. Multiple PRLM variants have been proposed, such as parallel phone recognition followed by LM (PPRLM)  ,  , and phone recognition on a multilingual phone set  . Other tokens such as syllables  and words  ,  have also been investigated. The prosody-based approach utilizes patterns of duration, pitch, and stress to discriminate between languages. For example, Foil et al.  studied formant and prosodic features and found formant features to be more discriminative. Rouas et al.

The average duration (including silence) of all the $12,939$ test utterances of the seven languages is $4.74$ seconds, ranging from $1.08$ seconds to $18.06$ seconds. The phonetic DNN is a TDNN structure, and the LID model is based on the LSTM-RNN. The raw feature used for those models consists of 23-dimensional Fbanks, with a symmetric 2-frame window for RNN and a symmetric 4-frame window for TDNN to splice neighboring frames. All the experiments were conducted with Kaldi  . The default configurations of the Kaldi WSJ s5 nnet3 recipe were used to train the phonetic DNN and the LID RNN. We first report experiments based on the Babel database, and then experiments with the AP16-OLR database.

LSTM-RNN LID	The LSTM-RNN model used in this study is a one-layer RNN model, where the hidden units are LSTM. The structure proposed by Sak et al.  is used, as shown in Fig. 2 . The associated computation is given as follows:  $$i_t &=& \sigma (W_{ix}x_{t} + W_{ir}r_{t-1} + W_{ic}c_{t-1} + b_i) \nonumber \\
f_t &=& \sigma (W_{fx}x_{t} + W_{fr}r_{t-1} + W_{fc}c_{t-1} + b_f) \nonumber \\
c_t &=& f_t \odot c_{t-1} + i_t \odot g(W_{cx}x_t + W_{cr}r_{t-1} + b_c) \nonumber \\
o_t &=& \sigma (W_{ox}x_t + W_{or}r_{t-1} + W_{oc}c_t + b_o) \nonumber \\

It should be noted that DNNs have been used in other ways in LID. For example, Song et al.  used a DNN to extract phonetic feature for the i-vector system, and Ferrer et al.  proposed a DNN i-vector approach that uses posteriors produced by a phone-discriminative FFDNN to compute the Baum-Welch statistics. Tian et al.  extended this by using an RNN to produce the posteriors. These methods all use neural models as part of the system, but their basic framework is still probabilistic, so they share the same problem of decision latency. In this paper, we focus on the pure neural approach that uses neural models as the basic framework, so that short-time language information can be learned by frame-level discriminative training.

Babel: PTN for bilingual LID	In the above experiments, the phonetic feature is used as auxiliary information. Here, we evaluate the PTN architecture where the phonetic feature entirely replaces the acoustic features (Fbanks). The experiment is conducted with two phonetic DNN models: AG-TDNN-MLT and SWB-TDNN-ASR. The results are presented in Table 4 . We first observe that the PTN systems perform as well as the best phonetically aware system in Table 3 , and even better in terms of the utterance-level EER. For better comparison, we also test the special case of the phonetically aware RNN LID (Ph. Aware), where both the phonetic and acoustic features are used as the LID RNN input (Ph+Fb). This is the same as the PTN model, but involves additional acoustic features. The results are shown in the second group of Table 4 . It can be seen that this feature combination does not provide any notable improvement to the results. This means that the phonetic feature is sufficient to represent the distinctiveness of each language, in accordance with our argument that language characters are mostly phonetic.

$b$4 is the logistic sigmoid function, and $b$5 and $b$6 are non-linear activation functions, chosen to be hyperbolic. $b$7 denotes element-wise multiplication. In this study, the LSTM layer consists of $1,024$ cells, and the dimensionality of both the recurrent and non-recurrent projections is set to 256. The natural stochastic gradient descent (NSGD) algorithm  was employed to train the model. During the training and decoding, the cells were reset for each 20 frames to ensure only short-time patterns are learned.

Phonetic temporal neural (PTN) LID	The phonetically aware acoustic RNN model is an acoustic-based approach, with the phonetic feature used as auxiliary information. In contrast, the PTN approach assumes that the phonetic temporal properties cover most of the information for language discrimination, so the acoustic feature is not important any more. Therefore, it removes all acoustic features and uses the phonetic features as the only input of the LID RNN, as shown in Fig. 3 (b). It is interesting to compare the PTN approach with other LID approaches. Firstly, it can be regarded as a new version of the conventional PRLM approach, particularly the recent PRLM implementation using RNN as the LM  . The major difference is that the PTN approach uses frame-level phonetic features while the PRLM approach uses token-level phonetic sequences; in addition, the phonetic information in the PTN approach is much richer than for PRLM, as it is represented as a continuous phonetic vector rather than discrete phonetic symbols.

Motivation of the paper	All the present neural LID methods are based on acoustic features, e.g., Mel filter banks (Fbanks) or Mel frequency cepstral coefficients (MFCCs), with phonetic information largely overlooked. This may have significantly hindered the performance of neural LID. Intuitively, it is a long-standing hypothesis that languages can be discriminated between by phonetic properties, either distributional or temporal; additionally, phonetic features represent information at a higher level than acoustic features, and so are more invariant with respect to noise and channels. Pragmatically, it has been demonstrated that phonetic information, either in the form of phone sequences, phone posteriors, or phonetic bottleneck features, can significantly improve LID accuracy in both the conventional PRLM approach  and the more modern i-vector system  ,  ,  . In this paper, we will investigate the utilization of phonetic information to improve neural LID. The basic concept is to use a phone-discriminative model to produce frame-level phonetic features, and then use these features to enhance RNN LID systems that were originally built with raw acoustic features.

m_t &=& o_t \odot h(c_t) \nonumber \\
r_t &=& W_{rm} m_t \nonumber \\
p_t &=& W_{pm} m_t \nonumber \\
y_t &=& W_{yr}r_t + W_{yp}p_t + b_y \nonumber $$   (Eq. 13)  In the above equations, the $W$ terms denote weight matrices, and those associated with the cells were constrained to be diagonal in our implementation. The $b$ terms denote bias vectors. $x_t$ and $y_t$ are the input and output symbols respectively; $i_t$ , $f_t$ , $o_t$ represent the input, forget and output gates, respectively; $c_t$ is the cell and $m_t$ is the cell output. $r_t$ and $b$0 are two output components derived from $b$1 , where $b$2 is recurrent and fed to the next time step, while $b$3 is not recurrent and contributes to the present output only.

With this configuration, calculation of the LID RNN is similar, except that the cell value should be updated as follows: $
c_t = f_t \odot c_{t-1} + i_t \odot g(W_{cx}x_t + W_{cr}r_{t-1} + \underline{W^{\prime }_{c\phi }\phi _{t}} + b_c)
$  where $\phi _t$ is the phonetic feature obtained from the phonetic DNN.

As the Babel speech data is much more noisy than the AP16-OLR speech, this noise robustness with the PTN approach partly explains why the relative performance is inconsistent between the two databases.

The average duration of the test utterances is $4.15$ seconds, ranging from $0.19$ seconds to $30.85$ seconds. The AP16-OL7 database was originally created by Speechocean Inc., targeted towards various speech processing tasks (mainly speech recognition), and was used as the official data for the AP16-OLR LID challenge. The database contains seven datasets, each in a particular language. These are: Mandarin, Cantonese, Indonesian, Japanese, Russian, Korean and Vietnamese. The data volume for each language is approximately 10 hours of speech signals recorded by 24 speakers (12 males and 12 females), with each speaker recording approximately 300 utterances in reading style by mobile phones, with a sampling rate of 16kHz and a sample size of 16 bits. Each dataset was split into a training set consisting of 18 speakers, and a test set consisting of 6 speakers. For Mandarin, Cantonese, Vietnamese and Indonesian, the recording was conducted in a quiet environment. For Russian, Korean and Japanese, there are 2 recording conditions for each speaker, quiet and noisy.

This observation is particularly interesting for LID tasks on low-resource languages, as the phonetic DNN can be trained with data from any rich-resource languages.

These results indicate that the improvement with the PTN architecture is mainly due to the phonetic information it has learned from the ASR-oriented training (sometimes by multi-task learning), rather than the deep network structure. In other words, it is the transfer learning instead of deep learning that improves LID performance with the PTN architecture.

However, phonetic DNNs trained with data in foreign languages and in mismatched environment conditions (e.g., SWB-TDNN-ASR) still work well.

AP16-OLR: utterance duration effect	To show the relative advantage of the RNN and the i-vector systems on utterances of different length, we select the utterances of at least 5 seconds from the AP16-OLR test set, and create 10 test sets by dividing them into small utterances of different durations, from $0.5$ seconds to 5 seconds, in steps of $0.5$ seconds. Each group contains $5,907$ utterances, and each utterance in a group is a random segment excerpted from the original utterance. The performance of the i-vector and PTN systems on the 10 test sets are shown in Fig. 4 , in terms of $C_{avg}$ and EER respectively. It is clear that the PTN system is more effective on short utterances, and if the utterance duration is more than 3 seconds, the i-vector system is the best performer, especially in terms of EER. The duration distribution of the test utterances of the Babel database and the AP16-OLR database are shown in Fig. 5 .

The tokens can be phones/phonemes, syllables, words or even syntactic or semantic tags. At the prosody level, the duration, pitch and stress patterns often differ between languages. For example, patterns of stress can provide an important cue for discriminating between two stressed languages, duration can also be potentially useful, and the tone patterns of syllables or words offer a clear cue to discriminate between tonal languages.

Subjects were presented with unaltered speech samples, samples with randomly altered syllables, and samples with the vocal-tract information removed to leave only the F0 and amplitude. Navratil found that the speech samples with random syllables are more difficult to identify compared to the original samples (73.9% vs 96%), and removing vocal-tract information leads to significant performance reduction (73.9% vs 49.4%). This means that with this 5-language LID task, the lexical and phonotactic information is important for human decision making. The LID experiments summarised above suggest that languages can be discriminated by multiple cues at different levels, and the cues used to differentiate different language pairs are different. In general, the cues can be categorized into three levels: feature level, token level and prosody level. At the feature level, different languages have their own implementation of phones, and the transitions between phones are also different. This acoustic speciality is a short-time property and can be identified by certain spectral analysis and feature extraction of our auditory system. At the token level, the distribution and transition patterns of linguistic tokens at various levels are significantly different.

Cues for language identification	There are more than 5000 languages in the world, and each language has distinct properties at different levels, from acoustic to semantics  ,  ,  . A number of studies have investigated how humans use these properties as cues to distinguish between languages  . For example, Muthusamy  found that familiarity with a language is an important factor affecting LID accuracy, and that longer speech samples are easier to identify. Moreover, people can easily tell what cues they use for identification, including phonemic inventory, word usage, and prosody. More thorough investigations were conducted by others by modifying speech samples to promote one or several factors. For example, Mori et al.  found that people are able to identify Japanese and English fairly reliably even when phone information is reduced. They argued that other non-linguistic cues such as intensity and pitch were used to decide the language. Navratil  evaluated the importance of various types of knowledge, including lexical, phonotactic and prosodic, by asking humans to identify five languages, Chinese, English, French, German and Japanese.

It is clear that the test utterances are generally longer in AP16-OLR than in Babel. This explains why the relative performance of the i-vector system and the RNN system is inconsistent between the two databases.

Introduction	Language identification (LID) lends itself to a wide range of applications, such as mixed-lingual (code-switching) speech recognition. Humans use many cues to discriminate languages, and better accuracy can be achieved with the use of more cues. Various LID approaches have been developed, based on different types of cues.

Question: Which is the baseline model?
Answer: The three baseline models are the i-vector model, a standard RNN LID system and a multi-task RNN LID system.