# Misalignment-Resilient Propagation Model for Underwater Optical Wireless Links +
## 4 Live Misalignment Offset Prediction  
As seen in Section 3, in a real communication scenario between an AUV and a fixed sensor, as illustrated in Figure 16, an optimum divergence of the emitter exists at which the system is most tolerant to the offset misalignment, and the MALO takes its maximum value. To maintain a stable and reliable communication link in a live communication scenario in the presence of ocean currents, the AUV needs to adapt to the divergence of the emitter by changing the distance of the laser to the diverging lens, based on how much the present average offset is. However, the transmitter does not have this information unless it is estimated by the receiver and sent to the transmitter. Assuming that a low data rate link is established in the reverse direction, one can hypothesize that the distribution of power over the arrangement of lenses at the receiver, namely the use of seven lenses, might provide sufficient information to extract the critical misalignment data. Based on this supposition, a random forest machine learning method was assessed for its suitability to identify the offset of the AUV in relation to the fixed sensor at each  
Figure 14: The maximum MALO as a function of the rotation angle, considering a harbor II water type, a Tx–Rx distance of 0.5 m and a 7-lens scheme. Figure 15: Divergence for the maximum MALO as a function of the rotation angle, considering a harbor II water type, a Tx–Rx distance of 0.5 m and a 7-lens scheme. moment. With this aim, using a seven-lens scheme, a random forest algorithm was trained based on a 64 \(\times\) 7 matrix containing the power received by each lens at each point of a 8 \(\times\) 8-point grid in the AUV receiver plane \((r,\theta)\), which constituted the training labels for a specific transmission length and divergence angle and are presented in Table 3.  
The received power at each lens was obtained from the numerical simulation by propagating 10\({}^{9}\) photons. Having a trained algorithm with optimized parameters, its ability to estimate the offset was then tested on a different matrix holding the power received at each lens but at another set of random points in space, given in Table 4.  
The optimal random forest parameters were found to be the following:  
* N estimators: 400;
* Minimum samples per split: 2;
* Minimum samples per leaf: 1;
* Maximum features: square root;
* Maximum tree depth: none;
* Bootstrap: false. For a propagation distance of 1 m and a clear water type, the half-angle divergence was set to 8.5\({}^{\circ}\). A comparison between the estimated results and the actual test data can be seen in Figures 17 and 18. The deviation or error from the expected values was assessed by calculating the root mean squared (RMS) error of the two sets of values (predicted and estimated). The RMS error for the estimation of the radius was 6 mm, and it was 0.174 rad (10\({}^{\circ}\)) for the angular offset. For a propagation distance of 0.5 m and clear waters, the optimum half-angle divergence obtained from the simulations was 10\({}^{\circ}\). The RMS value for the estimation of the offset \((r,\theta)\), which in this case was 5 mm, was 0.157 rad (9\({}^{\circ}\)). \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \(r\) (cm) & 2.0000 & 3.8571 & 5.7143 & 7.5714 & 9.4286 & 11.2857 & 13.1428 & 15.0000 \\ \(\theta\) (rad) & 0.6283 & 1.3614 & 2.0944 & 2.8274 & 3.5605 & 4.2935 & 5.0265 & 5.7596 \\ \hline \end{tabular}
\end{table} 
Table 4: Grid of 8 \(\times\) 8 points in space used for testing the algorithm, estimating the offset between the transmitter and receiver. Figure 16: Diagram of AUV communicating with a fixed receiver using a divergent optical beam. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \(r\) (cm) & 1.0000 & 3.1428 & 5.2857 & 7.4286 & 9.5714 & 11.7143 & 13.8571 & 16.0000 \\ \(\theta\) (rad) & 0.6283 & 1.3614 & 2.0944 & 2.8274 & 3.5605 & 4.2935 & 5.0265 & 5.7596 \\ \hline \end{tabular}
\end{table} 
Table 3: Grid of 8 \(\times\) 8 points in space used for training.