## 4 Machine Learning to Identify Bat Calls
### Study of the Window Length to Use for Parameterizing the Data  
For both methodologies, the temporal size of the data for its parameterization has been studied. For its study, the testing files have been split in fragments of fixed length. The studied lengths were estimated by considering the overall duration distribution of the calls. After each of these splittings, a new dataset was created and the obtained data was used to train the prediction model. The length that achieved the best results was the one that was used. Table 3 presents the overall F1 score [57] obtained for the filter bank coefficients method and Table 4 for the spectrogram matrices parameterization. The data contained in the tables are plotted in Figures 12 and 13. To obtain both results, a 5-fold cross-validation has been computed. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & _Pipistrellus pipistrellus_ & _Pipistrellus pygmaeus_ & **Silence** \\ \hline
**Precision score** & 71.34\% & 76.28\% & 91.31\% \\ \hline
**Recall score** & 76.97\% & 72.10\% & 89.05\% \\ \hline
**F1 score** & 74.05\% & 74.13\% & 90.17\% \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Results of the classification model using the spectrogram energy matrices. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Length of Window (ms)** & **F1 Score Pipistrellus pipistrellus** & **F1 Score Pipistrellus pygmaeus** & **F1 Score Silence** \\ \hline
1 & 57.75\% & 60.15\% & 76.60\% \\ \hline
3 & 62.30\% & 61.62\% & 76.58\% \\ \hline
5 & 65.38\% & 64.47\% & 76.84\% \\ \hline
7 & 67.43\% & 66.16\% & 77.10\% \\ \hline
9 & 68.18\% & 66.69\% & 76.65\% \\ \hline
11 & 68.09\% & 68.18\% & 76.91\% \\ \hline
13 & 68.14\% & 68.12\% & 76.94\% \\ \hline
15 & 68.23\% & 70.97\% & 78.01\% \\ \hline
17 & 68.63\% & 69.77\% & 77.69\% \\ \hline
19 & 69.66\% & 70.83\% & 78.75\% \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Length of the temporal frames with which the data were parameterized and the obtained overall F1 score. Figure 12: F1 score results of each window length obtained with the filter bank parameterization and the Feedforward Neural Network (FNN). Figure 13: F1 score results of each matrix time length obtained with the spectrogram matrices parameterizations a Convolutional Neural Network (CNN). \begin{table}
\begin{tabular}{c c c} \hline \hline
**Length of Generated Matrix (ms)** & **F1 Score** _Pipistrellus_ _pipistrellus_ & **F1 Score** _Pipistrellus_ _pygmaus_ \\ \hline
10 & 61.14\% & 71.85\% \\ \hline
20 & 78.30\% & 79.95\% \\ \hline
30 & 79.87\% & 79.80\% \\ \hline
40 & 79.80\% & 81.25\% \\ \hline
50 & 81.37\% & 82.62\% \\ \hline
60 & 78.28\% & 79.97\% \\ \hline
70 & 61.14\% & 71.85\% \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Table of the length of the matrices with which the data was parameterized and their overall F1 score. In Figure 12, the F1 scores of the different window lengths are drawn. On the one hand, silent fragments do not suffer any severe variation through all the studied window lengths. On the other hand, bat calls do not achieve good prediction results when being parameterized using short window lengths. The low performance when using short frames indicates that the model can not obtain enough information from those data to make accurate predictions. Until the 7 ms window, the bigger the length of the window, the better the performance. Afterwards, results are stabilized, remaining roughly constant although the window expands. From the results obtained, we see that the model's learning rate decreases after the 7 ms window length. For that reason, it has been decided to select the 7 ms window as the one to use. In the case of Figure 13, there is a performance improvement at shorter matrices and a deterioration at longer ones. The usage of short matrices does not give enough information to the network to enable it to accurately predict the specie. That could be because the full pulse is not long enough to fit into a short length matrix and just one part of it is analyzed.