A method and system for concentration classification based on single-channel EEG signals
Through the single-channel EEG EEG signal combined with body temperature and heartbeat data, the LSTM neural network model and joint loss function are improved, the problem of low recognition accuracy of single-channel EEG signal is solved, and efficient focus monitoring is achieved, which is suitable for distance education and intelligent driving.
Patent Information
- Application Number
- CN202411042668.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2044-07-31
AI Technical Summary
In the prior art, the focus recognition accuracy of single-channel EEG EEG signal is too low and has poor accuracy. The multi-channel EEG signal analysis is complex and susceptible to noise interference, which is not suitable for IoT application scenarios. Single-channel devices are susceptible to muscle activity and are inconvenient to use.
A single-channel EEG EEG EEG device is used to collect signals, combine body temperature and heartbeat data, and through the improved LSTM neural network model and joint loss function optimization, data augmentation and reconstruction is performed using window bend and overlapping sampling, and a body temperature and heartbeat data correction model is introduced to build a concentration classification system.
It improves the concentration monitoring accuracy and system ease of use of single-channel EEG EEG signal, and realizes fast and efficient concentration classification, and is suitable for distance education, teenager learning disability intervention and intelligent driving.
Smart Images

Figure CN119046820B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of signal processing and deep learning, and particularly relates to a method and system for concentration classification based on single-channel EEG brain electrical signals. Background Art
[0002] With the deepening of informatization, human social activities have become increasingly complex, and human concentration ability has been gradually dispersed by the fast-paced and fragmented lifestyle. In the fields of intelligent driving, remote teaching, correction of learning disabilities in teenagers, etc., efficiently and quickly obtaining the concentration state of the measured person is a very important link.
[0003] For many years, EEG brain electrical signals have been the standard method for measuring human attention. Some scholars have proved at the beginning of the 21st century that electroencephalogram biofeedback can be used as an effective method for treating inattention. Later, some scholars combined other methods such as questionnaire surveys when using EEG to detect the brain waves of subjects, and thus reached the conclusion that a certain frequency in the EEG brain electrical signals can accurately reflect an individual's attention. Many studies have shown that the attention level can be characterized by the complexity of brain wave signals. However, the analysis of multi-channel EEG signals is complex and easily interfered by noise, and is not suitable for various current Internet of Things application scenarios. In addition, multi-channel electroencephalogram signal acquisition devices are too troublesome to use and cannot be used for daily concentration monitoring.
[0004] Recently, single-channel EEG brain electrical signal acquisition devices have become the first choice for concentration monitoring applications due to their small size and portability. However, due to the significant reduction in the acquisition channels, the single-channel EEG brain electrical signals have insufficient information carrying capacity, and are extremely vulnerable to interference from muscle activities such as blinking, resulting in low accuracy. After being processed by signal processing technologies, deep learning methods in the field of artificial intelligence can be used for the processing and recognition of such signals. Network models such as Convolutional Neural Networks (CNN) and Generative Adversarial Networks (GAN) are commonly used deep learning recognition methods in research. Some scholars have even used several network models in combination to avoid problems such as overfitting and gradient descent during the model learning process. Summary of the Invention
[0005] Aiming at the problems existing in the above-mentioned prior art, the present invention provides a method and system for concentration classification based on single-channel EEG brain electrical signals, so as to solve the defects of too low recognition accuracy and poor accuracy in the prior art, and improve the usability of the concentration monitoring system, making it convenient and flexible to use.
[0006] To achieve the above technical objectives, the present invention provides the following technical solutions:
[0007] The present invention provides a method for classifying concentration based on a single-channel EEG signal, which specifically includes:
[0008] S1. Use a single-channel EEG device to collect the original data set of EEG signals, and use an auxiliary module to collect the subject's body temperature and heart rate data;
[0009] S2, preprocessing the original data set of the collected EEG signal, performing data enhancement and reconstruction, and then dividing the processed data set into a training data set and a test data set to complete the feature extraction of the EEG signal data;
[0010] S3. Build an improved LSTM neural network model, use the improved loss function to optimize the training data set, and use the optimized training data set as input to train the network model;
[0011] S4, using the collected body temperature and heartbeat data of the subject to calibrate the training results of the LSTM neural network model, and obtain a single-channel EEG brain electrical signal concentration classification model;
[0012] S5. Input the test data set into the single-channel EEG signal concentration classification model to obtain the EEG signal concentration classification result.
[0013] Furthermore, step S1 specifically includes:
[0014] S11. Clean the forehead and fingers of the subject, attach the single-channel EEG signal acquisition dry electrode to the forehead of the subject, wear the ear clip, and attach the pulp of any finger to the signal acquisition area of the auxiliary module;
[0015] S12. According to the preset collection process and tasks, collect the original data of the single-channel EEG brain wave signal; and simultaneously collect the heartbeat and body temperature data of the subject;
[0016] S13. The collected single-channel EEG signal is transmitted to the receiving device in real time by the transmission module and forms an original data file, which constitutes the original data set of the EEG signal, and simultaneously saves the corresponding heartbeat and body temperature data.
[0017] Furthermore, step S2 specifically includes:
[0018] S21, using a low-pass filter and a band-pass filter of a specific frequency band in turn to perform noise reduction and filtering on the original data set of the EEG signal obtained in step S1, to obtain the original data set of the EEG signal after filtering and noise reduction;
[0019] S22. Use the method of Window Warping to perform data augmentation on the original dataset of EEG signals after filtering and noise reduction through a preset stretching and compression ratio; then use the method of Overlapping Sampling to perform data reconstruction through a preset sliding window size and overlapping dimension to obtain an EEG signal dataset after data augmentation and reconstruction;
[0020] S23. According to the differences in brain activities in the preset acquisition process, perform a preliminary cut on the EEG signal dataset after data augmentation and reconstruction, and then perform a further cut according to the preset window size to obtain a segmented EEG signal dataset;
[0021] S24. Perform normalization processing on the segmented EEG signal dataset and extract features according to a preset feature parameter formula.
[0022] Further, step S3 specifically includes:
[0023] S31. Adopt an LSTM neural network model with a two-layer hidden layer structure and preset the size of the hidden layer cells;
[0024] S32. After the training set data of the EEG signal is input into the hidden layer, perform normalized batch processing, and then pass through the activation function layer after normalized batch processing. The activation function uses the Leaky Rectified Linear Unit (LeakyReLU);
[0025] S33. Then connect the fully connected layer to summarize the data features of the training set data of the EEG signal and output the attention classification probability through the Tanh function;
[0026] S34. Use a joint loss function of multi-class cross-entropy and mean squared error to compensate and optimize the neural network model; the formula is expressed as:
[0027]
[0028] L = L CCE + L MSE ;
[0029] where L CCE is the multi-class cross-entropy loss function, n is the number of classes, y[i] represents the true label of the sample, represents the predicted probability, L MSE is the mean squared error loss function, N is the number of samples, L is the joint loss function, and i represents the i-th sample.
[0030] S35. Train the neural network classification model using the training dataset according to the preset parameters.
[0031] Further, step S4 specifically includes:
[0032] S41. Define a concentration calculation formula, select a signal frequency band related to concentration, express concentration as a value between 0 and 1, and define a concentration classification label based on the calculated value; the formula is expressed as:
[0033]
[0034] Among them, D is the concentration value, E δ 、E θ 、E α 、E β 、E γ They respectively represent the energy entropy of the δ, θ, α, β, and γ frequency bands in the same EEG signal.
[0035] S42. Use the subject's body temperature and heart rate physiological data of the same period to correct the classification training results and obtain an optimized single-channel EEG signal concentration classification model.
[0036] Furthermore, step S5 specifically includes:
[0037] S51, determining a preset concentration threshold and running time;
[0038] S52, inputting the test data set of the single-channel EEG brain electrical signal to be identified into the single-channel EEG brain electrical signal concentration classification model obtained in step S4 within a preset running time, and obtaining the EEG signal concentration value according to the concentration calculation formula;
[0039] S53. Assign corresponding classification labels to the test set data according to the obtained EEG signal concentration value, and obtain one of the three classification labels of concentration, partial concentration, and inattention as the classification result.
[0040] The present invention also provides a concentration classification system based on a single-channel EEG signal, comprising the following modules:
[0041] Acquisition module, collecting original single-channel EEG signals;
[0042] Auxiliary module, collects the temperature and heart rate data of the subject at the same time;
[0043] The transmission module transmits the collected original signal to the receiving end in real time to form an original data set;
[0044] A preprocessing module preprocesses the single-channel EEG brain electrical signal original data set to obtain a preprocessed single-channel EEG brain electrical signal original data set, and then divides it into a training data set and a test data set;
[0045] The training optimization module constructs an improved LSTM neural network model, inputs the preprocessed single-channel EEG signal training dataset into the neural network model for training, and combines an improved joint loss function to obtain an EEG signal concentration classification model. At the same time, in cooperation with body temperature and heart rate data, the EEG signal concentration classification model is further optimized.
[0046] The recognition module inputs the test dataset of the single-channel EEG signal to be recognized into the EEG signal concentration classification model to obtain the EEG signal concentration classification result.
[0047] In addition, the present invention also provides an electronic device, including a single-channel EEG acquisition module and a body temperature and heart rate assistance module. It also includes a computer program stored on a memory and executable on a processor, characterized in that the EEG signal concentration classification method according to any one of claims 1 to 6 can be implemented by using the electronic device and the program.
[0048] Through the above technical solutions, the present invention has the following beneficial effects:
[0049] The concentration classification method based on single-channel EEG signals provided by the present invention completes data augmentation and reconstruction through window bending and overlapping sampling, effectively and evenly expands the number of samples, avoids bias towards a certain type of sample during training, and provides different category feature quantities of the same order of magnitude for the feature selection process as much as possible.
[0050] In the concentration classification method based on single-channel EEG signals provided by the present invention, the joint loss function of the special multi-classification loss and mean square error loss can effectively measure the difference between the model output probability distribution and the actual label in the three-classification task involved in the present invention, prompting the model to gradually learn correct classification predictions during training, compensating for the deviation between the predicted probability and the true label. At the same time, due to the existence of the mean square error loss, the accuracy of the classification algorithm is further improved.
[0051] In addition, the concentration classification method based on single-channel EEG signals provided by the present invention introduces physiological data such as body temperature and heart rate data as a calibration reference means to optimize the neural network recognition model. By the changes in physiological data caused by different degrees of brain concentration, the concentration value is evaluated and corrected from another angle, improving the reliability of the concentration classification result. It can further improve the training efficiency during training and finally obtain a high classification correctness, which is a supplement to the technical gap of only using EEG signals for concentration recognition in the prior art.
[0052] The concentration classification method based on single-channel EEG brain electrical signals provided by the present invention finally classifies the measured concentration into three recognition results: concentrated, partially concentrated, and non-concentrated. The whole process is fast and efficient. Compared with the existing technologies, the recognition accuracy rate has been significantly improved. It has the characteristics of convenient use, simple method, accurate recognition, etc., and has quite important application prospects in the fields of distance education, intervention of teenagers' learning disabilities, and intelligent driving. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0054] Figure 1 is a flowchart of the concentration classification method based on single-channel EEG brain electrical signals;
[0055] Figure 2 is a structural diagram of the LSTM neural network algorithm of the concentration classification method based on single-channel EEG brain electrical signals;
[0056] Figure 3 is a flowchart of single-channel EEG brain electrical signal acquisition;
[0057] Figure 4 is a structural diagram of the concentration classification system based on single-channel EEG brain electrical signals;
[0058] Figure 5 is a structural diagram of the acquisition module;
[0059] Figure 6 is a structural diagram of the auxiliary module. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0060] In order to make the above-mentioned objects, features, and advantages of the present invention more obvious and understandable, the following will further describe the present invention in detail with reference to the drawings and specific embodiments. Thereby, a full understanding of how the present application applies technical means to solve technical problems and achieve the realization process of technical effects can be obtained and implemented accordingly.
[0061] Those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, so the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0062] Please refer to Figure 1 The present invention shows a method for classifying concentration based on a single-channel EEG signal, which specifically includes the following steps:
[0063] S1. Use a single-channel EEG device to collect the original data set of EEG signals, and use an auxiliary module to collect the subject's body temperature and heart rate data;
[0064] As a preferred implementation of step S1, it specifically includes:
[0065] S11. Clean the forehead and fingers of the subject, attach the single-channel EEG signal acquisition dry electrode to the forehead of the subject, wear the ear clip, and attach the pulp of any finger to the signal acquisition area of the auxiliary module;
[0066] S12. According to the preset collection process and tasks, collect the original data of the single-channel EEG brain wave signal; and simultaneously collect the heartbeat and body temperature data of the subject;
[0067] S13. The collected single-channel EEG signal is transmitted to the receiving device in real time by the transmission module and forms an original data file, which constitutes the original data set of the EEG signal, and simultaneously saves the corresponding heartbeat and body temperature data.
[0068] In this embodiment, the collection process and tasks preset in step S12 are: going through three EEG signal collection stages of "passive learning-active learning-relaxation";
[0069] In step S13, the sampling frequency is set to 512 Hz during the data acquisition process; Figure 3 As shown, the collected single-channel EEG brain signal forms a raw data file, which is transmitted to the receiving device in real time by the Bluetooth transmission module. The data received through the Bluetooth serial port is checked for checksum after preliminary filtering to ensure the authenticity of the received data. The correct data that completes the checksum check will be converted from hexadecimal to decimal and stored in .csv format to form the single-channel EEG brain signal raw data set; at the same time, the corresponding physiological data is saved through the Bluetooth interface.
[0070] S2. Preprocess the original dataset of the collected EEG signals, perform data augmentation and reconstruction, and then divide the processed dataset into a training dataset and a test dataset to complete the feature extraction of the EEG signal data;
[0071] As a preferred implementation manner of step S2, it specifically includes:
[0072] S21. Successively use a low-pass filter and a band-pass filter in a specific frequency band to perform noise reduction and filtering on the original dataset of the EEG signals obtained in step S1 to obtain the original dataset of the EEG signals after filtering and noise reduction;
[0073] S22. Use the method of Window Warping to perform data augmentation on the original dataset of the EEG signals after filtering and noise reduction through a preset stretching and compression ratio; then use the method of Overlapping Sampling to perform data reconstruction through a preset sliding window size and overlapping size to obtain the dataset of the EEG signals after data augmentation and reconstruction;
[0074] S23. According to the differences in brain activities in the preset acquisition process, perform preliminary cutting on the dataset of the EEG signals after data augmentation and reconstruction, and then perform further cutting according to the preset window size to obtain the segmented dataset of the EEG signals;
[0075] S24. Perform normalization processing on the segmented dataset of the EEG signals and extract features from it according to the preset feature parameter formula.
[0076] More specifically, in this embodiment, in the preprocessing stage, a low-pass filter below 50 Hz is used for noise reduction, and then band-pass filters of 8 - 13 Hz and 13 - 30 Hz are used for filtering to obtain the α band and β band that need to be focused on in subsequent processing. The method of Window Warping is used to enhance the data, the sliding window size is set to 10% of the original data time series, the stretching ratio is set to 2, and the compression ratio is set to 0.5. The sliding window size of Overlapping Sampling is set to 50, and the overlapping area size is set to 32. When splitting the data, first split the dataset preliminarily according to different stages of "passive learning - active learning - relaxation" in the acquisition process, and then further split the data using the sliding window method, with the window size set to 256 and the step size set to 64. Normalization processing is performed on the segmented unit data. Further, the energy entropy, energy spectral density, and the custom energy ratio parameter Vec1 are selected as feature parameters to extract features from the dataset. The formula expression of the custom energy ratio parameter Vecl is:
[0077]
[0078] Among them, Energy(α) and Energy(β) are the energies of the α and β frequency bands respectively.
[0079] S3. Construct an improved LSTM neural network model, optimize the training data set using an improved loss function, and use the optimized training data set as input to train the network model;
[0080] As a preferred implementation of step S3, it specifically includes:
[0081] S31. Adopt an LSTM neural network model with a two-layer hidden layer structure and preset the size of the hidden layer cells; in this embodiment, the size of the hidden layer cells is set to 128;
[0082] S32. After the training set data of the electroencephalogram signal is input into the hidden layer, perform normalized batch processing, and then pass through the activation function layer after the normalized batch processing. The activation function uses the Leaky Rectified Linear Unit (LeakyReLU);
[0083] S33. Then connect the fully connected layer to summarize the data features of the training set data of the electroencephalogram signal and output the concentration classification probability through the Tanh function;
[0084] S34. Use a combined loss function of multi-class cross-entropy and mean squared error to compensate and optimize the neural network model; the formula is expressed as:
[0085]
[0086] L = L CCE + L MSE ;
[0087] Among them, L CCE is the multi-class cross-entropy loss function, n is the number of classes, y[i] represents the true label of the sample, represents the predicted probability, L MSE is the mean squared error loss function, N is the number of samples, L is the combined loss function, and i represents the i-th sample.
[0088] S35. Train the neural network classification model using the training data set according to the preset parameters.
[0089] In addition, the hyperparameters for training the LSTM neural network in this embodiment include: the batch size is 64, the number of epochs is 100, the learning rate is 0.001, and the loss function is as above. Complete the training process according to the preset parameters and use the Adam optimizer to accelerate the learning process.
[0090] S4. Use the collected body temperature and heart rate data of the subject to correct the training result of the LSTM neural network model, and obtain a single-channel EEG signal concentration classification model;
[0091] As a preferred implementation manner of step S4, it specifically includes:
[0092] S41. Define a concentration calculation formula, select signal frequency bands related to concentration, represent the concentration as a value between 0 and 1, and define concentration classification labels according to the calculated value; The formula is expressed as:
[0093]
[0094] where D is the concentration value, E δ 、E θ 、E α 、E β 、E γ respectively represent the energy entropy of the δ, θ, α, β, and γ frequency bands in the same segment of EEG signal.
[0095] S42. Use the body temperature and heart rate physiological data of the subject in the same period to correct the classification training result, and obtain an optimized single-channel EEG signal concentration classification model.
[0096] In this embodiment, the smaller the concentration value D, the less concentrated the attention of the subject is. Further, the continuous concentration values are divided into three labels: D ∈ [0, 0.35) is not concentrated, D ∈ [0.35, 0.7) is partially concentrated, and D ∈ [0.7, 1] is concentrated.
[0097] Table 1 Relationship between the average deviation of the subject's body temperature and heart rate and the concentration label
[0098] Label Not focused Partially focused Focused Focus degree value D [0,0.35) [0.35,0.7) [0.7,1] Body temperature deviation °C [-0.3,0) [0,+0.3) [+0.3,+0.6] Heartbeat deviation [-15%,0) [0,10%) [10%,25%]
[0099] In step 42 of the embodiment of the present invention, the preliminary trained model can be corrected and optimized according to the relationship shown in Table 1 above.
[0100] S5. Input the test data set into the single-channel EEG signal concentration classification model to obtain the EEG signal concentration classification result.
[0101] As a preferred implementation manner of step S5, it specifically includes:
[0102] S51. Determine the preset concentration threshold and running duration;
[0103] S52, inputting the test data set of the single-channel EEG brain electrical signal to be identified into the single-channel EEG brain electrical signal concentration classification model obtained in step S4 within a preset running time, and obtaining the EEG signal concentration value according to the concentration calculation formula;
[0104] S53. Assign corresponding classification labels to the test set data according to the obtained EEG signal concentration value, and obtain one of the three classification labels of concentration, partial concentration, and inattention as the classification result.
[0105] More specifically, in this embodiment, the user selects the running time on the mobile terminal; when the classification result is that the ratio of concentration to inattention is lower than the gear requirement, the mobile terminal sends a reminder to the user; when the running time is reached, the attention change curve during the running time is output, and the time periods and total duration of the inattention, partial concentration and concentration stages are counted.
[0106] In summary, the experimental results finally obtained in this embodiment are shown in Table 2:
[0107] Table 2 Performance comparison between the classification model of the present invention and the classic classification model
[0108] Classification model of the present invention Support Vector Machine (SVM) K-Nearest Neighbor (KNN) Accuracy 0.7356 0.6134 0.5948 Macro-F1 score 0.6778 0.5464 0.5290
[0109] The experimental results are evaluated based on two indicators: accuracy and Macro-F1 score. The accuracy rate grasps the prediction ability and classification effect of the classification model as a whole, while the Macro-F1 score focuses more on measuring the balance of feature quantities of each different category, and is used to measure the performance of the model in the dimension of feature quantities of each category.
[0110] It can be seen from Table 2 that, compared with other recognition algorithm models, the improved LSTM neural network model proposed in the embodiment of the present invention can achieve an average accuracy of 73.56% in recognizing the concentration of single-channel EEG signals, which is higher than the accuracy of similar technologies.
[0111] The ablation experiment further verifies the advancedness of the embodiment of the present invention. The following Table 3 shows the influence of the joint loss function proposed in the embodiment of the present invention on the accuracy of the recognition model. If only a single cross entropy or mean square error loss function is used, even if the same neural network model is used, the average accuracy of concentration recognition based on a single-channel EEG signal will be greatly reduced. The following Table 4 shows the influence of using and not using data enhancement methods on the final classification accuracy.
[0112] Table 3 Loss function ablation experiment
[0113]
[0114] Table 4 Data augmentation ablation experiment
[0115] Without using data augmentation method Using data augmentation method Accuracy 0.5744 0.7356 Macro-F1 score 0.5279 0.6778
[0116] It can be clearly seen from the comparison of Table 3 and Table 4 that the method provided by the present invention is more accurate and reliable than the traditional method, and has a better classification effect.
[0117] The following describes the concentration classification system based on single-channel EEG brain electrical signals provided by the present invention. The concentration classification system based on single-channel EEG brain electrical signals described below can be correspondingly referred to the concentration classification method based on single-channel EEG brain electrical signals described above.
[0118] Figure 4 It is the structure diagram of the concentration classification system based on single-channel EEG brain electrical signals provided by the present invention, including: acquisition module M1, auxiliary module M2, transmission module M3, preprocessing module M4, training and optimization module M5, and recognition module M6. Among them:
[0119] The acquisition module M1 is used to acquire the original single-channel EEG brain electrical signals; the auxiliary module M2 is used to acquire physiological signals such as body temperature and heartbeat of the same subject at the same time; the transmission module M3 is used to transmit the acquired original signals to the receiving end in real time to form an original data set; the preprocessing module M4 is used to preprocess the original data set of the single-channel EEG brain electrical signals to obtain the preprocessed original data set of the single-channel EEG brain electrical signals, and then split it into a training data set and a test data set; the training and optimization module M5 is used to construct an improved LSTM neural network model, input the preprocessed training data set of the single-channel EEG brain electrical signals into the neural network model for training, and cooperate with the optimized joint loss function to obtain a brain electrical signal concentration classification model. Cooperate with the body temperature and heartbeat synchronous data to further optimize the brain electrical signal concentration classification model; the recognition module M6 is used to input the test data set of the single-channel EEG brain electrical signals to be recognized into the brain electrical signal concentration classification model to obtain the brain electrical signal concentration classification result.
[0120] Figure 5 Illustrates the entity structure diagram of an electronic acquisition device (the acquisition module M1 in the embodiment of the present invention). The electronic device may include: a TGAM single-channel EEG brain electrical sensor (TGAM module), a voltage regulator (3.3V regulated power supply), a Bluetooth interface (Bluetooth module), and a communication line. Among them, the TGAM brain electrical sensor, the voltage regulator, and the Bluetooth interface complete mutual communication through the communication line. The P1 pin of the TGAM brain electrical sensor is connected to the acquisition dry electrode and the ear clip to collect single-channel EEG brain electrical signals (EEG) and reference voltage (REF); the P2 pin is connected to the power supply component; the P3 (PIN6-9) pin is connected to the Bluetooth transmission interface, responsible for data sending and receiving (RXD / TXD) and grounding (GND) respectively.
[0121] Figure 6 Illustrates a schematic diagram of the physical structure of an electronic acquisition device (auxiliary module M2 in the embodiments of the present invention). The overall structure of the electronic device is constructed on the Arduino platform, including Figure 6 the heart rate acquisition part shown in (a) and Figure 6 the body temperature acquisition part shown in (b). The connection methods of the two parts are the same: the VIN pin is connected to the 5V interface of the Arduino Uno, SDA is connected to A4 on the Arduino, and SCL is connected to A5. SCL is the clock line on the IIC bus connected to Arduino A5, and SDA is the data line on the IIC bus connected to Arduino A4. The monitoring unit is connected to GND. The connection methods of VIN, GND, SCL, and SDA on the OLED are also similar, where VIN (connected to 3.3V on the Arduino) is the positive pole of the power supply, and GND is the negative pole.
[0122] In summary, the concentration classification method and system based on single-channel EEG brain signals provided by the present invention, combined with an improved LSTM system and physiological data assistance, make the entire concentration classification process fast and efficient. Compared with the prior art, the recognition accuracy rate has been significantly improved, and it has the characteristics of convenient use, simple method, accurate recognition, etc. It has quite important application prospects in the fields of distance education, intervention in adolescent learning disorders, and intelligent driving.
[0123] In this specification, descriptions such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" refer to at least one embodiment or example described in combination with specific features, structures, materials, or characteristics. These specific features, structures, materials, or characteristics can be combined in one or more embodiments or examples in an appropriate manner. In addition, without contradiction, those skilled in the art can combine and combine different embodiments or examples and their features described in this specification.
[0124] The logic and / or steps shown in the flowchart or described in other ways can be regarded as a sequence of executable instructions for implementing logical functions. These instructions can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device. These systems, apparatuses, or devices include a processor system or other systems capable of receiving and executing instructions.
[0125] The above embodiments have introduced the principle and implementation of the present invention in detail, and have elaborated its working principle using specific examples. These examples are only used to help understand the method and its core idea of the present invention. At the same time, according to the idea of the present invention, the actual implementation and application scope may change. Therefore, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A method for classifying concentration based on single-channel EEG brain electrical signals, characterized in that, Including the following steps: S1. Use a single-channel EEG device to collect the original dataset of EEG signals, and at the same time use an auxiliary module to collect the body temperature and heart rate data of the subject; Step S1 specifically includes the following steps: S11. Clean the forehead and fingers of the subject, attach the single-channel EEG dry electrode to the forehead position of the subject, and wear ear clips. At the same time, attach the pulp of any finger to the signal acquisition area of the auxiliary module; S12. According to the preset acquisition process and tasks, collect the original data of the single-channel EEG signals; synchronously collect the heart rate and body temperature data of the subject; the preset acquisition process and tasks are: experience three EEG signal acquisition stages of "passive learning - active learning - relaxation"; S13. The collected single-channel EEG signals are transmitted to the receiving device in real time by the transmission module and form an original data file, which constitutes the original dataset of EEG signals, and at the same time save the corresponding heart rate and body temperature data; S2. Preprocess the original dataset of the collected EEG signals, perform data augmentation and reconstruction, and then divide the processed dataset into a training dataset and a test dataset to complete the feature extraction of the EEG signal data; Step S2 specifically includes the following steps: S21. Use a low-pass filter and a band-pass filter with a specific frequency band in sequence to perform noise reduction and filtering on the original dataset of the EEG signals obtained in Step S1, and obtain the original dataset of the EEG signals after filtering and noise reduction; specifically, use a low-pass filter below 50Hz for noise reduction, and then use band-pass filters of 8 - 13Hz and 13 - 30Hz for filtering; S22. Use the method of WindowWarping to perform data augmentation on the original dataset of the EEG signals after filtering and noise reduction through the preset stretching and compression ratio; then use the method of Overlapping Sampling to perform data reconstruction through the preset sliding window size and overlapping size to obtain the EEG signal dataset after data augmentation and reconstruction; S23. According to the differences in brain activities in the preset acquisition process, perform preliminary cutting on the EEG signal dataset after data augmentation and reconstruction, and then perform further cutting according to the preset window size to obtain the segmented EEG signal dataset; S24. Perform normalization processing on the segmented EEG signal dataset, and extract features according to the preset feature parameter formula; specifically, select energy entropy, energy spectral density, and the custom energy ratio parameter Vec1 as feature parameters to extract features from the dataset. The formula expression of the custom energy ratio parameter Vecl is: where Energy(α) and Energy(β) are the energies of the α and β frequency bands respectively; S3. Build an improved LSTM neural network model, use the improved loss function to optimize the training dataset, and use the optimized training dataset as the input to train the network model; S4. Use the collected body temperature and heart rate data of the subject to correct the training results of the LSTM neural network model, and obtain a single-channel EEG signal focus classification model. Step S4 specifically includes the following steps: S41. Define a focus calculation formula, select signal frequency bands related to focus, represent focus as a value between 0 and 1, and define focus classification labels according to the calculated value. The formula is expressed as: Among them, D is the concentration value, and E δ , E θ , E α , E β , E γ respectively represent the energy entropy of the δ, θ, α, β, and γ frequency bands in the same segment of EEG signals; S42. Divide the focus values into three labels: D ∈ [0, 0.35) is unfocused, D ∈ [0.35, 0.7) is partially focused, and D ∈ [0.7, 1] is focused. Use the body temperature and heart rate physiological data of the subject at the same time period, and correct the classification training results according to the relationship between the mean deviation of the subject's body temperature and heart rate and the focus label, and obtain an optimized single-channel EEG signal focus classification model. S5. Input the test data set into the single-channel EEG signal focus classification model to obtain the EEG signal focus classification result.
2. The concentration classification method based on single-channel EEG brain electrical signals according to claim 1, characterized in that Step S3 specifically includes the following steps: S31. Use an LSTM neural network model with a two-layer hidden layer structure and preset the hidden layer cell size. S32. After the training set data of the EEG signal is input into the hidden layer, perform normalized batch processing. After the normalized batch processing, pass it through the activation function layer, and the activation function uses the Leaky Rectified Linear Unit (LeakyReLU). S33. Then connect the fully connected layer to summarize the data features of the training set data of the EEG signal, and output the focus classification probability through the Tanh function. S34. Use a combined loss function of multi-class cross-entropy and mean squared error to compensate and optimize the neural network model. The formula is expressed as: L = L CCE + L MSE ; Among them, L CCE is the multi-class cross-entropy loss function, n is the number of classes, y[i] represents the true label of the sample, represents the predicted probability, and L MSE is the mean squared error loss function, N is the number of samples, L is the combined loss function, and i represents the i-th sample; S35. Train the neural network classification model using the training data set according to the preset parameters.
3. A method for classifying concentration based on single-channel EEG brain signals according to claim 1, characterized in that, Step S5 specifically includes the following steps: S51. Determine the preset focus threshold and running duration. S52. Input the test data set of the single-channel EEG signal to be recognized within the preset running duration into the single-channel EEG signal focus classification model obtained in step S4, and obtain the EEG signal focus value according to the focus calculation formula. S53. Assign the corresponding classification label to the test set data according to the obtained EEG signal focus value, and obtain one of the three classification labels of focused, partially focused, and unfocused as the classification result.
4. Application system of the concentration classification method according to any one of claims 1-3, characterized in that, Including the following modules: Acquisition module, which acquires the original single-channel EEG signal. Auxiliary module, which acquires the body temperature and heart rate data of the subject at the same time period. Transmission module, which transmits the collected original signal to the receiving end in real time to form an original data set. Preprocessing module, which preprocesses the original data set of the single-channel EEG signal to obtain the preprocessed original data set of the single-channel EEG signal, and further divides it into a training data set and a test data set. A training optimization module constructs an improved LSTM neural network model, inputs the preprocessed single-channel EEG signal training dataset into the neural network model for training, and combines an improved joint loss function to obtain an EEG signal concentration classification model. At the same time, in cooperation with body temperature and heartbeat data, the EEG signal concentration classification model is further optimized; An identification module inputs the test dataset of the single-channel EEG signal to be identified into the EEG signal concentration classification model to obtain an EEG signal concentration classification result.
5. An electronic device, comprising a single-channel EEG brain electrical signal acquisition module and a body temperature and heart rate auxiliary module; further comprising a computer program stored on a memory and executable on a processor, characterized in that, The electronic device and the computer program can be used to implement the concentration classification method based on single-channel EEG signals according to any one of claims 1 to 3.
Citation Information
Patent Citations
Brain electrical signal and physiological signal fused fatigue detection system
CN106691474A
Human body behavior recognition method and terminal
CN113609957A
Electroencephalogram signal concentration degree classification method and system
CN116350239A