# Deep Learning-Based Optimization for Maritime Relay Networks
## 3 Relay Network Based on Deep Learning
MATLAB R2022a simulations are utilized to generate raw data by modeling key channel characteristics in maritime communication environments, including Rayleigh fading and large-scale path loss. These simulations are subsequently used to construct channel dataset samples for training. The key communication parameter settings for generating the dataset are summarized in \[x_{t}=\big{[}v_{1t},v_{2t},v_{3t},\theta_{1t},\theta_{2t},\theta_{3t},L_{1t}, L_{2t},h_{1t},h_{2t},h_{3t},\gamma_{1t},\gamma_{2t}\big{]}. \tag{23}\]2

Before training the model, the sample data must be preprocessed. As the deep learning-based maritime communication relay network optimization model follows a supervised learning paradigm, each set of relay link data must be labeled with the optimal relay and its corresponding connectivity probability. During the training process, the network architecture is iteratively adjusted, and parameter values are fine-tuned to maximize predictive performance. Table 2 provides the parameter settings for the CNN-GRU method used in this experiment. To validate the consistency between the theoretical analysis and the simulation results for connectivity probability, Figure 4 presents the connectivity probability under different system parameters. Figure 4a,b demonstrate that an increase in the number of relay nodes K significantly enhances the connectivity probability, while higher SNR thresholds \(\gamma_{0}\) lead to a reduction. Figure 4c illustrates a gradual decline in connectivity probability as the number of clusters M increases, emphasizing the trade-off inherent in multi-cluster systems. The high levels of consistency between the theoretical and simulation results validate the accuracy of the formulas and the reliability of the methods. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Carrier frequency & 5.8 GHz \\ Transmit antenna height & 8 m \\ Receive antenna height & 8 m \\ Number of relays & 4 \\ Transmission power & 20\(\sim\)25 dBm \\ Noise power & 10\(\sim\)11 dBm \\ Path loss & 90\(\sim\)200 dB \\ SNR & 10\(\sim\)30 dB \\ Speed & \(0\leq v(t)\leq 30\,\mathrm{km/h}\) \\ Direction & \(-\pi/6\leq\theta(t)\leq\pi/6\) \\ Distance & 20 km \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Communication parameter. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline CNN convolutional filters & 64 \\ Convolution kernel size & \(2\times 1\) \\ Activation function & Relu \\ GRU hidden units & 16 \\ Dropout rate & 0.2 \\ Batch size & 128 \\ Epochs & 100 \\ Learning rate & 0.01 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Model simulation parameters. The accuracy of the model is evaluated by comparing the predicted labels of the test set with the corresponding optimal choices. To assess the link prediction performance of the CNN-GRU model, the mean squared error (MSE) is employed as the performance metric. The MSE is defined as

\[MSE=\frac{1}{N}\sum_{i=1}^{N}(p_{i}-\hat{p}_{i})^{2}, \tag{31}\]

where \(N\) represents the number of predictions, \(p_{i}\) denotes the true value and \(\hat{p}_{i}\) represents the predicted value. The smaller the MSE value, the better the prediction performance. Figure 5 illustrates the variation in the model accuracy with the increase in the number of relays. It can be observed that the accuracy of the CNN-GRU-based relay selection scheme decreases slightly as K grows but remains consistently above 92%, which is within an acceptable range. This trend can be attributed to the fact that when the number of relays is small (e.g., two relays), the model can more effectively learn and memorize the dataset features, resulting in higher accuracy on the training set. However, as the number of relays increases, the model tends to overfit the training data, leading to a decrease in performance on the test data. Figure 6 illustrates the prediction accuracy of the model's labels over the entire time-series.