# Multifeature Metric Learning Based on Enhanced Equidistance Embedding for Electroencephalogram Recognition of Epilepsy

Authors: Bing Lu; Haipeng Lu; Guohua Zhou; Xinchun Yin; Xiaoqing Gu; Tongguang Ni
Journal: Wireless Communications and Mobile Computing
 (2021)

---

## Abstract

Mobile edge computing (MEC) has the ability of pattern recognition and intelligent processing of real-time data. Electroencephalogram (EEG) is a very important tool in the study of epilepsy. It provides rich information that can not be provided by other physiological methods. In the automatic classification of EEG signals by intelligent algorithms, feature extraction and the establishment of classifiers are both very important steps. Different feature extraction methods, such as time domain, frequency domain, and nonlinear dynamic feature methods, contain independent and diverse specific information. Using multiple forms of features at the same time can improve the accuracy of epilepsy recognition. In this paper, we apply metric learning to epileptic EEG signal recognition. Inspired by the equidistance constrained metric learning algorithm, we propose multifeature metric learning based on enhanced equidistance embedding (MMLE3) for EEG recognition of epilepsy. The MMLE3 algorithm makes use of various forms of EEG features, and the feature weights are adaptively weighted. It is a big advantage that the feature weight vector can be adjusted adaptively, without manual adjustment. The MMLE3 algorithm maximizes the distance between the samples constrained by the cannot-link, and the samples of different classes are transformed into equidistant; meanwhile, MMLE3 minimizes the distance between the data constrained by the must-link, and the samples of the same class are compressed to one point. Under the premise that the various feature classification tasks are consistent, MMLE3 can fully extract the associated and complementary information hidden between the features. The experimental results on the CHB-MIT dataset verify that the MMLE3 algorithm has good generalization performance.


---

## Body

## 1. Introduction

Mobile edge computing (MEC) converges cloud computing capabilities and Internet service environment to the edge of the network, which can provide services to users nearby, and effectively makes up for the deficiencies of cloud computing [1]. The combination of MEC and artificial intelligence technology is a research hotspot in recent years. MEC has rich application scenarios in the field of intelligent medicine. Electroencephalogram (EEG) analysis is widely used in neuroscience, especially in the diagnosis and seizure of epilepsy [2, 3]. In clinical practice, the diagnosis of epilepsy is mainly based on the patient’s history of seizures, and further examination and diagnosis are made concerning the EEG signals. EEG-based epilepsy detection mainly relies on the personal experience of the doctor. With the gradual development of intelligent medical treatment, the automatic recognition and detection of epileptic EEG signals have become an important auxiliary detection means. How to extract effective features from EEG and design appropriate classification algorithms is the key task to epilepsy detection.At present, the most commonly used feature extraction methods include the following: time domain analysis, frequency domain analysis, time-frequency analysis, nonlinear dynamics, and model-based methods [4]. The time domain feature method regards EEG as a time series, calculates the correlation statistics of the sequence, and extracts the corresponding epileptic EEG features. For example, Kaya et al. [5] used the histogram features based on local binary patterns (LBP) together with Bayesian networks to classify epileptic seizures. Another widely used strategy is to extract frequency domain features from a given EEG signal. Fourier transform is one of the most commonly used algorithms to extract frequency domain features from time series data. Frassineti et al. [6] proposed a preprocessing step method. The signal is filtered by a fixed wavelet transform to reduce possible artifacts. Then, the support vector machine fine Gaussian method is used to detect epilepsy. Chandel et al. [7] proposed a combination of features based on ternary wavelet decomposition to predict the onset and termination of epilepsy. This method extracted standard deviation, variance, and high-order moments to represent the characteristics of different EEG activities and used linear discriminant analysis and K-nearest neighbor (KNN) classifiers to classify EEG between seizure and interictal periods. In the extraction of nonlinear dynamic features, the method based on complexity analysis is widely used in epilepsy detection, and the most commonly used is the feature extraction method using entropy strategy. For example, Xiang et al. [8] developed a feature extraction algorithm using fuzzy entropy. This method first calculated the fuzzy entropy of EEG signals from different epileptic states, then performed feature selection, and finally used a support vector machine for prediction. Hussein et al. [9] identified EEG seizures by modifying the fuzzy entropy with minimum variance. Firstly, appropriate filtering and independent quantity analysis were carried out to remove noise and artifacts, and then, the proportional operation was carried out to obtain the optimal features. Empirical mode decomposition is an analysis method based on the Fourier transform. Recently, it is also widely used in epilepsy detection. Bajaj and Pachori [10] regarded the intrinsic mode function (IMF) as a group of amplitude frequency modulation signals and gave the analytical expression of IMF by using the Hilbert transform form of IMF. IMF transform calculated two kinds of bandwidth, namely, a bandwidth and FM bandwidth. Kaleem et al. [11] used a new variant of empirical mode decomposition. This model allowed the detrending of the signal based on the time scale, which decomposed the signal into detrended components and nondetrended components according to the frequency separation standard, and then extracted features from the decomposed components. Usman et al. [12] converted the EEG data into a proxy channel and then used the empirical mode decomposition to improve the prediction results.Supervised learning in machine learning is widely used in epilepsy detection. Some famous supervised learning algorithms, such as KNN, decision trees, and metric learning, have been successfully used for epilepsy detection. Metric learning is aimed at learning a more suitable distance measurement criterion in the feature space, in order to more accurately represent the similarity between samples. Metric learning is widely used in face recognition, object detection, image recognition, and so on. Weinberger and Saul [13] developed a large margin nearest neighbor analysis algorithm based on a support vector machine. The obtained Mahalanobis distance had the advantages of maximum marginal and internal consistency. Liu et al. [14] developed a global metric learning algorithm, which made the separation of different categories of samples greater in EEG signal recognition. Phan et al. [15] developed a global metric learning framework using supervised information. The algorithm can directly process EEG data without preprocessing such as artifact removal. Alwasiti et al. [16] developed a depth metric learning algorithm. Different from the traditional deep learning model, a large amount of training data was required; this algorithm only required very little training data.Many classification algorithms largely rely on the distance measurement of the input data. In EEG classification, the key problem is to find a good distance measurement, to classify the test EEG into the class of the nearest EEG samples. Many researches have shown that an appropriate distance measure can significantly improve classification accuracy. In metric learning, EEG recognition depends on the similarity measurement between the input EEG data samples, and the similarity measurement between EEG data samples is realized by the distance measurement of the input feature vector of EEG data samples [17, 18]. Therefore, it is crucial to find a good distance metric in the sample feature space.Due to the rhythm of EEG signals and the collection of EEG signals of multiple channels, EEG data samples have rich feature information. The contribution of different forms of features to EEG recognition is different, some play a decisive role, some play an auxiliary role, and some play a small or no role. Metric learning measures the similarity of EEG data samples and treats all features equally. Obviously, this strategy cannot accurately measure the similarity between EEG data samples, which will affect EEG signal recognition. In addition, various types of EEG signal features can be obtained from different feature extraction algorithms. Based on the principle of consistency and complementarity, the features of each type will contain specific information, and the use of multiple forms of features at the same time will improve the accuracy of epilepsy recognition.In this paper, we apply metric learning to the recognition of epilepsy EEG signals. We make full use of various forms of EEG features and assign their different weights automatically. We try to find an appropriate distance measure for EEG data samples, so as to measure the similarity between EEG data samples more accurately, and finally achieve the purpose of improving the accuracy of epilepsy recognition. To achieve this goal, we propose multifeature metric learning based on enhanced equidistance embedding (MMLE3) for EEG recognition of epilepsy. We learn from the techniques of the EquiDML algorithm [19] to maximize the distance between the samples constrained by the cannot-link, so that the samples belonging to different classes are transformed into equidistant. At the same time, the distance between the data constrained by the must-link is minimized, so that the samples belonging to the same class are compressed to one point. In the process of metric matrix learning, feature weight vectors are introduced, and various features are adaptively weighted to effectively adjust the weight relationship between various features. Under the premise of the consistency of various feature classification tasks, the MMLE3 algorithm can effectively mine the hidden and complementary information between the features and highlight the role of the optimal feature, and it has a stronger discriminative ability. We conduct experiments on the CHB-MIT dataset, and the experimental results validate the effectiveness of MMLE3.


## 2. Related Work

Metric learning uses a given pair of samples to calculate the similarity between pairs of feature vectors. Metric learning generally uses distance metrics. Taking the commonly used Mahalanobis distance as an example, the distance metric between the two sampleszi and zj can be written as
(1)zi−zjQ2=zi−zjTQzi−zj,where Q is a positive semidefinite matrix. Q can be decomposed as Q=HHT, where the matrix Hd×mm≤d is metric matrix (or projection matrix). Therefore, Equation (1) can be expressed as
(2)zi−zjQ2=Hzi−HzjTHzi−Hzj.Therefore, the essence of metric learning is to learn a mapping space. In classification tasks, the commonly used strategy for metric learning is to output a positive value close to zero for pairs of samples of the same class and output larger values for pairs of samples of different classes.Given a labeled datasetZ=z1,⋯,zn with dimensionality d and n number samples, the label matrix Y is composed of all class labels of X. The sets of must-link M and cannot-link C are defined as
(3)M=zi,zjyi=yj,C=zi,zjyi≠yj.According to the classification principle of minimum intraclass distance and maximum interclass distance, a supervised metric learning framework can be represented as(4)zi−zjQ2<δ1zi,zj∈M,zi−zjQ2>δ2zi,zj∈C,where δ1 and δ2 are thresholds for sets of must-link and cannot-link, respectively, and δ1<δ2.In the EquiDML algorithm [19], the sample pairs in set M are gathered directly to a signal point. The distances of sample pairs in set C are forced to have the same constant value. The constraints in the EquiDML algorithm are expressed as
(5)zi−zjQ2=0zi,zj∈M,zi−zjQ2=μzi,zj∈C,where μ is a positive value. The equidistance constraint indicates that the distance between classes must be greater than the distance within classes. In the metric space, the samples in the C set correspond to different classes of samples, and the distances of any different pairs will have the same constant value.


## 3. Multifeature Metric Learning Based on Enhanced Equidistance Embedding

### 3.1. The Objective Function of MMLE3

We try to learn a metric space with distinguishing ability. In this metric space, the samples belonging to the same class with different feature forms are as close as possible, and the samples belonging to different classes with different feature forms are as far away as possible. That is, there are more compact intraclass distances and more separable interclass distances in the metric space. The Mahalanobis distance of thel-th feature of samples zi and zj can be written in the following form as
(6)zil−zjlQ2.Based on the EquiDML algorithm [19], the proposed MMLE3 algorithm makes use of the correlation and difference between multiple forms of features and makes the proposed algorithm more distinguishable by learning the complementary information of different types of features. Then, the MMLE3 algorithm can be represented by
(7)LQ,Δ=min∑l=1LΔlλ2Ml∑zil,zjl∈Mlzil−zjlQ2+12+1−λ2Cl∑zil,zjl∈Clzil−zjlQ2−μ2+12Q−IF2,s.t.∑l=1LΔl=1,Δl≥0,where Ml and Cl are the sample sets of must-link and cannot-link with the l-th feature expression, respectively. Ml and Cl are the size of Ml and Cl, respectively. λ is the trade-off parameter, and Δ is the feature weight vector, and Δl is the feature weight of the l-th sample features. It is worth emphasizing that
(1)
in order to reduce the convergence time, MMLE3 uses the shifted squared loss z+12−1 for the set Ml(2)
Δl is not a parameter that needs to be adjusted manually. It can be obtained in a closed-form solution


### 3.2. The Optimization Procedure

According to the Lagrange multiplier method, the Lagrangian function of Equation (7) can be represented as
(8)L=∑l=1LΔlλ2Ml∑zil,zjl∈Mlzil−zjlQ2+12+1−λ2Cl∑zil,zjl∈Clzil−zjlQ2−μ2+12Q−IF2−Λ∑l=1LΔl−1,,where Λ is the Lagrange parameter.There are two tune parametersQ and Δ in the MMLE3. We use the alternating updating strategy to obtain their optimal parameters. When Δ is fixed in Equation (8), the optimization of Q is equal to solve the following problem:
(9)∂LQ∂Q=∑l=1LΔlλMl∑zil,zjl∈Mlzil−zjlQ2+1zil−zjlzil−zjlT+1−λCl∑zil,zjl∈Clzil−zjlQ2−μzil−zjlzil−zjlT+Q−I.Using the simplest projected gradient method,Q can be updated by
(10)Qh+1=Qh+ηhQh∗−Qh,where Qh∗=Qh−εh∇LQh+. ⋅+ denotes projection on Ω=Q∣Q≻=0. ηh∈0,1 and εh are the step and regulation parameters, respectively.At theh-th iteration, denote Qh∗=Γh+=argminQ∗∈ΩQ∗−ΓhF2, where Γh=Qh−εh∇LQh. Using the positive semidefinite matrix approximation method [19], we can obtain Qh∗ as
(11)Qh∗=PhΣh+Ph,where PhPhT=I. Σh+=max0,Σh is a positive diagonal matrix.WhenQ is fixed in Equation (8), the optimization of Δ is equal to solve ∂L/∂Δl=0. We can obtain
(12)Δlλ2Ml∑zil,zjl∈Mlzil−zjlQ2+12+1−λ2Cl∑zil,zjl∈Clzil−zjlQ2−μ2+12Q−IF2−Λ=0,∑l=1LΔl−1=0.Then, the solution ofΔl is
(13)Δl=1/λ/Ml∑zil,zjl∈Mlzil−zjlQ2+12+1−λ/Cl∑zil,zjl∈Clzil−zjlQ2−μ2+Q−IF2∑l=1L1/λ/Ml∑zil,zjl∈Mlzil−zjlQ2+12+1−λ/Cl∑zil,zjl∈Clzil−zjlQ2−μ2+Q−IF2.Obviously, different from the manual parameter adjustment strategy, the weight parameter in the MMLE3 algorithm is adaptive and it can converge to the extreme value at any initial value.Based on the above analysis, we give the MMLE3 algorithm as follows.Algorithm 1: MMLE3.
Input: Multi-feature matrixXl, its cannot-link and must-link sets;Output: The metric matrixQ and Δ.Initialization:Δ=1/L,1/L,⋯,1/L, Q = I,Repeatt = t+1Step 1: fixedQ(t),compute Δt using Eq.(13);Step 2: fixedΔt, compute Q(t) using Eqs.(9)-(11);Step 3: compute the value of objective functionJ(t);UntilJ(t) is convergence or t≥tmaxStep 4: obtain the optimalQ and Δ.


## 3.1. The Objective Function of MMLE3

We try to learn a metric space with distinguishing ability. In this metric space, the samples belonging to the same class with different feature forms are as close as possible, and the samples belonging to different classes with different feature forms are as far away as possible. That is, there are more compact intraclass distances and more separable interclass distances in the metric space. The Mahalanobis distance of thel-th feature of samples zi and zj can be written in the following form as
(6)zil−zjlQ2.Based on the EquiDML algorithm [19], the proposed MMLE3 algorithm makes use of the correlation and difference between multiple forms of features and makes the proposed algorithm more distinguishable by learning the complementary information of different types of features. Then, the MMLE3 algorithm can be represented by
(7)LQ,Δ=min∑l=1LΔlλ2Ml∑zil,zjl∈Mlzil−zjlQ2+12+1−λ2Cl∑zil,zjl∈Clzil−zjlQ2−μ2+12Q−IF2,s.t.∑l=1LΔl=1,Δl≥0,where Ml and Cl are the sample sets of must-link and cannot-link with the l-th feature expression, respectively. Ml and Cl are the size of Ml and Cl, respectively. λ is the trade-off parameter, and Δ is the feature weight vector, and Δl is the feature weight of the l-th sample features. It is worth emphasizing that
(1)
in order to reduce the convergence time, MMLE3 uses the shifted squared loss z+12−1 for the set Ml(2)
Δl is not a parameter that needs to be adjusted manually. It can be obtained in a closed-form solution


## 3.2. The Optimization Procedure

According to the Lagrange multiplier method, the Lagrangian function of Equation (7) can be represented as
(8)L=∑l=1LΔlλ2Ml∑zil,zjl∈Mlzil−zjlQ2+12+1−λ2Cl∑zil,zjl∈Clzil−zjlQ2−μ2+12Q−IF2−Λ∑l=1LΔl−1,,where Λ is the Lagrange parameter.There are two tune parametersQ and Δ in the MMLE3. We use the alternating updating strategy to obtain their optimal parameters. When Δ is fixed in Equation (8), the optimization of Q is equal to solve the following problem:
(9)∂LQ∂Q=∑l=1LΔlλMl∑zil,zjl∈Mlzil−zjlQ2+1zil−zjlzil−zjlT+1−λCl∑zil,zjl∈Clzil−zjlQ2−μzil−zjlzil−zjlT+Q−I.Using the simplest projected gradient method,Q can be updated by
(10)Qh+1=Qh+ηhQh∗−Qh,where Qh∗=Qh−εh∇LQh+. ⋅+ denotes projection on Ω=Q∣Q≻=0. ηh∈0,1 and εh are the step and regulation parameters, respectively.At theh-th iteration, denote Qh∗=Γh+=argminQ∗∈ΩQ∗−ΓhF2, where Γh=Qh−εh∇LQh. Using the positive semidefinite matrix approximation method [19], we can obtain Qh∗ as
(11)Qh∗=PhΣh+Ph,where PhPhT=I. Σh+=max0,Σh is a positive diagonal matrix.WhenQ is fixed in Equation (8), the optimization of Δ is equal to solve ∂L/∂Δl=0. We can obtain
(12)Δlλ2Ml∑zil,zjl∈Mlzil−zjlQ2+12+1−λ2Cl∑zil,zjl∈Clzil−zjlQ2−μ2+12Q−IF2−Λ=0,∑l=1LΔl−1=0.Then, the solution ofΔl is
(13)Δl=1/λ/Ml∑zil,zjl∈Mlzil−zjlQ2+12+1−λ/Cl∑zil,zjl∈Clzil−zjlQ2−μ2+Q−IF2∑l=1L1/λ/Ml∑zil,zjl∈Mlzil−zjlQ2+12+1−λ/Cl∑zil,zjl∈Clzil−zjlQ2−μ2+Q−IF2.Obviously, different from the manual parameter adjustment strategy, the weight parameter in the MMLE3 algorithm is adaptive and it can converge to the extreme value at any initial value.Based on the above analysis, we give the MMLE3 algorithm as follows.Algorithm 1: MMLE3.
Input: Multi-feature matrixXl, its cannot-link and must-link sets;Output: The metric matrixQ and Δ.Initialization:Δ=1/L,1/L,⋯,1/L, Q = I,Repeatt = t+1Step 1: fixedQ(t),compute Δt using Eq.(13);Step 2: fixedΔt, compute Q(t) using Eqs.(9)-(11);Step 3: compute the value of objective functionJ(t);UntilJ(t) is convergence or t≥tmaxStep 4: obtain the optimalQ and Δ.


## 4. Experiments

### 4.1. Dataset and Feature Extraction

The used dataset called CHB-MIT is from Boston Children’s Hospital [20]. The signal data is recorded by the international standard 10-20 system, and the sampling frequency is 256 Hz. The example EEG signals and the used international standard 10-20 system are shown in Figures 1 and 2, respectively. The dataset includes the cortical EEG data of 23 patients with epilepsy. Among the 23 patients, 5 are males, aged between 3 and 22 years, and 17 females, aged 1.5-19 years. The data No. 21 is collected again by patient No. 1, one and a half years later. The gender of patient No. 24 is unknown. In our experiment, 21 out of 24 patients are selected, excluding Nos. 6, 12, and 16, since some channel data of these patients can not be read.Figure 1
The example EEG signals in CHB-MIT dataset.Figure 2
The international standard 10-20 system used in the CHB-MIT dataset.We use two forms of EEG features in the experiment. The first form of features is the time domain features of EEG signals. We extract the correlation coefficient matrix and its eigenvalues of the original EEG signal and fuse them. The detailed time domain feature extraction process is shown in Figure3. The “Date” is the original EEG signals. The “Sta” is the standardized matrix of EEG signals. The “CorrM” is the correlation coefficient matrix of “Sta,” and the “Eigen” is the eigenvalue corresponding to the “CorrM” matrix. The “Corr” is the expansion of “CorrM.” The “Feat1” is the experimental time domain feature by feature fusion of “Corr” and “Eigen.”Figure 3
The time domain feature extraction process in this study.The second form of features is the frequency domain features of EEG signals. The detailed frequency domain feature extraction process is shown in Figure4. The amplitude spectrum and phase spectrum in the frequency domain are two important features related to the time domain information. After being extracted the amplitude and phase features (called “AS” and “PS” in Figure 4), the correlation coefficients (called “CorrM1” and “CorrM2” in Figure 4) and eigenvalues of the spectrum (called “Eigen1” and “Eigen2” in Figure 4) are further extracted. The Feat2 is the experimental frequency domain feature by feature fusion of “Eigen1,” “Eigen2,” “Corr1,” and “Corr2”. The third form of features is the nonlinear features of EEG signals. In the experiment, the Shannon entropy, spectral entropy, and differential entropy of each delta (1-4 Hz), theta (4-7 Hz), alpha (7-13 Hz), and beta (13-30 Hz) band of EEG signals are calculated. Then, the nonlinear feature Feat3 is obtained by three entropies.Figure 4
The frequency domain feature extraction process in this study.We compare MMLE3 with seven algorithms. The comparison algorithms include LMNN [13], ITML [21], RDML-CCPVL [22], EquiDML [19], CMML [23], MV-TSK-FS [4], and MvCVM [24]. The slack variable in ITML is selected in {0.01, 0.1, 1, 10}. In CMML, the tradeoff parameter, learning rate, and parameter p are set to 1, 10-6, and 5, respectively. The number of fuzzy rules in MV-TSK-FS is selected in 5,10,⋯,30, and three regulation parameters are set in 10−2,10−1,⋯,102. In MV-TSK-FS and MvCVM, the penalty parameter for each view is selected in {1, 10, 102, 103}, and the Gaussian kernel parameter is selected in {10-2, 10-1, …, 102}. In MMLE3, the parameter λ is selected in {0.1, 0.2, …, 0.9}, and the parameter μis set to be 2. The KNN is used as the classifier in MMLE3. We use the grid search and 5-fold cross strategy to select the best variables. The running environment of all algorithms is CPU i7-8700k, 3.2GHZ, and 32GB RAM, and software is Matlab 2016. The evaluation index adopts the specificity, sensitivity, and classification accuracy rate. The experiment is executed 10 times.


### 4.2. MMLE3 Performance Verification

The classification accuracy of MMLE3 with different parameters is shown in Figure 5. The first parameter is the balance parameter λ. The parameter λ is between [0,1] to balance the proportion of minimizing the distance term of the same class samples and maximizing the distance term of different class samples in the objective function. The accuracy of MMLE3 with different λ is shown in Figure 5(a). When the balance parameter is 1, the MMLE3 algorithm only optimizes the must-link constraint and ignores the cannot-link constraint, so its classification accuracy is low. When the balance parameter is close to 0, the objective function of MMLE3 ignores the optimization of the must-link constraint, so the classification accuracy of MMLE3 is also unsatisfactory. From Figure 5(a), when the balance parameter is between 0.4 and 0.6, the two optimization terms can be balanced, so that the EEG data samples in the metric space have the highest discriminative ability, and the classification accuracy of MMLE3 is the highest.Figure 5
The classification accuracy of MMLE3 with different parameters: (a)λ; (b) m; (c) k.
(a)(b)(c)Second, we evaluate the dimensionm in matrix Q. The dimension of each form of features is 200. The MMLE3 algorithm obtains the Mahalanobis matrix by metric learning on the multiple forms of EEG features and projects the features into the projection space. The dimension m takes an important role in MMLE3. The classification accuracy of MMLE3 with different m is shown in Figure 5(b). When m is very small, MMLE3 will ignore most of the discriminative feature information, which leads to low classification accuracy. With the increase of m value, the discriminative feature information increases, and this improves the classification accuracy. When m increases to a certain value, all the discriminative feature information has been obtained, and the remaining small or ineffective feature information has little contribution to the EEG signals recognition. Therefore, the classification accuracy of MMLE3 keeps stable.Thirdly, we evaluate the KNN classifier parameter in MMLE3. The k parameter is selected in {3, 6, …, 30}. The accuracy of MMLE3 with different k is shown in Figure 5(c). The value of k has little effect on classification accuracy. Regardless of the value of k, the fluctuation of classification accuracy is very small.


### 4.3. Algorithm Performance Comparison

The proposed algorithm MMLE3 is compared with several algorithms on 4CHB-MIT dataset. During the experiment, every algorithm runs 10 times and the specificity, sensitivity, and accuracy of all algorithms are recorded in Tables 1–3. CMML, MV-TSK-FS, MvCVM, and MMLE3 can make use of various forms of EEG features. In the experiment, three forms of EEG features: time domain, frequency domain, and nonlinear features, are used. When analyzing the time domain characteristics, the mode of the eigenvalue of the correlation coefficient matrix of EEG signal will change before and after the seizure, which shows that the time domain correlation coefficient matrix and its eigenvalue can predict the seizure and termination of epilepsy to a certain extent. The amplitude and phase in the frequency domain are effective features, which can directly reflect the difference between the seizure period and seizure interval. Entropy can describe the uncertainty of information source and plays an important role in nonstationary EEG signals. MMLE3 obtains the best classification performance and has the highest generalization ability, which is 2.43%, 2.52%, and 2.44% higher than baseline algorithm EquiDML in specificity, sensitivity, and accuracy. It can be seen that the comprehensive use of multifeature information can promote the accuracy of epilepsy recognition.Table 1
Results of specificity rates (%) of MMLE3 and the comparison algorithms.
Patient IDLMNNITMLRDML-CCPVLEquiDMLMV-TSK-FSCMMLMvCVMMMLE3193.6894.1295.0795.4196.0996.1796.0898.09293.9794.0394.6595.2396.1096.2895.3097.60391.2091.1692.0593.1893.1894.1493.1895.59494.3793.7095.1595.6196.2196.6395.4998.14593.4193.2494.3594.6495.7595.4994.9197.29793.0792.4593.0094.6694.8695.0594.2996.59894.3294.3594.9995.8396.8596.8695.7598.35993.3294.2794.4895.2596.2796.2095.5297.711092.7393.3194.0094.4994.9795.4394.9496.731193.1493.1893.7694.6495.3195.2494.7896.971393.0293.3093.7495.0395.6795.8995.1797.331492.9192.8493.1294.5395.2395.3394.3796.851593.3893.1093.9094.8495.6695.2995.2697.401793.3094.1694.1095.3795.7396.1695.0797.781893.2993.9494.1395.5996.0296.0794.9997.751993.8894.3795.0595.8696.2096.9395.7198.252093.6193.6194.1495.2595.8395.7195.1697.752193.6393.6394.6995.2196.0995.8195.8997.832293.6793.6893.7294.4395.8895.6195.5697.232393.2593.7294.4995.3496.2396.2894.8497.622493.0893.6794.4994.8595.6895.5495.1797.31Mean93.3493.5294.1595.0195.7195.8195.1297.44The bold values mean that they are the best classification results in the experiments.Table 2
Results of sensitivity rates (%) of MMLE3 and the comparison algorithms.
Patient IDLMNNITMLRDML-CCPVLEquiDMLMV-TSK-FSCMMLMvCVMMMLE3192.7293.4693.6494.5295.8995.3295.2097.28292.4093.0493.7394.7194.5895.4695.0397.13390.7690.9891.1292.6792.9492.6192.8794.64493.0593.9193.9895.0395.6696.1895.0297.28592.6992.8492.8293.9894.9994.7293.9096.49791.3291.7792.8092.8994.5594.2093.8595.95893.5794.1194.0194.8295.9195.5094.6797.47992.4492.6593.6694.5495.3595.4994.7596.811092.1891.6892.7093.7794.3594.2093.3595.941192.1091.8392.9893.5695.0194.2794.5096.231392.4192.3692.8793.9594.5394.6694.6096.431491.7692.4592.3693.6394.2394.6693.3896.001592.9592.1993.3594.2495.2294.8793.9096.511793.3492.8393.2794.5495.5095.4794.9196.951892.7893.3193.8894.0795.4995.1695.0897.011993.0793.5594.5495.3795.5096.2094.7397.442093.0093.4493.7094.0995.1294.9594.3196.992193.0293.1493.5794.9495.6695.0994.9996.962292.0992.9192.8593.6194.6894.5894.1696.522393.0192.4893.1094.0694.8294.7894.1896.852492.6592.9892.7693.4894.3894.9694.1696.56Mean92.5492.7693.2294.1294.9794.9294.3696.64The bold values mean that they are the best classification results in the experiments.Table 3
Results of accuracy rates (%) of MMLE3 and the comparison algorithms.
Patient IDLMNNITMLRDML-CCPVLEquiDMLMV-TSK-FSCMMLMvCVMMMLE3193.5093.7794.5695.4995.9896.5295.3497.74293.1593.9593.6295.1595.9495.3794.9097.35391.3091.7391.3993.1193.2693.6593.2695.19493.8794.0894.5195.7196.4895.8495.4797.84592.9093.4093.3194.3595.0394.8994.8697.05791.8792.4693.2893.8694.6994.5094.0096.38893.8493.9094.7595.2596.3696.3595.8697.98993.4693.0494.2094.4595.2495.6295.4497.331092.1192.5492.7294.1894.2794.7593.7096.471192.8592.9993.1494.5494.5894.7494.2696.751392.7893.6294.0394.0695.1595.7994.5697.031492.0892.9493.4893.7894.1995.1094.3496.481593.3893.1093.5094.5095.6395.7094.6197.091793.5993.4494.2895.1095.8795.8195.4297.531893.4793.2294.1695.3795.2795.2795.5897.391993.7794.3695.0895.8596.0696.1796.0097.982093.1893.8394.2495.3995.4796.0195.2997.462193.0893.6794.0394.8795.3496.2095.1997.542292.9292.9393.9194.4994.7895.7595.0697.012392.7192.9893.5294.2994.9595.2695.3497.232492.6892.7293.3794.6595.4595.1694.7996.97Mean92.9893.2793.7794.6995.2495.4594.9297.13The bold values mean that they are the best classification results in the experiments.In addition, the MMLE3 algorithm uses the constraint forms of must link and cannot link to project the samples into a low-dimensional space, in which the distance between the samples constrained by cannot link is maximized, and the samples of different classes are transformed into equidistant; meanwhile, the distance between the samples constrained by must link is minimized, and the samples of different classes are compressed to a point. We introduce the feature weight vector to adaptively weigh various features and effectively adjust the weight relationship between various features in the process of metric matrix learning. On the premise that all kinds of feature classification tasks are consistent, the MMLE3 algorithm can effectively mine the association and complementary information hidden among features and highlight the role of optimal features. The MMLE3 algorithm has stronger discrimination ability. Therefore, the results in Tables 1–3 indicate that various forms of EEG features can be treated differently in the MMLE3 algorithm and the similarity between EEG data samples can be measured more accurately. The MMLE3 algorithm shows superiority and effectiveness for EEG recognition of epilepsy.


## 4.1. Dataset and Feature Extraction

The used dataset called CHB-MIT is from Boston Children’s Hospital [20]. The signal data is recorded by the international standard 10-20 system, and the sampling frequency is 256 Hz. The example EEG signals and the used international standard 10-20 system are shown in Figures 1 and 2, respectively. The dataset includes the cortical EEG data of 23 patients with epilepsy. Among the 23 patients, 5 are males, aged between 3 and 22 years, and 17 females, aged 1.5-19 years. The data No. 21 is collected again by patient No. 1, one and a half years later. The gender of patient No. 24 is unknown. In our experiment, 21 out of 24 patients are selected, excluding Nos. 6, 12, and 16, since some channel data of these patients can not be read.Figure 1
The example EEG signals in CHB-MIT dataset.Figure 2
The international standard 10-20 system used in the CHB-MIT dataset.We use two forms of EEG features in the experiment. The first form of features is the time domain features of EEG signals. We extract the correlation coefficient matrix and its eigenvalues of the original EEG signal and fuse them. The detailed time domain feature extraction process is shown in Figure3. The “Date” is the original EEG signals. The “Sta” is the standardized matrix of EEG signals. The “CorrM” is the correlation coefficient matrix of “Sta,” and the “Eigen” is the eigenvalue corresponding to the “CorrM” matrix. The “Corr” is the expansion of “CorrM.” The “Feat1” is the experimental time domain feature by feature fusion of “Corr” and “Eigen.”Figure 3
The time domain feature extraction process in this study.The second form of features is the frequency domain features of EEG signals. The detailed frequency domain feature extraction process is shown in Figure4. The amplitude spectrum and phase spectrum in the frequency domain are two important features related to the time domain information. After being extracted the amplitude and phase features (called “AS” and “PS” in Figure 4), the correlation coefficients (called “CorrM1” and “CorrM2” in Figure 4) and eigenvalues of the spectrum (called “Eigen1” and “Eigen2” in Figure 4) are further extracted. The Feat2 is the experimental frequency domain feature by feature fusion of “Eigen1,” “Eigen2,” “Corr1,” and “Corr2”. The third form of features is the nonlinear features of EEG signals. In the experiment, the Shannon entropy, spectral entropy, and differential entropy of each delta (1-4 Hz), theta (4-7 Hz), alpha (7-13 Hz), and beta (13-30 Hz) band of EEG signals are calculated. Then, the nonlinear feature Feat3 is obtained by three entropies.Figure 4
The frequency domain feature extraction process in this study.We compare MMLE3 with seven algorithms. The comparison algorithms include LMNN [13], ITML [21], RDML-CCPVL [22], EquiDML [19], CMML [23], MV-TSK-FS [4], and MvCVM [24]. The slack variable in ITML is selected in {0.01, 0.1, 1, 10}. In CMML, the tradeoff parameter, learning rate, and parameter p are set to 1, 10-6, and 5, respectively. The number of fuzzy rules in MV-TSK-FS is selected in 5,10,⋯,30, and three regulation parameters are set in 10−2,10−1,⋯,102. In MV-TSK-FS and MvCVM, the penalty parameter for each view is selected in {1, 10, 102, 103}, and the Gaussian kernel parameter is selected in {10-2, 10-1, …, 102}. In MMLE3, the parameter λ is selected in {0.1, 0.2, …, 0.9}, and the parameter μis set to be 2. The KNN is used as the classifier in MMLE3. We use the grid search and 5-fold cross strategy to select the best variables. The running environment of all algorithms is CPU i7-8700k, 3.2GHZ, and 32GB RAM, and software is Matlab 2016. The evaluation index adopts the specificity, sensitivity, and classification accuracy rate. The experiment is executed 10 times.


## 4.2. MMLE3 Performance Verification

The classification accuracy of MMLE3 with different parameters is shown in Figure 5. The first parameter is the balance parameter λ. The parameter λ is between [0,1] to balance the proportion of minimizing the distance term of the same class samples and maximizing the distance term of different class samples in the objective function. The accuracy of MMLE3 with different λ is shown in Figure 5(a). When the balance parameter is 1, the MMLE3 algorithm only optimizes the must-link constraint and ignores the cannot-link constraint, so its classification accuracy is low. When the balance parameter is close to 0, the objective function of MMLE3 ignores the optimization of the must-link constraint, so the classification accuracy of MMLE3 is also unsatisfactory. From Figure 5(a), when the balance parameter is between 0.4 and 0.6, the two optimization terms can be balanced, so that the EEG data samples in the metric space have the highest discriminative ability, and the classification accuracy of MMLE3 is the highest.Figure 5
The classification accuracy of MMLE3 with different parameters: (a)λ; (b) m; (c) k.
(a)(b)(c)Second, we evaluate the dimensionm in matrix Q. The dimension of each form of features is 200. The MMLE3 algorithm obtains the Mahalanobis matrix by metric learning on the multiple forms of EEG features and projects the features into the projection space. The dimension m takes an important role in MMLE3. The classification accuracy of MMLE3 with different m is shown in Figure 5(b). When m is very small, MMLE3 will ignore most of the discriminative feature information, which leads to low classification accuracy. With the increase of m value, the discriminative feature information increases, and this improves the classification accuracy. When m increases to a certain value, all the discriminative feature information has been obtained, and the remaining small or ineffective feature information has little contribution to the EEG signals recognition. Therefore, the classification accuracy of MMLE3 keeps stable.Thirdly, we evaluate the KNN classifier parameter in MMLE3. The k parameter is selected in {3, 6, …, 30}. The accuracy of MMLE3 with different k is shown in Figure 5(c). The value of k has little effect on classification accuracy. Regardless of the value of k, the fluctuation of classification accuracy is very small.


## 4.3. Algorithm Performance Comparison

The proposed algorithm MMLE3 is compared with several algorithms on 4CHB-MIT dataset. During the experiment, every algorithm runs 10 times and the specificity, sensitivity, and accuracy of all algorithms are recorded in Tables 1–3. CMML, MV-TSK-FS, MvCVM, and MMLE3 can make use of various forms of EEG features. In the experiment, three forms of EEG features: time domain, frequency domain, and nonlinear features, are used. When analyzing the time domain characteristics, the mode of the eigenvalue of the correlation coefficient matrix of EEG signal will change before and after the seizure, which shows that the time domain correlation coefficient matrix and its eigenvalue can predict the seizure and termination of epilepsy to a certain extent. The amplitude and phase in the frequency domain are effective features, which can directly reflect the difference between the seizure period and seizure interval. Entropy can describe the uncertainty of information source and plays an important role in nonstationary EEG signals. MMLE3 obtains the best classification performance and has the highest generalization ability, which is 2.43%, 2.52%, and 2.44% higher than baseline algorithm EquiDML in specificity, sensitivity, and accuracy. It can be seen that the comprehensive use of multifeature information can promote the accuracy of epilepsy recognition.Table 1
Results of specificity rates (%) of MMLE3 and the comparison algorithms.
Patient IDLMNNITMLRDML-CCPVLEquiDMLMV-TSK-FSCMMLMvCVMMMLE3193.6894.1295.0795.4196.0996.1796.0898.09293.9794.0394.6595.2396.1096.2895.3097.60391.2091.1692.0593.1893.1894.1493.1895.59494.3793.7095.1595.6196.2196.6395.4998.14593.4193.2494.3594.6495.7595.4994.9197.29793.0792.4593.0094.6694.8695.0594.2996.59894.3294.3594.9995.8396.8596.8695.7598.35993.3294.2794.4895.2596.2796.2095.5297.711092.7393.3194.0094.4994.9795.4394.9496.731193.1493.1893.7694.6495.3195.2494.7896.971393.0293.3093.7495.0395.6795.8995.1797.331492.9192.8493.1294.5395.2395.3394.3796.851593.3893.1093.9094.8495.6695.2995.2697.401793.3094.1694.1095.3795.7396.1695.0797.781893.2993.9494.1395.5996.0296.0794.9997.751993.8894.3795.0595.8696.2096.9395.7198.252093.6193.6194.1495.2595.8395.7195.1697.752193.6393.6394.6995.2196.0995.8195.8997.832293.6793.6893.7294.4395.8895.6195.5697.232393.2593.7294.4995.3496.2396.2894.8497.622493.0893.6794.4994.8595.6895.5495.1797.31Mean93.3493.5294.1595.0195.7195.8195.1297.44The bold values mean that they are the best classification results in the experiments.Table 2
Results of sensitivity rates (%) of MMLE3 and the comparison algorithms.
Patient IDLMNNITMLRDML-CCPVLEquiDMLMV-TSK-FSCMMLMvCVMMMLE3192.7293.4693.6494.5295.8995.3295.2097.28292.4093.0493.7394.7194.5895.4695.0397.13390.7690.9891.1292.6792.9492.6192.8794.64493.0593.9193.9895.0395.6696.1895.0297.28592.6992.8492.8293.9894.9994.7293.9096.49791.3291.7792.8092.8994.5594.2093.8595.95893.5794.1194.0194.8295.9195.5094.6797.47992.4492.6593.6694.5495.3595.4994.7596.811092.1891.6892.7093.7794.3594.2093.3595.941192.1091.8392.9893.5695.0194.2794.5096.231392.4192.3692.8793.9594.5394.6694.6096.431491.7692.4592.3693.6394.2394.6693.3896.001592.9592.1993.3594.2495.2294.8793.9096.511793.3492.8393.2794.5495.5095.4794.9196.951892.7893.3193.8894.0795.4995.1695.0897.011993.0793.5594.5495.3795.5096.2094.7397.442093.0093.4493.7094.0995.1294.9594.3196.992193.0293.1493.5794.9495.6695.0994.9996.962292.0992.9192.8593.6194.6894.5894.1696.522393.0192.4893.1094.0694.8294.7894.1896.852492.6592.9892.7693.4894.3894.9694.1696.56Mean92.5492.7693.2294.1294.9794.9294.3696.64The bold values mean that they are the best classification results in the experiments.Table 3
Results of accuracy rates (%) of MMLE3 and the comparison algorithms.
Patient IDLMNNITMLRDML-CCPVLEquiDMLMV-TSK-FSCMMLMvCVMMMLE3193.5093.7794.5695.4995.9896.5295.3497.74293.1593.9593.6295.1595.9495.3794.9097.35391.3091.7391.3993.1193.2693.6593.2695.19493.8794.0894.5195.7196.4895.8495.4797.84592.9093.4093.3194.3595.0394.8994.8697.05791.8792.4693.2893.8694.6994.5094.0096.38893.8493.9094.7595.2596.3696.3595.8697.98993.4693.0494.2094.4595.2495.6295.4497.331092.1192.5492.7294.1894.2794.7593.7096.471192.8592.9993.1494.5494.5894.7494.2696.751392.7893.6294.0394.0695.1595.7994.5697.031492.0892.9493.4893.7894.1995.1094.3496.481593.3893.1093.5094.5095.6395.7094.6197.091793.5993.4494.2895.1095.8795.8195.4297.531893.4793.2294.1695.3795.2795.2795.5897.391993.7794.3695.0895.8596.0696.1796.0097.982093.1893.8394.2495.3995.4796.0195.2997.462193.0893.6794.0394.8795.3496.2095.1997.542292.9292.9393.9194.4994.7895.7595.0697.012392.7192.9893.5294.2994.9595.2695.3497.232492.6892.7293.3794.6595.4595.1694.7996.97Mean92.9893.2793.7794.6995.2495.4594.9297.13The bold values mean that they are the best classification results in the experiments.In addition, the MMLE3 algorithm uses the constraint forms of must link and cannot link to project the samples into a low-dimensional space, in which the distance between the samples constrained by cannot link is maximized, and the samples of different classes are transformed into equidistant; meanwhile, the distance between the samples constrained by must link is minimized, and the samples of different classes are compressed to a point. We introduce the feature weight vector to adaptively weigh various features and effectively adjust the weight relationship between various features in the process of metric matrix learning. On the premise that all kinds of feature classification tasks are consistent, the MMLE3 algorithm can effectively mine the association and complementary information hidden among features and highlight the role of optimal features. The MMLE3 algorithm has stronger discrimination ability. Therefore, the results in Tables 1–3 indicate that various forms of EEG features can be treated differently in the MMLE3 algorithm and the similarity between EEG data samples can be measured more accurately. The MMLE3 algorithm shows superiority and effectiveness for EEG recognition of epilepsy.


## 5. Conclusion

In clinical research, EEG is a basic tool for diagnosing and studying brain diseases, especially in the field of epilepsy diagnosis. This study explores how to improve the classification accuracy of epileptic EEG based on various feature extraction methods and metric learning algorithm. We propose the MMLE3 algorithm for EEG recognition of epilepsy. In the process of metric matrix learning, MMLE3 uses various forms of EEG features to effectively adjust the weight relationship between various features. Experiments show that the classification performance of comprehensive utilization of multiple features is significantly better than single feature, and multifeature metric learning has better stability and generalization ability. In the future, we will embed the proposed algorithm into the deep network for new latent representations. We will apply the proposed algorithm to clinical diagnosis in the next stage. In addition, with the development of computer-aided technology, visualized operating systems are one of the development trends of future medical care. We will also try to design the MMLE3 algorithm into a visual operating system to facilitate the application of clinical diagnosis.



---

*Source: 3199362-2021-12-06.xml*