# Fuzzy Echo State Network-Based Fault Diagnosis of Remote-Controlled Robotic Arms
## 3 Deep Fuzzy Echo State Networks for Fault Classification
### CMA-ES-Based Hyperparameter Optimization  
The covariance matrix adaptation evolution strategy (CMA-ES) is used to iteratively search for the best combination of these hyperparameters by minimizing the model's validation error [28]. In each generation, multiple sets of hyperparameters are sampled, and the DFESN model is trained and evaluated for each set. The covariance matrix adaptation helps to efficiently explore the hyperparameter space by adjusting the sampling distribution based on the performance of previous generations. In this study, we employ the CMA-ES to optimize several critical hyperparameters of the DFESN used for fault diagnosis, which include the reservoir size (\(N_{res}\)), spectral radius (\(\rho\)), sparsity parameter (\(\mu\)), and the number of fuzzy clusters (\(c\)). The complexity of optimizing multiple hyperparameters lies in the high-dimensional and potentially non-convex nature of the search space. The primary advantage of using CMA-ES in this context is its ability to efficiently handle the high-dimensional optimization problem without requiring gradient information. CMA-ES iteratively adapts the covariance matrix of the sampling distribution, allowing it to effectively explore the search space and converge to an optimal solution even in complex, multimodal landscapes. This capability makes CMA-ES particularly suitable for optimizing the diverse set of hyperparameters in DFESN, ensuring that the network can achieve a balanced trade-off between expressiveness, stability, and computational efficiency. The objective of the CMA-ES optimization is to minimize the classification error of the DFESN, which is measured by the Mean Squared Error (MSE) between the predicted output \(\hat{y}(t)\) and the true output \(y(t)\). The objective function \(J(\theta)\) is defined as follows:  
\[J(\theta)=\frac{1}{N}\underset{t=1}{\overset{N}{\sum}}\|y(t)-\hat{y}(t)\|^{2} \tag{19}\]  
where \(\theta=[N_{res},\rho,\mu,c]^{T}\) is the vector of hyperparameters being optimized, representing the reservoir size (\(N_{res}\)), spectral radius (\(\rho\)), sparsity parameter (\(\mu\)), and the number of fuzzy clusters (\(c\)). CMA-ES models the hyperparameters as a multivariate normal distribution, parameterized by a mean vector \(m^{(\delta)}\in\mathbb{R}^{d}\) and a covariance matrix \(C^{(\delta)}\in\mathbb{R}^{d\times d}\), where d is the number of hyperparameters to optimize. The algorithm iteratively updates these parameters to search for the optimal solution. At each generation \(g\), a population of \(\lambda\) candidate solutions \(x_{k}^{(g+1)}\) is generated by sampling from the multivariate normal distribution:  
\[x_{k}^{(g+1)}\sim\aleph(m^{(g)},{(\sigma^{(g)})}^{2}C^{(g)}) \tag{20}\]  
where \(\sigma^{(g)}\) is the global step size that controls the search radius. The candidate solutions are evaluated using the objective function \(J(\theta)\), and the best \(\mu^{\prime}\) individuals are selected to update the mean vector:  
\[m^{(g+1)}=\underset{i=1}{\overset{\mu^{\prime}}{\sum}}w_{i}x_{i:\lambda}^{(g +1)} \tag{21}\]  
where \(w_{i}\) are positive weights that sum to one, and \(x_{i:\lambda}\) represents the \(i\)-th best individual among the \(\lambda\) candidates. The covariance matrix \(C\) is updated to capture the spread and orientation of the successful search directions, thus influencing future sampling:  
\[C^{(g+1)}=(1-c_{1}-c_{\mu^{\prime}})C^{(g)}+c_{1}p_{c}^{(g+1)}(p_{c}^{(g+1)}) ^{T}+c_{\mu^{\prime}}\underset{i=1}{\overset{\mu^{\prime}}{\sum}}w_{i}( \frac{m^{(g+1)}-m^{(g)}}{\sigma^{(g)}})(\frac{m^{(g+1)}-m^{(g)}}{\sigma^{(g)}} )^{T} \tag{22}\]  
where \(p_{c}\) is the evolution path, which accumulates information about the successful search directions, \(c_{1}\) and \(c_{\mu^{\prime}}\) are some empirical parameters that are typically defined based on the dimension of the problem.