## 3 Laboratory Experiment
### Damage Detection
The averaged \(k\)-th element of the output vector \(\mathbf{y}\) for the \(i\)-th pattern, for the \(j\)-th neural network of the specified architecture, is defined as  
\[g_{k}^{i}=\frac{\sum_{j=1}^{30}{y_{k}^{i,j}}}{30}. \tag{5}\]  
Considering the standard deviation,  
\[\sigma_{k}^{i}=\sqrt{\frac{\sum_{j=1}^{30}{(y_{k}^{i,j}-\bar{y}_{k}^{i})}^{2}}{ 30}}, \tag{6}\]  
the set of \(k\)-th outputs for the \(i\)-th pattern without outliers \(B_{k}^{i}\) is specified as  
\[B_{k}^{i}=\{y_{k}^{i,j}\}\qquad\ for\qquad\ \ \ \ g_{k}^{i}-3\sigma_{k}^{i}\leq y_{k}^{i,j}\leq g_{k}^{i}+3 \sigma_{k}^{i}, \tag{7}\]  
and \(\hat{y}_{k}^{i}\) for the \(k\)-th element of the output vector for the \(i\)-th pattern can be calculated using the following formula:  
\[\hat{y}_{k}^{i}=\text{round}\left(\frac{\sum y_{k}^{i,j}\in B_{k}^{i}}{\overline {B_{k}^{i}}}\right), \tag{8}\]  
where \(\text{round}(\cdot)\) returns the nearest integer treated as the class of anomaly, and \(\overline{\overline{B_{k}^{i}}}\) is the number of elements in the \(B_{k}^{i}\) set. The correctness of the classification was checked according to  
\[CL(i)=\left\{ \begin{array}{ccc}1&for&\ \ \ \mathbf{\mathfrak{t}}^{i}-\mathbf{\mathfrak{y}}^{i }=\mathbf{0}\\ 0&for&\ \ \ \mathbf{\mathfrak{t}}^{i}-\mathbf{\mathfrak{y}}^{i}\
eq\mathbf{0}\end{array}  \right., \tag{9}\]  
where \(CL(i)\) is a proper classification coefficient. The number of neurons in the hidden layer (\(Hi\)) also varied. It was optimized every time to increase the success ratio of anomaly detection \(SR\):  
\[SR=\frac{\sum_{i=1}^{n}{CL(i)}}{n}\cdot 100\%\,. \tag{10}\]Obviously, \(SR\to 100\%\) means success, and \(SR\to 0\%\) means failure. Three types of network architecture, designed for solving the problem, are shown schematically in Figure 4. The attempt to detect the type of anomaly implied the application of ANN Type 1 (see Figure 4a). For the six-element input vector, the elements of which were affine transformation parameters, the information about the class of anomaly (specified by its number) was searched. The results of the architecture optimization process, presenting SR that was dependent on the number of hidden neurons for learning and testing sets are shown in Figure 5a. It is evident that the increase of hidden neurons above 12 did not cause an improvement of SR, which remained at a level of 87%. However, it was observed that the scattering of results for individual classes (see Figure 5b) is smaller for a greater number of hidden neurons. In order to improve the classification results, ANN Type 2 was used (see Figure 4b). On the basis of the same input vectors as used previously, networks provided the information about the appearance of loosening in each single row of bolts. The values of the elements of the four-element output vector determined the condition of bolts in four rows of the investigated connection, from the uppermost and ending at the lowest row. The results of optimization of the hidden neurons number, as well as the success ratio for ANNs of the architecture 6-35-4 are presented in Figure 6a. In this case also, the SR level is rather constant for \(Hi\geq 12\), but it is higher than before and equals 94%.