## 1 Introduction  
Epilepsy is one of the most prevalent neurological disorders, affecting tens of millions of individuals worldwide. Patients diagnosed with epilepsy experience seizures, which are the primary clinical manifestation of the condition. A diagnosis of epilepsy is established after a patient experiences two or more unprovoked seizures, separated by at least 24 h [1]. Seizures vary in type, duration, and severity, and regardless of the specific characteristics, they represent a distressing and, at times, painful experience for the patient. These seizures may range from brief lapses of consciousness to severe muscular spasms, and in some instances, they pose significant risks. Patients may sustain injuries from falls or while handling hazardous objects or machinery. The abnormal neuronal activity (reaching up to 500 discharges per second) associated with seizures can also lead to brain cell damage, particularly during prolonged seizures or those occurring in rapid succession, a condition known as _status epilepticus_[2]. Numerous studies emphasize the importance of implementing automated methods for the detection of epileptic activity, as well as for the diagnosis and prediction of epileptic seizures [3]. Such methods can help minimize human errors by medical professionals,particularly those caused by fatigue after long periods of analyzing subtle differences in numerous recorded MEG images. This is crucial in preventing epileptic seizures and enables continuous machine-based monitoring of patients in critical conditions. While several advanced models have been proposed for EEG classification [3], fewer publications address the classification of MEG data, with most utilizing advanced artificial neural networks (ANNs). However, none of these studies have conducted a comprehensive examination of basic ANN models. [PERSON] et al. proposed an automatic feature extraction from EEG Spectra and classification method using deep convolutional neural networks integrating three DCNNs: Inception-ResNet-V2, Inception V3, and ResNet152 achieving an average classification accuracy of over 90% [4]. [PERSON] et al. in their work [5] tested a deep learning strategy derived from robust methods for object recognition tasks in the computer vision field on the EPILEPSIAE and CHB-MIT Scalp EEG Signal datasets, achieving global accuracy and specificity levels of 92.9 \(\pm\) 21.8 and 93.1 \(\pm\) 21.9, respectively. [PERSON] et al. experimented with pretrained models including AlexNet, DenseNet201, EfficientNet, ResNet18, etc. They also introduced a multimodal two-branch CNN which can extract low- and high-frequency features from EEG signals. This model obtains a comparable performance to that of the state-of-the-art approaches with 97% accuracy. The dataset used was the publicly available EEG dataset of the University of Bonn, consisting of five subsets, each subset contains 100 single-channel EEG segments of 23.6 s duration [6]. In [7], [PERSON] tried feature extraction from several Wavelet transforms of EEG signals, then fed into different ANNs, achieving a best accuracy of 99.4% with a model called the NN-D ensemble classification method. He also used the dataset of the University of Bonn. [PERSON] et al. applied a radial basis function neural network (RBFNN) that uses a modified particle swarm optimization (PSO) algorithm to optimize the mean square error [8]. This method produced a maximum accuracy of 99% tested on two datasets. The first dataset was an EEG dataset for epileptic seizure identification, and the second dataset was an EEG dataset for eye state prediction, both publicly available. [PERSON] et al. developed Mnet, a novel deep convolutional neural network to classify multiple neurological diseases using resting-state magnetoencephalography (MEG) signals. The dataset consisted of MEG signals of 67 healthy subjects, 26 patients with spinal cord injuries, and 140 patients with epilepsy and was used to train and test the network using 10-fold cross-validation.