Electroencephalogram attention state detection model construction method based on particle swarm genetic fusion

Optimize the hyperparameter detection model of Electrical Electrical Electrical Electrical Electrical Electrical Electricity State Detection Models through particle group genetic fusion algorithms, solve the problem of insufficient detection results in existing technologies, and achieve higher attention status detection accuracy.

CN119326421APending Publication Date: 2025-01-21XUANWU HOSPITAL OF CAPITAL UNIV OF MEDICAL SCI
View PDF 11 Cites 0 Cited by

Patent Information

Application Number
CN202411378991.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

In the prior art, the EEG attention state detection model based on convolutional neural networks fails to effectively optimize its hyperparameters, resulting in insufficient accuracy of the detection results.

Method used

The particle swarm genetic fusion algorithm is used to optimize the hyperparameters of the EEG attention state detection model, and the optimal hyperparameters are obtained through an iterative process, thereby constructing the optimal EEG attention state detection model.

Benefits of technology

By optimizing the superstipping, the accuracy of the test results of the detection state of the test to be detected can be significantly improved, and it can more accurately output the attention of the test to the test.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119326421A_ABST
    Figure CN119326421A_ABST
Patent Text Reader

Abstract

The invention discloses an electroencephalogram attention state detection model construction method and system based on particle swarm genetic fusion. The method comprises the steps that original electroencephalogram signals of all channels of all brain function areas in a non-interference detection mode and an interference detection mode of multiple historical detectors are collected, and attention state degree marks of all the historical detectors are marked; preliminarily preprocessing the original electroencephalogram signal to obtain a corresponding preliminary electroencephalogram signal; optimal electroencephalogram signals of all brain function areas of all historical detectors in the non-interference detection mode and the interference detection mode are screened; constructing an electroencephalogram attention feature set (composed of electroencephalogram attention feature sets in a non-interference detection mode and an interference detection mode) of each historical detector; constructing an electroencephalogram attention training sample set and an electroencephalogram attention verification sample set; the method comprises the following steps: constructing an electroencephalogram attention state detection model, optimizing hyper-parameters of the electroencephalogram attention state detection model by using a particle swarm genetic fusion algorithm, continuously iterating to obtain optimal hyper-parameters, and constructing an optimal electroencephalogram attention state detection model by using the optimal hyper-parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of attention state detection based on electroencephalogram signals and particle swarm genetic fusion algorithm, and in particular to a method and system for constructing an electroencephalogram attention state detection model based on particle swarm genetic fusion. Background Art

[0002] The inventor of the present application has previously applied for an invention patent with application number 2024113272722 and titled "A method and system for attention state detection based on EEG signals". In this invention patent, the EEG attention feature set in the non-interference detection mode and the EEG attention feature set in the interference detection mode of the person to be detected are input into the trained attention state detection model for detection, thereby outputting the attention state detection result of the person to be detected. The attention state detection model is constructed based on the convolutional neural network model, but this invention patent does not describe how to obtain the trained attention state detection model. On this basis, the present application uses a particle swarm genetic fusion algorithm to optimize the attention state detection model, thereby obtaining the optimal attention state detection model. Based on the optimal attention state detection model, more accurate attention state detection results of the person to be detected can be obtained. Summary of the invention

[0003] In view of the problems and shortcomings of the prior art, the present invention provides a method and system for constructing an EEG attention state detection model based on particle swarm genetic fusion.

[0004] The present invention solves the above technical problems through the following technical solutions:

[0005] The present invention provides a method for constructing an EEG attention state detection model based on particle swarm genetic fusion, which is characterized in that it comprises the following steps:

[0006] S1. Collecting original EEG signals of historical testers and marking the degree of attention state: obtaining basic information including age and identity of A historical testers, and sequentially playing N interference-free videos in the interference-free detection mode and N interference videos in the interference detection mode for each historical tester to watch that match the age of the historical tester, respectively collecting original EEG signals of M channels of each brain functional area in K brain functional areas during the viewing process of the historical tester in the interference-free detection mode and the interference detection mode, thereby obtaining original EEG signals of each channel of each brain functional area of ​​multiple historical testers in the interference-free detection mode and the interference detection mode, and marking the degree of attention state of each historical tester, wherein the historical testers include historical testers of different age groups, and the degree of attention state marks include different degrees of attention states, N is a positive integer and N≥2, K is a positive integer and K≥2, M is a positive integer and M≥2, and A is a positive integer and A≥2;

[0007] S2. Preliminary preprocessing of original EEG signals: Preliminary preprocessing is performed on the original EEG signals of each channel of each brain functional area of ​​each historical test subject in the non-interference detection mode and the interference detection mode, respectively, to obtain the preliminary EEG signals of each channel of each brain functional area of ​​each historical test subject in the non-interference detection mode and the interference detection mode;

[0008] S3. Screening the optimal EEG signals of each brain functional area of ​​the historical tester: for the EEG signals of M channels of the kth brain functional area of ​​each historical tester in the non-interference detection mode, select a preliminary EEG signal of an optimal channel from the M channels as the optimal EEG signal of the kth brain functional area, thereby screening the optimal EEG signals of each brain functional area of ​​each historical tester in the non-interference detection mode;

[0009] For the EEG signals of M channels of the kth brain functional area of ​​each historical tester in the interference detection mode, a preliminary EEG signal of an optimal channel is selected from the M channels as the optimal EEG signal of the kth brain functional area, thereby screening out the optimal EEG signals of each brain functional area of ​​each historical tester in the interference detection mode;

[0010] S4. Constructing the EEG attention feature set of historical testers: extracting features from the optimal EEG signals of K brain function areas of each historical tester in the non-interference detection mode to obtain the attention time domain features, attention frequency domain features, and connection features of any two brain function areas corresponding to each non-interference video of each brain function area, and constructing the EEG attention feature set of each historical tester in the non-interference detection mode from the attention time domain features, attention frequency domain features corresponding to each non-interference video of each brain function area arranged in sequence in advance, and the connection features of two brain function areas arranged in sequence later;

[0011] Feature extraction is performed on the optimal EEG signals of K brain function areas of each historical detector in the interference detection mode to obtain the attention time domain features, attention frequency domain features, and connection features of any two brain function intervals corresponding to each interference video of each brain function area. The EEG attention feature set of each historical detector in the interference detection mode is constructed by the attention time domain features, attention frequency domain features corresponding to each interference video of each brain function area arranged in sequence in advance, and the connection features of two brain function intervals arranged in sequence later;

[0012] Constructing an EEG attention feature set for each historical detector, wherein the EEG attention feature set for each historical detector is composed of an EEG attention feature set in a non-interference detection mode and an EEG attention feature set in a interference detection mode of the historical detector;

[0013] S5. Construct an EEG attention training sample set and an EEG attention verification sample set. The EEG attention training sample set includes the EEG attention feature sets and corresponding attention state degree marks of A1 historical testers, and the EEG attention verification sample set includes the EEG attention feature sets and corresponding attention state degree marks of A2 historical testers, A=A1+A2, A1 and A2 are both positive integers and A1≥3*A2;

[0014] S6. Construct an EEG attention state detection model based on convolutional neural network, use particle swarm genetic fusion algorithm to optimize the hyperparameters of the EEG attention state detection model, and use the EEG attention training sample set and EEG attention verification sample set to train and verify the EEG attention state detection model respectively. The optimal hyperparameters are obtained through continuous iteration of particle swarm genetic fusion algorithm, and the optimal EEG attention state detection model is constructed using the optimal hyperparameters.

[0015] The present invention also provides a system for constructing an EEG attention state detection model based on particle swarm genetic fusion, which is characterized in that it includes an EEG acquisition module, an EEG preprocessing module, an optimal EEG screening module, an EEG feature extraction module, a sample set construction module and a model construction module;

[0016] The EEG acquisition module is used to collect the original EEG signals of historical testers and mark the degree of attention state: obtain the basic information of A historical testers including age and identity, play N non-interference videos contained in the non-interference detection mode and N interference videos contained in the interference detection mode for each historical tester to watch in sequence, and collect the original EEG signals of M channels of each brain functional area in K brain functional areas during the viewing process of the historical tester in the non-interference detection mode and the interference detection mode, so as to obtain the original EEG signals of each channel of each brain functional area of ​​multiple historical testers in the non-interference detection mode and the interference detection mode, and mark the degree of attention state of each historical tester, wherein the historical testers include historical testers of different age groups, and the degree of attention state marks include different degrees of attention states, N is a positive integer and N≥2, K is a positive integer and K≥2, M is a positive integer and M≥2, and A is a positive integer and A≥2;

[0017] The EEG preprocessing module is used for preliminary preprocessing of raw EEG signals: preliminary preprocessing is performed on the raw EEG signals of each channel of each brain functional area of ​​each historical tester in the non-interference detection mode and the interference detection mode, respectively, to obtain preliminary EEG signals of each channel of each brain functional area of ​​each historical tester in the non-interference detection mode and the interference detection mode;

[0018] The optimal EEG screening module is used to screen the optimal EEG signals of each brain functional area of ​​the historical tester: for the EEG signals of M channels of the kth brain functional area of ​​each historical tester in the non-interference detection mode, a preliminary EEG signal of an optimal channel is selected from the M channels as the optimal EEG signal of the kth brain functional area, thereby screening out the optimal EEG signals of each brain functional area of ​​each historical tester in the non-interference detection mode;

[0019] For the EEG signals of M channels of the kth brain functional area of ​​each historical tester in the interference detection mode, a preliminary EEG signal of an optimal channel is selected from the M channels as the optimal EEG signal of the kth brain functional area, thereby screening out the optimal EEG signals of each brain functional area of ​​each historical tester in the interference detection mode;

[0020] The EEG feature extraction module is used to construct the EEG attention feature set of the historical tester: feature extraction is performed on the optimal EEG signals of K brain function areas of each historical tester in the non-interference detection mode to obtain the attention time domain features, attention frequency domain features, and connection features of any two brain function intervals corresponding to each non-interference video of each brain function area, and the EEG attention feature set of each historical tester in the non-interference detection mode is constructed by the attention time domain features, attention frequency domain features corresponding to each non-interference video of each brain function area arranged in sequence in advance, and the connection features of the two brain function intervals arranged in sequence later;

[0021] Feature extraction is performed on the optimal EEG signals of K brain function areas of each historical detector in the interference detection mode to obtain the attention time domain features, attention frequency domain features, and connection features of any two brain function intervals corresponding to each interference video of each brain function area. The EEG attention feature set of each historical detector in the interference detection mode is constructed by the attention time domain features, attention frequency domain features corresponding to each interference video of each brain function area arranged in sequence in advance, and the connection features of two brain function intervals arranged in sequence later;

[0022] Constructing an EEG attention feature set for each historical detector, wherein the EEG attention feature set for each historical detector is composed of an EEG attention feature set in a non-interference detection mode and an EEG attention feature set in a interference detection mode of the historical detector;

[0023] The sample set construction module is used to construct an EEG attention training sample set and an EEG attention verification sample set, wherein the EEG attention training sample set includes an EEG attention feature set of A1 historical testers and corresponding attention state degree marks, and the EEG attention verification sample set includes an EEG attention feature set of A2 historical testers and corresponding attention state degree marks, A=A1+A2, A1 and A2 are both positive integers and A1≥3*A2;

[0024] The model building module is used to build an EEG attention state detection model based on a convolutional neural network, use a particle swarm genetic fusion algorithm to optimize the hyperparameters of the EEG attention state detection model, and use an EEG attention training sample set and an EEG attention verification sample set to perform model training and model verification on the EEG attention state detection model respectively, and continuously iterate the particle swarm genetic fusion algorithm to obtain the optimal hyperparameters, and use the optimal hyperparameters to build the optimal EEG attention state detection model.

[0025] The positive and progressive effects of the present invention are:

[0026] The present invention constructs an EEG attention state detection model based on a convolutional neural network, uses a particle swarm genetic fusion algorithm to optimize the hyperparameters of the EEG attention state detection model, and uses an EEG attention training sample set and an EEG attention verification sample set to perform model training and model verification on the EEG attention state detection model respectively. The particle swarm genetic fusion algorithm is continuously iterated to obtain the optimal hyperparameters, and the optimal hyperparameters are used to construct an optimal EEG attention state detection model. The optimal EEG attention state detection model is used to detect the attention state of a subject to be detected, so as to obtain a more accurate attention state detection result of the subject to be detected. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 This is a flowchart of a method for constructing an EEG attention state detection model according to a preferred embodiment of the present invention.

[0028] Figure 2 This is a structural block diagram of a method for constructing an EEG attention state detection model according to a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0030] like Figure 1 As shown, this embodiment provides a method for constructing an EEG attention state detection model based on particle swarm genetic fusion, which includes the following steps:

[0031] Step 101, collect the original EEG signals of the historical testers and annotate the attention state: obtain the basic information of A (A is a positive integer and A≥2) historical testers including age and identity, and play N (N is a positive integer and N≥2) non-interference videos in the non-interference detection mode and N interference videos in the interference detection mode for each historical tester to watch, which are matched with the age of the historical tester. The playing time of the N non-interference videos is the same and the required attention level is different, and the playing time of the N interference videos is the same and the required attention level is different; collect the basic information of the historical tester including age and identity in the non-interference detection mode and the interference detection mode respectively. The original EEG signals of M (M is a positive integer and M≥2) channels of each brain functional area in K (K is a positive integer and K≥2) brain functional areas are obtained, so as to obtain the original EEG signals of each channel of each brain functional area of ​​multiple historical testers in the non-interference detection mode and the interference detection mode respectively, and mark the attention state degree mark of each historical tester, these historical testers include historical testers of different age groups, and these attention state degree marks include different degrees of attention state, the attention state degree is 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90% and 100%, among which 0% is unconscious and 100% is over-concentration.

[0032] In this step, an experienced expert doctor can mark the attention state of each historical test subject based on the collected EEG signals.

[0033] Step 102, preliminary preprocessing of original EEG signals: preliminary preprocessing is performed on the original EEG signals of each channel of each brain functional area of ​​each historical tester in the non-interference detection mode and the interference detection mode, respectively, to obtain preliminary EEG signals of each channel of each brain functional area of ​​each historical tester in the non-interference detection mode and the interference detection mode.

[0034] Step 103, screening the optimal EEG signals of each brain functional area of ​​the historical testers: for the EEG signals of M channels of the kth brain functional area of ​​each historical tester in the non-interference detection mode, select a preliminary EEG signal of the optimal channel from the M channels as the optimal EEG signal of the kth brain functional area, thereby screening out the optimal EEG signals of each brain functional area of ​​each historical tester in the non-interference detection mode; for the EEG signals of M channels of the kth brain functional area of ​​each historical tester in the interference detection mode, select a preliminary EEG signal of the optimal channel from the M channels as the optimal EEG signal of the kth brain functional area, thereby screening out the optimal EEG signals of each brain functional area of ​​each historical tester in the interference detection mode.

[0035] Specifically, the K brain functional areas correspond to each other, and K is an even number. For example, K=8, and the original EEG signals of M channels in each of the 8 brain functional areas are the left frontal lobe Fp1, the right frontal lobe Fp2, the left central C3, the right central C4, the left parietal lobe P3, the right parietal lobe P4, the left occipital lobe O1, and the right occipital lobe O2. The left frontal lobe Fp1 corresponds to the right frontal lobe Fp2, the left central C3 corresponds to the right central C4, the left parietal lobe P3 corresponds to the right parietal lobe P4, and the left occipital lobe O1 corresponds to the right occipital lobe O2.

[0036] The method for obtaining the optimal EEG signals of each brain functional area of ​​a historical tester in the non-interference detection mode is as follows: for any two corresponding brain functional areas Ea and Eb in the non-interference detection mode of this historical tester: determine whether there are abnormal signals in the preliminary EEG signals of each channel in the brain functional areas Ea and Eb, and when the abnormal signals are yes, perform interpolation processing on the abnormal signals to replace the abnormal signals to obtain normal EEG signals, and when the abnormal signals are no, the preliminary EEG signals of each channel are used as normal EEG signals; for the normal EEG signals of each channel in the brain functional areas Ea and Eb: use the EEG signals of the i-th channel in the brain functional area Ea and the EEG signals of the j-th channel in the brain functional area Eb to calculate the correlation coefficient EX between the i-th channel and the j-th channel ij , thus obtaining 2M correlation coefficients EX for brain functional areas Ea and Eb ij , select the two channels with the largest correlation coefficient as the optimal channel of brain function area Ea and the optimal channel of brain function area Eb respectively, the EEG signal of the optimal channel of brain function area Ea is used as the optimal EEG signal of brain function area Ea, and the EEG signal of the optimal channel of brain function area Eb is used as the optimal EEG signal of brain function area Eb. Similarly, the optimal EEG signal of each brain function area in the non-interference detection mode of this historical detector can be selected, 1≤i≤M, 1≤j≤M, and the abnormal signal refers to the signal with abnormal amplitude or the missing signal. Similarly, the optimal EEG signal of each brain function area of ​​a historical detector in the interference detection mode can be obtained.

[0037] Step 104, constructing the EEG attention feature set of historical testers: performing feature extraction on the optimal EEG signals of K brain functional areas of each historical tester in the undisturbed detection mode to obtain the attention time domain features, attention frequency domain features, and connection features of any two brain functional areas corresponding to each undisturbed video of each brain functional area (see application number 2024113272722, entitled A method and system for detecting an attention state based on EEG signals). The EEG attention feature set of each historical tester in the undisturbed detection mode is constructed by the attention time domain features, attention frequency domain features corresponding to each undisturbed video of each brain functional area arranged in sequence in advance, and the connection features of two brain functional areas arranged in sequence later.

[0038] Feature extraction is performed on the optimal EEG signals of K brain functional areas of each historical detector in the interference detection mode to obtain the attention time domain features, attention frequency domain features, and connection features of any two brain functional areas corresponding to each interference video of each brain functional area (see the invention patent with application number 2024113272722, entitled A method and system for detecting attention states based on EEG signals). The EEG attention feature set of each historical detector in the interference detection mode is constructed by the attention time domain features, attention frequency domain features corresponding to each interference video of each brain functional area arranged in sequence in advance, and the connection features of two brain functional areas arranged in sequence later.

[0039] Construct an EEG attention feature set for each historical detector, wherein the EEG attention feature set for each historical detector is composed of the EEG attention feature set of the historical detector in a non-interference detection mode and the EEG attention feature set in a interference detection mode.

[0040] Step 105, construct an EEG attention training sample set and an EEG attention verification sample set, the EEG attention training sample set includes A1 (such as the number corresponding to 80% of the proportion) historical testers' EEG attention feature sets and corresponding attention state degree marks, the EEG attention verification sample set includes A2 (such as the number corresponding to 20% of the proportion) historical testers' EEG attention feature sets and corresponding attention state degree marks, A=A1+A2, A1 and A2 are both positive integers and A1≥3*A2.

[0041] Step 106, construct an EEG attention state detection model based on a convolutional neural network, use a particle swarm genetic fusion algorithm to optimize the hyperparameters of the EEG attention state detection model, and use an EEG attention training sample set and an EEG attention verification sample set to perform model training and model verification on the EEG attention state detection model, and continuously iterate the particle swarm genetic fusion algorithm to obtain the optimal hyperparameters, and use the optimal hyperparameters to construct an optimal EEG attention state detection model. The EEG attention feature set in the non-interference detection mode and the EEG attention feature set in the interference detection mode obtained based on the original EEG signal of the subject to be detected are input into the optimal EEG attention state detection model for detection, and the attention state detection result of the subject to be detected can be accurately output.

[0042] Specifically, step 106 includes the following steps:

[0043] Step 1061: construct an EEG attention state detection model based on a convolutional neural network. The EEG attention state detection model contains multiple hyperparameters to be optimized, and the hyperparameters are initialized.

[0044] Step 1062, generate an initial particle population, set the number of particles L, the maximum number of iterations T and the particle search space dimension D of the particle population, the particle dimension D of each particle corresponds to the hyperparameters one by one, each particle represents a set of hyperparameters, initialize the speed and position of each particle, and each particle has an initial speed and an initial position.

[0045] Step 1063, using a certain particle as a hyperparameter to construct an initialized EEG attention state detection model, using the EEG attention feature set of A1 historical detectors in the EEG attention training sample set as input to train the initialized EEG attention state detection model, comparing the model training output values ​​corresponding to the A1 historical detectors with the corresponding attention state degree marks to calculate the initialization fitness, based on which the initialization fitness of each particle is calculated, the maximum value of the initialization fitness of each particle is used as the initialization optimal fitness, the current position of each particle is used as the individual optimal position of each particle, and the current position of the particle corresponding to the optimal fitness is used as the group optimal position of the initial particle population.

[0046] Among them, fitness MSE(X) represents the mean square error of the deviation. The larger the fitness value, the better the model training.

[0047] Step 1064: Update the speed and position of each particle:

[0048]

[0049] X ld (t+1)=X ld (t)+V ld (t+1)

[0050]

[0051] Among them, V ld (t) and X ld (t) represent the current particle speed and position, V ld (t+1) and X ld (t+1) represents the updated particle speed and position, l represents the lth particle, d represents the dth dimension of the search space, t represents the current iteration number, W(t) represents the adaptive inertia weight, W min Indicates the minimum inertia weight, W max Indicates the maximum inertia weight, C1 and C2 indicate the acceleration factor, Xpb ld represents the historical individual optimal position, Xgb d Represents the optimal position of the historical group.

[0052] Step 1065, updating the historical individual optimal position and the historical group optimal position: calculating the fitness of each particle after the update as the current fitness of each particle, comparing the current fitness of each particle with the historical individual optimal fitness of the particle, if the current fitness is greater than the historical individual optimal fitness, then updating the historical individual optimal fitness of the particle = the current fitness of the particle, and updating the historical individual optimal position of the particle = the current position of the particle, otherwise not updating; then taking the maximum value of the historical individual optimal fitness of each particle as the current optimal fitness, if the current optimal fitness is greater than the historical group optimal fitness, then updating the historical group optimal fitness = the current optimal fitness, and updating the historical group optimal position = the current position of the particle corresponding to the current optimal fitness, otherwise not updating.

[0053] Among them, Xpb ld The corresponding fitness is the optimal fitness of the historical individual, Xgb d The corresponding fitness is the optimal fitness of the historical group.

[0054] Step 1066, determine whether the optimal fitness of the historical group reaches the set fitness value or the number of iterations reaches the maximum number of iterations T, if yes, proceed to step 1067, if not, proceed to step 1068.

[0055] Step 1067, obtain the optimal hyperparameters based on the particles in the optimal position of the historical group, use the optimal hyperparameters to build the EEG attention state detection model to be verified, use the EEG attention feature set of A2 historical detectors in the EEG attention verification sample set as input to verify the EEG attention state detection model to be verified, calculate the accuracy after model verification, when the accuracy reaches the set accuracy, the EEG attention state detection model to be verified is used as the optimal EEG attention state detection model, when the accuracy does not reach the set accuracy, increase the set fitness value and the maximum number of iterations T, and go to step 1068.

[0056] Step 1068, arrange the current fitness of each particle in descending order, eliminate L1 particles with the lowest order, use the particle with the best position in the historical population among the non-eliminated particles as the parent generation, randomly select L1 particles from the remaining non-eliminated particles as the parent generation, and hybridize each selected parent generation with the parent generation to generate L1 particles. The current positions of the L1 particles generated by hybridization are used as the positions of the corresponding particles after t iterations. The current speed of each particle in the L1 particles generated by hybridization is the average speed of the particles on both sides of the particle, N1 is a positive integer and 1≤L1≤1 / 2L, t=t+1, and execute step 1064 again.

[0057] In this step, the hyperparameters of the EEG attention state detection model are optimized by using an algorithm that combines the particle swarm algorithm and the genetic algorithm to obtain the optimal hyperparameters. The EEG attention state detection model constructed with the optimal hyperparameters is the optimal EEG attention state detection model.

[0058] like Figure 2 As shown, this embodiment also provides an EEG attention state detection model construction system based on particle swarm genetic fusion, which includes an EEG acquisition module 1, an EEG preprocessing module 2, an optimal EEG screening module 3, an EEG feature extraction module 4, a sample set construction module 5 and a model construction module 6.

[0059] The EEG acquisition module 1 is used to collect the original EEG signals of historical testers and mark the degree of attention state: obtain the basic information of A historical testers including age and identity, and play N interference-free videos contained in the interference-free detection mode and N interference videos contained in the interference detection mode that match the age of the historical tester for each historical tester to watch in turn, and collect the original EEG signals of M channels of each brain functional area in K brain functional areas during the viewing process of the historical tester in the interference-free detection mode and the interference detection mode, so as to obtain the original EEG signals of each channel of each brain functional area of ​​multiple historical testers in the interference-free detection mode and the interference detection mode, and mark the degree of attention state of each historical tester, these historical testers include historical testers of different age groups, and these attention state degree marks include different degrees of attention states, N is a positive integer and N≥2, K is a positive integer and K≥2, M is a positive integer and M≥2, and A is a positive integer and A≥2.

[0060] The EEG preprocessing module 2 is used for preliminary preprocessing of the original EEG signals: preliminary preprocessing is performed on the original EEG signals of each channel of each brain functional area of ​​each historical tester in the non-interference detection mode and the interference detection mode, and preliminary EEG signals of each channel of each brain functional area of ​​each historical tester in the non-interference detection mode and the interference detection mode are obtained respectively.

[0061] The optimal EEG screening module 3 is used to screen the optimal EEG signals of each brain functional area of ​​the historical testers: for the EEG signals of the M channels of the kth brain functional area of ​​each historical tester in the non-interference detection mode, a preliminary EEG signal of the optimal channel is selected from the M channels as the optimal EEG signal of the kth brain functional area, thereby screening out the optimal EEG signals of each brain functional area of ​​each historical tester in the non-interference detection mode; for the EEG signals of the M channels of the kth brain functional area of ​​each historical tester in the interference detection mode, a preliminary EEG signal of the optimal channel is selected from the M channels as the optimal EEG signal of the kth brain functional area, thereby screening out the optimal EEG signals of each brain functional area of ​​each historical tester in the interference detection mode.

[0062] The EEG feature extraction module 4 is used to construct the EEG attention feature set of the historical testers: feature extraction is performed on the optimal EEG signals of the K brain function areas of each historical tester in the undisturbed detection mode to obtain the attention time domain features, attention frequency domain features, and connection features of any two brain function intervals corresponding to each undisturbed video of each brain function area. The EEG attention feature set of each historical tester in the undisturbed detection mode is constructed by the attention time domain features, attention frequency domain features corresponding to each undisturbed video of each brain function area arranged in sequence first, and the connection features of the two brain function intervals arranged in sequence later; the optimal EEG signals of the K brain function areas of each historical tester in the interference detection mode are extracted to obtain the attention time domain features, attention frequency domain features, and connection features of any two brain function intervals corresponding to each undisturbed video of each brain function area arranged in sequence first, and the connection features of the two brain function intervals arranged in sequence later. Feature extraction is performed on the optimal EEG signal to obtain the attention time domain features, attention frequency domain features, and connection features between any two brain function intervals corresponding to each interference video of each brain function area; the EEG attention feature set of each historical detector in the interference detection mode is constructed by the attention time domain features, attention frequency domain features corresponding to each interference video of each brain function area arranged in sequence in advance, and the connection features between two brain function intervals arranged in sequence later; the EEG attention feature set of each historical detector is constructed, and the EEG attention feature set of each historical detector is composed of the EEG attention feature set of the historical detector in the non-interference detection mode and the EEG attention feature set in the interference detection mode.

[0063] The sample set construction module 5 is used to construct an EEG attention training sample set and an EEG attention verification sample set. The EEG attention training sample set includes the EEG attention feature sets of A1 historical testers and the corresponding attention state degree marks. The EEG attention verification sample set includes the EEG attention feature sets of A2 historical testers and the corresponding attention state degree marks. A=A1+A2, A1 and A2 are both positive integers and A1≥3*A2.

[0064] The model building module 6 is used to build an EEG attention state detection model based on a convolutional neural network, use a particle swarm genetic fusion algorithm to optimize the hyperparameters of the EEG attention state detection model, and use an EEG attention training sample set and an EEG attention verification sample set to perform model training and model verification on the EEG attention state detection model respectively, and continuously iterate the particle swarm genetic fusion algorithm to obtain the optimal hyperparameters, and use the optimal hyperparameters to build the optimal EEG attention state detection model.

[0065] The EEG attention state detection model construction system based on particle swarm genetic fusion provided in this embodiment is consistent with the working principle and beneficial effects of the above-mentioned EEG attention state detection model construction method based on particle swarm genetic fusion, so it will not be described in detail here. For specific contents, please refer to the introduction of the above-mentioned method embodiment.

[0066] This embodiment also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for constructing an EEG attention state detection model based on particle swarm genetic fusion as described above is implemented.

[0067] This embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed, the method for constructing an EEG attention state detection model based on particle swarm genetic fusion as described above is implemented.

[0068] Although the specific embodiments of the present invention are described above, those skilled in the art should understand that these are only examples, and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.

Claims

1. A method for constructing an EEG attention state detection model based on particle swarm genetic fusion, characterized in that: It includes the following steps: S1. Collecting original EEG signals of historical testers and marking the degree of attention state: obtaining basic information including age and identity of A historical testers, and sequentially playing N interference-free videos in the interference-free detection mode and N interference videos in the interference detection mode for each historical tester to watch that match the age of the historical tester, respectively collecting original EEG signals of M channels of each brain functional area in K brain functional areas during the viewing process of the historical tester in the interference-free detection mode and the interference detection mode, thereby obtaining original EEG signals of each channel of each brain functional area of ​​multiple historical testers in the interference-free detection mode and the interference detection mode, and marking the degree of attention state of each historical tester, wherein the historical testers include historical testers of different age groups, and the degree of attention state marks include different degrees of attention states, N is a positive integer and N≥2, K is a positive integer and K≥2, M is a positive integer and M≥2, and A is a positive integer and A≥2; S2. Preliminary preprocessing of original EEG signals: Preliminary preprocessing is performed on the original EEG signals of each channel of each brain functional area of ​​each historical test subject in the non-interference detection mode and the interference detection mode, respectively, to obtain the preliminary EEG signals of each channel of each brain functional area of ​​each historical test subject in the non-interference detection mode and the interference detection mode; S3. Screening the optimal EEG signals of each brain functional area of ​​the historical tester: for the EEG signals of M channels of the kth brain functional area of ​​each historical tester in the non-interference detection mode, select a preliminary EEG signal of an optimal channel from the M channels as the optimal EEG signal of the kth brain functional area, thereby screening the optimal EEG signals of each brain functional area of ​​each historical tester in the non-interference detection mode; For the EEG signals of M channels of the kth brain functional area of ​​each historical tester in the interference detection mode, a preliminary EEG signal of an optimal channel is selected from the M channels as the optimal EEG signal of the kth brain functional area, thereby screening out the optimal EEG signals of each brain functional area of ​​each historical tester in the interference detection mode; S4. Constructing the EEG attention feature set of historical testers: extracting features from the optimal EEG signals of K brain function areas of each historical tester in the non-interference detection mode to obtain the attention time domain features, attention frequency domain features, and connection features of any two brain function areas corresponding to each non-interference video of each brain function area, and constructing the EEG attention feature set of each historical tester in the non-interference detection mode from the attention time domain features, attention frequency domain features corresponding to each non-interference video of each brain function area arranged in sequence in advance, and the connection features of two brain function areas arranged in sequence later; Feature extraction is performed on the optimal EEG signals of K brain function areas of each historical detector in the interference detection mode to obtain the attention time domain features, attention frequency domain features, and connection features of any two brain function intervals corresponding to each interference video of each brain function area. The EEG attention feature set of each historical detector in the interference detection mode is constructed by the attention time domain features, attention frequency domain features corresponding to each interference video of each brain function area arranged in sequence in advance, and the connection features of two brain function intervals arranged in sequence later; Constructing an EEG attention feature set for each historical detector, wherein the EEG attention feature set for each historical detector is composed of an EEG attention feature set in a non-interference detection mode and an EEG attention feature set in a interference detection mode of the historical detector; S5. Construct an EEG attention training sample set and an EEG attention verification sample set. The EEG attention training sample set includes the EEG attention feature sets of A1 historical testers and the corresponding attention state degree marks. The EEG attention verification sample set includes the EEG attention feature sets of A2 historical testers and the corresponding attention state degree marks. A=A1+A2, A1 and A2 are both positive integers and A1≥3*A2; S6. Construct an EEG attention state detection model based on convolutional neural network, use particle swarm genetic fusion algorithm to optimize the hyperparameters of the EEG attention state detection model, and use the EEG attention training sample set and EEG attention verification sample set to train and verify the EEG attention state detection model respectively. The optimal hyperparameters are obtained through continuous iteration of particle swarm genetic fusion algorithm, and the optimal EEG attention state detection model is constructed using the optimal hyperparameters.

2. The method for constructing an EEG attention state detection model based on particle swarm genetic fusion as claimed in claim 1, characterized in that: Step S6 includes the following steps: S61. Construct an EEG attention state detection model based on a convolutional neural network. The EEG attention state detection model contains multiple hyperparameters to be optimized, and the hyperparameters are initialized. S62, generating an initial particle population, setting the number of particles L, the maximum number of iterations T and the particle search space dimension D of the particle population, the particle dimension D of each particle corresponds to a hyperparameter one by one, each particle represents a set of hyperparameters, and initializing the speed and position of each particle; S63, using a certain particle as a hyperparameter to construct an initialized EEG attention state detection model, using the EEG attention feature set of A1 historical detectors in the EEG attention training sample set as input to perform model training on the initialized EEG attention state detection model, comparing the model training output values ​​corresponding to the A1 historical detectors with the corresponding attention state degree marks to calculate the initialization fitness, based on which the initialization fitness of each particle is calculated, the maximum value of the initialization fitness of each particle is used as the optimal fitness, the current position of each particle is used as the individual optimal position of each particle, and the current position of the particle corresponding to the optimal fitness is used as the group optimal position of the initial particle population; S64, updating the speed and position of each particle; X ld (t+1)=X ld (t)+V ld (t+1) Among them, V ld (t) and X ld (t) represent the current particle speed and position, V ld (t+1) and X ld (t+1) represents the updated particle speed and position, l represents the lth particle, d represents the dth dimension of the search space, t represents the current iteration number, W(t) represents the adaptive inertia weight, W min Indicates the minimum inertia weight, W max Indicates the maximum inertia weight, C1 and C2 indicate the acceleration factor, Xpb ld represents the historical individual optimal position, Xgb d represents the optimal position of the historical group; S65, update the historical individual optimal position and the historical group optimal position: calculate the fitness of each particle after the update as the current fitness of each particle, compare the current fitness of each particle with the historical individual optimal fitness of the particle, if the current fitness is greater than the historical individual optimal fitness, then update the historical individual optimal fitness of the particle = the current fitness of the particle, and update the historical individual optimal position of the particle = the current position of the particle, otherwise do not update, and then take the maximum value of the historical individual optimal fitness of each particle as the current optimal fitness, if the current optimal fitness is greater than the historical group optimal fitness, then update the historical group optimal fitness = the current optimal fitness, and update the historical group optimal position = the current optimal fitness corresponding to the particle current position, otherwise do not update, Xpb ld The corresponding fitness is the optimal fitness of the historical individual, Xgb d The corresponding fitness is the optimal fitness of the historical group; S66, judging whether the optimal fitness of the historical group reaches the set fitness value or the number of iterations reaches the maximum number of iterations T, if yes, proceeding to step S67, if no, proceeding to step S68; S67, based on the particles at the optimal position of the historical group, the optimal hyperparameters are obtained, and the optimal EEG attention state detection model is constructed using the optimal hyperparameters; S68, arrange the current fitness of each particle in descending order, eliminate the L1 particles with the lowest order, take the particle with the best position in the historical group among the non-eliminated particles as the parent generation, randomly select L1 particles from the remaining non-eliminated particles as the parent generation, and hybridize each selected parent generation with the parent generation to generate L1 particles. The current positions of the L1 particles generated by hybridization are used as the positions of the corresponding particles after t iterations. The current speed of each particle in the L1 particles generated by hybridization is the average speed of the particles on the front and back sides of the particle. N1 is a positive integer and 1≤L1≤1 / 2L. t=t+1, and execute step S64 again.

3. The method for constructing an EEG attention state detection model based on particle swarm genetic fusion as claimed in claim 2, characterized in that: In step S67, the optimal hyperparameters are obtained based on the particles at the optimal position of the historical group, and the EEG attention state detection model to be verified is constructed using the optimal hyperparameters. The EEG attention feature set of A2 historical detectors in the EEG attention verification sample set is used as input to perform model verification on the EEG attention state detection model to be verified, and the accuracy of the model after verification is calculated. When the accuracy reaches the set accuracy, the EEG attention state detection model to be verified is used as the optimal EEG attention state detection model. When the accuracy does not reach the set accuracy, the set fitness value and the maximum number of iterations T are increased, and the process proceeds to step S68.

4. The method for constructing an EEG attention state detection model based on particle swarm genetic fusion as claimed in claim 2, characterized in that: Fitness MSE(X) stands for mean square error.

5. The method for constructing an EEG attention state detection model based on particle swarm genetic fusion as claimed in claim 1, characterized in that: In step S1, the playing time of N non-interference videos is the same and the required attention levels are different, and the playing time of N interference videos is the same and the required attention levels are different; The attention state levels are 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90% and 100%, where 0% is unconscious and 100% is over-focused.

6. A system for constructing an EEG attention state detection model based on particle swarm genetic fusion, characterized in that: It includes an EEG acquisition module, an EEG preprocessing module, an optimal EEG screening module, an EEG feature extraction module, a sample set construction module and a model construction module; The EEG acquisition module is used to collect the original EEG signals of historical testers and mark the degree of attention state: obtain the basic information of A historical testers including age and identity, play N non-interference videos contained in the non-interference detection mode and N interference videos contained in the interference detection mode for each historical tester to watch in sequence, and collect the original EEG signals of M channels of each brain functional area in K brain functional areas during the viewing process of the historical tester in the non-interference detection mode and the interference detection mode, so as to obtain the original EEG signals of each channel of each brain functional area of ​​multiple historical testers in the non-interference detection mode and the interference detection mode, and mark the degree of attention state of each historical tester, wherein the historical testers include historical testers of different age groups, and the degree of attention state marks include different degrees of attention states, N is a positive integer and N≥2, K is a positive integer and K≥2, M is a positive integer and M≥2, and A is a positive integer and A≥2; The EEG preprocessing module is used for preliminary preprocessing of raw EEG signals: preliminary preprocessing is performed on the raw EEG signals of each channel of each brain functional area of ​​each historical tester in the non-interference detection mode and the interference detection mode, respectively, to obtain preliminary EEG signals of each channel of each brain functional area of ​​each historical tester in the non-interference detection mode and the interference detection mode; The optimal EEG screening module is used to screen the optimal EEG signals of each brain functional area of ​​the historical tester: for the EEG signals of M channels of the kth brain functional area of ​​each historical tester in the non-interference detection mode, a preliminary EEG signal of an optimal channel is selected from the M channels as the optimal EEG signal of the kth brain functional area, thereby screening out the optimal EEG signals of each brain functional area of ​​each historical tester in the non-interference detection mode; For the EEG signals of M channels of the kth brain functional area of ​​each historical tester in the interference detection mode, a preliminary EEG signal of an optimal channel is selected from the M channels as the optimal EEG signal of the kth brain functional area, thereby screening out the optimal EEG signals of each brain functional area of ​​each historical tester in the interference detection mode; The EEG feature extraction module is used to construct the EEG attention feature set of the historical tester: feature extraction is performed on the optimal EEG signals of K brain function areas of each historical tester in the non-interference detection mode to obtain the attention time domain features, attention frequency domain features, and connection features of any two brain function intervals corresponding to each non-interference video of each brain function area, and the EEG attention feature set of each historical tester in the non-interference detection mode is constructed by the attention time domain features, attention frequency domain features corresponding to each non-interference video of each brain function area arranged in sequence in advance, and the connection features of the two brain function intervals arranged in sequence later; Feature extraction is performed on the optimal EEG signals of K brain function areas of each historical detector in the interference detection mode to obtain the attention time domain features, attention frequency domain features, and connection features of any two brain function intervals corresponding to each interference video of each brain function area. The EEG attention feature set of each historical detector in the interference detection mode is constructed by the attention time domain features, attention frequency domain features corresponding to each interference video of each brain function area arranged in sequence in advance, and the connection features of two brain function intervals arranged in sequence later; Constructing an EEG attention feature set for each historical detector, wherein the EEG attention feature set for each historical detector is composed of an EEG attention feature set in a non-interference detection mode and an EEG attention feature set in a interference detection mode of the historical detector; The sample set construction module is used to construct an EEG attention training sample set and an EEG attention verification sample set, wherein the EEG attention training sample set includes an EEG attention feature set of A1 historical testers and corresponding attention state degree marks, and the EEG attention verification sample set includes an EEG attention feature set of A2 historical testers and corresponding attention state degree marks, A=A1+A2, A1 and A2 are both positive integers and A1≥3*A2; The model building module is used to build an EEG attention state detection model based on a convolutional neural network, use a particle swarm genetic fusion algorithm to optimize the hyperparameters of the EEG attention state detection model, and use an EEG attention training sample set and an EEG attention verification sample set to perform model training and model verification on the EEG attention state detection model respectively, and continuously iterate the particle swarm genetic fusion algorithm to obtain the optimal hyperparameters, and use the optimal hyperparameters to build the optimal EEG attention state detection model.

7. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for constructing an EEG attention state detection model based on particle swarm genetic fusion as described in any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed, the method for constructing an EEG attention state detection model based on particle swarm genetic fusion as described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Electroencephalogram-based video lag limit measuring method

    CN107837089A

  • Expression recognition method for optimizing convolutional neural network based on improved particle swarm optimization algorithm

    CN110598552A

  • Intrusion detection method based on GA-PSO-DBN

    CN111614609A

  • Attention state monitoring device and method based on brain-computer interface equipment technology

    CN112957049A

  • Sleep stage staging method and system based on parallel frequency domain electroencephalogram signals

    CN113807299A