# A Robust Method Based on Deep Learning for Compressive Spectrum Sensing
## 3 The Proposed CSS Method
### Training Methodology  
The training of the CSS method is performed in two stages. The first stage involves training the BEISTA-Net. Considering both computational complexity and performance, the number of network iterations is set to four. Given training data \(\{(\mathbf{Y}_{i},\mathbf{X}_{i})\}_{i=1}^{N_{CS}}\), BEISTA-Net takes compressed measurements \(\mathbf{Y}_{i}\) as input and generates the reconstruction result \(\mathbf{X}_{i}^{(N_{p})}\) as output. Similar to traditional ISTA, BEISTA-Net requires an initial value, which is set as \(\mathbf{X}^{(0)}=\mathbf{\Phi}^{\top}\mathbf{Y}\). During training, we aim to minimize the difference between \(\mathbf{X}_{i}^{(N_{p})}\) and \(\mathbf{X}_{i}\) while satisfying the symmetry constraint \(\tilde{f}^{(k)}\circ f^{(k)}=I;\forall k=1,\dots,N_{p}\)[17]. Therefore, we incorporate a regularization term to enforce the symmetry constraint, in addition to the \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Layer** & **Filter** & **Stride** & **Padding** \\ \hline \multirow{6}{*}{Convolutional Pooling Layer} & C\({}_{1-1}\) & 4 & 2 & 1 \\  & C\({}_{1-2}\) & 8 & 2 & 3 \\  & C\({}_{1-3}\) & 12 & 2 & 5 \\  & C\({}_{1-4}\) & 16 & 2 & 7 \\  & S\({}_{1}\) & 4 & 4 & 0 \\  & C\({}_{2}\) & 8 & 2 & 3 \\  & S\({}_{2}\) & 4 & 4 & 0 \\ \hline \multirow{3}{*}{Fully Connected Layer} & C\({}_{1}\) & \multirow{3}{*}{256} \\  & F\({}_{2}\) & & \multirow{3}{*}{\(N_{c}\)} \\ \cline{1-1} \cline{4-5}  & & & & \\ \cline{1-1} \cline{4-5}  & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Hyperparameters of the BSWSS-Net. relative mean squared error (r-MSE) term, which can help prevent overfitting. The final loss function is expressed as  
\[L_{CS}=L_{discrepancy}+\gamma L_{constraint}, \tag{15}\]  
with  
\[\left\{ \begin{array}{c}L_{discrepancy}=\frac{1}{N_{CS}}\sum\limits_{i=1}^{N_{ CS}}\frac{\|\mathbf{x}_{i}^{(N_{p})}-\mathbf{x}_{i}\|_{2}^{2}}{\|\mathbf{x}_{i}\|_{2}^{2}}\\ L_{constraint}=\frac{1}{N_{CS}N_{p}}\sum\limits_{i=1}^{N_{CS}}\sum\limits_{k=1}^{ N_{p}}\frac{\|\hat{r}^{(N_{c})}(f^{(N_{c})}(\mathbf{x}_{i}))-\mathbf{x}_{i}\|_{2}^{2}}{\| \mathbf{x}_{i}\|_{2}^{2}},\end{array} \right. \tag{16}\]  
where \(N_{CS}\), \(N_{p}\), \(\gamma\) are the size of the training dataset, the number of network layers, and the regularization parameter, respectively. In the experiments, \(\gamma\) is set to 0.001. Typically, the collected wideband spectrum signals are in a complex form. The frequency domain representation of the wideband spectrum signals is directly utilized as the training data. To better adapt to the neural network, we use the real and imaginary parts of the frequency domain representation as two separate channels for input during training. This approach yields satisfactory performance as the powerful learning capability of neural networks. When training BEISTA-Net, we use the Adam optimizer with a maximum of 100 epochs and stop the training process when an increase in the loss value on the test set is detected. The learning rate is initially set to 0.001 for the first 30 epochs and then reduced to 0.0001. Next, the BSWSS-Net is trained using the reconstructed signals to predict \(\hat{\mathbf{s}}\). The training data are represented as,  
\[(\mathbf{I},\mathbf{S})=\Big{\{}(\mathbf{i}^{(1)},\mathbf{s}^{(1)}),\cdots,(\mathbf{i}^{( n_{WSS})},\mathbf{s}^{(n_{WSS})}),\cdots,(\mathbf{i}^{(N_{WSS})},\mathbf{s}^{(N_{WSS})}) \Big{\}}, \tag{17}\]  
where \(\mathbf{i}^{(N_{WSS})}\) represents the input data for the neural network, \(N_{WSS}\) represents the size of the training dataset, \(\mathbf{s}^{(n_{WSS})}=[s_{1}^{(n_{WSS})},\cdots,s_{n_{c}}^{(n_{WSS})},\cdots,s_{ N_{c}}^{(n_{WSS})}]\) represents \(N_{c}\) labels, \(s_{n_{c}}^{(n_{WSS})}\in\{0,1\}\).