## 2 Material and Methods
Our models were built and tested on a Hewlett-Packard Elite 800 G9 (HP Development Company, Palo Alto, CA, USA) machine with an Intel i5 10,500 3.1 GHz 6-core processor (Intel Corporation, Santa Clara, CA, USA) and 16 GB of RAM, using MATLAB R2018a (9.4.0.813654) as the programming environment, which was provided by the Laboratory of Applied Mathematics at the Hellenic Open University. In this study, we employed several artificial neural network (ANN) models to classify the collected MEG segments. We began by evaluating simple feed-forward neural networks (FFNNs), one of the most basic ANN architectures. These models consist of multiple fully connected layers of artificial neurons. The input MEG segment, comprising 256 samples, is fed into all 256 neurons of the input layer. Each neuron transforms its input by applying the function described in Equation (1),  
\[y=f(\sum w_{i}x_{i}-b) \tag{1}\]  
where \(x_{i}\) are the inputs of the neuron, \(w_{i}\) are the weights, \(b\) is the bias applied to the neuron, and \(f\) is a nonlinear activation function. In our study, we used the Hyperbolic Tangent Sigmoid Transfer Function in the hidden layers and Linear Transfer Function for the output layer. The outputs of all the neurons of one layer serve as the inputs to all the neurons of the next layer. The parameters \(w_{i}\) and \(b\) are formed by the procedure called _training_, and its goal is to minimize the difference between the network's actual output and the desired output [28]. In this study we used the Levenberg-Marquardt Training Algorithm. Convolutional NNs, on the other hand, use a series of convolution, pooling, and fully connected layers in order to extract feature hierarchies beginning from low- and moving towards higher-level patterns. The role of the convolution layer is fundamental. Anoptimized feature extractor, called the kernel, is applied to each position of the signal. Every layer's output is the input of the next layer, so the extracted features may progressively become more complex. The parameters of the kernels are optimized by training performed by means of the backpropagation algorithm-gradient descent [29]. CNNs exploit local spatial correlations by processing small receptive fields rather than treating all input features as independent. The computational complexity per layer of CNNs is O(K\({}^{2}\)-C\(\cdot\)F) where K is the filter size, C is the number of channels, and F is the number of filters. For FFNNs, the computational complexity per layer is O(N\(\cdot\)M) where N is the number of input neurons, and M is the number of output neurons. Since K\({}^{2}\ll\) N, CNN layers tend to require far fewer computations than fully connected layers with the same number of neurons. Furthermore, training a neural network involves _backpropagation_, where gradients of the loss function are computed with respect to each parameter. Since CNNs have fewer parameters than FFNNs, they require fewer gradient updates per epoch, leading to faster convergence during training [30]. In the first part of our study, we conduct four groups of experiments using feed-forward neural networks (FFNNs) and one-dimensional convolutional neural networks (1D-CNN). The first group (Group I) consists of two identical experiments (Exp. 1, 2), both in terms of the type of data and the model used. However, the results differ due to the heuristic nature of the experiments. We use a feed-forward neural network (FFNN) with five hidden layers consisting of 64, 32, 32, 32, and 16 neurons, respectively. The data used in this experiment are the raw values of the 256 samples for each segment of our signal. In the second group (Group II), we employ three FFNNs of different sizes. In Exp. 3, we train a two-hidden-layer network with 32 and 16 neurons, respectively. In Exp. 4, we train a four-layer network with 64, 32, 32, and 16 neurons, respectively. In Exp. 5, we train a three-hidden-layer network with 64, 32, and 16 neurons, respectively.