# Fuzzy Echo State Network-Based Fault Diagnosis of Remote-Controlled Robotic Arms
## 3 Deep Fuzzy Echo State Networks for Fault Classification
### Architecture of DFESN  
The aforementioned fuzzy ESN is a fundamental component of the DFESN illustrated in Figure 3. In the DFESN model, the original input signal passes through multiple fuzzy ESNs for feature extraction, ultimately being classified by a final ESN. Each stage of the DFESN plays a critical role in ensuring the robustness and accuracy of the model. Initially, fuzzy clustering is employed to reduce noise and manage uncertainty in the input data, providing a cleaner representation for further processing. The reservoir layer subsequently maps these inputs to a high-dimensional dynamic space, effectively capturing complex temporal patterns inherent in the data. State updates within the reservoir layer allow the model to maintain temporal dependencies over time, ensuring that relevant sequential information is preserved. The output layer is optimized using ridge regression, which helps minimize overfitting and enhances the overall classification performance. Finally, the softmax function is utilized to convert the output into probability distributions, enabling reliable classification. These components collectively contribute to the robustness of the DFESN in noisy environments and its capability to achieve accurate fault diagnosis.  
Figure 3: The architecture of the DFESN.  
The optimization of the final output weights \(W_{o}\), depicted in Figure 3, can be optimized through solving an optimization problem as  
\[W_{o}=\underset{W_{o}}{\text{argmin}}(\left\|W_{o}X-\left.v\right\|_{2}^{2}+ \lambda_{1}\right\|W_{o}\left\|_{2}^{2}\right) \tag{16}\]  
where \(v\in\mathbb{R}^{N\times q}\) is the label matrix, which can be defined as follows:  
\[v(t)=\begin{cases}1&if\quad u(t)\in j-thcluster\\ 0&else\end{cases} \tag{17}\]  
The solution to the optimization problem defined in Equation (16) is presented as follows:  
\[W_{o}=vX^{T}(XX^{T}+\lambda_{1}I)^{-1} \tag{18}\]  
Finally, during the testing, the output is obtained based on the model weights and classified using the Softmax function. The result calculated by the Softmax function represents the probability of the test samples being classified into a particular category. The establishment process of the DFESN model is shown in Algorithm 1.  
```
0: Input signal \(u(t)\), target classification \(y(t)\), categories \(c\), max iterative number \(o\), spectral radius \(\rho\), sparsity \(\mu\), and regularization coefficient \(\lambda\);
1:for\(i=1\)to\(o\)do
2: Calculate clustering results \(\text{h}(t)\) by using Formulas (5), (6), and (13);
3:endfor
4: Randomly generate the input weight matrix \(W_{1}\) as a densely connected matrix from a standard normal distribution;
5: Calculate the reservoir weight matrix \(W_{2}\) by using Formula (9);
6:for\(t=1\)to T do
7: Calculate the internal state \(x(t)\) by using Formula (10), and include \(x(t)\) in the state collection matrix \(X\);
8:endfor
9: Calculate the output weight matrix \(W_{3}\) by using Formula (14);
10: Randomly generate input weight matrix \(W_{in}\) in uniform distribution;
11: Calculate the reservoir weight matrix \(W_{res}\);
12:for\(t=1\)to T do
13: Calculate the internal state \(x(t)\) and include \(x(t)\) in the state collection matrix \(X\);
14:endfor
15: Calculate the output weight matrix \(W_{o}\) by using Formula (16);
16:
17:
18:Output weight matrix \(W_{o}\);
```  
**Algorithm 1** Training Algorithm of DFESN