## 4 Modes Identification and DoA Determination Classifiers  
The free space direct-detection method depends on observing the image of the intensity profiles. Therefore, the CNN-based classifier is exploited to identify the images of different mode patterns, as it can directly process the two-dimensional input signal types. The CNN, shown in Figure 5a, is used to automatically extract features from the raw image data which leads to better discrimination between modes and, consequently, better performance in the testing phase. The CNN network is constructed using three main processing layers. These are the convolutional, pooling, and fully direct connected layers. In our work, the CCD colored recorded images were greyscaled and resized to 28 \(\times\) 28 pixels to reduce the processing complexity. The resultant images were processed using the convolutional and pooling layers. The convolutional layer is considered as the core building block of CNN-based classifier. The input mode image is subdivided into different windows, which are convolved with kernel filters to produce the feature maps. The result of the convolution layer is passed through a nonlinear activation function. In this work, the activation function is the Rectified Linear Unit (ReLU). The convolutional layer is then followed by a pooling layer to reduce the size of the feature map. Two blocks of alternating convolutional and pooling layers were considered, where the convolutional layers use 16 and 32 kernels with 3 \(\times\) 3 pixels, respectively. The output feature maps pass through the pooling layers with a max-pooling of 2 \(\times\) 2 pixels. This produces 32 feature maps with 7 \(\times\) 7 pixels after the second pooling layer. Then, these feature maps are flattened to 1-D vector with 1568 length and applied to a fully connected layer which contains 256 weights, sufficient to solve the problem without requiring much resources. Finally, the CNN output layer is 8, or 16, or 32 elements vector (e.g., 8 for 8-ary LG modes and 16 for 16-ary HG modes). The softmax activation function is implemented at the output layer. The position of output vector element of highest value determines the type of received mode pattern. Note that the entries of output vector are of values \(\leq 1\), where each entry represents the probability of corresponding mode type. The sum of all output vector probabilities equals to one. Figure 5: (**a**) CNN-based classifier architecture. (**b**) LDA-based classifier principles. The network training is relying on the back propagation algorithm which updates the network's weights based on gradient of the loss. The loss function (\(L\)) is the cross-entropy, given by [22]  
\[L=-\sum_{j=1}^{N}\sum_{i=1}^{K}t_{ij}\ln(y_{ij}) \tag{3}\]  
where \(K\) is the number of classes, \(N\) is the number of samples, and \(y\) and \(t\) are the predicted and target class (mode) probabilities, respectively. In the training phase, instead of using the entire dataset as input to the CNN, which requires high memory space, the dataset is divided into different batches. Every batch contains 64 images. Further, to reduce the training time, batch normalization (i.e., subtracting the mean of each batch and dividing by the batch standard deviation) is considered. Batch normalization considerably decreases the training time when normalizing the input of each processing layer in the network, not only the network input layer. Moreover, an important hyperparameter for tuning Deep Neural Networks (DNNs) is the use of optimizer. In this study, the adaptive moment optimizer (Adam) is considered with learning rate equals 5 \(\times\) 10\({}^{-3}\). Adam is easy to implement, computationally efficient, and requires less memory resources [23]. Because overfitting is a common challenge in training DNN models, L2 regularization of 10\({}^{-4}\) is used to prevent it. On the other side, to determine the jammer DoA, the CNN-based and LDA classifiers are considered and their performances are compared. The later is considered owing to its simplicity.