# Conveyor Belt Damage Detection with the Use of a Two-Layer Neural Network
## 3 Result and Discussion  
The neural network was trained with the use of a Deep Learning Toolbox set, in the MATLAB environment. The area set contains 98 examples, with eight of them randomly selected for tests--one per each category (the \"two cords missing\" category does not contain any training examples and was therefore omitted). The training database consists of 90 examples. The aim of the network training process is to determine optimal weight values, which would ensure proper solutions. This tool enables the network to self-train and also determines the validation error--when it starts to increase, the training process is interrupted so that the network does not lose its generalization capability (the ability to solve examples not encountered during the learning process) [21,22]. Using the possibilities generated by _MATLAB_, the influence of several key elements on the quality of the algorithm was investigated, and the number of neurons in the hidden layer and the type of activation function were changed. Each of the experiments was carried out 100 times in order to minimize the impact of the initial weight values on the generated solution, and the results presented in this study present average values. Table 1 contains the values obtained on successive network outputs during the testing process performed on a prepared test set of eight samples, for different numbers of hidden layer neurons \(k_{1}\in\{1,3,8,20,100\}\). The network output in which the computed value should be the highest is indicated in red. In the process of learning a neural network, a number of factors influencing the completion or continuation of this process is investigated. One of them is the mean square error (MSE) course, which is determined on a separate (validation) data set. The result generated by the network on the examples from the validation set does not affect the weight matrix, but, on its basis, the MSE is determined. At some point, the validation error starts to increase, and the network loses the ability to generalize, so it is very important to interrupt the learning process in the event of such a situation and restore the value of weighting factors until the validation error is as small as possible. The learning process is also interrupted when the achieved MSE error drops below a certain expected value on the validation set. Table 2 summarizes the results of the basic parameters read in the learning process of the neural network. Figure 8: Representative conveyor belt—borders of potentially damaged areas. \begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline \multicolumn{2}{c}{**Number of**} & \multicolumn{8}{c}{**Network Output**} \\
**Neurons in the** & \multirow{2}{*}{**1**} & \multirow{2}{*}{**2**} & \multirow{2}{*}{**3**} & \multirow{2}{*}{**4**} & \multirow{2}{*}{**5**} & \multirow{2}{*}{**6**} & \multirow{2}{*}{**7**} & \multirow{2}{*}{**8**} & \multirow{2}{*}{**9**} \\
**Hidden Layer** & & & & & & & & & \\ \hline \multirow{9}{*}{\(k_{1}=1\)} & 0.26 & 0.00 & 0.07 & 0.07 & 0.14 & 0.08 & 0.16 & 0.16  
A classification is considered correct if one of the network outputs assumes a value above the predefined acceptance threshold, and all of the remaining outputs assume values below the rejection threshold. With the values being 0.6 for the acceptance threshold and 0.4 for the rejection threshold, the accuracy of the network may be evaluated as follows (Table 3): \begin{table}
\begin{tabular}{c c c} \hline \hline
**Number of Neurons** & **Epochs** & **MSE** \\
**in the Hidden Layer** & **Epochs** & **MSE** \\ \hline \(k=1\) & 16.97 & 0.0804 \\ \(k=3\) & 33.45 & 0.0535 \\ \(k=8\) & 37.06 & 0.0188 \\ \(k=20\) & 43.42 & 0.0114 \\ \(k=100\) & 46.27 & 0.0110 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Parameters of the network. Figure 10: Mean square error.