# Application of EEG Signal Recognition Method Based on Duffing Equation in Psychological Stress Analysis

Authors: Min Chai; Lei Ba
Journal: Advances in Mathematical Physics
 (2021)

---

## Abstract

Based on the study of the feature extraction algorithm based on the multiple empirical mode decomposition of the Duffing equation, this paper proposes a corresponding improved algorithm, completes the identification and analysis of the psychological pressure dimension space under the audiovisual induction method, and designs two typical psychological types of music and pictures. Based on the stress induction experiment, an audiovisual-induced psychological stress recognition system based on EEG (electroencephalogram) signals was built. Aiming at the problem that the spatial uniform sampling method cannot well reflect the dynamic characteristics of the multivariate EEG signal, based on the Duffing equation, a nonuniform sampling algorithm that adaptively selects the projection direction is proposed. At present, the use of the Duffing equation to detect weak unknown signals is to select a set of fixed parameters. Analysis of these two aspects to determine the parameters of the system is based on the parameter analysis of the Duffing equation oscillator. Due to the sensitivity of the Duffing equation to the initial value, the choice of parameters has a great influence on the detection effect. In response to this situation, the relationship between the parameters and initial values of the Duffing equation is analyzed. From the relationship between the parameters and the initial values, the influence of different parameters on the detection effect is analyzed to verify the superiority of the current equation parameters. First, the multichannel EEG signal is nonuniformly sampled multiempirical modal decomposition, and an effective intrinsic modal function is selected to extract the mental stress EEG characteristics. Experimental results show that the EEG signal recognition algorithm based on the Duffing equation effectively extracts EEG signal features and improves the classification accuracy of mental stress EEG signals.


---

## Body

## 1. Introduction

Psychological stress is the psychological and physiological state that is produced along with the process of cognition and consciousness. It plays a very important role in human communication. The analysis and recognition of psychological stress have broad application prospects in the fields of human-computer interaction, rehabilitation, and medical treatment [1]. Among the various information sources that can be used for psychological stress recognition, EEG signals are not easy to disguise and sensitive, and the recognition results are objective and true, which are the current research hotspots [2]. At present, there are more researches on the identification of basic psychological stress under the discrete model, and there are fewer studies based on the dimensional model, and the classification accuracy rate is not high. It is mainly for the induction method of a single type of stimulus. In real life, psychological stress is often caused by multiple types [3]. Accurate identification of psychological stress through technical methods is one of the most active research hotspots in psychology and cognitive neuroscience. With the development of the brain-computer interface (BCI) and the advancement of artificial intelligence, the identification of psychological stress through EEG signals has become a new method for studying psychological stress [4]. On the one hand, the EEG signal contains a lot of information related to psychological stress. On the other hand, the EEG signal has the characteristics of high time resolution and not easy to disguise. This makes it show great advantages in the field of real-time psychological stress recognition [5]. At present, the common methods of psychological stress recognition accomplish psychological stress recognition tasks based on expressions, voices, gestures, etc., outside the body. However, due to the invisibility of psychological stress, it is difficult to directly judge a person’s true psychological stress state from the external situation through these technologies [6]. In addition, due to the disguised nature of psychological pressure, for example, professional actors can even perform different psychological pressure states, it is difficult to ensure the accuracy of the recognition effect when performing psychological pressure recognition, which highlights the limitations of these methods [7].Weak signal detection technology has been developed rapidly in recent years, using electronics theory, information theory, and physics methods to achieve weak signal detection under a strong noise background [8]. In addition to the recognition of psychological stress through certain external manifestations of people, physiological signals such as heartbeat, respiration, body temperature, skin electrophysiology, and brain electricity are also widely used in the field of psychological stress recognition [9]. Most of these physiological signals can be acquired by noninvasive collection methods, so they can be collected more conveniently under a variety of environmental conditions. In addition, due to the inherent and undisguised nature of EEG signals, it has shown great potential in the field of psychological stress recognition. At the same time, compared with other types of physiological signals, EEG signals have a high time resolution, which provides the possibility to realize a real-time psychological stress recognition system. With the development of brain-computer interface technology and human-computer interaction technology (HCI), mental stress recognition based on EEG signals has attracted more and more attention from the whole society. In an ideal human-computer interaction system, the system should be able to adjust the settings of system-related parameters in real time according to the user’s current performance. The detection of traditional weak signals is based on linear and deterministic systems [10]. Traditional methods mainly focus on the time domain and frequency domain, such as wavelet transform and spectrum analysis. The traditional method requires a high signal-to-noise ratio and needs to preprocess the signal, which has great limitations. With the development of nonlinear dynamics and the in-depth study of chaos theory [11], people began to use nonlinear dynamics to analyze the dynamic behavior of faulty parts and reveal the general laws of fault occurrence and development.In order to study real-time psychological stress recognition through EEG signals, this paper first designed and carried out an EEG psychological stress experiment based on image stimuli. After preprocessing the original EEG signal, this paper extracts a total of 28 EEG features including time domain features, frequency domain features, and nonlinear features. Aiming at the problem of feature redundancy and high feature dimension in the feature extraction process, this paper uses the Duffing equation as the search strategy for the selection and removal of the optimal feature set and combines the filter and wrapper as the optimal feature. We set evaluation criteria and propose a hybrid feature selection algorithm to optimize the high-dimensional vector space formed by feature extraction. The experimental results show that the algorithm can effectively reduce the feature dimension and eliminate redundant features while improving the classification accuracy of EEG signals and can effectively perform feature selection. For feature extraction, the paper uses the combination of empirical mode decomposition algorithm and sample entropy for feature extraction. Its adaptability corresponds to solving the nonlinear characteristics of EEG signals. As for the sample entropy algorithm, it can be solved for fluctuation characteristics of EEG data. The two cooperate with each other to achieve a good treatment effect. This article is based on the parameter analysis of EEG signal recognition based on the Duffing equation and analyzes the relationship between system parameters and initial values. We analyze the abruptness of the critical point phase diagram of the system and the retention of the chaotic interval from different parameters.


## 2. Related Work

In the research of mental stress recognition based on EEG signals, most of the problems boil down to supervised learning. The main reason is that human psychological pressure can be roughly classified into several common types (such as the most common emotions, anger, and sadness), and the accurate identification of these types of psychological pressures has been able to cover most of the application scenarios. In statistical machine learning, the Duffing equation is a widely used classifier. A large number of studies have proved that the Duffing equation can achieve better results for mental stress recognition problems based on EEG signals [12]. Ingber [13] used the Duffing equation to estimate the valence level in psychological stress and used it to solve regression problems. Tretter [14] used the linear kernel Duffing equation to recognize the two-class EEG psychological stress of happy and sad psychological stress. When using CSP (Common Spatial Patterns) as the feature, they got the highest average recognition accuracy rate of 93.5%. If most of the k neighbor samples in the feature space of a sample belong to a certain category, the sample also belongs to this category. The Duffing equation is an online classification algorithm; that is, there is no need to train sample data in advance, and new samples directly participate in the classification to give prediction results. Liu et al. [15] used wavelet coefficients as features and used a classifier to identify five kinds of psychological stress in the psychological stress EEG signal and obtained a recognition accuracy of 82%.On the basis of the model established by EEG for psychological stress recognition, the whole process of psychological stress recognition can be further integrated into the real-time system. This is currently a popular research direction in the field of psychological stress recognition. The establishment of a real-time EEG psychological stress system directly brings psychological stress recognition into the application field. Nowadays, computing needs in a ubiquitous environment are gradually increasing, and the seamless interaction between people and devices is becoming a new research topic, and real-time and accurate identification of people’s psychological pressure can promote the development of this process. There are relatively few researches in this field at home and abroad. Stein and Sarnthein [16] realized a set of automatic mental stress recognition systems based on EEG signals, which completed the functions of automatic reading of EEG files, automatic mental stress recognition, and graphical display of recognition results. The limitation of this system is that the EEG signal needs to be collected separately and saved as a file in advance, and it has not achieved real real-time performance for the time being. Zeiler et al. [17] studied the dynamic characteristics of neural activity in the process of psychological stress regulation by analyzing the EEG signals of psychological stress and thus constructed a set of feedback systems for psychological stress regulation. The research focuses on the feedback on the regulation of psychological stress. Nagaraj [18] implemented a real-time happy psychological stress recognition system based on pictures and classical music, which extracted the power spectral density features of EEG signals and used them for pattern recognition and classification. Aiming at the two psychological pressures of happiness and unhappiness, the system achieved recognition accuracy of 75.62% (independent of the subjects) and 65.12% (compatible with all subjects).Aiming at the problem of real-time psychological stress recognition of EEG signals, some scholars have proposed a real-time subject-dependent psychological stress recognition algorithm. Through verification on the existing psychological stress EEG data set, the algorithm achieves a good and stable recognition effect on the four types of psychological stress and can be transplanted to the corresponding EEG acquisition system to form a complete set of real-time psychological stress recognition systems based on EEG signals [19]. It should be noted that the EEG signal acquisition equipment used in the above-mentioned studies is mostly multilead EEG acquisition equipment, which still has a certain degree of inconvenience when applied in a universal environment. The researchers developed a real-time psychological stress recognition system based on the EEG signals at the three leads. Real-time recognition and the recognition results are displayed in a graphical form [20]. In addition, based on the observation and analysis of signals, researchers continue to try to introduce new features to improve the accuracy of psychological stress recognition. According to the phenomenon that the normalized EEG sequence signal always oscillates at a value of 0, some scholars have proposed a psychological stress recognition EEG feature: high order crossing for the multisystem model of psychological stress to overcome the problem of differences between subjects [21].


## 3. Construction of a Psychological Stress Model for EEG Signal Recognition Based on Duffing Equation

### 3.1. Duffing Equation Distribution Solution

Theoretically speaking, the solution of the system in the phase space changes with the change of thex value. When x gradually increases from 0, the trajectory of the system solution in the phase space is an even-order subharmonic bifurcation. At this time, the system oscillates according to the period of the applied periodic force or its double period. The homoclinic trajectory appears, which results in chaotic motion in the sense of a small horseshoe. When x further increases, the system will appear inverted odd-order harmonic bifurcation, and finally, the frequency of externally applied periodic force performs large-scale periodic oscillation:
(1)x″+cx′−x+x2=xcost,xcost+Acos1+Δwt+α=0.In the formula,fx is the amplitude of the perturbation force, a is the amplitude of the signal to be detected, t is the phase difference between the perturbation signal and the signal to be measured, and c is the absolute frequency difference between the perturbation signal and the signal to be measured:
(2)fx=cost2+2acoswt+a2,x″0=fcost−c×x′0+x0.During detection,fx is set to be less than the critical threshold dx (the critical threshold for turning from chaos to large period). When c=0, it is a periodic motion, and in other cases, it is a chaotic motion, the vector path of the perturbation signal is regarded as the path of the immobile signal to be measured, and it will rotate very slowly around it at the frequency of w:
(3)d2xdt2+c×dxdt−x=fcost.When the two directions are the same, the trajectory of the system phase diagram is in the state of outer orbit period 1, which indicates that there is a weak periodic signal. The system is in a chaotic state, so the phenomenon of intermittent chaos appears sometimes chaotic and sometimes periodic:(4)x0=fcost,x′0=−fsint,y=1n×∑t∑nxiwi×k−1,n=1,2,⋯,N.Whenw is very small, the change of cost is very slow, much slower than the process of phase transition. If the phase change requires one or two cycles, and the time for the system to maintain a stable periodic state or chaotic state is dozens of cycles, the system can respond well to the signal to be measured, so the alternate appearance of cycles and chaos is very obvious. It shows that the phase change of the vibrator is sensitive to small signals.The chaotic system’s detection of weak signals is determined by the system’s sensitivity to initial values or parameters. Figure1 shows the level division of Duffing equation distribution solution. Different parameters have different detection performances and are also suitable for signal detection in different environments:
(5)zx=∑kxk+1yk+1,x<k,∑kxkyk,x<k.Figure 1
Duffing equation distribution solution level division.From the relationship between parameters and initial values, there are the effects of different parameters on the detection performance of the system. Analysis of these two aspects to determine the parameters of the system is based on the parameter analysis of the Duffing equation oscillator.


### 3.2. EEG Signal Recognition Algorithm

The classification algorithm is a method that can effectively detect ERP (Event-Related Potential) signals. In general, this type of method uses spatial filtering algorithms to reduce the multilead EEG data to one-dimensional or two-dimensional signals, so that the new signal obtained contains more task-related information:(6)S=1k−1x×∑k−1Kxk−x¯xk¯−xT,wt=zt,n×xt∣t=t−Δt2,t+Δt2.The more typical methods include the cospace model and its subsequent Duffing equation and the layered decision component analysis method. Among them, the Duffing equation uses the spatial information of the EEG signal and extracts rich time information by adding a time window, so that it can be effectively used for the detection of ERP components. The training samples can be mapped from the original space to a higher-dimensional space so that the samples are linearly separable in this space. If the original space has finite dimensionality, that is, the attributes are limited, then there must be a high-dimensional feature space so that the sample can be divided. According to the analysis results of the average of the experimental data group, the amplitude and latency of the ERP components in this experiment under different psychological stress conditions are different, so under different psychological stress valence strengths, the Duffing equation EEG signal recognition algorithm is used. It is estimated that the ERP component is feasible and theoretically can achieve better results.Figure2 shows the flow chart of the EEG signal recognition algorithm based on the Duffing equation. The algorithm assumes that the ERP components of different trials of the same category remain constant. By modeling the amplitude and latency of the ERP components, and integrating the information of space, time, and trials, the spatial patterns of ERP components induced by different categories are determined:
(7)Hx=x2+12×1−xx1,Gx=x2−12×1x2−x21.Figure 2
Flow chart of EEG signal recognition algorithm based on Duffing equation.The algorithm divides the detection of signals into three steps. This layer divides the EEG signal inton time periods and uses linear discriminant analysis to find the weights that maximize the difference between the target and nontarget categories in each time period, and the value reduces the multilead signal to one dimension. This type of algorithm focuses on the estimation and extraction of ERP components under a certain condition. The mainstream methods include principal component analysis (PCA) and independent component analysis (ICA). One-dimensional models are like discrete models. On this basis, people find that emotions are related. For example, people are always excited in a happy state; in an angry state, they are often accompanied by hatred and sadness. This inspires people to use this as a classification basis to classify two-dimensional and three-dimensional emotional models. However, because these two methods are not proposed for the characteristics of ERP components, there are certain shortcomings in the extraction of ERP components; that is, the method focuses more on the extraction of components under the condition of a high signal-to-noise ratio.


### 3.3. Optimization of Psychological Stress Parameters

This paper analyzes and detects the ERP components induced by psychological stress and proposes a method for identifying psychological stress based on the spatiotemporal characteristics of a small number of trial ERP components:(8)Tx=10lnlimn⟶∞∑n=1Nx2n∑n=1Nxn−x⌢n2,ux,t=sin2xt+sin4xt+cos2xt+cos4xt,vx,t=sin2xt+π2+sin4xt+π2+cos2xt+π2+cos4xt+π2.Based on the analysis of the ERP components induced by different psychological stress valences, this paper selects five components for subsequent identification analysis. The Duffing equation EEG signal recognition algorithm is introduced to construct a spatial filter to enhance the ERP component, and the time-spatial feature extraction of the entire ERP waveform is used to maximize the difference of different types of psychological stress.After using the Duffing equation EEG signal recognition algorithm to construct the spatial filter of the ERP component, the paper uses the following two steps to extract the features for psychological stress recognition on the signal after the spatial filtering. Using the weightw obtained, this article weights the extracted ERP components according to the linear model. Figure 3 shows the histogram of the EEG signal detection value. The psychological stress EEG signal sequence collected in the experiment is short, which will limit the scale factor in the multiscale fuzzy entropy algorithm, and the coarse-grained algorithm is improved. The feature vector is extracted by the multiscale fuzzy entropy algorithm based on an improved coarse-grained algorithm, and finally, the feature dimensionality is reduced, and the principal component feature vector is obtained for pattern classification.Figure 3
Histogram of EEG signal detection value distribution.Figure4 shows a schematic diagram of mental stress recognition of EEG signals based on Duffing’s equation. On the scale, the normalized values of positive, neutral, and negative psychological pressure have a better degree of discrimination, which is obviously better than fuzzy entropy. The multiscale fuzzy entropy introduces a scale factor on the basis of fuzzy entropy, which is a measure of the complexity of the time series under the multiscale factor. Due to the randomness and nonstationarity of the mental stress EEG signal, its time series will reflect more information under multiscale factors. After using the multiscale fuzzy entropy algorithm for feature extraction, it can be found in multiple scales. The psychological stress EEG signal distinguishes fuzzy entropy with the best degree, so as to better carry out pattern classification.Figure 4
Schematic diagram of mental stress recognition of EEG signals based on Duffing equation.


## 3.1. Duffing Equation Distribution Solution

Theoretically speaking, the solution of the system in the phase space changes with the change of thex value. When x gradually increases from 0, the trajectory of the system solution in the phase space is an even-order subharmonic bifurcation. At this time, the system oscillates according to the period of the applied periodic force or its double period. The homoclinic trajectory appears, which results in chaotic motion in the sense of a small horseshoe. When x further increases, the system will appear inverted odd-order harmonic bifurcation, and finally, the frequency of externally applied periodic force performs large-scale periodic oscillation:
(1)x″+cx′−x+x2=xcost,xcost+Acos1+Δwt+α=0.In the formula,fx is the amplitude of the perturbation force, a is the amplitude of the signal to be detected, t is the phase difference between the perturbation signal and the signal to be measured, and c is the absolute frequency difference between the perturbation signal and the signal to be measured:
(2)fx=cost2+2acoswt+a2,x″0=fcost−c×x′0+x0.During detection,fx is set to be less than the critical threshold dx (the critical threshold for turning from chaos to large period). When c=0, it is a periodic motion, and in other cases, it is a chaotic motion, the vector path of the perturbation signal is regarded as the path of the immobile signal to be measured, and it will rotate very slowly around it at the frequency of w:
(3)d2xdt2+c×dxdt−x=fcost.When the two directions are the same, the trajectory of the system phase diagram is in the state of outer orbit period 1, which indicates that there is a weak periodic signal. The system is in a chaotic state, so the phenomenon of intermittent chaos appears sometimes chaotic and sometimes periodic:(4)x0=fcost,x′0=−fsint,y=1n×∑t∑nxiwi×k−1,n=1,2,⋯,N.Whenw is very small, the change of cost is very slow, much slower than the process of phase transition. If the phase change requires one or two cycles, and the time for the system to maintain a stable periodic state or chaotic state is dozens of cycles, the system can respond well to the signal to be measured, so the alternate appearance of cycles and chaos is very obvious. It shows that the phase change of the vibrator is sensitive to small signals.The chaotic system’s detection of weak signals is determined by the system’s sensitivity to initial values or parameters. Figure1 shows the level division of Duffing equation distribution solution. Different parameters have different detection performances and are also suitable for signal detection in different environments:
(5)zx=∑kxk+1yk+1,x<k,∑kxkyk,x<k.Figure 1
Duffing equation distribution solution level division.From the relationship between parameters and initial values, there are the effects of different parameters on the detection performance of the system. Analysis of these two aspects to determine the parameters of the system is based on the parameter analysis of the Duffing equation oscillator.


## 3.2. EEG Signal Recognition Algorithm

The classification algorithm is a method that can effectively detect ERP (Event-Related Potential) signals. In general, this type of method uses spatial filtering algorithms to reduce the multilead EEG data to one-dimensional or two-dimensional signals, so that the new signal obtained contains more task-related information:(6)S=1k−1x×∑k−1Kxk−x¯xk¯−xT,wt=zt,n×xt∣t=t−Δt2,t+Δt2.The more typical methods include the cospace model and its subsequent Duffing equation and the layered decision component analysis method. Among them, the Duffing equation uses the spatial information of the EEG signal and extracts rich time information by adding a time window, so that it can be effectively used for the detection of ERP components. The training samples can be mapped from the original space to a higher-dimensional space so that the samples are linearly separable in this space. If the original space has finite dimensionality, that is, the attributes are limited, then there must be a high-dimensional feature space so that the sample can be divided. According to the analysis results of the average of the experimental data group, the amplitude and latency of the ERP components in this experiment under different psychological stress conditions are different, so under different psychological stress valence strengths, the Duffing equation EEG signal recognition algorithm is used. It is estimated that the ERP component is feasible and theoretically can achieve better results.Figure2 shows the flow chart of the EEG signal recognition algorithm based on the Duffing equation. The algorithm assumes that the ERP components of different trials of the same category remain constant. By modeling the amplitude and latency of the ERP components, and integrating the information of space, time, and trials, the spatial patterns of ERP components induced by different categories are determined:
(7)Hx=x2+12×1−xx1,Gx=x2−12×1x2−x21.Figure 2
Flow chart of EEG signal recognition algorithm based on Duffing equation.The algorithm divides the detection of signals into three steps. This layer divides the EEG signal inton time periods and uses linear discriminant analysis to find the weights that maximize the difference between the target and nontarget categories in each time period, and the value reduces the multilead signal to one dimension. This type of algorithm focuses on the estimation and extraction of ERP components under a certain condition. The mainstream methods include principal component analysis (PCA) and independent component analysis (ICA). One-dimensional models are like discrete models. On this basis, people find that emotions are related. For example, people are always excited in a happy state; in an angry state, they are often accompanied by hatred and sadness. This inspires people to use this as a classification basis to classify two-dimensional and three-dimensional emotional models. However, because these two methods are not proposed for the characteristics of ERP components, there are certain shortcomings in the extraction of ERP components; that is, the method focuses more on the extraction of components under the condition of a high signal-to-noise ratio.


## 3.3. Optimization of Psychological Stress Parameters

This paper analyzes and detects the ERP components induced by psychological stress and proposes a method for identifying psychological stress based on the spatiotemporal characteristics of a small number of trial ERP components:(8)Tx=10lnlimn⟶∞∑n=1Nx2n∑n=1Nxn−x⌢n2,ux,t=sin2xt+sin4xt+cos2xt+cos4xt,vx,t=sin2xt+π2+sin4xt+π2+cos2xt+π2+cos4xt+π2.Based on the analysis of the ERP components induced by different psychological stress valences, this paper selects five components for subsequent identification analysis. The Duffing equation EEG signal recognition algorithm is introduced to construct a spatial filter to enhance the ERP component, and the time-spatial feature extraction of the entire ERP waveform is used to maximize the difference of different types of psychological stress.After using the Duffing equation EEG signal recognition algorithm to construct the spatial filter of the ERP component, the paper uses the following two steps to extract the features for psychological stress recognition on the signal after the spatial filtering. Using the weightw obtained, this article weights the extracted ERP components according to the linear model. Figure 3 shows the histogram of the EEG signal detection value. The psychological stress EEG signal sequence collected in the experiment is short, which will limit the scale factor in the multiscale fuzzy entropy algorithm, and the coarse-grained algorithm is improved. The feature vector is extracted by the multiscale fuzzy entropy algorithm based on an improved coarse-grained algorithm, and finally, the feature dimensionality is reduced, and the principal component feature vector is obtained for pattern classification.Figure 3
Histogram of EEG signal detection value distribution.Figure4 shows a schematic diagram of mental stress recognition of EEG signals based on Duffing’s equation. On the scale, the normalized values of positive, neutral, and negative psychological pressure have a better degree of discrimination, which is obviously better than fuzzy entropy. The multiscale fuzzy entropy introduces a scale factor on the basis of fuzzy entropy, which is a measure of the complexity of the time series under the multiscale factor. Due to the randomness and nonstationarity of the mental stress EEG signal, its time series will reflect more information under multiscale factors. After using the multiscale fuzzy entropy algorithm for feature extraction, it can be found in multiple scales. The psychological stress EEG signal distinguishes fuzzy entropy with the best degree, so as to better carry out pattern classification.Figure 4
Schematic diagram of mental stress recognition of EEG signals based on Duffing equation.


## 4. Application and Analysis of Psychological Stress Model for EEG Signal Recognition Based on Duffing Equation

### 4.1. EEG Signal Feature Extraction

In order to achieve the objective of objective measurement and identification of psychological stress, this article chooses to use the psychological stress pictures as the experimental stimuli to induce the corresponding psychological stress of the subjects. In the data set, the acquisition device uses electrode leads to record peripheral physiological signals, such as electromyographic signals and eye movement signals. The idea of coherence analysis is to start with peripheral signals, analyze their connections with emotional EEG signals, and select the channels with the highest coherence. The specific information of the psychological stress picture stimulus is shown in the text. The results of analysis of variance showed that the potency intensity of psychological stress stimulation had a significant potency difference. Based on the experimental paradigm, this article first analyzes the ERP components induced by psychological stress stimuli and then analyzes the airspace patterns corresponding to different ERP components and the recognition results for psychological stress recognition. According to the key-press response, this article will remove the subjects whose correct key-press attempts are less than or equal to 45 times.The duration of data collection for each experiment is between 10 and 20 minutes, and feature extraction is performed every 5 seconds, including a time window overlap of 3 seconds, so the number of samples in each experiment data set is between 1000 and 1400. Figure5 shows the trend of EEG signal data with the acquisition time. EEG signals have great individual differences, and even the same subject’s corresponding baseline state on different days also has certain differences. Therefore, in the process of identifying mental stress based on EEG, we are dealing with each subject. In this paper, four categories of psychological stress states are classified, which basically correspond to the four basic psychological stress states. When marking the psychological stress state, we refer to the segment to induce the type of psychological stress and the participant’s feedback at the same time, of which the participant’s feedback is the main one. When analyzing psychological stress identification data, the EEG data corresponding to the first two segments of the same psychological stress state is used as the training set, and the EEG data corresponding to the latter segment of the same psychological stress state is used as the test set.Figure 5
Trend of EEG signal data with acquisition time.Table1 shows the preprocessing of EEG signal data. Since the EEG signal is extremely weak, it is susceptible to interference from other unrelated signals such as the outside world during the data acquisition process, which brings difficulties to the subsequent analysis of the EEG signal, so it is necessary to preprocess the EEG signal. First of all, in order to further reduce the amount of data, within the range allowed by the experimental data analysis, this article downsamples the signal to 250 Hz; at the same time, according to the existing conclusions, this article chooses to use inverse biorthogonal wavelet to filter the data. Secondly, this article divides the data into segments. Each data segment is 1200 ms long, including 200 ms data before stimulation and 1000 ms data after stimulation. The data is baseline corrected to ensure that the data are in the same benchmark. At the same time, according to other ERP researches, it is judged that the data whose signal amplitude is outside −80,80 μV is an artifact, and it is eliminated.Table 1
Data preprocessing of EEG signal.
Test numberData duration (ms)Sampling frequency (Hz)Signal amplitude (μV)Number of samples1200250-8010002300500-201200340075020130045001000801400


### 4.2. Psychological Pressure Model Simulation

In the course of this experiment, the subjects’ EEG signals are collected synchronously through the NeuroScan system (sampling rate is 1000 Hz). During the acquisition process, the frequency band of the filter of each EEG signal is set to 1-100 Hz. The power frequency noise interference existing on the left and right is filtered through the notch filter. Figure6 shows the frequency band response curve of the EEG signal. The sudden change of the phase diagram of the critical point of the system means that the system immediately enters the large period state from the chaotic state, and the sudden change represents the accuracy of the chaotic detection performance. In the process of detecting the signal, if the phase diagram has a sudden change, it means that the signal to be measured contains a weak signal consistent with the frequency of the perturbation signal. However, in the process of specific operation, the amplitude adjustment may be too large, crossing the chaotic interval, which leads to misjudgment. The performance of these two aspects will be analyzed by adjusting the value of damping below. Using simulation, the amplitude step of the perturbation force is 2.Figure 6
Band response curve of EEG signal.For the study of psychological stress recognition algorithms, the correctness and validity of the data are the key to subsequent processing and analysis. Therefore, the collection of ECG signals is the basis for the recognition of psychological stress. This design first builds a circuit based on the block diagram of the ECG acquisition module, and then, the signal is output through the acquisition circuit to the analog input; finally, we use the LabVIEW FPGA module to design the acquisition program and store the collected raw ECG data through the FIFO (First Input First Output) memory in the FPGA. The ECG data is finally read and displayed through the terminal program. When using the LabVIEW FPGA module, in order to make the FPGA programming process completely graphical, we can use the relevant panel of the LabVIEW FPGA module in LabVIEW to complete the FPGA design.Figure7 shows the fan-shaped distribution diagram of EEG signal recognition accuracy based on the Duffing equation. The comparison shows that the improved EEG signal recognition algorithm based on the Duffing equation has an average recognition rate of 2.66% higher than that of the Duffing equation method. It shows that the improved EEG signal recognition algorithm can significantly improve the classification and recognition accuracy of the neural network classifier and obtain satisfactory classification results. In this paper, the low-voltage sample category label is set to 1, and the high-voltage sample category label is set to 2, and a simulation experiment result of the classification results and classification accuracy of the neural network algorithm based on the Duffing equation is obtained. The simulation experiment shows that when the test set is the same, the classification accuracy of the improved Duffing equation optimization is 43.33%, the basic Duffing equation optimization classification accuracy is 46.67%, and the classification accuracy is increased by 3.66% after the improvement. Therefore, the classification accuracy of the neural network optimized by the improved Duffing equation EEG signal recognition algorithm is significantly higher than that of the basic EEG signal recognition algorithm to optimize the classifier, indicating that the improved Duffing equation EEG signal recognition algorithm has strong generalization ability in optimization.Figure 7
Fan-shaped distribution diagram of EEG signal recognition accuracy based on Duffing equation.


### 4.3. Example Application and Analysis

The experiment is divided into two groups: the first group of experiments is the positive psychological pressure group, and the second group of experiments is the negative psychological pressure group. Dividing the experiment according to the polarity of the psychological pressure can reduce the interference and conflict between different psychological pressures on the one hand and on the other hand can reduce the load of the experiment time of the subjects, so that the subjects have a better mental state during the experiment. Figure8 shows the graph of the EEG signal test time versus the number of training attempts. Group 1 represents the sample of reference [20], and group 2 represents the working data of this paper. Each experiment consists of two blocks, between which the subjects will be allowed to make appropriate rest adjustments. Each block includes 700 trials. First of all, a sign lasts for 300 ms and is used to remind the participant that the stimulus is about to be presented. After that, a random blank scene of 100 ms to 1000 ms will appear to randomize the subsequent psychological stress stimuli. At the same time, in order to ensure the participants’ attention, the experiment required the participants to respond as quickly as possible after seeing the stimulus pictures. Finally, before the next trial, there is a 200 ms break, during which the subjects need to ease their psychological pressure and reduce the impact on the next stimulus. All experiments presented in this paper are implemented in E-prime software.Figure 8
EEG signal test time vs. training trial time broken line comparison diagram.In this paper, the characteristic parameters extracted from the three methods of time domain, frequency domain, and nonlinearity are used as data samples. There are 150 sets of training samples and test sample data, including 80 sets of high-voltage sample data and 70 sets of low-voltage sample data. We extract 55 sets of data from low-pressure samples as training data and 15 sets of data as test data and extract 65 sets of data from high-pressure samples as training data and 15 sets of data as test data to test the classification ability. Data acquisition is mainly through the FIFO memory in the FPGA. When designing the FPGA-side program, we select the FPGA node control in the function palette and use this control to collect data, and then, in the FPGA I/O node control, we select the I/0 port that matches the hardware. Finally, the collected data is written into the FIFO memory and stored through the FIFO control. The collected data is read in the FIFO memory, and finally, the FIFO is used to realize the transfer between the two, that is, the data transfer between the FPGA end and the RT end. Using empirical mode decomposition, the signal can be decomposed adaptively, and several eigenmode functions IMF can be obtained, which has a better signal-to-noise ratio. At the same time, it can also smooth the original complex changes of the EEG signal to facilitate the subsequent linearization operation.Figure9 shows the three-dimensional histogram of the recognition rate of EEG signals with different characteristic parameters. According to the statistical method in the time domain analysis, the model method in the frequency domain, and the three-dimensional graph method in the nonlinearity, the feature parameters {“X1”, “X2”, “X3”, “X4”} are input into two classifiers, and then, the Duffing equation optimization algorithm is combined with the two classifiers to obtain the recognition rate of psychological stress. Finally, from the above data analysis, we can see the following: (1) The equation optimization EEG signal recognition network has a fast convergence speed and the highest recognition rate; the improved Duffing equation optimization network has a fast optimization speed. (2) Compared with the other methods, the improved Duffing equation EEG signal recognition algorithm has the highest recognition rate of psychological stress, and the average recognition rate is above 80%.Figure 9
Three-dimensional histogram distribution of EEG signal recognition rate with different characteristic parameters.


## 4.1. EEG Signal Feature Extraction

In order to achieve the objective of objective measurement and identification of psychological stress, this article chooses to use the psychological stress pictures as the experimental stimuli to induce the corresponding psychological stress of the subjects. In the data set, the acquisition device uses electrode leads to record peripheral physiological signals, such as electromyographic signals and eye movement signals. The idea of coherence analysis is to start with peripheral signals, analyze their connections with emotional EEG signals, and select the channels with the highest coherence. The specific information of the psychological stress picture stimulus is shown in the text. The results of analysis of variance showed that the potency intensity of psychological stress stimulation had a significant potency difference. Based on the experimental paradigm, this article first analyzes the ERP components induced by psychological stress stimuli and then analyzes the airspace patterns corresponding to different ERP components and the recognition results for psychological stress recognition. According to the key-press response, this article will remove the subjects whose correct key-press attempts are less than or equal to 45 times.The duration of data collection for each experiment is between 10 and 20 minutes, and feature extraction is performed every 5 seconds, including a time window overlap of 3 seconds, so the number of samples in each experiment data set is between 1000 and 1400. Figure5 shows the trend of EEG signal data with the acquisition time. EEG signals have great individual differences, and even the same subject’s corresponding baseline state on different days also has certain differences. Therefore, in the process of identifying mental stress based on EEG, we are dealing with each subject. In this paper, four categories of psychological stress states are classified, which basically correspond to the four basic psychological stress states. When marking the psychological stress state, we refer to the segment to induce the type of psychological stress and the participant’s feedback at the same time, of which the participant’s feedback is the main one. When analyzing psychological stress identification data, the EEG data corresponding to the first two segments of the same psychological stress state is used as the training set, and the EEG data corresponding to the latter segment of the same psychological stress state is used as the test set.Figure 5
Trend of EEG signal data with acquisition time.Table1 shows the preprocessing of EEG signal data. Since the EEG signal is extremely weak, it is susceptible to interference from other unrelated signals such as the outside world during the data acquisition process, which brings difficulties to the subsequent analysis of the EEG signal, so it is necessary to preprocess the EEG signal. First of all, in order to further reduce the amount of data, within the range allowed by the experimental data analysis, this article downsamples the signal to 250 Hz; at the same time, according to the existing conclusions, this article chooses to use inverse biorthogonal wavelet to filter the data. Secondly, this article divides the data into segments. Each data segment is 1200 ms long, including 200 ms data before stimulation and 1000 ms data after stimulation. The data is baseline corrected to ensure that the data are in the same benchmark. At the same time, according to other ERP researches, it is judged that the data whose signal amplitude is outside −80,80 μV is an artifact, and it is eliminated.Table 1
Data preprocessing of EEG signal.
Test numberData duration (ms)Sampling frequency (Hz)Signal amplitude (μV)Number of samples1200250-8010002300500-201200340075020130045001000801400


## 4.2. Psychological Pressure Model Simulation

In the course of this experiment, the subjects’ EEG signals are collected synchronously through the NeuroScan system (sampling rate is 1000 Hz). During the acquisition process, the frequency band of the filter of each EEG signal is set to 1-100 Hz. The power frequency noise interference existing on the left and right is filtered through the notch filter. Figure6 shows the frequency band response curve of the EEG signal. The sudden change of the phase diagram of the critical point of the system means that the system immediately enters the large period state from the chaotic state, and the sudden change represents the accuracy of the chaotic detection performance. In the process of detecting the signal, if the phase diagram has a sudden change, it means that the signal to be measured contains a weak signal consistent with the frequency of the perturbation signal. However, in the process of specific operation, the amplitude adjustment may be too large, crossing the chaotic interval, which leads to misjudgment. The performance of these two aspects will be analyzed by adjusting the value of damping below. Using simulation, the amplitude step of the perturbation force is 2.Figure 6
Band response curve of EEG signal.For the study of psychological stress recognition algorithms, the correctness and validity of the data are the key to subsequent processing and analysis. Therefore, the collection of ECG signals is the basis for the recognition of psychological stress. This design first builds a circuit based on the block diagram of the ECG acquisition module, and then, the signal is output through the acquisition circuit to the analog input; finally, we use the LabVIEW FPGA module to design the acquisition program and store the collected raw ECG data through the FIFO (First Input First Output) memory in the FPGA. The ECG data is finally read and displayed through the terminal program. When using the LabVIEW FPGA module, in order to make the FPGA programming process completely graphical, we can use the relevant panel of the LabVIEW FPGA module in LabVIEW to complete the FPGA design.Figure7 shows the fan-shaped distribution diagram of EEG signal recognition accuracy based on the Duffing equation. The comparison shows that the improved EEG signal recognition algorithm based on the Duffing equation has an average recognition rate of 2.66% higher than that of the Duffing equation method. It shows that the improved EEG signal recognition algorithm can significantly improve the classification and recognition accuracy of the neural network classifier and obtain satisfactory classification results. In this paper, the low-voltage sample category label is set to 1, and the high-voltage sample category label is set to 2, and a simulation experiment result of the classification results and classification accuracy of the neural network algorithm based on the Duffing equation is obtained. The simulation experiment shows that when the test set is the same, the classification accuracy of the improved Duffing equation optimization is 43.33%, the basic Duffing equation optimization classification accuracy is 46.67%, and the classification accuracy is increased by 3.66% after the improvement. Therefore, the classification accuracy of the neural network optimized by the improved Duffing equation EEG signal recognition algorithm is significantly higher than that of the basic EEG signal recognition algorithm to optimize the classifier, indicating that the improved Duffing equation EEG signal recognition algorithm has strong generalization ability in optimization.Figure 7
Fan-shaped distribution diagram of EEG signal recognition accuracy based on Duffing equation.


## 4.3. Example Application and Analysis

The experiment is divided into two groups: the first group of experiments is the positive psychological pressure group, and the second group of experiments is the negative psychological pressure group. Dividing the experiment according to the polarity of the psychological pressure can reduce the interference and conflict between different psychological pressures on the one hand and on the other hand can reduce the load of the experiment time of the subjects, so that the subjects have a better mental state during the experiment. Figure8 shows the graph of the EEG signal test time versus the number of training attempts. Group 1 represents the sample of reference [20], and group 2 represents the working data of this paper. Each experiment consists of two blocks, between which the subjects will be allowed to make appropriate rest adjustments. Each block includes 700 trials. First of all, a sign lasts for 300 ms and is used to remind the participant that the stimulus is about to be presented. After that, a random blank scene of 100 ms to 1000 ms will appear to randomize the subsequent psychological stress stimuli. At the same time, in order to ensure the participants’ attention, the experiment required the participants to respond as quickly as possible after seeing the stimulus pictures. Finally, before the next trial, there is a 200 ms break, during which the subjects need to ease their psychological pressure and reduce the impact on the next stimulus. All experiments presented in this paper are implemented in E-prime software.Figure 8
EEG signal test time vs. training trial time broken line comparison diagram.In this paper, the characteristic parameters extracted from the three methods of time domain, frequency domain, and nonlinearity are used as data samples. There are 150 sets of training samples and test sample data, including 80 sets of high-voltage sample data and 70 sets of low-voltage sample data. We extract 55 sets of data from low-pressure samples as training data and 15 sets of data as test data and extract 65 sets of data from high-pressure samples as training data and 15 sets of data as test data to test the classification ability. Data acquisition is mainly through the FIFO memory in the FPGA. When designing the FPGA-side program, we select the FPGA node control in the function palette and use this control to collect data, and then, in the FPGA I/O node control, we select the I/0 port that matches the hardware. Finally, the collected data is written into the FIFO memory and stored through the FIFO control. The collected data is read in the FIFO memory, and finally, the FIFO is used to realize the transfer between the two, that is, the data transfer between the FPGA end and the RT end. Using empirical mode decomposition, the signal can be decomposed adaptively, and several eigenmode functions IMF can be obtained, which has a better signal-to-noise ratio. At the same time, it can also smooth the original complex changes of the EEG signal to facilitate the subsequent linearization operation.Figure9 shows the three-dimensional histogram of the recognition rate of EEG signals with different characteristic parameters. According to the statistical method in the time domain analysis, the model method in the frequency domain, and the three-dimensional graph method in the nonlinearity, the feature parameters {“X1”, “X2”, “X3”, “X4”} are input into two classifiers, and then, the Duffing equation optimization algorithm is combined with the two classifiers to obtain the recognition rate of psychological stress. Finally, from the above data analysis, we can see the following: (1) The equation optimization EEG signal recognition network has a fast convergence speed and the highest recognition rate; the improved Duffing equation optimization network has a fast optimization speed. (2) Compared with the other methods, the improved Duffing equation EEG signal recognition algorithm has the highest recognition rate of psychological stress, and the average recognition rate is above 80%.Figure 9
Three-dimensional histogram distribution of EEG signal recognition rate with different characteristic parameters.


## 5. Conclusion

This paper builds a mental stress recognition system based on Duffing equation EEG signal recognition and completes audiovisual induction experiments to realize online mental stress recognition based on the two dimensions of valence and arousal. We design two typical inducing experiments of psychological stress, complete the psychological stress recognition under auditory channel stimulation and visual channel stimulation, verify the effectiveness of the feature extraction and selection methods in this paper, and build a psychological stress recognition system based on EEG signals. The system receives the EEG data collected by the EEG amplifier through the socket and calls MATLAB to perform feature extraction, selection, and classification of the EEG data. After the experimental process control and data synchronization control, the psychological pressure information in the dimensional space is finally obtained. After feature selection and classifier classification, classification results in several different situations are obtained. Among them, the highest classification accuracy rate of 80% was obtained in the four categories of psychological stress. Through the discussion and analysis of the classification results, this article explores the feasibility of identifying psychological stress based on the EEG signals of the three frontal leads. Compared with the traditional mental pressure EEG recognition process, the prototype system can quickly and easily realize the real-time recognition of mental pressure, indicating that the system has a certain application value. The system can automatically adjust the parameters of the system according to the unique EEG patterns of each user and effectively improve the performance of the psychological stress recognition model. The future psychological stress recognition system should fully collect all kinds of effective information and use information fusion technology to fuse various psychological stress characteristic information and finally form a multimodal psychological stress recognition system.



---

*Source: 1454547-2021-09-14.xml*