# AI-Enabled Compressive Spectrum Classification for Wideband Radios
## 2 Materials and Methods
### Classifier and Proposed Algorithm  
Artificial Neural Network (ANN) has been employed in different fields for classification problems. Our proposed algorithm uses an ANN classifier because of its successful applications for pattern recognition in both signal and image processing. Moreover, it has the ability to generalize the model to any compression ratio, SNRs, carrier frequency, and symbol rate. These characteristics make it a natural choice for spectrum characterization in the presence of stealthy jamming attacks that use modulated pulses to jam the targeted signal in WB. It is used to characterize the available NB signals in the received WB spectrum into four broad classes, with two legitimate signal classes, namely BPSK and QPSK, and two jamming signal classes, BPSK-jammed and QPSK-jammed. ANN consists of an input layer with 100 neurons related to the input features vector, one hidden layer that contains 16 neurons, and an output layer associated with targeted output classes. The hidden layer uses the sigmoid as a transfer function which is given as  
\[f(x)=\frac{1}{1+e^{-x}} \tag{15}\]  
Figure 2: The SCFs obtained at \(-5\) dB for NB signals (**a**) BPSK signal (**b**) QPSK signal, and corresponding alpha profiles (**c**) BPSK signal. (**d**) QPSK signal.The WB signal is reconstructed with a compression ratio of 0.50.  
The ANN like all other supervised learning algorithms works in two stages. First, the ANN is trained offline and then tested online. For training the ANN, we used a back-propagation algorithm, namely, scale conjugate gradient [38]. The output layer produces four outputs between 0 and 1, corresponding to each class of signal, and the class with the highest value between (0,1) among the four is marked as the targeted signal class. A large dataset of 48,000 received WB signals, corresponding to different SNRs and compression ratios, is collected. The dataset is split into three parts, 70% is used for training, 15% for validation, and 15% for testing. ANN architecture is trained for hundred runs with the dataset being randomly divided and weights being randomly initialized in each run. An average accuracy of over 98% is reported for true positive classification; hence, increasing the number of layers will not increase accuracy further but only increase the training time. Therefore, the ANN architecture with 16 neurons in a hidden layer that offers the highest accuracy is used for spectrum characterization. Figure 3 shows the ANN architecture discussed above.  
Our proposed algorithm is reported in Figure 4, where a CR received a WB composed of many NB signals. CR set the compression rate (K/N) to a specific value and used the random sampler to sample the WB signal and collect the related measurement matrix \((S_{c})\). Then the WB signal is reconstructed by exploiting BP from sub-Nyquist samples. Following this, the cyclostationary spectral analysis is performed and SCF is computed for each NB signal, and the corresponding features vector is formed by combining the \(f\) and \(alpha\) profiles. The features vector is then used to train the ANN that classifies each NB signal in the occupied subband as a normal communication with a specific modulation or NB signal blocked by the stealthy jammer. In the end, the classifier is tested with an independent dataset.