Brainwave optimization classification and recognition system and method based on swarm intelligence algorithm
Through the brainwave optimization classification and recognition system based on swarm intelligence algorithm, feature subsets are generated and evolved, which solves the problems of high feature dimension and unstable classification effect in traditional methods, and achieves more efficient and accurate brainwave classification.
Patent Information
- Application Number
- CN202410259920.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-07
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-03-07
AI Technical Summary
Traditional brainwave signal feature extraction and classification methods have problems such as high feature dimensions and unstable classification results. Existing technologies cannot effectively solve the problem of feature extraction and optimization.
Using a brainwave optimization classification and recognition system based on swarm intelligence algorithms, by collecting and preprocessing raw wave data, we generate an initial feature subset, build an emotion classifier, calculate fitness, and evolve high-quality feature subsets until the evolution stop condition is met. Obtain the final optimized feature subset.
It improves the efficiency and accuracy of brainwave classification, avoids the problem of computational explosion when using all features for classification, reduces the workload of manual feature selection, and improves classification performance and stability.
Smart Images

Figure CN118114146B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of brain wave optimization classification, and in particular to a brain wave optimization classification and recognition system and method based on a swarm intelligence algorithm. Background Art
[0002] Brain wave signals have broad application prospects in brain science research, human-computer interaction and other fields. However, feature extraction and classification of brain wave signals is a complex and challenging problem. Traditional feature extraction and classification methods are limited by the ability of artificially selected features and classifiers, and often have problems such as high feature dimension and unstable classification effect. Therefore, a brain wave optimization classification and recognition system based on swarm intelligence algorithm is needed to improve classification performance and reduce feature dimension;
[0003] The Chinese patent with publication number CN113935382A discloses a method for separating brain wave signals based on genetic algorithm and fast independent component analysis, including preprocessing brain wave signal data, using particle swarm algorithm (PSO) to improve genetic algorithm to construct the initial matrix W of FASTICA algorithm, and using FASTICA algorithm to separate the noisy brain wave blind source signal. However, this method uses genetic algorithm for denoising, but fails to solve the problem of feature extraction and optimization;
[0004] To this end, the present invention proposes a brain wave optimization classification and recognition system and method based on a swarm intelligence algorithm. Summary of the invention
[0005] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a brain wave optimization classification and recognition system and method based on a swarm intelligence algorithm, which improves the work efficiency and accuracy of brain wave classification.
[0006] To achieve the above purpose, a brain wave optimization classification and recognition method based on swarm intelligence algorithm is proposed, which includes the following steps:
[0007] Step 1: Collect original radio wave data and emotion label data, and pre-process the original radio wave data to obtain pre-processed radio wave data;
[0008] Step 2: Extract features from the pre-processed radio wave data to obtain a full feature set;
[0009] Step 3: Generate M initial feature subsets based on the full feature set; M is a preset quantity parameter;
[0010] Step 4: Use the preprocessed radio wave data and emotion label data to build an emotion classifier for each initial feature subset, and use the emotion classifier to calculate the fitness of each initial feature subset;
[0011] Step 5: Based on fitness, select high-quality feature subset populations from all initial feature subsets, perform evolution operations on the high-quality feature subset populations, and regenerate the initial feature subset population; repeat steps 4 to 5 until the evolution stop condition is met and the final optimized feature subset is obtained;
[0012] The method of collecting the original radio wave data and the emotion label data includes:
[0013] Recruit N testers, and collect N1 EEG channel data and N2 physiological channel data on the scalp of each tester, and the EEG channel data and physiological channel data of each tester constitute a group of individual original electric waves; wherein N, N1 and N2 are all preset quantity parameters; all individual original electric waves constitute original electric wave data;
[0014] Collect the emotion labels of each tester when being tested, where the emotion labels are positive integers between 0 and K; the emotion labels express different emotion patterns of the testers, where K is the number of emotion patterns; all emotion labels constitute emotion label data;
[0015] The obtaining of pre-processed radio wave data comprises:
[0016] Step 11: Use a digital filter to filter the EEG channel data of each channel of each individual original radio wave in the original radio wave data;
[0017] Step 12: Use denoising technology to further denoise the EEG channel data after filtering;
[0018] Step 13: Standardize the physiological channel data of each physiological channel and the EEG channel data of each EEG channel after denoising; form the physiological channel data and EEG channel data of each individual after standardization into pre-processed electric wave data;
[0019] The method of extracting features from the pre-processed radio wave data to obtain a full feature set is as follows:
[0020] Extract features from the EEG channel data in each group of individual original waves in the pre-processed wave data to obtain an EEG individual feature set;
[0021] The method for extracting features from the EEG channel data is as follows:
[0022] Extract the EEG time domain features corresponding to the EEG channel data of each EEG channel in the pre-processed radio wave data of each test person;
[0023] Extract the EEG frequency domain features corresponding to the EEG channel data of each EEG channel in the pre-processed radio wave data of each test person:
[0024] Extract the EEG time-frequency domain features corresponding to the EEG channel data of each EEG channel in the pre-processed radio wave data of each test person:
[0025] The EEG time domain features, EEG frequency domain features, and EEG time-frequency domain features corresponding to each EEG channel of each tester form a set of EEG discrete feature vectors;
[0026] The EEG discrete feature set of all EEG channels of each test person constitutes an EEG discrete feature set, and the physiological channel data of all physiological channels of each test person constitutes a set of physiological channel feature sets;
[0027] The union of each tester's EEG discrete feature set and physiological channel feature set constitutes a set of classification feature sets, and the classification feature sets of all testers constitute a full feature set;
[0028] The generating of M initial feature subsets comprises the following steps:
[0029] Step 21: randomly selecting a number of channels from the N1 EEG channels and the N2 physiological channels as candidate channels; setting the channel labels of the selected candidate channels to 1, and setting the channel labels of the unselected channels to 0, to generate a channel label string;
[0030] Step 22: Select several features from the EEG channel and several features from the physiological channel as candidate features, set the feature labels of the selected candidate features to 1, and set the feature labels of the unselected features to 0, to generate a feature label string;
[0031] Step 23: The candidate features in the candidate channels form a set of initial feature subsets;
[0032] Step 24: Repeat steps 21 to 23 M times to generate M initial feature subsets;
[0033] The method of constructing a sentiment classifier for each initial feature subset is:
[0034] For each initial feature subset:
[0035] From all the testers, randomly select Nx testers as training testers, and the remaining N-Nx testers as verification testers; in the full feature set, the classification feature set of each training tester is used as the radio wave training set, and the classification feature set of each verification tester is used as the radio wave verification set; where Nx is a preset number parameter,
[0036] For each training tester, the feature values corresponding to the initial feature subset are selected from the corresponding radio wave training set to form a set of training feature vectors;
[0037] Each set of training feature vectors is used as input of an emotion classifier, the emotion classifier uses the predicted value of the emotion pattern of the test person corresponding to the training feature vector as output, uses the emotion label of the test person corresponding to the training feature vector as a prediction target, uses the difference between the predicted value of the emotion pattern and the emotion label as a prediction error, and uses minimizing the sum of the prediction errors as a training target; the emotion classifier is trained until the sum of the prediction errors reaches convergence and the training is stopped;
[0038] The method of using the emotion classifier to calculate the fitness of each initial feature subset is:
[0039] For each initial feature subset:
[0040] For each verification tester, the feature values corresponding to the initial feature subset are selected from the corresponding radio wave training set to form a set of verification feature vectors;
[0041] Input the verification feature vector into the corresponding emotion classifier to obtain the predicted value of the emotion pattern output by the emotion classifier;
[0042] The prediction accuracy between the predicted value of the emotion pattern outputted by the statistics and the emotion label of the corresponding verification tester is calculated; the prediction accuracy is used as the fitness of the initial feature subset;
[0043] The method of selecting a high-quality feature subset population from all initial feature subsets based on fitness is as follows:
[0044] A high-quality fitness threshold is preset, and all initial feature subsets with fitness greater than the high-quality fitness threshold are regarded as high-quality feature subsets, and all high-quality feature subsets constitute a high-quality feature subset group;
[0045] The method of performing evolutionary operations on the high-quality feature subset population to regenerate the initial feature subset population includes:
[0046] Step 31: Calculate the sum of the fitness of all high-quality feature subsets as the total fitness;
[0047] Step 32: For each high-quality feature subset, calculate the ratio of its fitness to the total fitness, and use the ratio as the selection probability;
[0048] Step 33: Select two high-quality feature subsets in turn according to the selection probability, and perform crossover operations on the channel label strings and feature label strings of the two selected high-quality feature subsets to generate a new set of feature subsets; repeat step 33 until M new feature subsets are generated;
[0049] Step 34: performing mutation operation on the M new feature subsets; the new feature subsets after the M mutation operations are reassembled into the initial feature subset population;
[0050] The evolution stopping condition is:
[0051] A fitness stop threshold is pre-set. If the fitness of any initial feature subset in the high-quality feature subset population is greater than the fitness stop threshold, it is judged that the evolution stop condition is met; otherwise, it is judged that the evolution stop condition is not met.
[0052] The final optimized feature subset is the initialized feature subset with the largest fitness among all high-quality feature subset populations.
[0053] A brain wave optimization classification and recognition system based on swarm intelligence algorithm is proposed, which includes a pre-data collection module, a full feature set acquisition module and a swarm intelligence screening module; wherein each module is electrically connected;
[0054] A pre-data collection module is used to collect raw radio wave data and emotion label data, pre-process the raw radio wave data, obtain pre-processed radio wave data, send the pre-processed radio wave data to the full feature set acquisition module, and send the emotion label data to the group intelligent screening module;
[0055] A full feature set acquisition module is used to extract features from the pre-processed radio wave data, obtain a full feature set, and send the full feature set to the swarm intelligence screening module;
[0056] The swarm intelligence screening module is used to perform the following steps:
[0057] Step 41: Generate M initial feature subsets based on the full feature set, where M is a preset quantity parameter;
[0058] Step 42: Using the preprocessed radio wave data and the emotion label data, construct an emotion classifier for each initial feature subset, and use the emotion classifier to calculate the fitness of each initial feature subset;
[0059] Step 43: Based on the fitness, select high-quality feature subset populations from all initial feature subsets, perform evolution operations on the high-quality feature subset populations, and regenerate the initial feature subset population; repeat steps 41 to 43 until the evolution stop condition is met and the final optimized feature subset is obtained.
[0060] An electronic device is proposed, comprising: a processor and a memory, wherein the memory stores a computer program that can be called by the processor;
[0061] The processor executes the above-mentioned brain wave optimization classification and recognition method based on swarm intelligence algorithm by calling the computer program stored in the memory.
[0062] A computer-readable storage medium is provided, on which a rewritable computer program is stored;
[0063] When the computer program is executed on a computer device, the computer device executes the above-mentioned brain wave optimization classification and recognition method based on swarm intelligence algorithm.
[0064] Compared with the prior art, the present invention has the following beneficial effects:
[0065] The present invention collects original radio wave data and emotion label data, pre-processes the original radio wave data, obtains pre-processed radio wave data, extracts features from the pre-processed radio wave data, obtains a full feature set, and generates M initial feature subsets based on the full feature set; M is a preset quantity parameter, uses the pre-processed radio wave data and emotion label data, constructs an emotion classifier for each initial feature subset, and uses the emotion classifier to calculate the fitness of each initial feature subset; based on the fitness, selects a high-quality feature subset population from all initial feature subsets, performs an evolution operation on the high-quality feature subset population, and regenerates the initial feature subset population; repeatedly generates new initial feature subset populations, and screens the high-quality feature subset populations until the evolution stop condition is met, and obtains the final optimized feature subset; by using a genetic algorithm, it is ensured that some channels and features are discarded in the final optimized feature subset, and the classification accuracy of the emotion classifier can also reach the expected effect, thereby avoiding the problem of explosion of computational complexity when using all features for classification, improving classification performance and stability, reducing the workload of manually selecting features, and improving the work efficiency and accuracy of classifying brain waves. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 This is a flow chart of the brain wave optimization classification and recognition method based on the swarm intelligence algorithm in Example 1 of the present invention;
[0067] Figure 2 This is a flow chart of obtaining pre-processed radio wave data in Embodiment 1 of the present invention;
[0068] Figure 3 This is a flow chart of generating M initial feature subsets in Embodiment 1 of the present invention;
[0069] Figure 4A flow chart of regenerating an initial feature subset population in Embodiment 1 of the present invention;
[0070] Figure 5 This is a module connection relationship diagram of the brain wave optimization classification and recognition system based on the swarm intelligence algorithm in Example 2 of the present invention;
[0071] Figure 6 This is a schematic diagram of the structure of an electronic device in Embodiment 3 of the present invention;
[0072] Figure 7 This is a schematic diagram of the computer-readable storage medium structure in Example 4 of the present invention. DETAILED DESCRIPTION
[0073] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0074] like Figure 1 As shown, the brain wave optimization classification and recognition method based on the swarm intelligence algorithm includes the following steps:
[0075] Step 1: Collect original radio wave data and emotion label data, and pre-process the original radio wave data to obtain pre-processed radio wave data;
[0076] Step 2: Extract features from the pre-processed radio wave data to obtain a full feature set;
[0077] Step 3: Generate M initial feature subsets based on the full feature set; M is a preset quantity parameter;
[0078] Step 4: Use the preprocessed radio wave data and emotion label data to build an emotion classifier for each initial feature subset, and use the emotion classifier to calculate the fitness of each initial feature subset;
[0079] Step 5: Based on fitness, select high-quality feature subset populations from all initial feature subsets, perform evolution operations on the high-quality feature subset populations, and regenerate the initial feature subset population; repeat steps 4 to 5 until the evolution stop condition is met and the final optimized feature subset is obtained;
[0080] The method of collecting the original radio wave data and the emotion tag data includes:
[0081] Recruit N testers, and collect N1 EEG channel data and N2 physiological channel data on the scalp of each tester, and the EEG channel data and physiological channel data of each tester constitute a group of individual original electric waves; wherein N, N1 and N2 are all preset quantity parameters; all individual original electric waves constitute original electric wave data;
[0082] Collect the emotional labels of each tester when being tested, where the emotional labels are positive integers between 0 and K; the emotional labels express different emotional patterns of the testers, where K is the number of emotional patterns; all emotional labels constitute emotional label data; the emotional patterns include but are not limited to positive, negative, neutral, excited, depressed, anxious, angry, and fearful, etc.;
[0083] It can be understood that N1 represents the number of different areas on the human scalp. By using an EEG signal acquisition device such as an EEG amplifier to collect EEG signals in different areas, it is possible to collect data of different EEG channels in different scalp areas. In a specific example, N1 can be 32;
[0084] N2 represents the number of physiological channels. Physiological channels usually refer to channels for recording other physiological signals of the body. The physiological signals may include physiological characteristics of heart rate (average heart rate, maximum heart rate, minimum heart rate, heart rate variability (HRV) and other characteristics), physiological characteristics of skin electrical activity (amplitude, frequency or duration of skin electrical activity response and other characteristics), physiological characteristics of eye movement (eye movement path length, number of fixations, fixation duration, number of saccades and other characteristics), and each physiological characteristic corresponds to a channel of a physiological signal;
[0085] Further, such as Figure 2 As shown, the preprocessing of the original radio wave data to obtain the preprocessed radio wave data includes:
[0086] Step 11: using a digital filter to filter the EEG channel data of each channel of each individual original radio wave in the original radio wave data to remove noise and unnecessary frequency components; specifically, the digital filter includes but is not limited to a bandpass filter, a low-pass filter and a high-pass filter;
[0087] Step 12: further denoising the filtered EEG channel data using denoising technology to reduce the impact of noise; specifically, the denoising technology includes but is not limited to wavelet denoising and smoothing;
[0088] Step 13: Standardizing the physiological channel data of each physiological channel and the EEG channel data of each EEG channel after denoising to ensure that the data between different channels or different samples have similar scales and distributions; specifically, the standardization includes but is not limited to Z-score standardization and minimum-maximum standardization; the physiological channel data and EEG channel data of each individual after standardization are combined into pre-processed electric wave data;
[0089] Furthermore, the method of extracting features from the pre-processed radio wave data to obtain a full feature set is:
[0090] Extract features from the EEG channel data in each group of individual original waves in the pre-processed wave data to obtain an EEG individual feature set;
[0091] Specifically, the method of extracting features from the EEG channel data is as follows:
[0092] Extracting the EEG time domain features corresponding to the EEG channel data of each EEG channel in the pre-processed radio wave data of each tester; specifically, the EEG time domain features include but are not limited to mean, standard deviation, peak value, skewness, kurtosis, etc.;
[0093] Extracting EEG frequency domain features corresponding to the EEG channel data of each EEG channel in the pre-processed electric wave data of each tester: Specifically, the EEG frequency domain features can use Fourier transform to convert the EEG channel data into the frequency domain, calculate the power spectral density (PSD) on the frequency spectrum, and extract the energy on different frequency bands (such as δ wave, θ wave, α wave, β wave, γ wave) as the EEG frequency domain features;
[0094] Extracting the EEG time-frequency domain features corresponding to the EEG channel data of each EEG channel in the pre-processed electric wave data of each test person: Specifically, the EEG time-frequency domain features can be extracted by using wavelet transform to extract the time-frequency features of the signal, such as wavelet packet energy, wavelet packet entropy, etc.;
[0095] The EEG time domain features, EEG frequency domain features, and EEG time-frequency domain features corresponding to each EEG channel of each tester form a set of EEG discrete feature vectors;
[0096] The EEG discrete feature set of all EEG channels of each test person constitutes an EEG discrete feature set, and the physiological channel data of all physiological channels of each test person constitutes a set of physiological channel feature sets;
[0097] The union of each tester's EEG discrete feature set and physiological channel feature set constitutes a set of classification feature sets, and the classification feature sets of all testers constitute a full feature set;
[0098] For ease of understanding, an example of the form of a classification feature set is as follows: [[mean 1, standard deviation 1...],...,[mean N1, standard deviation N1],[],...[average heart rate, maximum heart rate...],[electrical activity amplitude, electrical activity frequency...],[eye movement path length, number of fixations...]];
[0099] It can be understood that the EEG time domain features, EEG frequency domain features and EEG time-frequency domain features are all discrete values (such as mean, standard deviation, peak value, skewness), and the physiological features of each physiological channel are also discrete values (such as average heart rate, maximum heart rate). Therefore, the EEG discrete feature set and the physiological channel feature set can be combined to form a set of classification feature sets;
[0100] Further, such as Figure 3 As shown, the generation of M initial feature subsets based on the full feature set includes the following steps:
[0101] Step 21: randomly selecting a number of channels from the N1 EEG channels and the N2 physiological channels as candidate channels; setting the channel label of the selected candidate channels to 1, and setting the channel label of the unselected channels to 0, to generate a channel label string; an example of the channel label string is 0101..., indicating that the second and fourth channels are selected as candidate channels;
[0102] Step 22: Selecting several features from the EEG channel and several features from the physiological channel as candidate features, setting feature labels of the selected candidate features to 1, and setting feature labels of the unselected features to 0, to generate a feature label string; an example of the feature label string is 0101...10..., indicating that the second and fourth features of the EEG channel and the first feature of the physiological channel are selected as candidate features;
[0103] Step 23: The candidate features in the candidate channels form a set of initial feature subsets; as an example, the initial feature subset may include mean 1, peak 1, ... mean 3, peak 3 ..., electrical activity amplitude ..., that is, the selected candidate channels are the 1st and 3rd EEG channels, and the electrical activity physiological channel;
[0104] Step 24: Repeat steps 21 to 23 M times to generate M initial feature subsets;
[0105] Furthermore, the method of constructing a sentiment classifier for each initial feature subset is as follows:
[0106] For each initial feature subset:
[0107] Randomly select Nx testers from all testers as training testers, and the remaining N-Nx testers as verification testers; use the classification feature set of each training tester in the full feature set as the radio wave training set, and the classification feature set of each verification tester as the radio wave verification set; wherein Nx is a preset quantity parameter, specifically, it can be 0.7×N;
[0108] For each training tester, the feature values corresponding to the initial feature subset are selected from the corresponding radio wave training set to form a set of training feature vectors;
[0109] Each set of training feature vectors is used as the input of the emotion classifier, the emotion classifier uses the predicted value of the emotion pattern of the test person corresponding to the training feature vector as the output, uses the emotion label of the test person corresponding to the training feature vector as the prediction target, uses the difference between the predicted value of the emotion pattern and the emotion label as the prediction error, and uses minimizing the sum of prediction errors as the training target; the emotion classifier is trained until the sum of prediction errors reaches convergence, and the training is stopped, and an emotion classifier trained using the initial feature subset is trained according to the training feature vector; the emotion classifier is a polynomial regression model or a deep neural network model; the sum of prediction errors is a mean square error;
[0110] Furthermore, the method of using the emotion classifier to calculate the fitness of each initial feature subset is as follows:
[0111] For each initial feature subset:
[0112] For each verification tester, the feature values corresponding to the initial feature subset are selected from the corresponding radio wave training set to form a set of verification feature vectors;
[0113] Input the verification feature vector into the corresponding emotion classifier to obtain the predicted value of the emotion pattern output by the emotion classifier;
[0114] The prediction accuracy between the predicted value of the emotion pattern outputted by the statistics and the emotion label of the corresponding verification tester is calculated; the prediction accuracy is used as the fitness of the initial feature subset;
[0115] Furthermore, the method of selecting a high-quality feature subset population from all initial feature subsets based on fitness is:
[0116] A high-quality fitness threshold is preset, and all initial feature subsets with fitness greater than the high-quality fitness threshold are regarded as high-quality feature subsets, and all high-quality feature subsets constitute a high-quality feature subset group;
[0117] Further, such as Figure 4As shown, the method of performing evolutionary operations on the high-quality feature subset population to regenerate the initial feature subset population includes:
[0118] Step 31: Calculate the sum of the fitness of all high-quality feature subsets as the total fitness;
[0119] Step 32: For each high-quality feature subset, calculate the ratio of its fitness to the total fitness, and use the ratio as the selection probability;
[0120] Step 33: Select two high-quality feature subsets in turn according to the selection probability, and perform crossover operations on the channel label strings and feature label strings of the two selected high-quality feature subsets to generate a new set of feature subsets; repeat step 33 until M new feature subsets are generated; the crossover operation includes but is not limited to single-point crossover and multi-point crossover;
[0121] Step 34: performing mutation operations on the M new feature subsets; the mutation operations include but are not limited to bit mutation and uniform mutation; the new feature subsets after the M mutation operations are reassembled into the initial feature subset population;
[0122] Furthermore, the evolution stopping condition is:
[0123] A fitness stop threshold is pre-set. If the fitness of any initial feature subset in the high-quality feature subset population is greater than the fitness stop threshold, it is judged that the evolution stop condition is met; otherwise, it is judged that the evolution stop condition is not met.
[0124] Furthermore, the final optimized feature subset is the initialization feature subset with the largest fitness among all high-quality feature subset populations;
[0125] It can be understood that the features in the final optimized feature subset contain a channel label string and a feature label string, and there are several channel labels and feature labels of 0 in the channel label string and the feature label string, which means that even if these channels and features of 0 are discarded, the classification accuracy of the emotion classifier can reach the expected effect, thereby avoiding the problem of the explosion of the amount of calculation when using all features for classification, reducing the workload of manually selecting features, and improving the efficiency and accuracy of classifying brain waves;
[0126] like Figure 5 As shown, the brain wave optimization classification and recognition system based on the swarm intelligence algorithm includes a pre-data collection module, a full feature set acquisition module and a swarm intelligence screening module; wherein each module is electrically connected;
[0127] The pre-data collection module is mainly used to collect raw radio wave data and emotion label data, and pre-process the raw radio wave data to obtain pre-processed radio wave data, and send the pre-processed radio wave data to the full feature set acquisition module, and send the emotion label data to the group intelligent screening module;
[0128] The full feature set acquisition module is mainly used to extract features from the pre-processed radio wave data, obtain a full feature set, and send the full feature set to the swarm intelligent screening module;
[0129] The swarm intelligence screening module is mainly used to perform the following steps:
[0130] Step 41: Generate M initial feature subsets based on the full feature set, where M is a preset quantity parameter;
[0131] Step 42: Using the preprocessed radio wave data and the emotion label data, construct an emotion classifier for each initial feature subset, and use the emotion classifier to calculate the fitness of each initial feature subset;
[0132] Step 43: Based on the fitness, select high-quality feature subset populations from all initial feature subsets, perform evolution operations on the high-quality feature subset populations, and regenerate the initial feature subset population; repeat steps 41 to 43 until the evolution stop condition is met and the final optimized feature subset is obtained.
[0133] Example 3
[0134] Figure 6 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 6 As shown, according to another aspect of the present application, an electronic device 100 is also provided. The electronic device 100 may include one or more processors and one or more memories. The memories store computer readable codes, and when the computer readable codes are executed by one or more processors, the brain wave optimization classification and recognition method based on the swarm intelligence algorithm as described above can be implemented.
[0135] The method or device according to the embodiment of the present application can also be used by Figure 6 The electronic device architecture shown in FIG. Figure 6As shown, the electronic device 100 may include a bus 101, one or more CPUs 102, ROM 103, RAM 104, a communication port 105 connected to a network, an input / output component 106, a hard disk 107, etc. The storage device in the electronic device 100, such as ROM 103 or hard disk 107, may store the implementation of the brain wave optimization classification and recognition method based on the swarm intelligence algorithm provided in the present application. The implementation of the brain wave optimization classification and recognition method based on the swarm intelligence algorithm may include the following steps: Step 1: Collect original electric wave data and emotion label data, and pre-process the original electric wave data to obtain pre-processed electric wave data; Step 2: Extract features from the pre-processed electric wave data to obtain a full feature set; Step 3: Generate M initial feature subsets based on the full feature set; M is a preset quantity parameter; Step 4: Use the pre-processed electric wave data and emotion label data to build an emotion classifier for each initial feature subset, and use the emotion classifier to calculate the fitness of each initial feature subset; Step 5: Based on the fitness, select a high-quality feature subset population from all initial feature subsets, perform evolution operations on the high-quality feature subset population, and regenerate the initial feature subset population; Repeat steps 4 to 5 until the evolution stop condition is met and the final optimized feature subset is obtained;
[0136] Furthermore, the electronic device 100 may further include a user interface 108. Figure 6 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different devices. Figure 6 One or more components of an electronic device are shown.
[0137] Example 4
[0138] Figure 7 Schematic diagram of a computer-readable storage medium structure provided by an embodiment of the present application. Figure 7 As shown, it is a computer-readable storage medium 200 according to an embodiment of the present application. Computer-readable instructions are stored on the computer-readable storage medium 200. When the computer-readable instructions are executed by the processor, the brain wave optimization classification and recognition method based on the swarm intelligence algorithm according to the embodiment of the present application described with reference to the above figures can be implemented. The computer-readable storage medium 200 includes but is not limited to volatile memory and / or non-volatile memory. Volatile memory may include random access memory (RAM) and cache memory (cache), etc. Non-volatile memory may include read-only memory (ROM), hard disk, flash memory, etc.
[0139] In addition, according to the implementation of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the present application provides a non-transitory machine-readable storage medium, the non-transitory machine-readable storage medium stores machine-readable instructions, the machine-readable instructions can be run by a processor to execute instructions corresponding to the method steps provided by the present application, and when the computer program is executed by a central processing unit (CPU), the above functions defined in the method of the present application are executed.
[0140] The methods, apparatuses, and devices of the present application may be implemented in many ways. For example, the methods, apparatuses, and devices of the present application may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present application are not limited to the order specifically described above unless otherwise specified. In addition, in some embodiments, the present application may also be implemented as programs recorded in a recording medium, which include machine-readable instructions for implementing the method according to the present application. Therefore, the present application also covers recording media storing programs for executing the method according to the present application.
[0141] In addition, the parts of the above-mentioned technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive redundancy.
[0142] The specific implementation modes as described above further describe the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation mode of the present invention and is not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0143] The above preset parameters or preset thresholds are all set by technicians in this field according to actual conditions or obtained by simulating a large amount of data.
[0144] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.
Claims
1. Brainwave optimization classification and recognition method based on swarm intelligence algorithm, It is characterized in that The following steps are involved: Step 1: Collect original radio wave data and emotion label data, and pre-process the original radio wave data to obtain pre-processed radio wave data; Step 2: Extract features from the pre-processed radio wave data to obtain a full feature set; Step 3: Generate M initial feature subsets based on the full feature set; M is the preset quantity parameter; Step 4: Use the preprocessed radio wave data and emotion label data to build an emotion classifier for each initial feature subset, and use the emotion classifier to calculate the fitness of each initial feature subset; Step 5: Based on fitness, select high-quality feature subset populations from all initial feature subsets, perform evolution operations on the high-quality feature subset populations, and regenerate the initial feature subset population; Repeat steps 4 to 5 until the evolution stop condition is met and the final optimized feature subset is obtained; The method of extracting features from the pre-processed radio wave data to obtain a full feature set is as follows: Extract features from the EEG channel data in each group of individual original waves in the pre-processed wave data to obtain an EEG individual feature set; The method for extracting features from the EEG channel data is as follows: Extract the EEG time domain features corresponding to the EEG channel data of each EEG channel in the pre-processed radio wave data of each test person; Extract the EEG frequency domain features corresponding to the EEG channel data of each EEG channel in the pre-processed radio wave data of each test person: Extract the EEG time-frequency domain features corresponding to the EEG channel data of each EEG channel in the pre-processed radio wave data of each test person: The EEG time domain features, EEG frequency domain features, and EEG time-frequency domain features corresponding to each EEG channel of each tester form a set of EEG discrete feature vectors; The EEG discrete feature set of all EEG channels of each test person constitutes an EEG discrete feature set, and the physiological channel data of all physiological channels of each test person constitutes a set of physiological channel feature sets; The union of each tester's EEG discrete feature set and physiological channel feature set constitutes a set of classification feature sets, and the classification feature sets of all testers constitute a full feature set; The generating of M initial feature subsets comprises the following steps: Step 21: randomly select a number of channels from the N1 EEG channels and the N2 physiological channels as candidate channels; set the channel labels of the selected candidate channels to 1, and set the channel labels of the unselected channels to 0, to generate a channel label string; Step 22: Select several features from the EEG channel and several features from the physiological channel as candidate features, set the feature labels of the selected candidate features to 1, and set the feature labels of the unselected features to 0, to generate a feature label string; Step 23: The candidate features in the candidate channels form a set of initial feature subsets; Step 24: Repeat steps 21 to 23 M times to generate M initial feature subsets; The method of constructing a sentiment classifier for each initial feature subset is: For each initial feature subset: Randomly select Nx testers from all testers as training testers, and the remaining N-Nx testers as verification testers; use the classification feature set of each training tester in the full feature set as the radio wave training set, and the classification feature set of each verification tester as the radio wave verification set; where Nx is a preset number parameter; For each training tester, the feature values corresponding to the initial feature subset are selected from the corresponding radio wave training set to form a set of training feature vectors; Each set of training feature vectors is used as the input of the emotion classifier. The emotion classifier uses the predicted value of the emotion pattern of the test person corresponding to the training feature vector as the output, the emotion label of the test person corresponding to the training feature vector as the prediction target, the difference between the predicted value of the emotion pattern and the emotion label as the prediction error, and minimizing the sum of the prediction errors as the training goal; the emotion classifier is trained until the sum of the prediction errors reaches convergence and the training is stopped.
2. The brain wave optimization classification and recognition method based on swarm intelligence algorithm according to claim 1, It is characterized in that The method of collecting the original radio wave data and the emotion label data includes: Recruit N testers, and collect N1 EEG channel data and N2 physiological channel data on the scalp of each tester, and the EEG channel data and physiological channel data of each tester constitute a group of individual original electric waves; wherein N, N1 and N2 are all preset quantity parameters; all individual original electric waves constitute original electric wave data; Collect the emotion labels of each tester when being tested, where the emotion labels are positive integers between 0 and K; the emotion labels express different emotion patterns of the testers, where K is the number of emotion patterns; all emotion labels constitute emotion label data; The obtaining of pre-processed radio wave data comprises: Step 11: Use a digital filter to filter the EEG channel data of each channel of each individual original radio wave in the original radio wave data; Step 12: Use denoising technology to denoise the EEG channel data after filtering; Step 13: Standardize the physiological channel data of each physiological channel and the EEG channel data of each EEG channel after denoising; and form the physiological channel data and EEG channel data of each individual after standardization into pre-processed electric wave data.
3. The brain wave optimization classification and recognition method based on swarm intelligence algorithm according to claim 2, It is characterized in that The method of using the emotion classifier to calculate the fitness of each initial feature subset is: For each initial feature subset: For each verification tester, the feature values corresponding to the initial feature subset are selected from the corresponding radio wave training set to form a set of verification feature vectors; Input the verification feature vector into the corresponding emotion classifier to obtain the predicted value of the emotion pattern output by the emotion classifier; The prediction accuracy between the predicted value of the emotion pattern outputted by the statistics and the emotion label of the corresponding verification tester is calculated; the prediction accuracy is used as the fitness of the initial feature subset.
4. The brain wave optimization classification and recognition method based on swarm intelligence algorithm according to claim 3, It is characterized in that The method of performing evolutionary operations on the high-quality feature subset population to regenerate the initial feature subset population includes: Step 31: Calculate the sum of the fitness of all high-quality feature subsets as the total fitness; Step 32: For each high-quality feature subset, calculate the ratio of its fitness to the total fitness, and use the ratio as the selection probability; Step 33: Select two high-quality feature subsets in turn according to the selection probability, and perform crossover operations on the channel label strings and feature label strings of the two selected high-quality feature subsets to generate a new set of feature subsets; repeat step 33 until M new feature subsets are generated; Step 34: Perform mutation operations on the M new feature subsets; the new feature subsets after the M mutation operations are reassembled into the initial feature subset population.
5. The brain wave optimization classification and recognition method based on swarm intelligence algorithm according to claim 4, It is characterized in that The evolution stopping condition is: A fitness stop threshold is pre-set. If the fitness of any initial feature subset in the high-quality feature subset population is greater than the fitness stop threshold, it is judged that the evolution stop condition is met; otherwise, it is judged that the evolution stop condition is not met. The final optimized feature subset is the initialized feature subset with the largest fitness among all high-quality feature subset populations.
6. A brain wave optimization classification and recognition system based on a swarm intelligence algorithm, which is used to implement the brain wave optimization classification and recognition method based on a swarm intelligence algorithm as described in any one of claims 1 to 5, It is characterized in that It includes a pre-data collection module, a full feature set acquisition module and a swarm intelligence screening module; wherein each module is electrically connected to each other; A pre-data collection module is used to collect raw radio wave data and emotion label data, pre-process the raw radio wave data, obtain pre-processed radio wave data, send the pre-processed radio wave data to the full feature set acquisition module, and send the emotion label data to the group intelligent screening module; A full feature set acquisition module is used to extract features from the pre-processed radio wave data, obtain a full feature set, and send the full feature set to the swarm intelligence screening module; The swarm intelligence screening module is used to perform the following steps: Step 41: Generate M initial feature subsets based on the full feature set, where M is a preset quantity parameter; Step 42: Using the preprocessed radio wave data and the emotion label data, construct an emotion classifier for each initial feature subset, and use the emotion classifier to calculate the fitness of each initial feature subset; Step 43: Based on the fitness, select high-quality feature subset populations from all initial feature subsets, perform evolution operations on the high-quality feature subset populations, and regenerate the initial feature subset population; repeat steps 41 to 43 until the evolution stop condition is met and the final optimized feature subset is obtained.
7. An electronic device, It is characterized in that include: processor and memory, wherein The memory stores a computer program that can be called by the processor; The processor executes the brain wave optimization classification and recognition method based on swarm intelligence algorithm described in any one of claims 1 to 5 in the background by calling the computer program stored in the memory.
8. A computer-readable storage medium, It is characterized in that A rewritable computer program is stored thereon; When the computer program is executed on a computer device, the computer device executes the brain wave optimization classification and recognition method based on swarm intelligence algorithm as described in any one of claims 1 to 5 in the background.
