## 2 Materials and Methods
### Evolution Process
It processes three neural networks, denoted as \(p_{1}\), \(p_{2}\), and \(p_{3}\), along with an integer parameter numEdges, which represents the total number of edges in the network. ```
1:procedure\(\textsc{gendc\_operator}(p1,p2,p3,numEdges)\)
2:\(mods=\lfloor numEdges\times 0.05\rceil\)
3:for\(j=0\) to \(mods-1\)do
4:\(HL=\mathrm{rand}(0,\mathrm{length}(p1[0].\mathit{hidL})-1)\)
5:\(N=\mathrm{rand}(0,\mathrm{length}(p1[0].\mathit{hidL}[HL].\mathit{neurons})-1)\)
6:\(w_{m}=\mathrm{rand}(0,\mathrm{length}(p1[0].\mathit{hidL}[HL].\mathit{neurons}[N]. \mathit{weights})-1)\)
7:\(w_{p1}=p1[0].\mathit{hidL}[HL].\mathit{neurons}[N].\mathit{weights}[w_{m}]\)
8:\(w_{p2}=p2[0].\mathit{hidL}[HL].\mathit{neurons}[N].\mathit{weights}[w_{m}]\)
9:\(w_{\mathrm{Temp}}=(w_{p1}-w_{p2})\times v\)
10:\(p=\mathrm{rand}(0,1)\)
11:if\(p\leq\mathit{father}_{\mathit{probability}}\)then
12:\(w_{\mathit{mod}}=p3.\mathit{hidL}[HL].\mathit{neurons}[N].\mathit{weights}[w_{m}]\)
13:\(w_{\mathit{Temp}}=w_{\mathrm{Temp}}+w_{\mathit{mod}}\)
14:\(p3.\mathit{hidL}[HL].\mathit{innov}=p3.\mathit{hidL}[HL].\mathit{innov}+1\)
15:\(p3.\mathit{hidL}[HL].\mathit{neurons}[N].\mathit{innov}=p3.\mathit{hidL}[HL]. \mathit{neurons}[N].\mathit{innov}+1\)
16:\(p3.\mathit{hidL}[HL].\mathit{neurons}[N].\mathit{lastW}=w_{\mathit{mod}}\)
17:\(p3.\mathit{hidL}[HL].\mathit{neurons}[N].\mathit{weights}[w_{m}]=w_{\mathrm{Temp}}\)
18:else
19:\(p3.\mathit{hidL}[HL].\mathit{innov}=p3.\mathit{hidL}[HL].\mathit{innov}+1\)
20:\(p3.\mathit{hidL}[HL].\mathit{neurons}[N].\mathit{innov}=p3.\mathit{hidL}[HL]. \mathit{neurons}[N].\mathit{innov}+1\)
21:\(p3.\mathit{hidL}[HL].\mathit{neurons}[N].\mathit{lastW}=p3.\mathit{hidL}[HL]. \mathit{neurons}[N].\mathit{weights}[w_{m}]\)
22:\(p3.\mathit{hidL}[HL].\mathit{neurons}[N].\mathit{weights}[w_{m}]=w_{\mathrm{Temp}}\)
23:endif
24:endfor
25:return\(p3\)
26:endprocedure
```  
**Algorithm 2** Differential Crossover Operator  
The number of modifications applied is computed as  
\[\mathrm{mods}=\lfloor\mathrm{numEdges}\times 0.05\rfloor \tag{3}\]  
The algorithm iterates for \(j=0,1,\ldots,\mathrm{mods}-1\), and, in each iteration, it performs the following steps. A hidden layer index HL is selected randomly, followed by a neuron index N within that layer and a weight index \(w_{m}\) from the neuron's weight vector. These indices define a specific weight to modify. The corresponding weights from \(p_{1}\) and \(p_{2}\) are retrieved:  
\[w_{p1}=p_{1}.\mathrm{hidL}[HL].\mathrm{neurons}[N].\mathrm{weights}[w_{m}] \tag{4}\]  
\[w_{p2}=p_{2}.\mathrm{hidL}[HL].\mathrm{neurons}[N].\mathrm{weights}[w_{m}] \tag{5}\]  
The new weight is computed as  
\[w_{\mathrm{Temp}}=(w_{p1}-w_{p2})\cdot v \tag{6}\]  
where \(v\) is a predefined scalar multiplier defined by experimentation. A probability value \(p\) is sampled from a uniform distribution in \([0,1]\). If \(p\leq\mathit{father}_{\mathit{probability}}\), which consists of the probability of selecting a third parent as a candidate to improve the solution as determined using Grid Search, where the final value selected was 0.30, a crossover occurs by incorporating a weight modification from \(p_{3}\):  
\[w_{\text{mod}}=p_{3}.\text{hidL}[HL].\text{neurons}[N].\text{weights}[w_{m}] \tag{7}\]  
The temporary weight is then updated:  
Figure 1:0  
In both cases, the algorithm updates the innovation counters:  
Figure 1:1  
Figure 1:2  
The last stored weight is also updated accordingly:  
Figure 1:3  
Finally, the modified weight is assigned:  
Figure 1:4  
Once the offspring are generated, the neural network's accuracy serves as the objective function for the next phase. The genetic algorithm (GA) used follows a structured approach to optimizing neural network configurations. An individual represents a neural network genotype, and each candidate solution consists of a structured list defining the number of neurons in each layer and their associated connection weights. The binary tournament technique was used as a selection operator, ensuring diversity while prioritizing high-performing individuals [33].