# A Novel Transfer Learning-Based OFDM Receiver Design for Enhanced Underwater Acoustic Communication
## 3 Proposed TL-Based UWA OFDM Receiver
### Transfer Learning and Fine-Tuning
```
1:Input:
2:\(X_{train}\): Training data from watermark channels (BCH, NOF1, KAU1, KAU2, NCS1)
3:\(Y_{train}\): Corresponding transmitted bits for the training data
4:\(X_{test}\): Test data from Qingdao Lake channel
5:\(Y_{test}\): Corresponding transmitted bits for the test data
6:\(\Theta_{pre}\): Pre-trained model weights from watermark channel data
7:\(\mathcal{L}\): Loss function (e.g., cross-entropy for classification)
8:\(E_{pre}\): Number of epochs for pre-training
9:\(E_{fine}\): Number of epochs for fine-tuning
10:\(\eta_{pre}\): Learning rate for pre-training
11:\(\eta_{fine}\): Learning rate for fine-tuning
12:\(\beta\): Regularization parameter
13:\(P\): Number of transmitted bits
14:\(B\): Number of batches
15:Step 1: Pre-training on watermark channels
16:for concatenation of the five watermark channels data (BCH, NOF1, KAU1, KAU2, NCS1) do
17: Train a model \(M_{pre}\) on \(X_{train}\) with corresponding \(Y_{train}\)
18: Use Adam optimizer with learning rate \(\eta_{pre}\) to minimize the loss function: \[\mathcal{L}_{pre}=\frac{1}{P}\sum_{i=1}^{\left(\hat{Y}_{i}-Y_{i}\right)^{2}}\]
19: Store model weights \(\Theta_{pre}\) for use in fine-tuning
20:endfor
21:Step 2: Fine-tuning on Qingdao Lake channel data
22: Initialize model \(M_{fine}\) with pre-trained weights \(\Theta_{pre}\)
23: Freeze the convolutional layers of the pre-trained model
24:for epoch = 1 to \(E_{fine}\)do
25:for batch = 1 to \(B\) in \(X_{test}\)do
26: Forward pass: Calculate predicted transmitted bits \(\hat{Y}_{test}=M_{fine}(X_{test})\)
27: Compute binary cross-entropy loss for the test data: \[\mathcal{L}_{fine}=-\frac{1}{P}\sum_{i=1}^{P}\left(Y_{test,i}\log(\hat{Y}_{test,i})+(1-Y_{test,i})\log(1-\hat{Y}_{test,i})\right)\]
28:Generate Data Using CIRs: Simulate the Qingdao Lake channel data using the CIRs to model the channel characteristics. 29: Backward pass: Update weights for fully connected layers using Adam optimizer: \[\theta_{i+1}=\theta_{i}-\eta_{fine}\
abla\mathcal{L}_{fine}(\theta_{i})\]
30:endfor
31:endfor
32:Step 3: Evaluate model performance on test data
33: Compute final accuracy and loss on test data: \[Accuracy=\frac{\text{Correct predictions}}{\text{Total predictions}}\times 100\]
34: Compute Loss for the final model: \[\mathcal{L}_{CE}=-\frac{1}{P}\sum_{i=1}^{P}\left(Y_{test,i}\log(\hat{Y}_{test,i})+(1-Y_{test,i})\log(1-\hat{Y}_{test,i})\right)\]
35: Generate Confusion Matrix for predicted vs. true transmitted bits and calculate classification metrics: precision, recall, F1 score, and MCC. 36:Output:
37: Fine-tuned model \(M_{fine}\), performance metrics (accuracy, loss, confusion matrix)
38: Final transmitted bit prediction results for Qingdao Lake channel data
```  
**Algorithm 1** Transfer Learning-based Channel OFDM receiver for UWA Communication  
Dataset preparation: The dataset \(D_{T}\) is split into training \(D_{TTr}\) and testing \(D_{TTe}\) sets. * Freezing convolutional layers: The feature extraction layers, initialized with \(\Theta_{pre}\), remain fixed, while only the fully connected layers are updated. The fine-tuning loss function is given by:  
\[L_{fine}=-\frac{1}{P}\sum_{i=1}^{P}\big{(}Y_{test,i}\log(\hat{Y}_{test,i})+(1-Y_{ test,i})\log(1-\hat{Y}_{test,i})\big{)}, \tag{7}\]  
where, \(P\) is the total number of test samples, \(Y_{test,i}\) is the true label of the \(i\)-th test sample, where \(Y_{test,i}\in 0,1\). \(\hat{Y}_{test,i}\) is the predicted probability that the \(i\)-th test sample belongs to class 1. The fine-tuning optimization follows:  
\[\Theta_{fin}=\Theta_{fin}-\gamma_{2}\
abla L_{fine}, \tag{8}\]  
where, \(\Theta_{fin}\) is the parameters of the model (weights and biases) in the fine-tuning phase, specifically the fully connected layers. These parameters are adjusted during fine-tuning based on the gradient of the fine-tuning loss. \(\gamma_{2}\) is the fine-tuning learning rate, which controls the magnitude of parameter updates during the fine-tuning process. \(\
abla L_{fine}\) is the gradient of the fine-tuning loss function with respect to the model parameters.