# PUE Attack Detection by Using DNN and Entropy in Cooperative Mobile Cognitive Radio Networks
## 5 Results
### DNN Algorithm Results  
Once the entropy and SNR results are taken, the DNN algorithm is trained with this data. For this purpose, the scikit-learn and Keras libraries of Python are used.  
A classifier was built using a DNN (fully connected) in a sequential model implemented in Keras. Two deep layers were simulated with 16 and 32 neurons, and using the ReLu activation function, the output layer contains two neurons and a Softmax activation function. The final model had 642 parameters, optimized through a training process that covered 50 epochs and a batch size of 32, as shown in Figure 11. The input is the SNR and calculated entropy.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Samples & 20,000 samples \\ Averaged Values & 100 samples for each point of the grid with \\  & an on/off value \\ Noise Signal & AWGN \\ Service & Phone Call-PUEA \\ Frequency & 831.8 MHz \\ Confidence Level & 95\% \\ Margin of error & 5\% \\ Users & 3 SU, 1 FC, 1 PUE \\ \hline \hline \end{tabular}
\end{table}
Table 1: Parameters for the Learning Process.  
Figure 10: Measured entropy example with _PUE attack_ signal and noise.  
Model: \"sequential\"  
Layer (type) Output Shape Param #  
===================================  
dense (Dense) (None, 16) 32  
dense_1 (Dense) (None, 32) 544  
dense_2 (Dense) (None, 2) 66  
===================================  
Total params: 642  
Trainable params: 642  
Non-trainable params: 0  
The algorithm is tested with 20% of the dataset when the training is performed. In this case, 20,000 samples are taken, so 4000 data points are used for the test, as shown in Figure 12 Values are measured for each SNR value from \(-25\) dB to 0 dB. For example, for \(-12\) dB, the algorithm's probability of detection and accuracy are 99%; the blue boxes are the right detection values.  
After the training algorithm is executed, the results are shared and recorded on each SU in the system. Then, the second part of the DNN is executed with each value of entropy; the algorithm predicts if there is an active PUE, and depending on the estimated SNR, a probability of detection is calculated.  
In the SDR experiments, the PUE position is random and fixed, the SNR is estimated, 100 entropy values are averaged on each sample, and then each value is processed by the SUs. A CSS with an OR logic is implemented; if any of the three SUs detect the PUE presence, the FC broadcasts a message of the PUE presence to any SU in the network. With the obtained data, the device records it on the blacklist of PUE attackers.  
The receiver operating characteristic (ROC) curves are similar to the practical results; the experiments are conducted in laboratory conditions. An example of the implemented algorithm can be seen in Figure 13. The PUE is active, and the FC indicates that a _PUE attack_ is present when any of the SUs detect it and send a \"1\" binary value. It can be seen that one SU detects the attack in some samples, which is why an OR rule is used.  
Figure 11: Parameters of DNN algorithm.  
Figure 12: Confusion matrix for SNR = \(-12\) dB.  
The probability of detection of the PUE is estimated as the number of positive detections when the PUE is active. In the experimental SDR testbed, the measurements are taken with steps of 1 dB each time, as seen in Figure 14 The results are compared with our previous results on entropy and the SVM _PUE attack_ detection system [9].