## 2 Theory and Methodology
### Artificial Neural Network (ANN)  
When solving the inverse problem, converting \(S_{e}(\omega_{e})\) to \(S(\omega)\), the problem cannot be solved directly under certain conditions, as explained above, which is the reason we employed the ML approach. Since the relationship between the original and encounter frequency is clearly defined mathematically by the variables of wave heading and forward speed, the neural network model could capture the correlation between \(S(\omega)\) and \(S_{e}(\omega_{e})\) with the given wave headings and speeds, enabling the ANN model to potentially recover the original wave spectrum through extensive training for the given instantaneous encounter-frequency spectrum. Figure 7 illustrates a proposed ANN model with its input layer comprising the vessel speed \(V\), angle between the vessel and wave \(\beta\), and spectral density \(S_{e}(\omega_{e})\). The output layer includes the discretized original wave spectrum \(S(\omega)\) for the original frequency. Three different models are considered in this paper depending on the selection of the wave parameter and the input variables, as shown in Table 2. Model 1 is an initial model where the peak enhancement factor \(\gamma\) is fixed at 2 for initial testing. For Models 2 and 3, various \(\gamma\) values were considered, increasing the total number of training data points to achieve sufficient model accuracy. Model 2 uses the significant wave height \(H\!s\) as an  
Figure 6: Encountered wave spectra (\(H\!s=3\) m, \(T\!p=7\) s, \(\gamma=2\)) with corresponding (**a**) forward speeds (\(\beta=40\) deg) and (**b**) wave headings (\(V=16\) knots). Figure 7: Artificial neural network (ANN) model for wave encounter-frequency conversion. additional input variable, assuming that it is obtained from the encounter wave spectrum measured. Meanwhile, Model 3 does not include _Hs_ as the input variable in training the ANN model. A total of 231,660 data points for the respective spectral relations (300 equally spaced points in the range of 0-3 rad/s) between \(S(\omega)\) and \(S_{e}(\omega_{e})\) are generated for the ANN scheme of Models 2 and 3. The models are trained using 80% of the total dataset and validated with the remaining 20% of the dataset. During the process, model optimization was performed to adjust the number of layers and nodes, optimizers, and loss functions. The configuration was selected based on preliminary testing, aiming to balance performance and model simplicity. ReLU activation was chosen due to its common effectiveness in regression tasks. The Adam optimizer was selected for its adaptive learning rate, which is generally effective for training nonlinear models such as ANNs. The MSE loss function was used as it is a standard choice for regression tasks and helps penalize larger prediction errors. An example of hyperparameter optimization, performed using Model 2 with a smaller dataset (totaling 105,300 samples), is presented in Table 3. The R2 score, computed using a 20% validation set, indicated that variations in the tested parameters had a relatively limited impact on model performance. Based on this analysis, the best-performing parameter set was selected and subsequently applied to all models for consistency.