3.3.4. GA-ANN

The number of nodes at the input and output layers is equal to the input and output variables, respectively. The number of the hidden layer and the number of nodes at the hidden layer were determined by GA. The important parameters for an ANN model consist of Nh, Nnh, Lr, and Mc, and the four genes in the binary form were considered for each chromosome. The number of the hidden layer (Nh) was limited 1 to 2, the number of the node at each hidden layer (Nnh) is selected from 1 to 10, and the learning rate (Lr) and momentum coefficient (Mc) ranged from 0 and 1.

The TLS measuring coordinates were seen as inputs, the real value of the coordinates was regarded as output, and then the transfer model was estimated. The ANN models with different momentum coefficients are shown in Figure 13. The ANN3 with the momentum coefficient Mc = 0.876 perform the best compared with other ANN models. As shown in Figure 13, the momentum coefficient cand strongly influence the model performance.

**Figure 13.** The model performance for ANN models with different momentum coefficients.

According to the results of the study [70], the position of the laser scanners has significant influence on data scanning accuracy. Hence, the study used the positions of the TLS as the ANN model inputs. In this study, the inputs of the ANN model were the coordinates of the key points, R distance, laser coefficients, and scan conditions. The output of the ANN model was the specified value (specified value of the set distance and space *dli* = 12 cm; *dti* = 15 cm; *si* = 10 cm). The value of the cross points can be calculated by using Equations (3)–(5).

Sigmoid function was employed as a transfer function for output and hidden layers of the GA-ANN. The model training process was to adjust the model parameters in order to minimize the error between the output and the target. Mean Squared Error (MSE) was adopted to evaluate the model performance, it can be calculated in Equation (8).

$$\text{MSE} = \frac{1}{n} \sum\_{i=1}^{n} (p\_i - x\_i)^2,\tag{8}$$

where *n* is the number of data samples, *pi* is the model estimate of the *i* sample, and *xi* represents the actual value of the *i* sample.

During the training process, the number of nodes and layers and functions of the network were changed. MATLAB software was used to train and test the ANN model. The important parameters of the proposed ANN model were first encoded as the genes of the genetic algorithm (GA). Then, the fitness values of each individual chromosome were calculated based on the fitness function. After a series of GA selection, such as the crossover, the mutation and the duplication, the GA can discover the optimal individual chromosome corresponding to the optimal fitness values. The evolution process is shown in Figure 14. It should be noticed that GA can properly coverage the fitness value to the global optimum rather than any other local optimal by random initialization.

**Figure 14.** The evaluation process of GA.

According to the GA results, the best number for the hidden layer was found to be one; the best number for the nodes at the hidden layer is six. The structure of the proposed GA-ANN model is shown in Figure 15.

The optimum network results in the lowest MSE. The optimum configuration of the ANN model is shown in Table 3. Moreover, several network configurations with different nodes at hidden layer were developed to evaluate and compare the accuracy of the proposed GA-ANN model in estimating the variables. The MSE function was used to assess the performance of the proposed GA-ANN model. The prediction performance of the models for the data of simulated defects and the coordinates of key points are shown in Table 4. The corresponding rating was provided by averaging each MSE for the models. As shown in Table 4, the proposed GA-ANN model achieves the best results among the other models. To assess the model performance of the prosed GA-ANN model, the study provided model performance value for ANN model and the ANN model optimised by using GA respectively. The model performance of the proposed GA-ANN model and the second-best ANN model compared with the actual value of the measurements are shown in Figure 16.

**Figure 15.** The structure of the proposed GA-ANN model.



**Table 4.** Prediction performance of the proposed GA-ANN model versus ANN model.


**Figure 16.** Model performance of the GA-ANN versus the ANN model and the actual value.

The obtained estimates from GA-ANN model versus the actual value are described in Figure 17. Obviously, the proposed model can generate reliable predictions as error is nearly zero. The R<sup>2</sup> results for the proposed GA-ANN model which are very close to 1 for training and testing dataset, as shown in Figure 18, explored that the proposed GA-ANN can generate high accuracy predictions.

**Figure 17.** *Cont*.

**Figure 17.** Actual versus predicted values of the measurements from GA-ANN model (**a**) training dataset (**b**) test dataset.

**Figure 18.** The R<sup>2</sup> of the proposed GA-ANN model.

According to [71], the R<sup>2</sup> of the ANN model indicates that the inputs provide sufficient information for the model predictions. Based on the results of [72], the Coefficient of Variation-Root Mean Square Error (CV-RMSE) should be <30%, CV-RMSEs of the ANN model is 12.5%, indicating that the developed ANN model meets the standard. Other model performance evaluations, such as Root Mean Square Error (RMSE) and Mean Absolute Error (MAE), also indicate that the model can generate predication with high accuracy.
