# Fuzzy Echo State Network-Based Fault Diagnosis of Remote-Controlled Robotic Arms
## 3 Deep Fuzzy Echo State Networks for Fault Classification
### A Fuzzy ESN  
The ESN achieves fast training and inference speeds when handling small-scale datasets, which is crucial for online fault diagnosis. Original input data often contain anomalies or noise, which can impede subsequent feature extraction processes of ESN. To distinguish between principal signals and background noise, and to reveal the intrinsic distribution characteristics of the data, fuzzy clustering is introduced prior to feature extraction. The cluster centers were obtained using the Fuzzy C-Means clustering method [34]. Assuming that the input samples comprise \(q\) categories, the optimal cluster centers are iteratively obtained by minimizing the objective function as  
\[J_{m}=\sum_{i=1}^{N}\sum_{j=1}^{q}\eta_{ij}^{m}\big{\|}u(t)-c_{j}\big{\|}^{2} \tag{4}\]  
where \(N\) denotes the number of data points, \(m\) represents the fuzziness exponent, which in this paper is set to 2 [29], \(u(t)\in R^{N}\) is the \(i\)-th input data point, and \(c_{j}\) stands for the center of the \(j\)-th cluster, which is computed as follows:  
\[c_{j}=\frac{\sum_{i=1}^{N}\eta_{ij}^{2}u(t)}{\sum_{i=1}^{N}\eta_{ij}^{2}} \tag{5}\]  
Moreover, \(\eta_{ij}\) denotes the degree of membership of \(u(t)\) in the \(j\)-th cluster, calculated as follows:  
\[\eta_{ij}=\frac{1}{\sum_{k=1}^{q}\left(\frac{\big{\|}u(t)-c_{j}\big{\|}}{u(t) -c_{k}\big{\|}}\right)^{2}} \tag{6}\]  
By iteratively updating the membership values \(\eta_{ij}\) and cluster centers \(c_{j}\), the objective function \(J_{m}\) is minimized to find the optimal cluster centers. First, initialize the membership matrix \(U\) with random values such that the sum of the membership values for each data point is 1:  
\[\sum_{j=1}^{q}\eta_{ij}=1 \tag{7}\]  
Then, calculate the cluster centers \(c\) with \(\eta\) based on Equation (5). Next, update the membership values \(\eta_{ij}\) using the newly computed cluster centers \(c_{j}\) based on Equation (6). Repeat the calculation of cluster centers \(c_{j}\) and the update of membership values \(\eta_{ij}\) until the changes in the membership values between iterations are below a predefined threshold, indicating convergence:  
\[\left\|U^{(t+1)}-\ U^{(t)}\right\|<\varepsilon \tag{8}\]  
where \(U^{(t)}\) is the membership matrix at iteration \(t\), and \(\varepsilon\) is a small positive number. The fuzzy ESN structure is shown in Figure 2. The architecture of the Fuzzy-ESN consists of three parts: the input layer, the reservoir layer, and the output layer. The original data \(u(t)\) undergo processing in the reservoir layer to extract its intrinsic distribution characteristics. The reservoir layer serves as a fixed, large-scale recurrent neural network that transforms the input data into a high-dimensional dynamic state space, capturing complex temporal patterns for subsequent analysis. In an ESN, the weights of the reservoir layer \(W_{2}\) play a crucial role in determining the network dynamic behavior and its ability to capture and process temporal patterns in the input data, as follows:  
\[W_{2}=\gamma\cdot\frac{W}{\rho(W)} \tag{9}\]  
where \(W\in\mathbb{R}^{N_{res}\times N_{res}}\) is a sparse matrix with its non-zero elements following a normal distribution. \(N_{res}\) is the dimensionality of the reservoir. \(\rho(W)\) denotes the spectral radius of the matrix \(W\), which is the largest absolute value among the eigenvalues of \(W\). The spectral radius is a critical factor in the context of ESN as it influences the memory capacity and stability of the network, and it is generally smaller than 1. \(\gamma\) is a scaling factor that is used to adjust the influence of the spectral radius on the network's dynamics. It is a predefined constant, typically smaller than 1. As for the input weight matrix of the reservoir \(W_{1}\), they are a randomly generated matrix following a standard normal distribution and are densely connected.