Effects of Data Augmentation with the BNNSMOTE Algorithm in Seizure Detection Using 1D-MobileNet

Automatic seizure detection technology has important implications for reducing the workload of neurologists for epilepsy diagnosis and treatment. Due to the unpredictable nature of seizures, the imbalanced classification of seizure and nonseizure data continues to be challenging. In this work, we first propose a novel algorithm named the borderline nearest neighbor synthetic minority oversampling technique (BNNSMOTE) to address the imbalanced classification problem and improve seizure detection performance. The algorithm uses the nearest neighbor notion to generate nonseizure samples near the boundary, then determines the seizure samples that are difficult to learn at the boundary, and lastly selects seizure samples at random to be used in the synthesis of new samples. In view of the characteristic that electroencephalogram (EEG) signals are one-dimensional signals, we then develop a 1D-MobileNet model to validate the algorithm's performance. Results demonstrate that the proposed algorithm outperforms previous seizure detection methods on the CHB-MIT dataset, achieving an average accuracy of 99.40%, a recall value of 87.46%, a precision of 97.17%, and an F1-score of 91.90%, respectively. We also had considerable success when we used additional datasets for verification at the same time. Our algorithm's data augmentation effects are more pronounced and perform better at seizure detection than the existing imbalanced techniques. Besides, the model's parameters and calculation volume have been significantly reduced, making it more suitable for mobile terminals and embedded devices.


Introduction
Epilepsy is a chronic neurological condition caused by aberrant fring of nerve cells in the brain [1]. Epilepsy afects more than 50 million people globally, according to statistics, and the number is growing every year. Despite the fact that some individuals' illnesses can be controlled with medicines or surgery, roughly one-third of persons with epilepsy do not respond well to antiepileptic drugs (AEDs) or have no effective treatment, a condition known as refractory epilepsy [2]. Because of the human central nervous system's structural and functional complexity, aberrant discharges brought on by epileptic seizures can afect various parts of the cerebral cortex or subcutaneous layer. Rapid brain spread results in a variety of epileptic seizure symptoms as well as complex and diverse clinical presentations.
Epilepsy is currently one of the most common disorders, with irregular seizures, often accompanied by loss of consciousness, involuntary convulsions, increased heart rate, and elevated blood pressure [3]. If you are in a potentially risky location at this time, such as stairs or roadways, the patient is likely to get additional harm [4]. Te recurrence of epileptic seizures puts refractory patients at long-term risk of developing epilepsy, which seriously afects their physical and mental health and quality of life. For such intractable epilepsy patients, the current commonly used treatment method is long-range video electroencephalography (VEEG) monitoring, which evaluates the development of the disease by observing the patient's clinical response and analyzing abnormal EEG waveforms during epileptic seizures [5]. However, this approach has drawbacks such as low work efciency, uneven ward monitoring, high treatment costs, and an impact on patients' daily lives, making it unsuitable for long-term monitoring. Automatic epilepsy detection technology will provide a more efcient technique to increase epilepsy diagnosis efciency [6,7].
In order to focus on this problem, researchers are using deep learning techniques. Deep learning is currently being used for a wider range of tasks, such as image classifcation, object detection, and semantic segmentation. By using the region-growing algorithm and the improved genetic algorithm for segmentation and feature extraction, respectively, Kaluri and Pradeep [8] improved the recognition rate by about 10% compared with the existing methods in gesture recognition. In addition, in a follow-up study [9], they improved the region growing algorithm and used an adaptive genetic fuzzy classifer (AGFC) for feature extraction and recognition. Tey used a genetic algorithm with a fuzzy classifer to fnd out the optimal rules generated by the fuzzy classifer, and the fnal average recognition rate could reach 83%.
Te rest of this paper is arranged in the following way: Section 2 outlines the related work about seizure detection. Te proposed methods are detailed in Section 3. Section 4 presents the analysis of the results and the necessary discussion. Finally, the conclusion and prognosis are included in Section 5.

Related Works
Many scholars have expressed interest in automatic seizure detection technology, and various seizure detection algorithms have been presented. Acharya et al. [10] frst applied convolutional neural networks (CNNs) to the study of EEG signal analysis, implementing a 13-layer deep CNN algorithm to detect normal, preictal, and seizure categories. Ultimately, they achieved an average accuracy of 88.7%, a specifcity of 90%, and a sensitivity of 95% on the Bonn dataset. However, its main drawback is the lack of a large EEG database. Te proposed algorithm needs diverse data to achieve the best performance. Segundo et al. [11] processed electroencephalogram signals using the Fourier transform (FT), wavelet transform (WT), and empirical mode decomposition (EMD), respectively. Ten, they used a twolayer CNN for feature extraction and classifcation. Although more than 95% accuracy can be obtained on the Bonn dataset, it is too single to use only one evaluation index. In addition, when combining all transforms, they obtained slightly better results but not statistically diferent from the best result obtained using individual transforms. Gundluru et al. [12] designed a deep learning model with principal component analysis (PCA) for dimensionality reduction, and the Harris Hawks optimization algorithm is used further to optimize the classifcation and feature extraction process. Finally, the specifcity, precision, accuracy, and recall rate are very much satisfactory compared to the existing systems. Nevertheless, in the event of a low-dimensional dataset, the model's ability to perform well may be limited by the possibility of overftting.
Nowadays, multichannel EEG signal detection is commonly used to improve the accuracy of seizure detection. For multichannel EEG signals, Jana et al. [13] studied the effectiveness of discrete wavelet transform (DWT) and EMD feature fusion on four diferent classifers for seizure detection, and fnally, the accuracy and F1-score reached more than 90%. Moreover, Diykh et al. [14] proposed a waveletbased texture approach to detect seizures. Tey found that only 59 of the texture features can exhibit the abnormal increase in EEG amplitude and the spikes notable during a seizure and then designed an ensemble classifer method to realize automatic detection of neonatal seizure from multichannel EEG signals.
Due to the large memory requirements and a large amount of parameter calculation of traditional neural network models, it is difcult to run on mobile terminals and embedded devices. Terefore, lightweight neural networks emerge as the times require. Zhu et al. [15] predicted the feasibility of sudden death in epilepsy (SUDEP) using a lightweight CNN, proposed a baseline CNN model with a lightweight structure, and fnally attained an area under the curve (AUC) of 0.72. Shelatkar et al. [16] applied their modifed lightweight deep learning model to medical imaging. Tey applied YOLOv5's diferent variant algorithm on the Brats 2020 annotated dataset to detect brain tumor location and achieved accuracy rates of 82% to 92%. In recent years, some lightweight network structures have been proposed, such as GhostNet [17], ShufeNet [18], and MobileNet [19], among which the MobileNet series is particularly efective and more representative. Silva et al. [20] used MobileNet combined with transfer learning for EEG analysis in the study of automatic diagnosis of alcoholism patients. Tey fnally achieved 95.33% accuracy and 95.24% F1-score, far exceeding the performance of classical extractors, which also proves the superiority of MobileNet series.
However, existing studies focus mostly on new feature extraction and classifcation approaches, while the disparity between seizure and nonseizure data distribution remains a technological challenge. In fact, in long-term continuous EEG recordings, due to the contingency of seizures, the nonictal period is substantially longer than the ictal period [21]. If it is not processed, the discriminant decision is likely to be biased towards the majority classes, negatively impacting classifcation results. Terefore, data balance is crucial to improve epilepsy detection performance.
Recently, some studies on imbalanced epilepsy datasets have been undertaken to address this issue. Amin and Kamboh [22] combined random undersampling with AdaBoost to classify epilepsy signals. Although they achieved good results, they lost a lot of valid data, so undersampling was not an efective method. Alkanhal et al. [23] employed random sampling techniques to balance the proportion of data in ictal and nonictal periods and optimize the complexity of the network, which improved the sensitivity, specifcity, and accuracy to a certain extent. However, they converted EEG signals into multispectral and temporal images, which inevitably lost some of their signature information. To increase the number of preictal EEG signals, Zhang et al. [24] performed signal segmentation and reorganization in the temporal domain, followed by a feature extraction method combining wavelet packet decomposition (WPD) and common spatial pattern (CSP), and fnally CNN for classifcation. Teir advantage in dealing with imbalances is that they produce real data. However, they disrupted the original arrangement and distribution order because they randomly selected training segments for series, which went against the original intention of seizure detection and could not be applied to the research and development of smart devices. Zhao et al. [25] utilized focal loss to redefne the loss function of the linear graph convolution network (LGCN) to deal with the data imbalance problem during seizure detection. Finally, the accuracy of 99.30% and F1-score of 98.73% were achieved on the CHB-MIT dataset. Haldar et al. [26] adopted the synthetic minority oversampling technique (SMOTE) and selective preprocessing of imbalanced data algorithm (SPIDER) for imbalanced data, together with the k-nearest neighbor (KNN) classifer to increase epilepsy detection performance. Te experimental results are up to 95% accuracy and F1-score. Jiang and Zhao [21] combined the SMOTE algorithm with the undersampling TomekLink technique to balance the data set, and compared with the previous fve unbalanced processing methods, the sensitivity and accuracy reached 86% and 94%, respectively. However, there was no detailed analysis in the data preprocessing part, and the performance of individual patients in the experimental results was still very poor, and some even had a sensitivity lower than 60%. Kumar et al. [27] evaluated the empirical performance of six classifers on seven diferent category balancing techniques on fve imbalanced clinical datasets according to the imbalance problem in clinical datasets so as to achieve the purpose of data augmentation. Relatively speaking, SMOTEEN with KNN provided the highest accuracy, recall, precision, and F1-score over all the machine learning techniques all others for the BCD dataset. Gao et al. [28] built a generative adversarial network (GAN) to perform data augmentation to produce EEG data during seizures, which could be used to form a more balanced training set. Ten, they designed a pyramidal one-dimensional CNN (1D-CNN) to process 1D EEG signals and achieved good results on three diferent epilepsy data sets.
In addition to the above-imbalanced treatment methods, there are also random oversampling (ROS) and improved borderline-SMOTE (BLSMOTE) [29] and SVM SMOTE algorithms based on SMOTE. Chen et al. [30] introduced the BLSMOTE algorithm to obtain a more balanced EEG feature set. Ten, the 1D-CNN model is trained for three-classifcation in two dimensions of emotional valence and arousal, and fnally, the average accuracy rate of 32 subjects on valence and arousal are 97.47% and 97.76%, respectively. It proves the validity of the idea of "data augmentation + classifcation," which is very helpful for the research of our paper. However, there are some faws in the BLSMOTE algorithm. It will cause the model to overlearn boundary data features, diminishing the infuence of other data on the model, and it will be unable to efectively distinguish noise samples. Furthermore, in some cases, the method does not detect seizure samples at borderline locations [31]. In addition, although GAN can generate clearer and more realistic samples, it is not suitable for processing discrete text data. Moreover, it also sufers from training instability, gradient disappearance, and mode collapse. In short, the above-imbalanced treatment methods either have no obvious data enhancement, or the processing process is complex and unstable.
In this work, we propose a novel oversampling algorithm named the borderline nearest neighbor synthetic minority oversampling technique (BNNSMOTE) in response to the previous issues. Our study adopts the fusion algorithm of BNNSMOTE and 1D-MobileNet to handle the data imbalance problem, resulting in higher accuracy, fewer parameters, and lower computing complexity. Te specifc contributions of this paper can be summarized as follows: (a) We use channel screening to improve the operation efciency and perform data segmentation based on sliding windows to obtain enough samples. (b) We introduce data augmentation algorithm BNNSMOTE, for getting more balanced EEG data of epilepsy. Using the idea of the nearest neighbor, the method constructs difcult-to-learn boundary seizure samples after fltering out noise samples and then selects seizure samples at random to be used in the synthesis of new samples. Moreover, we also compared the existing ROS, SMOTE, BLSMOTE, and SVM SMOTE algorithms in detail to refect the superiority of this algorithm. (c) We train a dichotomous 1D-MobileNet model based on seizure detection and compared the parameters and computational load with the traditional network model, which highlights the lightweight characteristics of the model. (d) In order to prove the universality of our proposed algorithm, we also use other data sets for verifcation. We can still get good results on the Bonn dataset, which also proves the generalization ability of our proposed algorithm and model.
Experimental results suggest that our algorithm can signifcantly improve the binary classifcation results of epilepsy seizure and nonseizure when compared to conventional imbalanced EEG data processing (IEDP) algorithms, which dramatically enhance the performance of epilepsy detection.

Proposed Methods
Tis paper extracts the synchronization features of multichannel epilepsy EEG signals based on EEG signal characteristics and makes various patients train and test separately. In addition, due to the diferences between the data of each channel, the signal characteristics contained in them may be complementary, so they should be trained individually while undertaking epilepsy detection tasks. Te workfow of the proposed seizure detection system is shown in Figure 1. Raw EEG signals are preprocessed and channel selected before imbalance processing. Next, the processing data are used as 1D-MobileNet input data, which is then trained and tested to identify epilepsy automatically.

BNNSMOTE.
In the process of synthesizing new samples, not all seizure samples are important, as some of them may be easily learned and provide little information for the synthesis of new samples. Terefore, it is necessary to identify a sample set of seizures that are difcult to learn and synthesize new samples from them. Tese samples are usually located near the decision boundary. Although the BLSMOTE algorithm tries to fnd a set of hard-to-learn samples, it cannot correctly identify all of them. Besides, the BLSMOTE algorithm cannot efectively distinguish noise samples, it will also make the model overlearn boundary data features while weakening other data features. Moreover, in some cases, it does not fnd seizure samples at borderline locations. To overcome the challenges mentioned previously, we propose a BNNSMOTE algorithm for constructing boundary samples based on the nearest neighbor. Tis algorithm uses the nearest neighbor notion to generate nonseizure samples near the boundary after fltering out noise samples. Moreover, it identifes the difcult-to-learn seizure samples at the border and lastly selects seizure samples at random to be used in the synthesis of new samples. Te basic ideas are as follows: (a) We flter the original seizure samples to remove noise (b) We construct the hard-to-learn boundary seizure sample set (c) We synthesize new seizure samples Figure 2 shows a schematic diagram of its new sample synthesis. Algorithm 1 depicts the whole algorithm for augmenting data with BNNSMOTE.

1D-MobileNet.
Te existing neural network structure has a big memory need and a huge number of parameter calculation, making it difcult to use on mobile terminals and embedded devices. Based on this, in view of the characteristic that EEG signals are one-dimensional signals, we design a lightweight 1D-MobileNet model. As shown in Figure 3, it includes a one-dimensional convolutional layer (Conv1d), a bottleneck block, an average pooling layer (Average Pooling), a fully-connected layer (FC Layer), and a linear classifer (Linear). Table 1 shows the model's detailed network parameters, where t is the expansion factor, c is the channel of the output matrix, n is the number of module repetitions, and s is the step size.
Te core part of the model is the bottleneck block, which includes a depthwise separable convolution and an inverted residual module. Unlike ResNet, the inverted residual always extracts features using depthwise convolution. Te diference between it and standard convolution is that the parameters and amount of calculation are substantially reduced when the accuracy is practically unchanged.

Dataset.
Te CHB-MIT EEG dataset, which includes scalp EEG (sEEG) recordings of 23 patients with medically intractable focal epilepsy obtained from 22 subjects, was used in this study [32]. Te case "chb24" was added later, and each EEG recording contained 23 commonly used channels [33]. Because the acquisition time of case "chb04" is too long, the duration of case "chb06" and case "chb16" episodes is too short, and case "chb12" comprises alterations in electrode montage. Te previous 4 cases will be eliminated in the follow-up study.

Data Processing.
It is required to denoise the original signal for the sake of extracting EEG signal features more efectively. Tis paper flters with a 0.5-50 Hz Butterworth bandpass flter before performing sliding segmentation. In order to increase the amount of samples, we adopt the sliding window of 4 s and the step size of 2 s to select the EEG signal of patients for analysis, with each segment corresponding to 1024 sampled data. Te EEG signal of patients is classifed into two categories in this paper: ictal and nonictal.
In order to optimize the channel selection, for the 23 commonly used channels, a one-way analysis of variance (ANOVA) was utilized to judge if there is a signifcant diference between the ictal and nonictal states of the channel. After the previous screening and according to the common channels among diferent patients, 10 channels were fnally determined, as shown in Table 2.

Evaluation Metrics.
Te detection of seizures is classifed as a binary classifcation problem. In this paper, positive samples represent epileptic seizures, and negative samples represent nonseizures. Table 3 shows the confusion matrix, which lists the four possible detection results: true positive (TP), false positive (FP), true negative (TN), and false negative (FN) [14]. Equation (1) has a formula for accuracy, equation (2) shows for recall, and equation (3) represents precision.
Te F1-score formula as shown in equation (4) is the harmonic mean of precision and recall as follows: F1 � 2 × precision × recall precision + recall , A 5-fold cross-validation method was utilized for each situation to evaluate the robustness of the proposed Input: seizure sample set P � P 1 , P 2 , . . . , P p and nonseizure sample set Q � Q 1 , Q 2 , . . . , Q q Output: seizure sample set after imbalance treatment P new (1) Calculate the k-nearest neighbor set NN(P i ) of P i (2) Denoised seizure sample set P′ � P − P i ∈ P: no seizure samples in NN(P i ) (3) Calculate the k-nearest neighbor nonseizure set NN q (P Calculate the number of new samples that each seizure sample should generate T

Result Analysis.
Te data set is processed by ROS, SMOTE, BLSMOTE, SVM SMOTE, and BNNSMOTE algorithms, respectively, and the processed data are input into the 1D-MobileNet model for classifcation and testing. Te following is a brief description of several IEDP technologies.

ROS.
ROS is the simplest oversampling technique to balance the imbalance of data sets. It balances the data by copying a few class examples without any loss of information. However, if noisy samples are selected for replication, the interference of noise signals will be increased. In addition, too many repeated samples will reduce the decision-making area of the model and cause overftting.

SMOTE.
SMOTE works by using the k-nearest neighbor algorithm to create synthetic data. It can get the new sample data after some operation between the selected two samples and add the new data to the sample data set, which solves the problem of learning repeated feature information from a large number of the same data caused by ROS. However, the SMOTE algorithm cannot efectively solve the efect of noise data on classifcation. On the contrary, if there are too many noisy data in the data set, the SMOTE algorithm will also synthesize new sample data according to the algorithm principle and add it to the data set. Tis will aggravate the adverse efect of noisy data on the classifer, thus afecting the overall classifcation performance.

BLSMOTE.
In the BLSMOTE technique, only seizure samples near the boundary were oversampled. It avoids the bad efect of expanding noisy data on the classifer. At the same time, the boundary feature information between the two types of data is strengthened, which makes it easier for the classifer to learn more distinct features from the boundary of the two types of data. However, it cannot effectively distinguish the noise samples and will cause the model to overlearn the boundary data features so as to weaken the infuence of other data on the model. Furthermore, in some cases, this method cannot accurately fnd the seizure samples at the boundary locations.

SVM SMOTE.
Another variant of BLSMOTE is SVM SMOTE. Tis technique combines a support vector machine (SVM) algorithm to identify misclassifed points. After training the SVM classifer on the original training set, the boundary region is approximated by the support vector. Synthetic data are then randomly created along a line connecting each seizure sample support vector to its multiple nearest neighbors. However, it has similar pitfalls as BLSMOTE and is difcult to implement for large training samples. Figure 4 shows the performance efect of diferent IEDP algorithms in each channel using the channel of case "chb01" as an example. Because each channel carries a varied quantity of information, each channel's accuracy varies, with channel "ch22" having the best efect and the most obvious features. Except for the higher recall rate after SMOTE processing, almost all other indicators have the best efect of BNNSMOTE. Generally speaking, the precision and the recall have an inverse relationship: the greater the precision, the lower the recall; the lower the precision, the higher the recall. Diferent detection tasks have diferent requirements for the two. Te comprehensive F1-score is commonly used to measure both when there are high criteria for both. Moreover, the higher the F1-score, the more robust the model is. In our paper, in addition to detecting the generally used accuracy, the comprehensive F1-score can better refect the performance of the algorithm. Table 4 shows the accuracy and F1-score of the 1D-MobileNet model in each patient. Te average accuracy and F1-score of our proposed algorithm achieve the best values of 99.40% and 91.90%, respectively. Figure 5 shows the detection performance of diferent IEDP algorithms in every patient. Similar to Figure 4, for almost every case, the proposed algorithm performs best overall in seizure detection. Especially in case "chb09," her performance metrics have reached the best, with a recall rate of 94.71%, a precision of 100%, an F1-score of 97.62%, and an accuracy of 99.93%. However, there are also some cases with low detection results. For example, the F1-score of case "chb15" after employing numerous IEDP algorithms are 73.4%, 75.86%, 69.31%, 73.66%, and 82.0%, respectively. It is possible that too much noise interfered with the data during collecting, blurring the lines between diferent sorts of samples. Tese situations will be improved in future studies to better identify the boundaries between diferent sorts of samples.
To verify the superiority of our algorithm, we compare the traditional ROS, SMOTE, BLSMOTE, and SVM SMOTE algorithms, as shown in Table 5. Te results reveal that after balancing treatment, the detection efect is greatly improved. Te SMOTE algorithm has the best recall value but the lowest precision value when compared to unprocessed data. Yet the BNNSMOTE algorithm proposed in this research has the best efect in terms of precision, F1-score, and accuracy. Because the algorithm can not only efectively identify and remove noise samples but also selectively learn seizure samples, identify difcult-to-learn seizure samples, and synthesise new samples to enhance the diference between diferent samples. Te proposed algorithm corrects the faws in the BLSMOTE algorithm, increasing precision and F1-score by 12% and 6%, respectively. As a result, the overall efect of our proposed BNNSMOTE algorithm is the best, and it outperforms the existing IEDP technique. Table 6 compares the parameters and computation quantity of several network models. Te parameters and calculation amount of the 1D-MobileNet model proposed in this work are only 2.2 M and 94 M. Compared with the traditional network, our network considerably reduces the parameters and calculation amount when the accuracy is improved. Furthermore, the parameters of our model are just half of those in the standard MobileNet model, which is better suited to mobile terminals and embedded devices.
In order to verify the universality of the proposed algorithm, Table 7 shows the comparison of the results of the Bonn dataset after IEDP. No matter what the imbalance ratio between the seizure sample and the nonseizure sample is, the BNNSMOTE algorithm can achieve a good efect in accuracy and F1-score, which also proves the generalization ability of the algorithm. Table 8 compares this work to earlier research, all of which were assessed using the CHB-MIT dataset, including methods, the number of patients, and the indicators. Te traditional machine learning methods such as linear discriminant analysis (LDA) [34], SVM [21,35], random forest (RF) [40], and others were used for seizure detection. Tese approaches yielded accuracy ranging from 89.49% to 96.87%, with the SVM in [35] attaining the highest accuracy of 96.87% but only 72.99% recall. Te deep-learning approaches, including long-short term memory (LSTM) [36,42], CNN [37,41], recurrent neural network (RNN) [38], as well as autoencoders [39], achieved the accuracy ranging from 84.00% to 99.83%. Among them, [41] introduced a new model, ScoreNet, which was combined with CNN to obtain the maximum accuracy of 99.83% but only 76.54% recall. In addition, DenseNet-LSTM, a new deep-learning hybrid model developed by [42], achieved over 90% of the four basic indicators. However, the network is too complex and the data imbalance is not dealt with in depth. [43] proposed a graph attention network, which fully explored the spatial relationship of diferent EEG electrodes on the scalp with the self-attention mechanism. Te model also adopted focal loss to deal with the data imbalance problem that appeared in seizure detection, and the fnal results demonstrated the superior performance and stability of the proposed method. However, when they converted EEG signals into two-dimensional graphics, some data features were lost, resulting in incomplete feature information extracted. In this paper, the original one-dimensional EEG signal is directly input, and all the features are preserved. Diferent from previous methods, [44] frst mixed unsupervised learning (UL) and supervised learning (SL) methods in the feld of seizure detection. Te hybrid method used a small amount of labeled data to train the model while achieving satisfactory seizure detection ch03 ch04 ch07 ch08 ch13 ch14 ch15 ch16 ch20 ch22   performance. Nevertheless, the use of the EasyEnsemble algorithm in undersampling will lead to the loss of sample information during a seizure, ignoring many pieces of potentially useful seizure sample information.

Performance Comparison.
In comparison to the approaches described previously, our algorithm has a 99.40% average accuracy after 5-fold cross-validation, and the recall, precision, and F1-score reach 87.46%, 97.17%, and 91.90%, respectively. Terefore, in terms of accuracy, the performance of our method surpasses most of the previous research in Table 8, demonstrating that the proposed BNNSMOTE and 1D-MobileNet combination was efective. We also had considerable success when we used the Bonn dataset for verifcation. In fact, the data processing portion of the experiment will take a long time, and a large number of experiments will be required to discover the best outcome. In this work, we used a sliding window of 4 s and a step size of 2 s to expand the data and enhance the diversity of samples and used the 5-fold crossvalidation approach to get good results fnally. Furthermore, as shown in Table 6, the parameters and calculation amount of the model introduced in this study were greatly decreased compared with other models, saving the system memory. Tis is not observed in other algorithm models, which is also a major feature of this paper, and it will substantially facilitate the future use of mobile terminals and the realization of embedded AI.

Conclusions
In this work, we have proposed a novel oversampling method named the BNNSMOTE algorithm for data augmentation to address the imbalance problem in seizure detection. Ten, the 1D-MobileNet model was utilized to verify the performance of the proposed algorithm, and the parameters and calculation of the model are greatly reduced. Experimental results demonstrated that this method has a better efect on the CHB-MIT dataset than the existing seizure detection algorithms, which also provides a very efective method for other felds. Such a lightweight network structure also provides a theoretical basis for the development of smart medical care. In the future, on the one hand, it is necessary to improve the efect of data processing, continue to optimize the model algorithm, and enhance the detection performance. On the other hand, it will be combined with embedded hardware to realize embedded AI and truly achieve the purpose of real-time monitoring and real-time alarm.

Conflicts of Interest
Te authors declare that they have no conficts of interest.