Concentration degree classification method and system based on single-channel EEG electroencephalogram signals
By combining single-channel EEG EEG signal and physiological data, using the improved LSTM neural network model and joint loss function, the problem of low recognition accuracy of single-channel EEG signal is solved, and efficient and accurate concentration monitoring is achieved, suitable for a variety of purposes Application scenario.
Patent Information
- Application Number
- CN202411042668.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-29
- 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 the device is susceptible to noise interference, making it difficult to use for daily monitoring. Multi-channel EEG signal analysis is complex and not suitable for Internet of Things applications.
Using single-channel EEG EEG signal combined with body temperature and heartbeat data, data enhancement and reconstruction are carried out through the joint optimization of the improved LSTM neural network model and multi-classified cross entropy and mean square variance loss function, and the focus classification model is constructed to improve the identification accuracy. sex.
It significantly improves the accuracy and system ease of use of single-channel EEG EEG signal concentration recognition, and provides fast and efficient concentration monitoring results, which are suitable for distance education, teenage learning disability intervention and intelligent driving.
Smart Images

Figure CN119046820A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of signal processing technology and deep learning technology, and in particular to a concentration classification method and system based on single-channel EEG brain wave signals. Background Art
[0002] As the level of informatization deepens, human social activities become increasingly complex, and human concentration ability is gradually dispersed by the fast and fragmented lifestyle. In the fields of intelligent driving, remote teaching, correction of adolescent learning disabilities, etc., it is very important to obtain the concentration state of the subject efficiently and quickly.
[0003] For many years, EEG brainwave signals have been the standard method for measuring human attention. Some scholars have proved in the early 21st century that EEG biofeedback can be used as an effective method to treat inattention. Later, some scholars combined other methods such as questionnaires when using EEG to detect the brain waves of subjects, and concluded that a certain frequency in the EEG brainwave signal can accurately reflect an individual's attention. Many studies have shown that the level of attention can be characterized by the complexity of brainwave signals. However, the analysis of multi-channel EEG signals is complex and easily interfered by noise, which is not suitable for various IoT application scenarios today. In addition, multi-channel EEG signal acquisition equipment is too cumbersome to use and cannot be used for daily concentration monitoring.
[0004] Recently, single-channel EEG signal acquisition equipment has become the first choice for concentration monitoring applications because of its small size and portability. However, single-channel EEG signals have insufficient information carrying capacity due to the significant reduction in acquisition channels, and are easily disturbed by muscle activities such as blinking, resulting in low accuracy. After single-channel EEG signals are processed by signal processing technology, deep learning methods in the field of artificial intelligence can be used to process and identify 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 even use several network models in combination to avoid problems such as overfitting and gradient descent during model learning. Summary of the invention
[0005] In view of the problems existing in the above-mentioned prior art, the present invention provides a concentration classification method and system based on single-channel EEG brain wave signals, which are used to solve the defects of low concentration recognition precision and poor accuracy in the prior art, and improve the usability of the concentration monitoring system, making it convenient and flexible to use.
[0006] In order 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, using a window warping method to perform data enhancement on the original data set of the EEG signal after filtering and noise reduction by using a preset stretching and compression ratio; then using an overlapping sampling method to perform data reconstruction by using a preset sliding window size and overlapping size to obtain a data enhanced and reconstructed EEG signal data set;
[0020] S23, performing preliminary segmentation on the EEG signal data set after data enhancement and reconstruction according to the difference of brain activities in the preset acquisition process, and then performing further segmentation according to the preset window size to obtain a segmented EEG signal data set;
[0021] S24, normalizing the segmented EEG signal data set, and extracting features according to a preset feature parameter formula.
[0022] Furthermore, step S3 specifically includes:
[0023] S31, adopting a LSTM neural network model with a double hidden layer structure and preset hidden layer cell size;
[0024] S32, after the training set data of the EEG signal is input into the hidden layer, it is subjected to normalized batch processing, and then passes through the activation function layer after normalized batch processing, and the activation function adopts 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 concentration classification probability through the Tanh function;
[0026] S34. Use the multi-classification cross entropy and mean square error loss joint loss function to compensate and optimize the neural network model; the formula is expressed as:
[0027]
[0028] L=L CCE +L MSE ;
[0029] Among them, L CCE is the multi-classification cross entropy loss function, n is the number of categories, y[i] represents the true label of the sample, represents the predicted probability, L MSE is the mean square error loss function, N is the number of samples, L is the joint loss function, and i represents the i-th sample.
[0030] S35. Training the neural network classification model using the training data set according to preset parameters.
[0031] Furthermore, 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 data set into the neural network model for training, and obtains the EEG signal concentration classification model in combination with the improved joint loss function; at the same time, the EEG signal concentration classification model is further optimized in combination with body temperature and heartbeat data;
[0046] The recognition module inputs the test data set of the single-channel EEG brain wave signal to be recognized into the brain wave signal concentration classification model to obtain the brain wave 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 heartbeat auxiliary module. It also includes a computer program stored in a memory and executable on a processor, characterized in that the method for classifying the concentration of EEG signals as claimed in any one of claims 1 to 6 can be implemented by using the electronic device and the program.
[0048] Through the above technical solution, 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 enhancement and reconstruction through window bending and overlapping sampling, effectively and evenly expands the number of samples, avoids bias in a certain type of samples during the training process, and provides feature quantities of different categories of equal magnitude as much as possible for the feature selection process.
[0050] In the concentration classification method based on single-channel EEG brain wave signals provided by the present invention, the special joint loss function of 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, and prompt the model to gradually learn the correct classification prediction during the training process and compensate for the deviation between the predicted probability and the real label. At the same time, due to the existence of 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 brain wave signals provided by the present invention introduces physiological data such as body temperature and heartbeat data as correction reference means to optimize the neural network recognition model. Through the changes in physiological data caused by different brain concentration levels, the concentration value is evaluated and corrected from another perspective, thereby improving the reliability of the concentration classification results. The training efficiency can be further improved during the training process, and a higher classification accuracy can be finally obtained, which supplements the technical gap in the prior art that only uses EEG signals for concentration recognition.
[0052] The concentration classification method based on single-channel EEG brain wave signals provided by the present invention ultimately divides the measured concentration into three recognition results: concentration, partial concentration, and inattention. The whole process is fast and efficient, and compared with the existing technology, the recognition accuracy has been significantly improved. It has the characteristics of easy use, simple method, accurate recognition, etc., and has very important application prospects in the fields of distance education, intervention for adolescent 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 drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0054] Figure 1 It is a flowchart of the concentration classification method based on single-channel EEG signals;
[0055] Figure 2 This is the structure diagram of the LSTM neural network algorithm based on the concentration classification method of single-channel EEG signals;
[0056] Figure 3 This is a single-channel EEG signal acquisition flow chart;
[0057] Figure 4 This is a structural diagram of the concentration classification system based on single-channel EEG signals;
[0058] Figure 5 It is a structural diagram of the acquisition module;
[0059] Figure 6 It is a structural diagram of the auxiliary module. DETAILED DESCRIPTION
[0060] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods, so that the implementation process of how the present application uses technical means to solve technical problems and achieve technical effects can be fully understood 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, 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;
[0071] As a preferred implementation of step S2, it specifically includes:
[0072] 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;
[0073] S22, using a window warping method to perform data enhancement on the original data set of the EEG signal after filtering and noise reduction by using a preset stretching and compression ratio; then using an overlapping sampling method to perform data reconstruction by using a preset sliding window size and overlapping size to obtain a data enhanced and reconstructed EEG signal data set;
[0074] S23, performing preliminary segmentation on the EEG signal data set after data enhancement and reconstruction according to the difference of brain activities in the preset acquisition process, and then performing further segmentation according to the preset window size to obtain a segmented EEG signal data set;
[0075] S24, normalizing the segmented EEG signal data set, and extracting features according to a preset feature parameter formula.
[0076] More specifically, in the preprocessing stage of this embodiment, a low-pass filter below 50 Hz is used for noise reduction, and then 8-13 Hz and 13-30 Hz band-pass filters are used for filtering to obtain the α band and β band that need to be focused on in subsequent processing. The data is enhanced using the window warping processing method, and the sliding window size is set to 10% of the original data time series, the stretch 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 segmenting the data, the data set is first preliminarily split according to the different stages of "passive learning-active learning-relaxation" in the acquisition process, and then the data is further segmented using a sliding window method, setting the window size to 256 and the step size to 64. The unit data after segmentation is normalized. Furthermore, energy entropy, energy spectral density and a custom energy ratio parameter Vec1 are selected as feature parameters to extract features from the data set. The formula of the custom energy ratio parameter Vecl is expressed as:
[0077]
[0078] Among them, Energy(α) and Energy(β) are the energies in the α and β frequency bands respectively.
[0079] 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;
[0080] As a preferred implementation of step S3, it specifically includes:
[0081] S31, adopting an LSTM neural network model with a double hidden layer structure, and presetting the hidden layer cell size; in this embodiment, the hidden layer cell size is set to 128;
[0082] S32, after the training set data of the EEG signal is input into the hidden layer, it is subjected to normalized batch processing, and then passes through the activation function layer after normalized batch processing, and the activation function adopts 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 EEG signal, and output the concentration classification probability through the Tanh function;
[0084] S34. Use the multi-classification cross entropy and mean square error loss joint loss function 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-classification cross entropy loss function, n is the number of categories, y[i] represents the true label of the sample, represents the predicted probability, L MSE is the mean square error loss function, N is the number of samples, L is the joint loss function, and i represents the i-th sample.
[0088] S35. Training the neural network classification model using the training data set according to preset parameters.
[0089] In addition, the hyperparameters for training the LSTM neural network in this embodiment include: batch size is 64, number of cycles is 100, learning rate is 0.001, and loss function is as above. The training process is completed according to the preset parameters, and the Adam optimizer is used to accelerate the learning process.
[0090] 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;
[0091] As a preferred implementation of step S4, it specifically includes:
[0092] 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:
[0093]
[0094] 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.
[0095] 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.
[0096] In this embodiment, the smaller the concentration value D is, the less focused the person's attention is. Furthermore, the continuous concentration value is divided into three labels: D∈[0,0.35) for inattention, D∈[0.35,0.7) for partial concentration, and D∈[0.7,1] for concentration.
[0097] Table 1 Relationship between the measured body temperature and heart rate mean deviation and concentration label
[0098] Label Not focused Partial Focus Focus Concentration value D [0,0.35) [0.35,0.7) [0.7,1] Body temperature deviation℃ [-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 model after preliminary training 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 of step S5, it specifically includes:
[0102] S51, determining a preset concentration threshold and running time;
[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 Neighbors (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] No data augmentation methods are used Using data augmentation methods Accuracy 0.5744 0.7356 Macro-F1 score 0.5279 0.6778
[0116] By comparing Table 3 and Table 4, it can be clearly seen 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 is a description of the concentration classification system based on a single-channel EEG brain wave signal provided by the present invention. The concentration classification system based on a single-channel EEG brain wave signal described below and the concentration classification method based on a single-channel EEG brain wave signal described above can be referred to each other.
[0118] Figure 4 This is a structural diagram of a concentration classification system based on a single-channel EEG signal provided by the present invention, including: an acquisition module M1, an auxiliary module M2, a transmission module M3, a preprocessing module M4, a training optimization module M5, and a recognition module M6. Among them:
[0119] The acquisition module M1 is used to acquire the original single-channel EEG brain wave signal; the auxiliary module M2 is used to acquire the physiological signals such as body temperature and heartbeat that are measured at the same time; the transmission module M3 is used to transmit the acquired original signal to the receiving end in real time to form an original data set; the preprocessing module M4 is used to preprocess the single-channel EEG brain wave signal original data set to obtain the preprocessed single-channel EEG brain wave signal original data set, and then divide it into a training data set and a test data set; the training optimization module M5 is used to construct a modified LSTM neural network model, input the preprocessed single-channel EEG brain wave signal training data set into the neural network model for training, and cooperate with the optimized joint loss function to obtain the EEG signal concentration classification model. In combination with the body temperature and heartbeat data at the same time, the EEG signal concentration classification model is further optimized; the recognition module M6 is used to input the single-channel EEG brain wave signal test data set to be identified into the EEG signal concentration classification model to obtain the EEG signal concentration classification result.
[0120] Figure 5 The physical structure diagram of an electronic acquisition device (acquisition module M1 in the embodiment of the present invention) is illustrated. The electronic device may include: a TGAM single-channel EEG electroencephalogram sensor (TGAM module), a voltage regulator (3.3V voltage regulator), a Bluetooth interface (Bluetooth module) and a communication line, wherein the TGAM electroencephalogram sensor, the voltage regulator and the Bluetooth interface communicate with each other through the communication line. The P1 pin of the TGAM electroencephalogram sensor is connected to the acquisition dry electrode and the ear clip to collect the single-channel EEG electroencephalogram signal (EEG) and the 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, which is responsible for data transmission and reception (RXD / TXD) and grounding (GND).
[0121] Figure 6 The schematic diagram of the physical structure of an electronic acquisition device (the auxiliary module M2 in the embodiment of the present invention) is illustrated. The electronic device is integrally constructed on the Arduino platform, including: Figure 6 (a) shows the heartbeat acquisition part and Figure 6 (b) The temperature collection part shown. The connection method of the two parts is the same: the VIN pin is connected to the 5V interface of Arduino Uno, SDA is connected to A4 on 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 method of VIN, GND, SCL, and SDA on the OLED is also similar, where VIN (connected to 3.3V on 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 wave signals provided by the present invention are combined with an improved LSTM system and physiological data assistance, so that the entire concentration classification process is fast and efficient, and compared with the existing technology, the recognition accuracy has been significantly improved. It has the characteristics of easy use, simple method, accurate recognition, etc., and has very important application prospects in the fields of distance education, intervention for adolescent learning disabilities, and intelligent driving.
[0123] In this specification, the terms "one embodiment", "some embodiments", "examples", "specific examples" or "some examples" refer to at least one embodiment or example described in combination with specific features, structures, materials or characteristics. These described specific features, structures, materials or characteristics can be combined in an appropriate manner in one or more embodiments or examples. In addition, the technician can combine and combine different embodiments or examples and their features described in this specification without contradiction.
[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 implemented in any computer-readable medium for use by instruction execution systems, devices or equipment. These systems, devices or equipment include processor systems or other systems capable of receiving and executing instructions.
[0125] The above embodiments have described the principles and implementations of the present invention in detail, and have used specific examples to illustrate the working principles thereof. These examples are only used to help understand the method of the present invention and its core concept. Meanwhile, according to the concept of the present invention, the actual implementation methods and application scope may vary. Therefore, the contents of this specification should not be construed as limiting the present invention.
Claims
1. A concentration classification method based on single-channel EEG signals, characterized in that: The following steps are involved: 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; 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; 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; 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; S5. Input the test data set into the single-channel EEG signal concentration classification model to obtain the EEG signal concentration classification result.
2. A concentration classification method based on single-channel EEG signals according to claim 1, characterized in that: Step S1 specifically includes the following steps: 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; 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; 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.
3. The method for classifying concentration based on single-channel EEG signals according to claim 1, characterized in that: Step S2 specifically includes the following steps: 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; S22, using a window warping method to perform data enhancement on the original data set of the EEG signal after filtering and noise reduction by using a preset stretching and compression ratio; then using an overlapping sampling method to perform data reconstruction by using a preset sliding window size and overlapping size to obtain a data enhanced and reconstructed EEG signal data set; S23, performing preliminary segmentation on the EEG signal data set after data enhancement and reconstruction according to the difference of brain activities in the preset acquisition process, and then performing further segmentation according to the preset window size to obtain a segmented EEG signal data set; S24, normalizing the segmented EEG signal data set, and extracting features according to a preset feature parameter formula.
4. The method for classifying concentration based on single-channel EEG signals according to claim 1, characterized in that: Step S3 specifically includes the following steps: S31, adopting a LSTM neural network model with a double hidden layer structure and preset hidden layer cell size; S32, after the training set data of the EEG signal is input into the hidden layer, it is subjected to normalized batch processing, and then passes through the activation function layer after normalized batch processing, and the activation function adopts 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 concentration classification probability through the Tanh function; S34. Use the multi-classification cross entropy and mean square error loss joint loss function 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-classification cross entropy loss function, n is the number of categories, y[i] represents the true label of the sample, represents the predicted probability, L MSE is the mean square error loss function, N is the number of samples, L is the joint loss function, and i represents the i-th sample. S35. Training the neural network classification model using the training data set according to preset parameters.
5. The method for classifying concentration based on single-channel EEG signals according to claim 4, characterized in that: Step S4 specifically includes the following steps: 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: 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. 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.
6. A method for classifying concentration based on single-channel EEG signals according to claim 5, characterized in that: Step S5 specifically includes the following steps: S51, determining a preset concentration threshold and running time; 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; 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.
7. A concentration classification system based on single-channel EEG signals, characterized in that: Includes the following modules: Acquisition module, collecting original single-channel EEG signals; Auxiliary module, collects the temperature and heart rate data of the subject at the same time; The transmission module transmits the collected original signal to the receiving end in real time to form an original data set; 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; The training optimization module constructs an improved LSTM neural network model, inputs the preprocessed single-channel EEG signal training data set into the neural network model for training, and obtains the EEG signal concentration classification model in combination with the improved joint loss function; at the same time, the EEG signal concentration classification model is further optimized in combination with body temperature and heartbeat data; The recognition module inputs the test data set of the single-channel EEG brain wave signal to be recognized into the brain wave signal concentration classification model to obtain the brain wave signal concentration classification result.
8. An electronic device, comprising a single-channel EEG acquisition module and a temperature and heartbeat auxiliary module; and further comprising a computer program stored in 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 brain wave signals as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Content evaluation system and content evaluation method using the system
CN104434140A
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
Cross-period electroencephalogram signal identity recognition method based on Fourier amplitude feature generalization
CN117272271A
Cited By
Wide-working-condition and multi-dimensional force characterization flexible film piezoelectric sensor and signal analysis method
CN119880203A
Sleep real-time staging modeling method, sleep real-time encoding and decoding method and system
CN120918574A
