# Part-Treatment Efficacy Prediction Using a CMA-ES-Based Dendritic Neuron Model
## 3 Methods
### Covariance Matrix Adaptation Evolution Strategy  
The backpropagation algorithm is the most widely used optimization algorithm but it easily falls into local convergence in the process of DNM optimization. To prevent premature convergence of the model optimization process, [PERSON] et al. attempted to optimize the dendritic neuron model using heuristic algorithms [29; 30; 35]. These heuristic algorithms can effectively help multivariate functions escape from local convergence. However, these heuristic algorithms are considered to lack interpretability. The CMA-ES is a powerful evolutionary algorithm and its optimization process can be interpreted as a form of natural gradient descent [36; 37]. In actual optimization problems, multivariate functions are often very complex and it is difficult to obtain the corresponding Hessian matrix. The CMA-ES adjusts the covariance matrix of the multivariate function to approximate the Hessian matrix of the multivariate function [38; 39]. The CMA-ES draws on the exploration and exploitation of the search strategy. Using the CMA-ES to optimize the DNM can effectively avoid local convergence. The key components of the CMA-ES are described below. _Optimization prerequisites_: The Hessian matrix is positive definite, and the fitness function has a minimal value. The covariance matrix and Hessian matrix are inverse matrices of each other. The CMA-ES obtains the minimal value by updating the covariance matrix, and each update of the covariance matrix must satisfy the matrix positive definite, i.e., the matrix eigenvalues \(\lambda_{max}/\lambda_{min}\geq 1\). _Candidate solution update_: The CMA-ES has \(\omega\) candidate solutions, where \(\omega=4+\lfloor 3\ln n\rfloor\) and \(n\) is the dimensionality of the solution vector. Each candidate solution \(\mathbf{\kappa}_{\lambda}\) is generated according to the corresponding multidimensional Gaussian distribution \(\mathbf{y}_{\lambda}\sim N(\mathbf{m},\mathbf{C})\). \(\mathbf{m}\) is the mean vector of \(\mathbf{y}_{\lambda}\). \(\mathbf{C}\) is the covariance matrix of \(\mathbf{y}_{\lambda}\), which determines the Gaussian distribution. Each candidate solution is updated, as shown in Equation (5). The calculations of \(\mathbf{C}\) and \(\sigma\) are described later. \[\mathbf{\kappa}_{\lambda}=\mathbf{m}+\sigma\mathbf{y}_{\lambda}\sim N(\mathbf{m}, \mathbf{C}) \tag{5}\]  
Then, all of the candidate solutions are evaluated using the fitness function. _Overall Gaussian distribution update_: To enable the fitness function to converge quickly, \(\mathbf{\kappa}_{\lambda}\) corresponding to \(\mathbf{y}_{\lambda}\) needs to be ranked, and those ranked after \(\mu\) need to be filtered out, where \(\mu=\omega/2\). A weight \(w^{\prime}_{i}\) is assigned to the remaining excellent Gaussian distribution. The top \(\mu\) weight \(w^{\prime}_{i}\) is normalized to \(w_{i}\). The overall Gaussian distribution \(<\mathbf{y}>_{w}\) is updated based on the top \(\mu\) excellent Gaussian distribution \(\mathbf{y}_{izw}\). The formula for calculating the weight \(w^{\prime}_{i}\) is shown in Equation (6) and the formula for calculating \(<\mathbf{y}>_{w}\) is shown in Equation (7). \[w^{\prime}_{i}=\frac{\ln(\lambda+1)}{2}-\ln i\;\;,\;\;i=1,2,\ldots,\mu \tag{6}\]  
Figure 4: The flow chart of training the DNM using the CMA-ES. \[<\mathbf{y}>_{w}=\sum_{i=1}^{\mu}w_{i}\mathbf{y}_{i:w}\ \,\ \ \text{ where }\sum_{i=1}^{\mu}w_{i}=1 \tag{7}\]  
_Covariance matrix update_: The covariance matrix \(\mathbf{C}\) update needs to combine the update history path of \(\mathbf{C}\), which is also called the covariance matrix evolution path \(\mathbf{P}_{c}\). The \(\mathbf{P}_{c}\) update needs to combine \(<\mathbf{y}>_{w}\). The evolution path \(\mathbf{P}_{c}\) is updated using Equation (8). The covariance matrix \(\mathbf{C}\) update requires a combined calculation of \(\mathbf{P}_{c}\) and \(\mathbf{y}_{i:w}\), which is calculated using Equation (9).