## 2 Material and Methods
The diagnoses were based on clinical manifestations, electroencephalography findings, and brain MRI scans when it was necessary. MEG signals were recorded while the patients were in a resting state with their eyes closed. In this study, we analyzed MEG signals recorded from 122 points on the patients' brains, with a sampling frequency of 256 Hz and a duration of 9 seconds. A low-pass filter with a cutoff frequency of 30 Hz was applied to all channels. In a few instances, due to sensor malfunctions, six (6) channels (6 \(\times\) 9 = 54 segments) contained values outside the acceptable range and were subsequently excluded from analysis. The remaining signals were segmented into [(5 \(\times\) 122) \(-\) 6] \(\times\) 9 = 5436 items (signal segments), each consisting of 1 channel with a duration of 1 second, resulting in 256 samples per segment. Each segment was independently classified by specialized neurologists as either containing epileptic activity (2059 segments) or not (3377 segments). Despite the absence of data from healthy patients, our dataset includes a sufficient number of non-epileptic segments (62.1%). The  
Figure 1: From top to bottom: Signal plot, the Spectrum bar graph, and the heatmap of the corresponding channel’s ST-FFT of a non-epileptic MEG segment (**a**) and an epileptic MEG segment (**b**). The graphs have been normalized so that all axes have the same calibration. In (**c**), we see the Spectrum bar graph and the heatmap of the corresponding channel’s ST-FFT of the same non-epileptic MEG segment as (**a**), with different axis scaling to better depict the signal’s details. data were randomly divided into three sets: 80% for the training set, 10% for the test set, and 10% for the validation set. To statistically support our results, we performed within-subject statistical tests on the spectra of the measured signals. For each one of the 31 frequency components (0-30 Hz), we performed a _t_-test on the null hypothesis that the power of the frequency band in the segments showing epileptic activity comes from the same distribution as that of the segments that do not show epileptic activity. In total, 31 \(\times\) 5 tests were performed, and the null hypothesis was rejected with very small _p_-values (mean _p_-value: 1.38 \(\times\) 10\({}^{-2}\)) for all but 6 tests (Subject 1--Frequency 5 Hz; Subject 2--Frequency 7 Hz; Subject 5--Frequencies 8, 9, 11, 27 Hz) [24]. Furthermore, the correlation across the signal channels was measured, showing that the degree of correlation is rather small (mean correlation coefficient: 0.066). The number of channel pairs having correlation above 0.5 is 1105 (0.6%), and the number of channel pairs having correlation above 0.3 is 3427 (1.88%). This can be explained because MEG, in contrast to EEG, is capable of recording the brain signal in great detail, at mm scale, with minimum interference, since the recording is performed in a Faraday cage [19]. Two additional points must be stressed. First, due to its high sensitivity, MEG is capable to detect epileptiform activity even if the patient is at the interictal state. As it was pointed out, even by early MEG studies in epilepsy, this kind of activity is persistent even if the patient is not experiencing an epileptic seizure. In addition, epileptiform activity not only is present at the interictal state but also manifests spatiotemporal stationarity [25]. The second point is that MEG signals were recorded using second-order SQUID sensors that avoid capturing overlapping magnetic activity emitted by nearby brain locations [26,27]. However, even if we had a significant correlation between many neighboring channels, this would not cancel the significance of our experiment. There is a need to move towards creating a device capable of collecting brain signals from a single patient and decide whether the patient is showing signs of epileptic brain activity that may lead to a seizure.