## 3 Proposed SNNtrainer3D
### Learning Algorithm  
It is essential to mention that the proposed application uses a backpropagation learning algorithm. This algorithm resembles STDP, as seen in the work in [27] and also proved by the authors in [47; 48; 49; 50]. Backpropagation in SNNs involves forward propagation of spikes and error backpropagation to adjust the network weights to minimize output loss. It treats the membrane potential as a differentiable activation and calculates the gradient of the loss function concerning the weights. The procedures for computing this derivative are complicated and computationally expensive. However, spike-based backpropagation has enabled end-to-end supervised training of deep SNNs and achieved state-of-the-art performance [51]. The downsides are that it can suffer from overfitting and unstable convergence and requires labeled data and extensive computational effort. In contrast, STDP is an unsupervised learning rule inspired by biological synaptic plasticity that adjusts weights based on the relative timing of pre-and post-synaptic spikes. A local learning rule strengthens the synaptic weight if the presynaptic neuron fires just before the postsynaptic neuron and weakens it if the order is reversed. While more biologically plausible, STDP alone achieves lower accuracy than supervised backpropagation, as it lacks global error guidance. However, it can be used to pre-train SNNs in an unsupervised manner. Interestingly, backpropagation in SNNs could engender STDP-like Hebbian learning [52]. In SNNs, the inner pre-activation value of a neuron fades over time until it reaches a firing threshold. During backpropagation, the gradient is mainly transferred to inputs fired just before the output as older signals decay. This resembles STDP, where a synapse is strengthened if the presynaptic neuron fires just before the postsynaptic neuron. Combining STDP-based unsupervised pre-training with supervised backpropagation fine-tuning has shown promise in improving the convergence, robustness, and accuracy of deep SNNs [51]. The standard backpropagation training procedure of computing the loss, backpropagating the gradients, and updating the weights to minimize the loss on the training data is as follows: the loss is calculated using a cross-entropy loss function. This supervised learning objective compares the network outputs to the true targets. Then, the gradients of  
Figure 8: Summarized view of the proposed SNNtrainer3D application and the technologies applied to each step. the loss concerning the network weights are computed, with the Adam optimizer updating the weights based on these gradients. Using mathematical equations, these three main steps regarding the backpropagation procedure are described below. Regarding the loss calculation (cross-entropy loss function), Equation (5) is used:  
\[L=-\sum_{c=1}^{M}y_{o,c}\log(p_{o,c}) \tag{5}\]  
where \(L\) represents the loss of one observation, \(y_{o,c}\) represents a binary indicator (0 or 1) of whether a class label \(c\) is the correct classification for observation \(o\), \(p_{o,c}\) represents the predicted probability that observation \(o\) is of class \(c\), and \(M\) represents the number of classes. Regarding the gradient computation, the gradient of the loss with respect to the weights can be calculated using the chain rule for derivatives in the context of a neural network. For a weight \(w\) in a layer \(l\), the gradient is typically the one seen in Equation (6):  
\[\frac{\partial L}{\partial w}=\frac{\partial L}{\partial a}\cdot\frac{\partial a }{\partial z}\cdot\frac{\partial z}{\partial w} \tag{6}\]  
where \(a\) represents the activation, \(z\) represents the weighted input to the activation function and \(\frac{\partial L}{\partial a}\) represents the gradient of the loss with respect to the activation. However, because SNNs are used, the training technique was adapted to the temporal dynamics of the spikes.