# Federated Learning for Maritime Environments: Use Cases, Experimental Results, and Open Issues
## 4 FL-Aided Fuel Consumption Prediction
### Performance vs. Spatial Complexity Comparison  
Upon completion of hyper-parameter value stabilization and feature elimination to aim towards a reasonable performance-complexity equilibrium, this section presents comparative results amongst several MEP prediction schemes. To quantitatively investigate the prons and cons of different centralized and decentralized approaches, four prediction schemes are considered and contrasted in terms of their prediction accuracy and complexity. The analytical high-level architecture of the considered schemes is shown in Figure 5, where the learning operation performed at the port site in FL scheme (Figure 5D) represents the aggregation step across the local models. Specifically, the following schemes were trained and tested:  
1. _Centralized Learning and Inference (CLI)_: This is the conventional computationally expensive scheme, in which all data samples (from all ships) are collected in the central server to build a large and powerful model. Inference takes place locally upon vertical communication between local ship clients and the central server. The ship-independent central model constantly requires data exchange with the local clients. The estimation model of this scheme was derived by training an ANN using the data from all ships as a whole. 2. _Local Learning and Model Sharing (LLMS)_: Based on the principles of transfer learning, one ship-specific model is trained locally and then the rest of the ships inherit the pretrained model for future inference purposes. In this scheme, we tested all ships inheriting from all ships (i.e., ship 1 transfers to the rest, ship 2 transfers to the rest, and so on). The central server is only used for model sharing operations across the local ship clients. The estimation model of this scheme was derived by training only one local model and then copying it to the rest of the agents. 3. _Local Learning and Collaborative Inference (LLCI)_: Similar to the ensemble learning technique, this scheme trains a local ship-specific model for each ship and then, during the inference phase, each ship can take the average prediction calculated over all local model predictions, given a particular testing sample. To make this scheme work, each local client has to store all the six models locally for the purposes of mean prediction extraction without communication overhead. 4. _Federated Learning (FL)_: This scheme follows the typical federation process proposed in the FedAvg algorithm [10]. In brief, each client trains the local model decentrally and only the learned model parameters are sent to a trusted center. The latter combines the  
Figure 4: Model performance of each ship model for different number of input features. parameters to aggregate the global model before circulating it back to all local clients. The formula used for the aggregation operation is the following [10]:  
\[W_{Global}^{t+1}=\sum_{m=1}^{N_{m}}\frac{n_{m}}{n_{total}}\cdot W_{Local,m}^{t}, \tag{3}\]  
where \(W_{Global}^{t+1}\) are the global model parameters at aggregation round \(t+1\) and \(W_{Local,m}^{t}\) are the parameters of the local model \(m\in[1,2,...,N_{m}]\) at the aggregation round \(t\). Further, \(n_{m}\) is the sample count of the local model \(m\) and \(n_{total}\) is the total sample count of all FL local models. The accuracy \(A_{i}\) of each deployed scheme \(i\) is measured as the MAE calculated over the validation data (unseen during training), whereas the corresponding complexity \(C_{i}\) is quantified via the following formula [31]:  
\[C_{i}=\sum_{m=1}^{N_{m}}\left(E_{m}\cdot U_{m}+S_{m}\right), \tag{4}\]  
where the total complexity \(C_{i}\) (in a.u.) of scheme \(i\) (that includes \(N_{m}\) ANN models) is equal to the aggregated complexity of all individual models included in the scheme. Each individual model \(m\) (\(m=1,\ldots,N_{m}\)) exhibits a complexity that is equal to the sum of ANN density (i.e., the product between the hidden edges \(E_{m}\) and the hidden units \(U_{m}\)) and ANN storage requirements \(S_{m}\) (in KB).