## 3 Methods
### Classical SVEP Detection Methods  
The proposed CNN algorithm has been compared with a number of classical methods traditionally used for SSVEP detection. The concepts of utilizing classical and dedicated algorithms for SSVEP detection are illustrated in Figures 6 and 7. Figure 6 demonstrates the application of typical machine learning methods, employing classifiers such as LDA, QDA, SVM, or MLP. The initial step involves training the classifier with data from a calibration session. Only after this step can the test data be classified. The classification process begins with the extraction of features from the EEG signal, followed by the selection of the most effective features. Figure 7 delineates the application of typical dedicated methods (such as CCA and sMP) for analyzing SSVEP. These methods do not necessitate a training session, but they do require knowledge of the frequencies of the stimuli. The aim is to find base signals that most closely correspond to stimuli at frequencies of 5 Hz, 6 Hz, 7 Hz, and 8 Hz. Canonical correlation analysis (CCA) seeks a linear combination between EEG signals and \begin{table}
\begin{tabular}{p{142.3 pt} p{142.3 pt} p{142.3 pt}} \hline \hline
**No.** & **Name of Layer** & **Parameters** \\ \hline
1 & Input Layer & 256 \(\times\) 3 \(\times\) 1 signals with zero-center normalization \\ \hline
2 & Convolution\_1 & 32 filters of size 8 \(\times\) 3 with stride [1 ] and padding ’same’ \\ \hline
3 & Batch Normalization\_1 & Batch normalization with 32 channels \\ \hline
4 & ReLU\_1 & ReLU \\ \hline
5 & Convolution\_2 & 64 filters of size 16 \(\times\) 3 with stride [1 ] and padding \\ \hline
6 & Batch Normalization\_2 & Batch normalization with 64 channels \\ \hline
7 & ReLU\_2 & ReLU \\ \hline
8 & Convolution\_3 & 128 filters of size 32 \(\times\) 1 with stride [1 ] and padding \\ \hline
9 & Batch Normalization\_3 & Batch normalization with 128 channels \\ \hline
10 & ReLU\_3 & ReLU \\ \hline
11 & Convolution\_4 & 128 filters of size 64 \(\times\) 1 with stride [1 ] and padding \\ \hline
12 & Batch Normalization\_4 & Batch normalization with 128 channels \\ \hline
13 & ReLU\_4 & ReLU \\ \hline
14 & Fully Connected & 4 fully connected layer \\ \hline
15 & Softmax & Softmax \\ \hline
16 & Classification Output & Crossentropyvex \\ \hline \hline \end{tabular}
\end{table} 
Table 1: CNN structure. Figure 5: Schematic illustration of using a CNN to classify SSVEPs. sinusoidal signals at the stimulation frequency and its harmonics. The frequency sought is the one for which the maximum correlation between EEG signals and sinusoidal signals, either at the stimulation frequency or its harmonics, is observed to be the largest [41]. Another method tailored for SSVEP detection is the sMP algorithm, which is derived from the well-known matching pursuit (MP) algorithm. However, the set of base functions in sMP is drastically narrowed down to sinusoidal signals at frequencies specifically chosen for visual stimulation. Traditional machine learning methods require a feature extraction stage. Frequency analysis is often used to extract features from the EEG signal to detect SSVEP [42]. This is because, during user stimulation with frequency \(k\), we expect an increased amplitude of the EEG signal in the visual cortex for the stimulation frequency \(k\) and its harmonics \(2k\), \(3k\). In our experiments, feature extraction was performed using DFT analysis. The spectrum was calculated from each second of the EEG signal, with a frequency resolution of 1 Hz. Such resolution should be sufficient to distinguish between the SSVEPs at stimulating frequencies of 5, 6, 7, and 8 Hz. Feature vectors were constructed for each channel, corresponding to one of the two cases:  
1. All frequencies between 1 and 40 Hz were extracted. 2. Only the frequencies of possible stimulations and their second and third harmonics were extracted. For the frequencies of 5, 6, 7, 8 Hz, these were, respectively: 5, 6, 7, 8, 10, 12, 14, 16, 15, 18, 21, and 24 Hz.