# Deep Learning-Based Spread-Spectrum FGSM for Underwater Communication
## 3 Proposed SS-FGSM Scheme
### Structure of DL-Based Detector  
The FC nonlinear layers are only required for the proposed DL-based detector, including the first hidden layer with \(Q\) nodes and the second hidden layer, corresponds to \(d_{i}\) nodes. The output layer is set based on the rate of the proposed SS-FGSM specified in (13). At the hidden layer, the rectifier linear unit (Relu) is utilized as \(f_{Relu}(\$)=\ \max(x,0)\), and the Sigmoid function (Sig) is utilized in the output layer with \(f_{Sig}(\$)=\frac{1}{1+e^{-\$}}\) to estimate the transmitted bits \(\ \overline{d}_{i}\). Since the output of the sigmoid function lies between 0 and 1, a threshold set to decide either the output is 0 or 1. In this paper we set 0.5 as a threshold and decided the output is 0 if the output less than 0.5 and 1 otherwise. It is worth mentioning that:  
\[\overline{d}_{i}=\ f_{Sig}\bigg{(}\sqrt{\ }f_{tanh}\bigg{(}\sqrt{\ }\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  
where \(\theta=\left[\sqrt{\;\;\{\}}\right]\) and the \(\theta\) parameters will be updated for the batches randomly and picked up of the data samples. In our training, the adaptive moment estimation (Adam), which is an advanced updated algorithm based on stochastic gradient descent (SGD), was adopted. Therefore, the parameter \(\theta\) can be updated as:  
\[\theta^{+}:=\theta-\;\alpha\
abla f\big{(}\mathbf{d}_{j},\;\overline{\mathbf{d}}_{j}, \;\theta\big{)}, \tag{21}\]  
where \(\alpha\) indicates the learning rate and \(\
abla\) is the gradient operator.  
The DL-based detector is very sensitive to the channel signal-to-noise ratio (SNR) \(\gamma_{train}\) used so it is selected carefully to let the DL-based detector able for working well at any other SNR. To save the underwater node power, a small value of channel SNR is used in the training stage. Thanks to the orthogonal spreading codes used in the proposed DLSS-FGSM scheme, the proposed DL-based detector can provide good performance if we use \(\gamma_{train}=15\,\mathrm{dB}\).  
It is worth mentioning that the inputs are concatenated and adopted into the input layer \(z\), that input is representing the pre-processes signal where the channel effects should be estimated and equalized. Additionally, the Doppler effect should be estimated too before adopting the input signal into layer \(z\). The next layer represents the hidden layer, in our case, the hidden layer is represented by \(Q\). The size of the hidden layer can be adopted as a tradeoff between complexity and performance. Finally, the output layer \(d\) has a size of transmitted data rate by blocks including indexed bits carried by the selected spreading code and a physical bit carried by the digital modulation. The size of the output layer \(d\) equals the transmitted data rate of each block. It means that no digital demodulation is required in the proposed scheme leading to relaxing more complexity compared to conventional schemes. Hence, the DL detector does not depend on the UWA channel variation; it is only used to detect the received data carried by the indices and digital modulation.