# Algorithm for Determining the Position of a Ship Hull-Cleaning Robot
## 6 Experiments on Rosario Data Set
### Deep Learning Approach  
The starting point for creating data for deep learning methods was the set defined for the Gradient Boosting method. Before directly creating models, these data were subjected to normalization, as it was expected that this could significantly improve the quality of the obtained results. In the next step, the dataset was divided into a training set (70%), validation set (15%), and test set (15%). A neural network model prepared on the basis of the Telemanom architecture was used to predict the robot's routes at this stage. The proposed neural network consists of 3 LSTM (Long Short-Term Memory) layers, 3 dropout layers, and an output layer with one neuron, which allows for the prediction of an expected value. LSTM layers are recurrent layers that use sequential information, which is why they are very good for time-series analyses. Dropout layers allow for the removal of neurons with a given probability, which allows for minimizing the overfitting phenomenon, i.e., excessive matching to the input data. Below (Figure 16) is a diagram of the neural network used to perform route forecasting analyzes. Initially, one neural network was used to predict the robot's position, but after conducting the tests (and due to the characteristics of the input data), two neural networks with an identical structure were used, but predicting two different variables: the length of the shift and the angle of rotation. The deep learning model assumed four variants of position correction based on the GPS signal. This correction was performed every 60, 30, 15 s, or not at all. The results obtained for individual frequencies based on the Rosario set are presented below (Tables 4-7). \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Model** & **Set** & **Min [m]** & **Max [m]** & **Mean [m]** & **Std [m]** & **Variance [m\({}^{2}\)]** \\ \hline shift prediction & training & 0.0035 & 7.6107 & 2.5564 & 1.6572 & 2.7464 \\  & validation & 0.3448 & 8.1166 & 2.8856 & 2.0974 & 4.3989 \\  & test & 1.6974 & 9.9814 & 6.1868 & 2.0326 & 4.1314 \\ \hline rotation angle prediction & training & 0.0016 & 5.7101 & 2.3974 & 1.0948 & 1.1985 \\  & validation & 0.2284 & 9.7487 & 2.9950 & 2.3211 & 5.3877 \\  & test & 1.1061 & 13.2860 & 5.3638 & 3.6709 & 13.4752 \\ \hline combined models & training & 0.0175 & 7.0544 & 3.1136 & 1.7321 & 3.0001 \\  & validation & 0.0695 & 11.1422 & 2.775 & 2.8718 & 8.2473 \\  & test & 0.1693 & 15.5186 & 8.3503 & 3.3219 & 11.0349 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Prediction accuracy (error statistics) for position correction every 60 s.  
The rows describing the models predicting the displacement length and rotation angle refer to individual models, while the last rows of the table define the total evaluation of the models. In order to enable the evaluation of the models, the predictions obtained by them (displacement vector length and rotation angle) were iteratively recalculated to subsequent robot positions. Based on subsequent robot positions, Euclidean distances were determined between the expected data and the positions determined using the neural network model. Positions were recalculated iteratively, so prediction errors may accumulate. Based on the prepared neural network models, predictions of the robot's travel routes were made on the basis of odometry data and data from IMU sensors. The following  
Figure 16: Diagram of the neural network based on which route forecasting analyses were performed (the arrows point the flow of the model).