# Anomaly Detection of Wind Turbines Based on Deep Small-World Neural Network
## 3 Anomaly Detection Based on Adaptive Threshold Estimating Method  
In anomaly detection, the trained DSWNN model is used to predict the future values of the SCADA signals, and the prediction error (\(PE\)) between predicted value and actual value is used to judge the abnormalities. The \(PE\) is defined as Equation (14). \[PE=\frac{\left(\widehat{X}-X\right)}{X}\times 100\% \tag{14}\]  
where \(X\) is the actual value of SCADA data, and \(\widehat{X}\) is the output of the DSWNN model. Generally, setting a threshold and comparing it with the \(PE\) is the most common and effective way to evaluate whether the wind turbine is in failure. When a wind turbine operates normally, the SCADA signals are all within the threshold range. Once an abnormality occurs, the implicit relationship between these monitoring signals will be broken, and one or more signal values will suddenly exceed the threshold to give an alarm. The rule for determining the abnormal condition is defined as Equation (15):  
\[D=\left\{ \begin{array}{ll}1(alarm),&PE\geq R_{th}\\ 0(normal),&PE<R_{th}\end{array} \right. \tag{15}\]  
where \(R_{th}\) is the threshold. However, the thresholds are often set in a wide range and remain unchanged after one set. On the one hand, the faults within the threshold will not be diagnosed; on the other hand, some occasional fluctuations caused by the random wind speed will be misdiagnosed as faults. Therefore, this paper  
Figure 6: Three processes for training the proposed DSWNN model. presents an adaptive threshold estimating method on the basis of the extreme value theory to monitor the trend of \(PE\) and detect its anomaly variation. Suppose \(X_{1}\), \(X_{2}\),..., \(X_{n}\) are \(n\) sample vectors of independent and randomly distributed variables whose distribution function is \(F(x)\). Each sample vector of \(X_{i}\) contains a certain amount of values in a period of time. \(M_{n}=\max(X_{1}\), \(X_{2}\),..., \(X_{n})\) represents the maximum of the \(n\) sample vectors. For a set of \(M_{n}\), the probability distribution function can be described as Equation (16). \[P_{r}(M_{n}\leq x)=P_{r}(X_{1}\leq x,X_{2}\leq x,\ldots,X_{n}\leq x)=F^{n}(x),x\in R. \tag{16}\]  
In general, \(F^{n}(x)\) is unknown, so we need to replace the \(F^{n}(x)\) with the extreme distribution function of the maximum or minimum values. When \(n\rightarrow\infty\), \(F^{n}(x)\to 0\). We should normalize the extreme distribution function to avoid the degradation of \(M_{n}\) to a point. Assume that there are two normalization parameters \(a_{n}\) and \(b_{n}\) that satisfying the non-degenerate distribution function \(H(x)\)[29]. \[\lim_{n\rightarrow\infty}P_{r}\left\{\frac{M_{n}-b_{n}}{a_{n}}\leq x\right\} \to H(x),x\in R \tag{17}\]  
\[H(x)=\exp\left(-\left[1+\left(\frac{x-b_{n}}{a_{n}}\right)\right]^{-\frac{1}{ \beta}}\right)\left( \begin{array}{c}a_{n}>0,-\infty<b_{n}<\infty,\\ -\infty<\beta<\infty\end{array} \right) \tag{18}\]  
where, \(a_{n}\) and \(b_{n}\) are the scale parameter and the location parameter, respectively, \(\beta\) is the shape parameter. A large number of normal SCADA data are used to train the DSWNN model, and also be used to calculate the \(PE\) value. As the data are mostly normal, the mean value of \(PE\) will be stable, but their variance data should be non-stationary. Therefore, the scale parameter \(a_{n}\) and the location parameter \(b_{n}\) can be obtained as follows. \[a_{n}(t)=\exp(\delta_{0}+\delta_{t}g(t)) \tag{19}\]  
\[b_{n}(t)=\delta_{0} \tag{20}\]  
where \(\delta_{0}\) and \(\delta_{t}\) are the constant coefficients, \(g(t)\) is a function describing the variable operating condition, which is affected by the changing SCADA data. Then the final adaptive thresholds for determination of warning can be calculated by:  
\[R_{th}=b_{n}-\frac{a_{n}}{\beta}\left[1-\left[-\ln(1-p)\right]^{-\beta}\right] \tag{21}\]  
where, \(p\) is the confidence limit, which is calculated by the cumulative distribution function (CDF) method.