# Evolutionary Optimization of Spiking Neural P Systems for Remaining Useful Life Prediction
## 5 Numerical Results  
The aim of our experiments is to evaluate the SN P systems found with the proposed method described in Section 3 by comparing their results with those obtained by the methods described in Section 4.2. We evaluate our method in terms of prediction accuracy and computational simplicity. For the former, the comparison is mainly based on two metrics: the RMSE and the \(s\)-score [36] on the test set. For the latter, we use as proxy the number of trainable parameters and the execution time for the test. When we define the error between the predicted and target RUL as \(d_{i}=RUL_{i}^{predicted}-RUL_{i}^{target}\), the RMSE on the test set is given by:  
\[RMSE=\sqrt{\frac{1}{N}\sum_{i=1}^{N}d_{i}^{2}} \tag{4}\]  
where \(N\) is the total number of test samples fed into the model during the test. The \(s\)-score metric was proposed to differentiate between optimistic and pessimistic predictions by using an asymmetric function, and it is computed as follows: \begin{table}
\begin{tabular}{l c c c c c c c c c c c} \hline \hline  & \multicolumn{3}{c}{\(c\)} & \multicolumn{3}{c}{\(p\)} & \multicolumn{3}{c}{\(d\)} & \multicolumn{3}{c}{\(f\)} \\ \cline{2-11}  & **Mean** & **Std. Dev.** & **Max** & **Mean** & **Std. Dev.** & **Max** & **Mean** & **Std. Dev.** & **Max** & **Mean** & **Std. Dev.** & **Max** \\ \hline SNPS (1) & 100 & 100 & 500 & 100 & 100 & 500 & 10 & 10 & 100 & 1 & 2 & 200 \\ SNPS (2) & 100 & 1 & 200 & 100 & 100 & 200 & 1 & 1 & 10 & 1 & 2 & 200 \\ SNPS (3) & 100 & 1 & 200 & 100 & 1 & 200 & 1 & 1 & 10 & 1 & 2 & 200 \\ SNPS (4) & 5 & 2 & 500 & 5 & 2 & 500 & 1 & 1 & 10 & 1 & 2 & 200 \\ SNPS (5) & 5 & 2 & 500 & 5 & 2 & 500 & 1 & 1 & 10 & 1 & 1 & 5 \\ SNPS (6) & 5 & 2 & 10 & 5 & 2 & 10 & 1 & 1 & 10 & 5 & 2 & 10 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Mean, std. dev., and max. value for each evolved parameter in the tested NEAT configurations. \begin{table}
\begin{tabular}{l c l} \hline \hline
**Parameter** & **Value** & **Parameter** & **Value** \\ \hline Population size & 30 & Generations & 300 \\ Initialization weight & \(\sim\mathcal{N}(0,1)\) & Weight range & [\(-1\), \(1\)] \\ Mutation power & \(\sim\mathcal{N}(0,3)\) & Mutation rate & 0.2 \\ Replacement rate & 0.1 & Add connection rate & 0.5 \\ Remove connection rate & 0.5 & Add node rate & 0.5 \\ Remove node rate & 0.5 & Toggle “enable” rate & 0.1 \\ Max stagnation period & 20 & Hidden neurons & 10 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Parameters used for the NEAT algorithm. \[s\text{-score}=\sum_{i=1}^{N}\text{SF}_{i},\quad SF= \begin{cases}e^{-\frac{d_{i}}{ \text{th}}-1},&d_{i}<0\\ e^{\frac{d_{i}}{\text{th}}}-1,&d_{i}\geq 0\end{cases}  \tag{5}\]  
i.e., it assigns a larger value to optimistic RUL predictions w.r.t. pessimistic RUL ones. This reflects the risk of predicting an RUL value higher than the real one. It should be noted that we use the \(s\)-score solely for evaluating the methods on the test set; on the other hand, we perform the evolutionary optimization on the RMSE, since it provides more information from an optimization point of view w.r.t. the \(s\)-score. In fact, based on our previous work [16], networks optimized using the RMSE as fitness function provide better results in terms of both metrics compared to networks optimized based on the \(s\)-score. To obtain the number of trainable parameters in the SN P systems, we need to take into account all the connections between input and hidden neurons and between hidden and output neurons, as well as the four parameters for each neuron. Thus, the number of parameters in the SN P systems is \(l_{i}l_{h}+l_{h}l_{o}+4l_{h}+4l_{o}\), where \(l_{i}\), \(l_{h}\), and \(l_{o}\) denote the number of input, hidden, and output neurons, respectively. It should be noted that this is the worst-case count; in fact, a structure produced by NEAT may not be fully connected. In addition to the above count, we measure the execution time of each method on the test set; it is the elapsed time to compute the predicted RUL for \(N\) test samples.