Research on real-time security authentication method based on EEG data features
Published Online: Mar 19, 2025
Received: Oct 19, 2024
Accepted: Jan 30, 2025
DOI: https://doi.org/10.2478/amns-2025-0500
Keywords
© 2025 Bin Liu et al., published by Sciendo
This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
In biomedical engineering, some basic signal processing techniques can be used to digitize biological signals in order to analyze their properties and patterns. Electroencephalogram (EEG) is a very important physiological signal that records the electrical activity of the brain and has been widely studied in cognitive, emotional and motor areas [1]. It can reflect the neurological information of the body and the various activities occurring in the brain, providing us with a lot of valuable information. Due to its non-invasive and high-resolution properties [2–3], EEG signal processing is increasingly receiving more and more rigorous attention. Whereas EEG signal is a type of current generated by neurons transmitting chemical signals through synapses, it is generated in real time on a time basis [4]. In today’s technologically advanced world, it is becoming increasingly important to ensure the security of users’ brains and personal information. Unlawful elements may obtain EEG data characteristics through some technical means, leading to the leakage of sensitive information, and may even cause harm to individuals [5]. Therefore, enhanced security measures are also needed to protect brain data from unauthorized access and leakage, where required by law. Such as encryption technology, secure authentication mechanism and regular security audits to identify and repair potential security vulnerabilities [6–7]. Among them, real-time security authentication can prevent illegal access to information on the one hand, and ensure real-time supervision of personal data on the other.
With the continuous penetration of digital technology in daily life, as a kind of individual identity authentication technology that can realize real-time and accuracy, EEG signal has become a research hotspot in related fields. In this paper, the EEG signal is firstly collected through experiments, and then analyzed and concluded that the ocular electrical interference and the industrial frequency interference are the two main influencing factors affecting the EEG signal. The peak-to-peak amplitude detection and iterative average denoising are used to process them respectively, so as to construct a deep convolutional recurrent neural network authentication model (CNN-LSTM), and the authentication model has been successively tested for user authentication classification and user intrusion.
EEG is gradually being applied to personal identity authentication as the technology becomes more developed. For example, literature [8] proposed an audiovisual presentation paradigm based on EEG signals as an accurate and effective authentication method. And literature [9] showed that eye-open resting state authentication can realize EEG identity authentication accuracy as high as 95%. Literature [10] utilized multilayer perceptron feedforward neural network to identify and authenticate EEG users, and its accuracy rate is even as high as 97%. Indeed, the current cutting-edge scholars also tend to EEG for identity authentication, but EEG records individual EEG biodata features, and accessing these data can presume individual characteristics and personal privacy [11]. Therefore, finding a secure authentication method when utilizing EEG data features for authentication is the prerequisite for EEG to be used for identity authentication. Literature [12] mentions that federated learning methods can be utilized to prevent EEG information leakage. And literature [13] utilizes deep learning method to obtain the fingerprint of EEG to protect the user data security, this fingerprint is similar to the role of password, and the accuracy rate can be up to 98%. However, EEG signal data is generated in real time, and data features are accumulated and analyzed continuously, and a more secure authentication method is missing.
The experiment was conducted using the EMOTIV EPOC+ head-mounted EEG device. The “EMOTIV EPOC+” wireless portable EEG system is a new human-computer interactive control system developed by NeuroTech, Inc. of San Francisco, California, and is the most reliable and cost-effective mobile EEG headset on the market today. The core feature is that Emotiv Epoc+ is designed for scalable and contextualized human brain research, providing access to professional-grade brain data in a fast and easy-to-use design with several features: 14 electrode channels, respectively: AF3, AF4, F3, F4, F7, F8, FC5, FC6, T7, T8, P7, P8, Easy to set up, the whole wearing process can be completed in only 3-5 minutes, while the use of wet sensor electrodes, compared with the conductive gel does not have a lot of viscosity, and only need to use a few drops of saline on the electrode can improve the accuracy rate. Wireless connection, signal acquisition can be done with the help of PC and mobile devices. Rechargeable, built-in battery with up to 12 hours standby time. Motion sensor, with a built-in 9-axis motion sensor to detect the head movement trajectory.
Raw EEG signals were collected from 7 adult participants (
Eye power is the most obvious noise that interferes with EEG signals. In the experiment, the two electrode channels AF3 and AF4 are very sensitive to the subject’s blinking, and these two electrodes are used as the reference electrodes for blink detection to exclude the trial in which the maximum value of the detected signals exceeds the threshold value of 75
For the disturbances caused by IF and external non-experimental stimuli, this paper will use a method of averaging the amplitude - iterative averaging, the EEG signal is the same deterministic process each time, while the noise signal is an independent non-smooth process each time, it can be seen that: after superimposing
In Equation (1),
One of the representative networks in deep learning, convolutional neural network, is a kind of neural network that contains convolutional computation, and its essence is to utilize specific convolutional kernel to perform convolutional computation on the region with the size of convolutional kernel in the feature map.CNN has the characteristics of local sensing and weight sharing, i.e., it acquires the local information globally in the form of sliding window, and the weights are fixed, so CNN has a better ability to acquire local information when it is manipulated on images or texts. The main structure of CNN is shown in Fig. 1, from which it can be seen that CNN is mainly composed of four layers, which are input layer, convolutional layer, pooling layer and fully connected layer. Among them, the convolutional layer and pooling layer are the most important structures for extracting key features.

The structure of CNN
Long Short-Term Memory (LSTM) is an improved type of recurrent neural network, which provides a solution to the problem of gradient vanishing and gradient explosion during long sequence training. Compared with traditional recurrent neural networks, LSTM processing has better performance in long sequential information, LSTM and its improved models are the most widely used models in natural language processing, and have excellent performance in reading comprehension and real-time translation.
Compared with ordinary recurrent neural networks, LSTM has obvious differences in input and output, and its simple structure is shown in Figure 2.

LSTM Simple structure diagram
For a normal recurrent neural network, there is only one covariate
One can see that in addition to the inputs and outputs, Oblivion Gate The forgetting gate, as the name suggests, is the part that determines what information needs to be “forgotten”, i.e., discarded, by the cell state. The formula for the forgetting gate is shown in equation (3) below:
Where The sigmoid function is a function that can convert any input value to a value between 0 and 1. Then Input gate The input gate is actually the newly added control part, some information has been discarded by forgetting the gate, then it needs to be decided what information needs to be added to the cell state. The input gate will cooperate with this cell state to realize the final addition of new information, i.e., to cooperate with the state value The so-called state value is actually a candidate for the cell state, which still needs to be further processed. From the formula, we can know that Cell state The updating part of the cell state is the key part of the LSTM, which is expressed as a horizontal line across the neural units, which involves only a small amount of some linear computations and the information is easy to flow. Its expression is shown in equation (7) below:
Output gate The output gate is actually similar to the input gate in a way, and the output gate formula is shown in equation (8) below:
It can be seen that the output gate is also a value between 0 and 1, except that this time the scaled value is the value of the cell state after the tanh(·) function, i.e., the final
For EEG authentication the essence is to capture the identity feature information in the EEG signal and decrypt and classify the feature information to obtain the user’s identity. In order to be able to better capture the EEG signal temporal and spatial information, according to the above mentioned, the traditional fully connected LSTM/GRU is not able to effectively capture the spatial feature information in the EEG information, and the ability to capture the temporal information in the sequences in CNN is far less effective than that of LSTM or GRU. Therefore, this paper proposes a combined neural network structure based on CNN and LSTM/GRU to capture the temporal and spatial features of EEG more effectively, and the overall flow of this classification model is shown in Fig. 3.

EEG identity authentication system structure diagram
In EEG-oriented EEG authentication classification, CNNs are mostly used as the front-end spatial feature extractor, and traditional deep convolutional models are usually constructed utilizing the coarse-to-fine method, which mainly refers to the fact that the lower convolutional layers contain fewer convolutional kernels but the higher layers have a large number of convolutional kernels, which requires a large amount of learning and designing of relevant hyperparameters, and a high degree of complexity, and do not utilized for computation. In this paper, a new CNN model is introduced to compare with the traditional convolutional model, which contains more convolutional kernels in the bottom layer of convolutional structure in the early stage, and gradually reduces the number of convolutional kernels in the high-level structure, and does not join the pooling layer after each convolutional structure, which results in a further reduction in the number of relevant parameters to be learned and reduces the risk of failure in the training of the model. In this paper, we remove the pooling layer for traditional convolution, use the number of convolution kernels (i.e., the number of filters, which determines the size of the output of the convolutional layer) to reduce the dimensionality, add the Batch Norm after each convolutional layer and remove the Dropout after each layer, and finally multiple outputs of the fully-connected layer for classification.
The network of the learning model used in this chapter mainly contains CNN layer and LSTM/GRU layer parts, which consists of 12 layers, including 5 convolutional layers, 4 batch normalization layers, 2 long and short-term memory network/gated recurrent unit layers, 1 fully-connected layer and 1 output layer composition.
First, the original EEG signals are passed into the convolutional layer, the size of each convolutional kernel is 3×1, and the number of each convolutional kernel is 1024, 512, 256, 128, and 64, respectively, with a step size of 1 each time, and the first 4 convolutions are all entered into the batch normalization layer at the end of the first 4 convolutions, which makes the next layer of input data close to the normal distribution, accelerates the convergence speed of the model, and reduces the initialization of the parameters. After passing the 5th convolutional layer, the Dropout layer is set further in order to prevent overfitting and output 160×64 EEG features.
Subsequently, the EEG feature layer data is fed into the LSTM/GRU layer with an input feature dimension of 64 and a time dimension of 160, the number of units per cell is 128, and the number of layers is 2. After passing through the LSTM/GRU layer, the output features are 128×160 into a Dropout layer with the Dropout value set to 0.3.
Finally, the data enters the fully connected layer and goes through Softmax to activate the output, whose main role is to determine the probability that the input signal belongs to each category.
In the model after each convolution module, in order to make the network has a better nonlinear ability, so a nonlinear function ReLU is utilized, when used as an activation function after each convolution layer, the function is calculated by the formula (10) as follows:
Compared to the ReLU function, the Tanh and Sigmoid activation function requires the use of exponential computation, which is only max( ), making it simpler and less computationally expensive.ReLU looks more like a linear function, and in general is easier to make the activated network avoid the problem of vanishing gradients and easier to optimize, and the emergence of ReLU has made it possible to take advantage of the hardware enhancements and the use of back propagation to successfully train deep multilayer networks with nonlinear activation functions. It is possible to successfully train deep multilayer networks with nonlinear activation functions.
The purpose of neural network learning is to find a series of parameters to make the value of the loss function as small as possible, only when the parameters are appropriate to achieve a good recognition effect, this paper focuses on the Dropout, the choice of the optimizer, the design of the learning rate of the adjustments to say that description. Dropout setting Dropout is introduced mainly to inhibit the occurrence of overfitting, Dropout is a method of randomly selecting neurons in the hidden layer to be deleted during the training process. Overfitting mainly refers to the fact that the accuracy will be particularly good during the training process, and the accuracy will drop after reaching a certain height during the testing process, where it is most necessary to adjust the Dropout parameters. The steps of Dropout setting in this study:Firstly, the Dropout is set to 0.1-0.6, if the overfitting situation improves but the accuracy decreases, then the value of Dropout is adjusted down, if the overfitting situation is still serious, then the value of Dropout can be increased. After the above operations this study finally set the Dropout value to 0.3. Optimizer selection For the selection of optimizer, this paper utilizes the optimizer of adaptive moment estimation, which effectively combines the advantages of the RMSprop algorithm and Momentum, solving both the problem of convergence speed and the problem of excessive swing, compared to the commonly used optimizers gradient descent method, stochastic gradient down method, RMSprop, and so on. The learning rate determines the update step at each moment and is the gradient accumulation index, and the improved first and second order gradient momentum is shown in Eqs. (11) and (12).
Setting of learning rate The main function of the learning rate is to find the optimal solution, which can determine whether the objective function in the model can converge to the minimum value. In the usual training process, a slightly larger learning rate is used in the early stage of training, and a smaller learning rate is used in the later stage of training. This method can be realized by exponential decay. In the study of this paper, the initial learning rate is set to 0.001, and then exponential decay is applied with the decay rate set to 0.95. Other parameters The weight parameter matrix of the neural network layer is initialized using the Xavier initialization method, Epoch is set to 200, and Batchsize is set to 64.
In this experiment, a total of nine healthy subjects, ranging in age from 22-26 years, participated in EEG acquisition. None of them had any history of brain-related diseases or surgery. The acquisition environment was in a dark, quiet room because visual stimuli were used. The acquisition equipment used for the experiment was a 16-channel gUSBamp manufactured by gtec, and the overall acquisition process was as follows: On the day of the acquisition work, the subject must have enough rest and be energetic, and the subject must clean the hair, forehead, earlobe, hair and forehead need to be in contact with the acquisition electrodes, and the earlobe needs to be clamped to the ground electrode; The subject sits in a chair with arms naturally hanging down and hands at the knee joints; The subject wears an appropriately sized collection electrode cap, injects conductive gel into the grounding electrode and clips it to either earlobe; Sequentially for the reference electrode and the collection electrode injected with conductive gel, injection, first of all, will be inserted into the electrode head and the electrode bowl and the hair will be set aside, so that the glue out of the head to touch the scalp, and then began to inject until the conductive gel just overflow when appropriate; Keep the room quiet and no noise, if necessary, close the doors and windows tightly. Turn off the indoor lights and tighten the curtains if necessary;
Conductor selection has a key role in EEG authentication systems, which not only improves the portability of the system, but also strengthens the system’s anti-intrusion and anti-spoofing capabilities. The areas of lead selection are basically distributed in the central and parietal brain regions of the brain. The central brain area is responsible for most of the “higher order” or intellectual brain functions such as thinking, reasoning, judgment, and overall behavior, while the parietal brain area is responsible for processing and interpreting signals such as vision, hearing, motor skills, and memory. Each lead has its corresponding evoked effective time period, and for each user, the effective time periods of the five leads selected in this paper were counted, and the distribution of effective time periods for each user was obtained as shown in Table 1. As can be seen from the distribution in the table, the effective time period of each user is different, verifying the inter-individual specificity. However, at the same time, we found that the effective time periods all covered 420~790ms, indicating that the EEG-evoked identity features based on face-specific RSVPs were mainly distributed in this time period.
15Valid duration distribution of 15 users
user | Effective time period distribution(ms) |
---|---|
1 | 378~988 |
2 | 405~793 |
3 | 305~810 |
4 | 393~796 |
5 | 415~805 |
6 | 405~791 |
7 | 353~803 |
8 | 415~798 |
9 | 400~920 |
10 | 345~864 |
11 | 373~799 |
12 | 410~820 |
13 | 395~886 |
14 | 390~902 |
15 | 312~843 |
Mean | 410~795 |
The classification results of the system under both LDA and CNN-LSTM classifiers are shown in Table 2. The classification results show that under the condition of ensuring the real-time performance of the system (6 seconds), the subject obtains a relatively satisfactory authentication result. Under the condition of LDA as a classifier, the average authentication accuracy of the system is 87.69%, the average false acceptance rate is 14.12%, and the average false rejection rate is 10.38%. Meanwhile, under the condition of CNN-LSTM as a classifier, the average authentication accuracy of the system can be up to 92.60%, the average error acceptance rate is 6.65%, and the average error rejection rate is 8.21%. The classification results from both classifiers can verify the effectiveness of the feature elicitation paradigm based on EEG data proposed in this paper, and also at the same time illustrate the reasonableness of the feature extraction and classifier design oriented to this experimental paradigm.
Classification results from LDA and CNN
ACC(%) | FAR (%) | FRR (%) | ||||
---|---|---|---|---|---|---|
user | LDA | CNN-LSTM | LDA | CNN-LSTM | LDA | CNN-LSTM |
1 | 83.295 | 91.352 | 16.836 | 5.961 | 16.699 | 11.284 |
2 | 93.774 | 96.682 | 6.23 | 3.367 | 6.815 | 3.302 |
3 | 89.19 | 98.075 | 16.848 | 3.493 | 4.729 | 0.825 |
4 | 89.826 | 93.88 | 12.544 | 5.813 | 7.504 | 6.805 |
5 | 92.886 | 88.45 | 9.169 | 7.976 | 5.454 | 15.404 |
6 | 92.779 | 97.684 | 7.107 | 2.189 | 6.52 | 2.628 |
7 | 81.846 | 85.173 | 18.433 | 14.439 | 17.258 | 15.359 |
8 | 89.993 | 90.781 | 12.207 | 4.745 | 7.024 | 13.992 |
9 | 81.713 | 90.508 | 22.851 | 7.849 | 13.937 | 10.848 |
10 | 85.048 | 94.273 | 17.614 | 7.554 | 12.28 | 4.091 |
11 | 89.679 | 93.266 | 10.83 | 6.029 | 9.253 | 7.27 |
12 | 81.163 | 93.043 | 19.782 | 6.889 | 17.619 | 6.498 |
13 | 84.348 | 91.509 | 18.222 | 7.325 | 13.216 | 9.33 |
14 | 92.054 | 91.706 | 9.044 | 9.505 | 6.959 | 7.371 |
Comparing the two classification models, the authentication performance of CNN-LSTM is significantly better than that of LDA, which improves the average authentication correct rate by 4.91%, and at the same time decreases the average false acceptance rate and average false rejection rate by 7.47% and 2.17%, respectively. The experimental results show that compared with LDA, CNN-LSTM can extract the individual differential feature information contained in the input information more accurately through its reasonable network structure, which in turn improves the system’s discriminative ability and robustness. It also shows that deep learning has a more significant advantage over shallow learning when the amount of data is sufficient.
Fig. 4(a) and (b) shows the classification tests for recognizing self and familiar names. The results in Fig. 4 show that the CNN-LSTM feature selection method has a higher starting point for classification performance and has a higher upper bound of accuracy. This indicates that the innovative method has high classification accuracy at low feature dimensions and maintains good classification performance at most features. The accuracy curve of this paper’s method is consistently higher than that of random selection and outperforms PCA in some feature count bands (10-29 features in self-strangers and 5-94 features in selfacquaintances).

Classification performance test of multi-domain general feature extraction method
Figure 5 illustrates the true rejection probability of non-blind and blind intrusions for 15 intruders. The average rejection probability of blind intrusion is 95.2%, which is slightly higher than the correct rejection probability of 91.5% for non-blind intrusion, and the success probability of single-trial intrusion is less than 5% for all of them, and the identity authentication system has a high recognition ability for all intruder subjects. The subthreshold paradigm is able to reduce the threat level of non-blind intrusion to a level similar to that of blind intrusion, and even a non-blind intruder who knows the real user information in advance and has gone through 7 days of intensive memory training is difficult to disguise the EEG signals of subthreshold stimulation, indicating that it is difficult for the subthreshold response of the legitimate user’s brain to be faked and imitated by the acquired. 7 out of the 15 intruders have a correct denial probability of 100%, accounting for 46.67% of the total number of intrusion tests. 46.67% of the total number of people. Except for the non-blind intrusion of subject #1 whose correct rejection was below 90%, the recognition rate of the rest of the intrusion tests was above 90%. The intruder results demonstrate the reliability of the subthreshold identity system, especially the performance against non-blind intrusions. The identity system still has excellent recognition rates for specialized non-blind intruders, validating the ability of the subthreshold identity system to resist different intrusion attacks.

Attack test for intruders
The deep learning model constructed by combining CNN and LSTM can deal with ocular and IF interference in EEG signals, thus giving full play to the EEG data features under the security authentication test experiments and realizing real-time security authentication.
Meanwhile the model under the condition of CNN-LSTM as classifier: (1) in the user authentication classification test, the average authentication accuracy of the system is 4.91% higher compared to LDA, the average false acceptance rate is 6.65%, and the average false rejection rate is 8.21%; (2) in the intrusion system test, the average rejection probability of the blind intrusion is 95.2%, and the probability of success of the intrusion of a single trial is all are lower than 5%. It shows that the CNN-LSTM model of deep learning has a relatively significant advantage over shallow learning when the amount of data is sufficient. Its reasonable network structure not only has a strong feature extraction learning ability also maintains a better classification performance, which can more accurately identify and extract the individual difference feature information contained in the input information, improve the discriminatory nature of the system, and effectively identify the attacks of non-blind intruders in a variety of intrusion tests. Compared with other EEG authentication methods, the CNN-LSTM deep learning model proposed in this paper has greater advantages in real-time and stability.