L-Tetrolet Pattern-Based Sleep Stage Classification Model Using Balanced EEG Datasets

Background: Sleep stage classification is a crucial process for the diagnosis of sleep or sleep-related diseases. Currently, this process is based on manual electroencephalogram (EEG) analysis, which is resource-intensive and error-prone. Various machine learning models have been recommended to standardize and automate the analysis process to address these problems. Materials and methods: The well-known cyclic alternating pattern (CAP) sleep dataset is used to train and test an L-tetrolet pattern-based sleep stage classification model in this research. By using this dataset, the following three cases are created, and they are: Insomnia, Normal, and Fused cases. For each of these cases, the machine learning model is tasked with identifying six sleep stages. The model is structured in terms of feature generation, feature selection, and classification. Feature generation is established with a new L-tetrolet (Tetris letter) function and multiple pooling decomposition for level creation. We fuse ReliefF and iterative neighborhood component analysis (INCA) feature selection using a threshold value. The hybrid and iterative feature selectors are named threshold selection-based ReliefF and INCA (TSRFINCA). The selected features are classified using a cubic support vector machine. Results: The presented L-tetrolet pattern and TSRFINCA-based sleep stage classification model yield 95.43%, 91.05%, and 92.31% accuracies for Insomnia, Normal dataset, and Fused cases, respectively. Conclusion: The recommended L-tetrolet pattern and TSRFINCA-based model push the envelope of current knowledge engineering by accurately classifying sleep stages even in the presence of sleep disorders.

• L-tetrolet pattern: a new, Tetris-inspired, textural feature generation function; • Statistical feature generator: created by fusing multiple pooling decomposers; • TSRFINCA: a three-leveled hybrid and iterative feature selector. Contributions: • A new feature engineering model has been created by proposing new generation feature extraction, decomposition, and feature selection methods. The essential purpose of the proposed feature engineering model is to extract the most informative features from the used signals to obtain high classification performance with low time complexity. • This research presents a highly accurate EEG classification model for sleep stage detection. By deploying the presented classification model, sleep stage classification results of the CAP sleep dataset are presented using three cases. Our proposal denotes general high classification performance since we applied this model to three different datasets.

Convolutional Neural Network
The Sleep Heart Health Study dataset [39] C4-A1, C3-A2 Accuracy: 87.00 Goshtasbi et al. [40] Convolutional Neural Network Softmax SHHS dataset [36] C4-A1, C3-A2 Accuracy: 81.30 Kappa: 74.00 Shahbakhti et al. [41] Nonlinear Analysis Linear discriminant analysis DREAMS dataset [42] Fp1, O1, and CZ or C3 Accuracy: 92.50 Sensitivity: 89.90 Specificity: 94. 50 Zhao et al. [43] SleepContextNet Softmax 1. SHHS dataset [36] 2. CAP dataset [24,44] C4-A1 and C3-A2 To support our novelty claims and to substantiate the key contributions, we have structured the manuscript as follows. The next section introduces the dataset used to design and test the sleep stage classification model. Section 3 outlines the processing methods that were used to implement and test the proposed sleep stage detection model. The model was evaluated with a set of experiments. Section 4 specifies these experiments and provides the corresponding results. The subsequent discussion section relates our results to the wider sleep research area. We also list limitations and future work before concluding the paper.

Material
The CAP sleep stage dataset is a widely used benchmark dataset. The dataset consists of EEG recordings during the Non-REM (NREM) sleep phase. These data were obtained from 108 polysomnographic patients registered at the Sleep Disorders Center of the Ospedale Maggiore of Parma in Italy [24]. The data were recorded as .edf files [47]. Sleep data comprises at least three EEG channels, two EOGs, submentalis muscle EMG, bilateral anterior tibial EMG, respiratory signals, and ECG. In total, 16 of the subjects were healthy, and 92 were pathological. Table 2 shows the neurological status and number of subjects [44]. The age range of the subjects is 14-82, and the average age is 45. In total, 61% of the subjects were men (66 people), and 38% were women (42 people). The CAP Sleep Database has been downloaded from Physionet [48]. Expert neurologists labeled these sleep data according to Rechtschaffen & Kales (R&K) rules using the sleep stage (W = waking, S1-S4 = sleep stages, R = REM, MT = body movements), time, duration, signal type data in the tag files. Each label classifies a unique (non-overlapping) 30-s data window. Data start time, hypnogram start time, and frequency information are needed for labeling. This information was obtained from files with EDF extensions. Using the Matlab 2019b program, the .edf files were read, and all recorded channels were listed. Of these channels, only the F4-C4 channels were used. Due to the absence of F4-C4 (these channels are commonly used EEG channels [43,49,50]. Therefore, we used these channels.) channels, some of the normal recordings were ignored.

Method
This research presents a new, handcrafted feature-based EEG signal classification model. Feature creation, feature selection, and classification are the main phases of the presented model. The feature creation step incorporates both textural and statistical methods. Maximum pooling was used to create decomposed signals. By using the created decomposed signals, features have been extracted at both low and high levels. Specifically, we used absolute pooling, average pooling, and maximum absolute pooling. In the feature selection phase, a three leveled selector (TSRFINCA) was employed. In the classification phase, CSVM was deployed as a classifier. The general steps of this model are given below.
Step 1: Apply absolute average pooling, average pooling, and absolute maximum pooling to obtain M1 (absolute average pooling), M2 (average pooling), and M3 (absolute maximum pooling) signals. Herein, we used non-overlapping blocks with a length of two to create decompressed signals. In the M1 function, the absolute value of the used non-overlapping block was used as the decompressed signal. In M2 and M3, we used the maximum of the absolute block values and average values of the used nonoverlapping blocks for decomposition. Equations (3)-(8) provide a mathematical definition of these functions.
Step 2: Extract 512 textural features from each signal (raw EEG signal and the generated M1, M2, and M3 signals). In this step, 4 × 512 = 2048 features have been generated. Step 3: Generate 36 statistical features from each signal and textural features by using 18 statistical moments. The used 18 statistical moments have been applied to the raw signal and the generated textural features in Step 2.
Two main feature extraction methodologies, namely, e-textural and statistical feature extraction, were used for handcrafted feature extraction. By deploying our proposed Ltetrolet pattern, textural features were generated. Statistical features were extracted using statistical moments to enforce our feature generation phase.
Step 4: Apply maximum pooling to the EEG signal and update signal. This step defines the decomposition level.
Step 5: Repeat Steps 1-4 five times. Herein, a multilevel feature generator is created. By using handcrafted feature extractors, only low-level features have been generated. To create high-level features, a multilevel feature extraction model was created. Equation (1) provides a mathematical definition of the maximum pooling operator.
Herein, MaxP(.) defines the maximum pooling function, D is decomposed signal, L is the length of the used EEG signal (EEG), and max(.) is maximum value finding function.
Step 6: Fuse the generated features.
Step 8: Determine the threshold point to eliminate redundant features.
Step 9: Apply ReliefF [51] to features and generate a weight for each feature.
Step 11: Apply INCA [52] to the positive weighted feature by selecting ReliefF in Step 10.
Step 12: Forward the selected features to the classifier. The twelve steps detailed above define the proposed decision support model. Steps 1-6 represent the L-tetrolet feature generation. Steps 8-11 denote TSRFINCA feature selection, and Step 12 demonstrates the classification phase. Figure 1 shows the proposed L-tetrolet pattern-based sleep stage classification model flow diagram. The next sections introduce the individual model phases in detail.   Feature generation/extraction is the first phase of the proposed decision support method. Statistical and textural features were generated in this phase. Linear and nonlinear statistical moments were used to generate statistical features, and 18 statistical features were generated by using these moments. In the textural feature generation phase, we present a new microstructure that was inspired by the Tetris game. The letter 'L' (L-tetrolet) of the Tetris game was employed for pattern identification [53,54]. Therefore, the presented textural feature generation function is called an L-tetrolet pattern. The L-tetrolet pattern generates 512 features from a one-dimensional signal. Statistical features were also extracted from the generated textural features by deploying the 18 moments.
The primary objective of the presented feature generation model is to create low-level and high-level features. Therefore, a multileveled/multilayered method was employed to generate these features. A pooling-based decomposer was utilized as a decomposition method. By deploying four pooling functions -absolute average pooling, absolute maximum pooling, average pooling, and maximum pooling -, a five leveled feature generation method was created. The steps of the presented feature generation method are given below.
Step 1: Employ average, absolute maximum, and absolute average pooling to decompose the raw EEG signal into M1, M2, and M3. Here, 2 size non-overlapping blocks were used.
Step 2: Generate features from the generated M1, M2, M3, and the raw one-dimensional signal (EEG). In this step, both statistical moments and the presented L-tetrolet pattern were used.
In these Equations (see Equations (7) and (8)) statistical feature generation function (st(.)) and L-tetrolet pattern (L − tetrolet(.)) are defined. f st represents 18 statistical features, f T is 512 textural features and f stT is the statistical features of the generated textural features. Table 3 lists the statistical moments that were used for feature extraction [55].
Here, the used 12th, 16th, 17th, and 18th moments extract nonlinear statistical features. The presented L-tetrolet pattern was used to extract textural features. The steps of this function are detailed as follows: Table 3. The statistical moments used for the generation of statistical features.
Step 2.1: Divide the used one-dimensional signals into overlapping blocks/windows (blk) with a size of 16.
Step 2.2: Create a matrix (mtr) with a size of 4 × 4 using the constructed block.  Step 2.3: Use two L-tetrolet based patterns by employing the 4 × 4 sized matrix. Figure  3 shows the L-tetrolet patterns that were used for feature generation. Step 2.3: Use two L-tetrolet based patterns by employing the 4 × 4 sized matrix. Figure 3 shows the L-tetrolet patterns that were used for feature generation.
Step 2.4: Extract bits using P1, P2, and binary feature generation function S(., .). These patterns (P1 and P2) are separately applied to the generated matrix. For P1 and P2, the used a, b, c, and d values are given in Equation (14)   Step 2.3: Use two L-tetrolet based patterns by employing the 4 × 4 sized matrix. Figure  3 shows the L-tetrolet patterns that were used for feature generation. Step 2.4: Extract bits using P1, P2, and binary feature generation function (. , . ). These patterns (P1 and P2) are separately applied to the generated matrix. For P1 and P2, the used a, b, c, and d values are given in Equation (14)   . The used L-tetrolet patterns. Each L-tetrolet is named using a letter (e.g., a, b, c, d), and these letters are shown using different colors. These patterns are called P1 and P2.
Herein, a 1 , b 1 , c 1 , d 1 are belonging to P1 pattern and a 2 , b 2 , c 2 , d 2 are belonging to P2 pattern. By using these values, feature extraction process has been conducted. The bit generation phase has been given below.
where par1 and par2 are the first and second parameters of the binary feature generation (signum) function. Equations (15)-(17) were deployed to both P1 and P2, and eight bits were extracted from each pattern. The extracted bits are named bit 1 and bit 2 (they are shown using bit t in Equations (15) and (16)). The length of each bit array is equal to eight. By deploying these bits, two novel signals were created for feature generation, and these signals were named the first map (map1) and the second map signal (map2), respectively. Binary to decimal conversion was used to create these signals, as shown in Equations (18) and (19).
Step 2.5: Create map signals employing the generated bits.
where hist 1 and hist 2 are histograms of the first and second map signals, respectively. δ(.) function is defined to extract histogram.
Step 2.7: Create a feature vector ( f eat) with a length of 512 by using hist 1 and hist 2 .
Equations (19) and (20) define the feature concatenation process. The given steps above (see Steps 2.1-2.7) are defined our proposed L-tetrolet pattern.
Step 3: Merge the generated textural, statistical, and statistical textural features of each signal. For a one-dimensional signal, 512 + 18 + 18 = 548 features were generated. In a level, the defined feature generation functions were applied to four signals (M1, M2, M3, and raw signal). Therefore, these functions generate 548 × 4 = 2192 features at each level.
Step 4: Decompose the one-dimensional signal (EEG) by deploying the maximum pooling decomposer. This step defines signal updating.
Step 5: Repeat Steps 1-4 five times utilizing decomposed signal input. This constitutes the multilevel feature extractor.
Step 6: Merge generated features in each level and obtain 2192 × 5 = 10,960 features from a one-dimensional signal.

Threshold Selection Based Relieff and Iterative Neighborhood Component Analysis
A three-layered feature selection model was used in this phase, and these layers were threshold-based feature selection, positive ReliefF weighted features selection, and INCA selection processes. The primary objectives of this feature selector were the following: • Present an effective feature selector; • Use advantages of the three feature selection methods together; • Select the most appropriate features automatically. Figure 4 shows a block diagram of the proposed TSRFINCA selector.
The following steps introduce the TSRFINCA functionality: Step 1: Normalize the generated features (X) individually.
Step 2: Deploy threshold-based feature selection. In this study, we used zero as threshold (β). The mathematical descriptions of this method are given below.
where tpl means summarization of the features, X 1 is the selected features in the first layer, and cnt is a counter.
Step 4: Eliminate negative weighted features to obtain second layer features (X 2 ).
Step 5: Apply INCA to X 2 and obtain the final features (X 3 ).
Step 4: Decompose the one-dimensional signal ( ) by deploying the maximum pooling decomposer. This step defines signal updating.
Step 5: Repeat Steps 1-4 five times utilizing decomposed signal input. This constitutes the multilevel feature extractor.
Step 6: Merge generated features in each level and obtain 2192 × 5 = 10,960 features from a one-dimensional signal.

Threshold Selection Based Relieff and Iterative Neighborhood Component Analysis
A three-layered feature selection model was used in this phase, and these layers were threshold-based feature selection, positive ReliefF weighted features selection, and INCA selection processes. The primary objectives of this feature selector were the following: • Present an effective feature selector; • Use advantages of the three feature selection methods together; • Select the most appropriate features automatically. Figure 4 shows a block diagram of the proposed TSRFINCA selector.
where represents normalized features by deploying min-max normalization.
Step 2: Deploy threshold-based feature selection. In this study, we used zero as threshold (β). The mathematical descriptions of this method are given below.  INCA is an iterative selector, and it can select features of various sizes and hence it is applicable to a wide range of problem solutions. In this work, we progress now to the classification algorithm that was used for sleep stage detection.

Classification
Classification is the last phase of the presented sleep stage classification model. Here, we used a CSVM classification algorithm. The hyper-parameters of this classifier are given below as follows:

Experimental Setup
The CAP dataset was downloaded from Physionet to train and test the presented L-tetrolet pattern and TSRFINCA-based sleep stage classification model. This research focused on the sleep stages of insomniacs and normal subjects. The sleep stage datasets are generally heterogeneous. Therefore, high classification rates do not reflect the model performance. A balanced EEG dataset has been created to overcome this problem by randomly selecting EEG signals from each subject. By creating these three datasets, the following three cases were defined, and these are explained below: Case 1: This dataset was collected from the insomnia subjects. It includes the following six classes: wake, stage 1, stage 2, stage 3, stage 4, and REM. This dataset contains 1356 EEG signals (each class has 226 EEG signals). F4-C4 channels have been used in this case.
Case 2: This case uses EEG signals from normal subjects. A homogenous dataset was created in this case. There are 1698 EEG signals in this dataset (each class has 283 EEG signals). F4-C4 channels have been used in this case.
Case 3: In this case, a merged dataset is used. This dataset was created by merging datasets of Cases 1-2. Therefore, it contains 3054 EEG signals (each class has 283 + 226 = 509 EEG signals). F4-C4 channels have been used in this case.
These three balanced datasets were used to define three distinct sleep stage identification tasks. The MATLAB (2020a) programming environment was used to calculate test results and implement the proposed decision support model. The used functions were named main, L-tetrolet pattern, statistical feature generator, TSRFINCA, and classification. In the main function, the EEG signals were read, and other functions were called in the main function to classify sleep stages. The proposed model was implemented on a basic desktop computer, and parallel programming or hardware acceleration was not used.

Results
The model quality was obtained by assessing the classification results according to the rules of 10-fold cross-validation. Here, six classification results were presented. Accuracy, F1-score, average precision, and geometric mean results were calculated. Table 4 lists the calculated results for each case. As can be seen from Table 4, the recommended method yielded 95.43%, 91.05%, and 92.31% classification accuracies for Case 1, Case 2, and Case 3, respectively. A 10-fold cross-validation was used to calculate these results. Table 5 details the fold-by-fold results.

Computational Complexity Analysis
Computational complexity is a crucial property that determines the practicality of the proposed model. A lower computational complexity is more resource-efficient, which translates into less energy usage and lower cost. The presented model consists of three al-gorithms. Therefore, the time complexities of these algorithms should be calculated [56,57]. Table 6 introduces these calculations in detail.
In this table (see Table 6), the used coefficients are given as follows. n is the length of the signal, d defines the number of observations, k represents the time complexity coefficient of the used feature selection and classification models, and I defines the number of iterations for iterative feature selection.
Feature generation: We have used a multileveled feature generation in this study. In each level, a maximum pooling decomposer was used to halve the signal length. The used feature generation functions (L-tetrolet pattern and statistical feature generator) have low computational complexity (O(n)). Therefore, the time complexity of this phase is calculated as O(ndlognd). Here, n is the size of the EEG signal, and d represents the number of EEG signals.
Feature selection: The TSRFINCA algorithm has three layers. The threshold-based feature selection model is a simple and basic model. Therefore, the time complexity of it is calculated as O(kd). Here, k is defined as the number of features. In this phase, INCA is the most complex feature selector and O Ik 3 d is found as the computational complexity. Here, I is the number of iterations because it is an iterative feature selector, and in each iteration, the loss value is calculated using the SVM classifier.
Classification: A CSVM classifier, with a time complexity of O k 3 d , was employed for classification.
As can be seen from the time complexity analysis (see Table 6), the proposed model has a low time burden. The deep learning models have an exponential time burden, but this model has a linear time burden. Therefore, there is no need to use extra hardware to implement our proposal. Furthermore, this model can extract features at low and high levels.

Discussion
As stated in Sect. 3, the presented model has the following three fundamental phases: feature generation, TSRFINCA-based feature selection, and classification. The presented model uses four pooling methods to overcome the routing problem of pooling. For instance, the maximum pooling only routes peak values. We proposed a multiple pooling-based decomposition model to overcome the routing problem. Both textural and statistical feature generators have been utilized for feature extraction to create handcrafted features. By using these feature extractors and the proposed multiple pooling function, a multileveled feature extraction method has been presented to generate features at both low and high levels. The presented three-layered feature selection function-TSRFINCA-selected the top informative features from the used datasets. In this research, we have used three datasets. The presented TSRFINCA selects a variable-sized feature vector for each dataset. The sizes of the optimal feature sets were found to be 644, 711, and 188 for Case 1, Case 2, and Case 3, respectively. Figure 5 documents the feature selection process. leveled feature extraction method has been presented to generate features at both low and high levels. The presented three-layered feature selection function-TSRFINCA-selected the top informative features from the used datasets. In this research, we have used three datasets. The presented TSRFINCA selects a variable-sized feature vector for each dataset. The sizes of the optimal feature sets were found to be 644, 711, and 188 for Case 1, Case 2, and Case 3, respectively. Figure 5 documents the feature selection process. In this figure (see Figure 5), a number of features and loss values are demonstrated. The proposed feature selector is an iterative feature selector and it calculates loss values of the 901 (initial value and end value of the loop are 100 and 1000, respectively; thus, 901 = 1000 − 100 + 1 feature vectors have been evaluated for each dataset) feature vectors. The optimal feature vectors have been selected using minimum loss values. These optimal features were forwarded to the CSVM classifier. This classifier was utilized as both a loss value generator (calculating misclassification rates of the chosen 901 feature vectors) and a classifier. Figure 6 shows a confusion matrix for each case. In this figure (see Figure 5), a number of features and loss values are demonstrated. The proposed feature selector is an iterative feature selector and it calculates loss values of the 901 (initial value and end value of the loop are 100 and 1000, respectively; thus, 901 = 1000 − 100 + 1 feature vectors have been evaluated for each dataset) feature vectors. The optimal feature vectors have been selected using minimum loss values. These optimal features were forwarded to the CSVM classifier. This classifier was utilized as both a loss value generator (calculating misclassification rates of the chosen 901 feature vectors) and a classifier. Figure 6 shows a confusion matrix for each case. In this figure (see Figure 5), a number of features and loss values are demonstrated. The proposed feature selector is an iterative feature selector and it calculates loss values of the 901 (initial value and end value of the loop are 100 and 1000, respectively; thus, 901 = 1000 − 100 + 1 feature vectors have been evaluated for each dataset) feature vectors. The optimal feature vectors have been selected using minimum loss values. These optimal features were forwarded to the CSVM classifier. This classifier was utilized as both a loss value generator (calculating misclassification rates of the chosen 901 feature vectors) and a classifier. Figure 6 shows a confusion matrix for each case. The confusion matrices in Figure 6 denote the case-specific results.
To select the optimal classifiers, features of Case 3 were tested on the shallow variable classifiers. These were decision tree (DT) [58], linear discriminant (LD) [59], Naïve Bayes (NB) [60], linear SVM (LSVM) [61], CSVM [62], quadratic SVM (QSVM) [62], k nearest neighbors (kNN) [63] and bagged tree (BT) [64]. Figure 7 introduces the accuracies achieved with the individual classifiers. Here, the presented L-tetrolet and maximum pooling-based feature generation method is applied to Case 3. The first and second layers of the TSRFINCA are applied to these features to eliminate the redundant feature, and NCA selected 1000 features for tests. Figure 6 demonstrates that the best classifier is CSVM. Therefore, CSVM is selected as both an error generator and a classifier.
We have compared our model with other sleep stage classification methods. Table 7 lists the comparison results. The confusion matrices in Figure 6 denote the case-specific results.
(c) Case 3 The confusion matrices in Figure 6 denote the case-specific results. To select the optimal classifiers, features of Case 3 were tested on the shallow classifiers. These were decision tree (DT) [58], linear discriminant (LD) [59], Naïv (NB) [60], linear SVM (LSVM) [61], CSVM [62], quadratic SVM (QSVM) [62], k neighbors (kNN) [63] and bagged tree (BT) [64]. Figure 7 introduces the ac achieved with the individual classifiers. Here, the presented L-tetrolet and m pooling-based feature generation method is applied to Case 3. The first and second laye TSRFINCA are applied to these features to eliminate the redundant feature, and NCA sele features for tests. Figure 6 demonstrates that the best classifier is CSVM. Therefore, CSVM is as both an error generator and a classifier.
We have compared our model with other sleep stage classification methods. lists the comparison results. Accuracy (%) Figure 7. Classification accuracies of the classifier. Here, the presented L-tetrolet and maximum pooling-based feature generation method is applied to Case 3. The first and second layers of the TSRFINCA are applied to these features to eliminate the redundant feature, and NCA selected 1000 features for tests. Figure 6 demonstrates that the best classifier is CSVM. Therefore, CSVM is selected as both an error generator and a classifier.
We have compared our model with other sleep stage classification methods. Table 7 lists the comparison results.  Table 7 shows the success of the presented L-tetrolet pattern and TSRFINCA-based model. Moreover, prior presented models generally used a single dataset, but we tested our model on three balanced/homogenous datasets. Our proposal attained over 90% classification accuracy for all cases. These findings clearly demonstrate our success. The advantages of this model are the following:

•
A new game-inspired feature generation model is presented, and the effectiveness of this approach is established through EEG-based sleep stage classification; • To overcome the routing problem of the pooling method, a multiple pooling decomposerbased feature generation strategy was used; • A three-layered feature selector is presented; • By applying these methods and CSVM, a highly accurate sleep stage classification model is presented; • The recommended model outperformed; • The proposed model can be applied to a computer with basic system configurations.
The drawbacks of this research are the following: • The presented TSRFINCA is a hybrid and iterative feature selector, but the computational complexity is high. Moreover, we have used a shallow classifier. In this work, deep classifiers can be used to increase the classification ability, or a metaheuristic optimization model can be used to tune the hyperparameters of the used classifier; • The datasets used are small. Therefore, when we used one dataset for training and the other datasets for testing, we achieved a classification accuracy of about 50%. Since these EEG signals have sick subjects (each case defines a disorder).
Diagnoses of sleep or sleep-related diseases are time-consuming because the diagnostic pathway relies on manual signal analysis. A new EEG-based sleep stage detection/monitoring system can be developed soon to help medical professionals with diagnosis. Figure 8 denotes the intended intelligent monitoring system. deep classifiers can be used to increase the classification ability, or a meta optimization model can be used to tune the hyperparameters of the used cla • The datasets used are small. Therefore, when we used one dataset for train the other datasets for testing, we achieved a classification accuracy of ab Since these EEG signals have sick subjects (each case defines a disorder).
Diagnoses of sleep or sleep-related diseases are time-consuming because t nostic pathway relies on manual signal analysis. A new EEG-based sleep stag tion/monitoring system can be developed soon to help medical professionals w nosis. Figure 8 denotes the intended intelligent monitoring system. This research presents a new game-based feature generation function. The L pattern is inspired by the Tetris game. Other game-based feature generation or d sition models can be presented in future studies, and the recommended mode applied to other one-dimensional signals to solve classification problems. In th we plan to develop a game-based deep learning model for one-dimensional sign fication, which might replace or augment recurrent neural networks.

Conclusions
In this research, we propose a new feature engineering model. The essentia that model is to extract the most significant features from EEG signals. The model on a new game-based feature extraction function, named L-tetrolet, which extr tural feature information. To generate high-level features, a multileveled featur tion structure is presented using a combination of four pooling techniques. This a fuses hybrid approximation and the advantages of pooling techniques. In the fe lection phase, a three-layered hybrid feature selector has been used, and the sele tures have been classified using a shallow classifier. Using PhysioNet, three differ EEG datasets were created, each containing six groups. Our proposed L-tetrol model attained >90% overall classification accuracy on these datasets. Moreover, posal reached 95.43% classification accuracy in Case 1. These results were com other recent models, showing that our model outperforms all the previous meth for sleep stage detection based on signals from the CAP database. These findings strated that our model achieved satisfactory classification performance and time c ity for solving sleep stage classification problems using EEG signals.
In the future, we plan to accomplish the following: -Propose new game-based feature extraction functions; -Purpose self-organized feature engineering models; This research presents a new game-based feature generation function. The L-tetrolet pattern is inspired by the Tetris game. Other game-based feature generation or decomposition models can be presented in future studies, and the recommended model can be applied to other one-dimensional signals to solve classification problems. In the future, we plan to develop a game-based deep learning model for one-dimensional signal classification, which might replace or augment recurrent neural networks.

Conclusions
In this research, we propose a new feature engineering model. The essential goal of that model is to extract the most significant features from EEG signals. The model is based on a new game-based feature extraction function, named L-tetrolet, which extracts textural feature information. To generate high-level features, a multileveled feature extraction structure is presented using a combination of four pooling techniques. This approach fuses hybrid approximation and the advantages of pooling techniques. In the feature selection phase, a three-layered hybrid feature selector has been used, and the selected features have been classified using a shallow classifier. Using PhysioNet, three different sleep EEG datasets were created, each containing six groups. Our proposed L-tetrolet-based model attained >90% overall classification accuracy on these datasets. Moreover, our proposal reached 95.43% classification accuracy in Case 1. These results were compared to other recent models, showing that our model outperforms all the previous methods used for sleep stage detection based on signals from the CAP database. These findings demonstrated that our model achieved satisfactory classification performance and time complexity for solving sleep stage classification problems using EEG signals.
In the future, we plan to accomplish the following: -Propose new game-based feature extraction functions; -Purpose self-organized feature engineering models; -Propose a new generation of pooling/decomposition methods by using quantum computing and superposition; -Develop a new sleep stage classification application, which will be used in medical centers.