## 2 Methods
### OSA Detection Based on Machine Learning Techniques  
As previously introduced in Section 1, many prior studies addressing OSA detection from RPs have typically combined RQA features with conventional ML classifiers [6]. In these cases, the most commonly computed features from RPs have often included the following [24]:  
\begin{table}
\begin{tabular}{c l l l} \hline
**Layer** & **Type** & **Input Size** & **Output Size** \\ \hline
1 & Input & \(227\times 227\times 3\) & \(227\times 227\times 3\) \\
2 & Convolutional & \(227\times 227\times 3\) & \(227\times 227\times 32\) \\
3 & Max Pooling & \(227\times 227\times 32\) & \(114\times 114\times 32\) \\
4 & Convolutional (ReLU) & \(114\times 114\times 32\) & \(114\times 114\times 64\) \\
5 & Max Pooling & \(114\times 114\times 64\) & \(57\times 57\times 64\) \\
6 & Convolutional (ReLU) & \(57\times 57\times 64\) & \(57\times 57\times 128\) \\
7 & Max Pooling & \(57\times 57\times 128\) & \(28\times 28\times 128\) \\
8 & Fully Conn. (ReLU) & \(28\times 28\times 128\) & \(256\) \\
9 & Fully Conn. (ReLU) & \(256\) & \(2\) \\
10 & Fully Conn. (Softmax) & \(2\) & \(2\) \\ \hline \end{tabular}
\end{table}
Table 2: Layer breakdown of cuCNN.  
\begin{table}
\begin{tabular}{l l l l} \hline
**L** & **Type (Activation)** & **Input Size** & **Output Size** \\ \hline
1 & Input & \(227\times 227\times 3\) & \(227\times 227\times 3\) \\
2 & Convolutional (ReLU) & \(227\times 227\times 3\) & \(55\times 55\times 96\) \\
3 & Max Pooling & \(55\times 55\times 96\) & \(27\times 27\times 96\) \\
4 & Convolutional (ReLU) & \(27\times 27\times 96\) & \(27\times 27\times 256\) \\
5 & Max Pooling & \(27\times 27\times 256\) & \(13\times 13\times 256\) \\
6 & Convolutional (ReLU) & \(13\times 13\times 256\) & \(13\times 13\times 384\) \\
7 & Convolutional (ReLU) & \(13\times 13\times 384\) & \(13\times 13\times 384\) \\
8 & Convolutional (ReLU) & \(13\times 13\times 384\) & \(13\times 13\times 256\) \\
9 & [PERSON] & \(13\times 13\times 256\) & \(6\times 6\times 256\) \\
10 & Fully Conn. (ReLU) & \(6\times 6\times 256\) & \(4096\) \\
11 & Fully Conn. (ReLU) & \(4096\) & \(4096\) \\
12 & Fully Conn. (Softmax) & \(4096\) & \(2\) \\ \hline \end{tabular}
\end{table}
Table 3: Layer breakdown of AlexNet (modified for OSA detection).  
* Recurrence rate (REC): percentage of points in the plot that represent recurrences or instances where the system revisits a similar state.
* Determinism (DET): percentage of recurrence points which form diagonal lines.
* Shannon entropy (ENTR): Shannon entropy of the probability distribution of the diagonal line lengths.
* Average diagonal line length (L): average length of all diagonal lines within an RP.
* Divergence (DIV): inverse of the length of the longest diagonal line, which also corresponds to the sum of the positive Lyapunov exponents [51].  
Thus, OSA detection was also tackled by combining the above parameters through the most common ML classifiers, such as support vector machine (SVM), k-nearest neighbor (KNN), decision tree (DT), and two random forest-based ensemble classifiers, i.e., adaptive boosting (ADA) and bootstrap aggregation (BAG). Specific parameters were chosen for each case. More precisely, SVM used a Gaussian radial basis function kernel (kernel scale 1, polynomial order 3). In addition, the KNN algorithm employed the Euclidean distance method with equal weights. DT models were set with a maximum of 2 splits, a minimum leaf size of 1, and a minimum parent size of 10, adhering to the classification and regression trees (CART) predictor [69]. Ultimately, both ensemble models underwent 100 learning cycles using the decision tree learner, differing only in ADA's learning rate set at 1.