# Deep Learning-Based Template Matching Spike Classification for Extracellular Recordings
## 3 Results  
We tested our model and compared the results with the presented contemporary models on both the single channel simulation datasets and the in-vivo dataset. When recording from a single electrode, signals from multiple neurons are detected. These neurons fire independently, and more than one neural signal types may be recorded at the same time resulting in overlapping signals. Such overlapping signals are considered either as outliers or more challenging data to classify. Table 1 shows the tested classification results as the ratio between the correctly classified spikes and the total number of spikes with and without overlapping spikes on Simulation dataset 1. Our method gives high accuracy overall in both cases where overlapping spikes are included and excluded. There exist few cases where our model scored sub-optimally on data with less than 10% noise. However, in all such cases, our model showed over 98% accuracy, and the difference between the best performing model was miniscule with less than 0.32%. On the contrary, for the Difficult data with high noise level, our model outperformed other methods consistently with noticeable gap. On Difficult 2 data with 20% noise, our model showed 71.15% accuracy on data without overlapping spikes and 51.55% accuracy on data with overlapping spikes. These results when compared to the second-best performing correlation-based template matching are 3.4% and 18.31% higher and compared to the lowest performing MSE-based template matching are 8.43% and 19.55% higher. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Data** & **Noise** & **Ours** & \begin{tabular}{c} **MSE-Based** \\ **Template Matching** \\ \end{tabular} & \
\begin{tabular}{c} **Correlation-Based** \\ **Template Matching** \\ \end{tabular} &
\begin{tabular}{c} **PCA + K-Means** \\ **Clustering** \\ \end{tabular} \\ \hline Easy1 & 0.05 & 100 (99.26) & 100 (99.30) & 100 (99.14) & 100 (99.40) \\  & 0.1 & 100 (99.43) & 100 (95.51) & 100 (99.34) & 100 (99.65) \\  & 0.15 & 100 (99.25) & 100 (99.11) & 100 (99.10) & 100 (99.48) \\  & 0.2 & 100 (99.19) & 100 (99.00) & 99.88 (98.76) & 100 (99.51) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Classification result for the simulation dataset 1 with and without overlapping spikes. The numbers in parenthesis correspond to the results on data with overlapping spikes. Figure 3 shows classification results on simulation dataset 2. Overall, even in cases of varying cluster count and noise levels, our model showed high classification accuracy. In cases where noise did not exist, MSE-based template matching method and our proposed method both showed best performance independent of cluster count. However, with the addition of noise, the accuracy of the compared methods began to drop. When cluster count was 2, all models showed high classification accuracy of above 99.8% with the addition of 10% noise. But with the addition of 20% noise, MSE-based template matching, correlation-based template matching, and PCA + K-means dropped in accuracy by 5.21%, 6.68%, and 1.7%, respectively. The proposed method showed drop of mere 0.29% in accuracy. When cluster count was 3, addition of 10% noise resulted in accuracy drop of 6.36%, 6.54%, and 2.28% for MSE-based template matching, correlation-based template matching, and PCA + K-means. The addition of 20% noise resulted in additional accuracy drop of 13.37%, 16.37%, and 5.87% for MSE-based template matching, correlation-based template matching, and PCA + K-means. The proposed method dropped in accuracy by 1.6% for the addition of 10% noise and 1.61% for the addition of 20% noise. When cluster count was 4, overall performance dropped with the accuracy of 96.70%, 95.73%, 94.45%, and 91.78% for the proposed model, MSE, correlation, and PCA + K-means, respectively. It showed accuracy drop of 2.51%, 3.79%, 7.67%, 2.95% with 10% noise and additional drop of 7.94%, 24.96%, 24.06%, 15.83% with 20% noise. When cluster count was 5, it showed accuracy drop of 8.47%, 14.91%, 15.97%, 20.15% with 10% noise.