EEG signal sample expansion method, medium and system based on improved SMOTE algorithm
Through the improved SMOTE algorithm and amplitude-frequency noise adding technology, the problem of insufficient sample number and information destruction in EEG signal sample expansion is solved, high-quality sample expansion is achieved, and the performance of the deep learning model is improved.
Patent Information
- Application Number
- CN202111519739.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-13
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-12-13
AI Technical Summary
Existing EEG signal sample expansion methods cannot effectively expand the number of samples of multi-channel time series signals, and traditional methods will destroy the time-frequency domain information of the original signal, resulting in a decrease in the quality of the data set.
The improved SMOTE algorithm is used to obtain the domain information of the sample through the dynamic time warping algorithm, and the amplitude-frequency noise adding technology is used to generate new samples to ensure that the characteristics of the new sample and the original sample remain unchanged, while increasing the number of samples at the junction and changing the sample distribution. .
Effectively expand the number of samples in the EEG signal data set, improve the generalization ability and classification accuracy of the deep learning model, and ensure the quality and complete time-frequency domain information of new samples.
Smart Images

Figure CN114492501B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of sample expansion and classification methods of electroencephalogram signals, and in particular to an electroencephalogram signal sample expansion method based on an improved SMOTE algorithm. Background Art
[0002] Brain-computer interface (BCI) can convert bioelectric signals into control signals of external devices, enabling the brain to directly control external devices. This technology has broad application prospects in the fields of medicine, military, entertainment and education. However, in the current medical field, brain-computer interface technology is one of the cutting-edge technologies to help disabled people recover some of their body functions.
[0003] The acquisition of high-quality EEG signals depends on advanced EEG signal acquisition equipment on the one hand, and on the subject's long-term and highly concentrated attention on the other hand, that is, the subject's psychological and mental state, which greatly affects the quality and quantity of the collected EEG signals. The sample size of each subject in the currently commonly used EEG signal public data set is about 300-800. When using machine learning and deep learning methods for classification, the number of samples in the data set is one of the important factors that determine the generalization and fitting capabilities of the model. In the field of image recognition, sample expansion methods have been widely used, usually by rotating, flipping, and cropping the image to expand a picture into multiple pictures, effectively increasing the amount of data. However, traditional sample expansion methods are not applicable to multi-channel time series samples that are difficult to collect, such as EEG signals.
[0004] The currently disclosed sample expansion methods for EEG signals mainly have the following problems: First, the sample expansion methods of analog images mainly include slicing, slice exchange, time domain transformation, frequency domain transformation, etc. For multi-channel time series signal samples (EEG signal samples), the use of analog image sample expansion methods will greatly destroy the time and frequency domain information in the original signal, and the generated samples will affect the quality of the overall data set; second, the information of the original samples is not fully considered during sample expansion, resulting in some low-quality samples and irrelevant samples being selected as the expanded original samples, thereby reducing the overall quality of the sample set.
[0005] Therefore, a new sample expansion method for EEG signal samples is needed.
[0006] The commonly used SMOTE algorithm is mainly used for oversampling of imbalanced samples, and is often used in classification tasks when the number of samples with different labels in the data set is seriously unbalanced. However, the number of samples with different labels in the EEG signal sample data set we use is controllable and balanced, so it is not easy to think of applying this to EEG signal sample expansion. The application of the SMOTE algorithm to EEG signal sample expansion technology has the following main problems:
[0007] 1. The original SMOTE algorithm uses Euclidean distance to obtain the domain of samples. However, as EEG signals are multi-channel time series signals (the original data is two-dimensional data matrix data), directly using Euclidean distance cannot accurately and truly represent the domain information. Therefore, a method that is more suitable for representing time series distance is used for reconstruction, using DTW.
[0008] 2. The original SMOTE algorithm directly synthesizes samples. This synthesis method easily causes sample overlap. When deep learning is used for classification learning, the sample characteristics at the junction of samples with different labels have a greater impact on the network parameters. Therefore, the sample selection conditions are increased, and the samples at the junction of samples with different labels are screened out as raw data for artificial synthesis, thereby increasing the number of samples at the junction and changing the distribution of samples as a whole to make it suitable for deep learning methods.
[0009] 3. The original SMOTE method directly takes a point on the path of two samples with the same label as a new sample. This new sample synthesis technology is completely unsuitable for EEG signals. This method will change the time domain and frequency domain information and features contained in the original signal. In order to ensure that the newly synthesized sample is different from the original sample and retains its characteristics, a new method is used for sample synthesis.
[0010] Application Publication No. CN112084935A, an emotion recognition method based on expanding high-quality EEG samples, characterized in that: the method comprises the following steps: step S1: based on the emotion state of the identified person and his EEG signals and the corresponding emotion state, the partial EEG signals of the person to be identified and the corresponding emotion state, feature extraction is performed on the EEG signals of the identified person and the person to be identified, and the EEG sample sets of the identified person and the person to be identified are formed respectively; step S2: calculating the average Fréchet distance between the EEG samples of the identified person and the person to be identified, and using the EEG sample selection algorithm based on the average Fréchet distance to screen Select high-quality EEG samples of the identified person; Step S3: Use the features of the high-quality EEG samples of the identified person obtained after screening as the source domain, and the features of the EEG samples of the person to be identified as the target domain, and use the feature migration algorithm based on the EEG samples to obtain the EEG sample set after the combination of the person to be identified and the identified person; Step S4: Establish an emotion recognition model based on the echo state network, and train the emotion recognition model with the EEG sample set obtained after the migration; Step S5: Use the trained emotion recognition classification model based on the echo state network to recognize the features of the current EEG signal of the person to be identified, and obtain the current emotional state of the person to be identified.
[0011] Technical differences:
[0012] 1. The purpose of calculating the distance is different: the purpose of calculating the distance in the comparative document is to obtain the similarity between the identified and unidentified samples; the purpose of calculating the distance in the present invention is to obtain the domain information of the sample.
[0013] 2. Different conditions for judging high-quality samples: In the comparison document, a threshold is set to judge high-quality samples. The function of this threshold is to judge the degree of similarity between the identified samples and the samples to be identified, so that samples with high similarity are regarded as high-quality samples. Its main purpose is to find samples similar to the samples to be identified in the identified samples; the method for judging the quality of the original samples in the present invention is determined by the label distribution of k samples in the field of the original samples. Its main purpose is to find samples at the junction of samples with different labels.
[0014] 3. The method of generating new samples is different. The signal sample synthesis method used in the comparison document is feature migration. Although this method enables the synthesized samples to retain the characteristics of the original samples, it does not guarantee the distribution of the samples. The present invention uses an amplitude-frequency noise addition technology. While ensuring that the original signal characteristics are not changed, the generated signal has a high similarity with the original sample after resynthesis, and thus can guarantee the distribution of samples to a certain extent, so that the newly synthesized samples can effectively change the sample distribution in the original training set (the idea is that when deep learning is performing classification learning, the sample characteristics at the junction of samples with different labels have a greater impact on the network parameters).
[0015] 4. The defect of the comparison document is that unidentified samples, that is, test data sets, are used when performing sample quality screening and new sample synthesis; however, the present invention does not design unclassified samples (test data sets) when performing sample screening and sample synthesis. Summary of the invention
[0016] The present invention aims to solve the above problems of the prior art. A method for expanding EEG signal samples based on an improved SMOTE algorithm is proposed. The technical solution of the present invention is as follows:
[0017] A method for expanding EEG signal samples based on an improved SMOTE algorithm comprises the following steps:
[0018] Collect EEG signal data using an EEG signal acquisition instrument;
[0019] The EEG signals are preprocessed by methods including bandpass filtering, baseline verification, and normalization. The preprocessed signals form a data set and are divided into a test data set and a training data set;
[0020] The improved synthetic minority oversampling technique (SMOTE) is used to screen samples of the preprocessed EEG signals and use them as original samples. The improved SMOTE algorithm: First, the original SMOTE algorithm uses the traditional Euclidean distance to obtain the domain of the samples, but the Euclidean distance is not suitable for time series samples. Therefore, in order to better obtain the domain information of time series samples, the dynamic time warping algorithm is used to obtain the sample domain information; then, in order to make the distribution of the newly synthesized artificial samples controllable, the samples are divided into three types: safe, danger and noise according to certain conditions, in preparation for the synthesis of artificial samples;
[0021] The amplitude-frequency noise technology is used to synthesize artificial samples based on the original samples, thereby expanding the sample of the data set, and merging the artificial samples with the divided training data set into a new training data set;
[0022] Performance testing using convolutional neural networks.
[0023] Furthermore, the use of an EEG signal acquisition instrument to collect EEG signal data of different subjects specifically includes the following steps: 5 healthy subjects are selected to collect EEG data using the EEG signal acquisition instrument, wherein the EEG signal acquisition instrument has 32 electrode channels, the electrodes are evenly distributed on the brain, the sampling frequency is 1000 Hz, a single sample acquisition cycle lasts 5 seconds, and the data collected in the 1.5 second time period after the 3rd second is selected as the initial sample, wherein each label sample is collected 180 times.
[0024] Furthermore, the preprocessing of the EEG signal specifically includes the following steps: preprocessing the obtained data set, first using a Butterworth filter to perform 8-32Hz bandpass filtering on the EEG signal to remove power frequency interference and most of the electrooculogram artifacts; then selecting the first 0.5 seconds of each signal sample as the baseline signal, and the information in the last 1 second as the sample and performing a baseline calibration on it to obtain a 1-second signal sample after baseline calibration, and finally normalizing it; the preprocessed signals are formed into a data set and divided into a test data set and a training data set in a ratio of 3:7.
[0025] Furthermore, the improved SMOTE algorithm is used to screen samples of the preprocessed EEG signals and use them as original samples, specifically including:
[0026] The EEG signal S n ∈R C×T Using one-dimensional time series S n ={s1,s2,…,s i} to represent, s i represents the signal collected by electrode i; C represents different electrodes, and T represents the EEG signal collected on the electrode;
[0027] S is obtained as follows n The field samples are obtained by n The most recent k samples;
[0028] The original SMOTE algorithm uses the Euclidean distance to calculate the sample distance, and its formula is:
[0029]
[0030] In this algorithm, the input samples are time series samples, so the dynamic time warping algorithm is used to calculate the distance between EEG signal samples, and the formula is:
[0031]
[0032] In the above formula, g i and h j They are two time series samples respectively, and i and j are the sample lengths respectively.
[0033] Furthermore, the method of classifying the samples into three types of safe, danger and noise according to certain conditions specifically includes the following steps:
[0034] To make the synthesized artificial samples similar to the samples at the boundary, it is necessary to classify the samples according to the k neighborhood information of the samples: for sample S, if there are k - n neighborhood samples with different labels from sample S among the k samples, then there are n neighborhood samples with the same label as sample S. Take the ratio of the neighborhood samples with the same label to k as the judgment parameter c; set the interval A = [a1, a2], where 0 < a1 < a2 < 1; if c < a1, then sample S is considered a noise - type sample; if c > a2, then sample S is considered a safe - type sample; if c ∈ A, then sample S is considered a danger - type sample; where the danger - type samples represent the samples at the boundary; repeat the above steps for each sample in the training dataset to obtain the danger - type sample set.
[0035] Furthermore, the amplitude - frequency noise - adding technology is used to synthesize artificial samples based on the original samples, so as to realize the sample expansion of the dataset. The artificial samples and the divided training dataset are combined into a new training dataset, which specifically includes:
[0036] Take the danger - type sample set as the original dataset for sample expansion, and use the amplitude - frequency noise - adding technology to synthesize artificial samples based on the original samples; first, use the STFT algorithm to extract the spectral image of the EEG signal record. Let x(t) represent the time series collected from one electrode of the EEG signal sample x i The STFT of the signal x(t) is defined as follows:
[0037]
[0038] where ω(t - τ) is the window function, and Z(t, f) is a two - dimensional complex matrix containing the amplitude and phase information of x(t) at time t and frequency f; represent the amplitude and phase of each time t and frequency f obtained in Z(t, f) as a t,f , The Gaussian noise is expressed as e ∼ N(μ, σ). Then add the noise to the amplitude, that is The new amplitude and the original phase are reconstructed to obtain the new x(t) in time series; apply this step to each electrode, and finally obtain new samples; if different intensities of noise are added, multiple artificial samples can be synthesized based on one original sample; repeat the above steps for each sample in the original dataset to obtain samples that are 3 - 4 times the sample size of the original artificial - synthesized dataset.
[0039] Furthermore, the performance test using the convolutional neural network specifically includes:
[0040] The new training data set is used as input to pre-train the convolutional neural network. Before training, the parameters in the convolutional neural network are initialized and the data in the training data set are sent to the network for iterative training. The convolutional neural network updates the parameters according to the training data until the classification accuracy during training reaches the requirement, then the training is stopped and the network parameters are saved.
[0041] Furthermore, the method further includes the step of obtaining the classification accuracy of the EEG signal, specifically:
[0042] The test data set is used as the input of the pre-trained convolutional neural network, and the output value is compared with the label of the test data set to obtain the classification accuracy of the EEG signal.
[0043] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements any one of the methods for expanding electroencephalogram (EEG) signal samples based on an improved SMOTE algorithm.
[0044] A method for expanding EEG signal samples based on an improved SMOTE algorithm, comprising:
[0045] Acquisition module: used to collect EEG signal data using an EEG signal acquisition instrument;
[0046] Preprocessing module: used to preprocess EEG signals using methods including bandpass filtering, baseline verification, and normalization. The preprocessed signals form a data set and are divided into a test data set and a training data set;
[0047] Sample screening and classification module: used to use the improved SMOTE algorithm to screen samples of the preprocessed EEG signals and use them as original samples. The improved SMOTE algorithm: First, the original SMOTE algorithm uses the traditional Euclidean distance to obtain the domain of the samples, but the Euclidean distance is not suitable for time series samples. Therefore, in order to better obtain the domain information of time series samples, the dynamic time warping algorithm is used to obtain the sample domain information; then, in order to make the distribution of the newly synthesized artificial samples controllable, the samples are divided into three types: safe, danger and noise according to certain conditions, in preparation for the synthesis of artificial samples;
[0048] Sample expansion module: Use amplitude-frequency noise addition technology to synthesize artificial samples based on the original samples, thereby expanding the sample of the data set, and merging the artificial samples with the divided training data set into a new training data set;
[0049] Testing module: used to perform performance testing using convolutional neural networks.
[0050] Comparison module: It is used to use the test data set as the input of the pre-trained convolutional neural network, compare the output value with the label of the test data set, and obtain the classification accuracy of the EEG signal.
[0051] The advantages and beneficial effects of the present invention are as follows:
[0052] The present invention improves the traditional SMOTE method and uses DTW to replace the Euclidean distance algorithm in the KNN domain extraction algorithm (Euclidean distance is used to extract the domain of samples (mostly applied to one-dimensional samples), and EEG signals are multi-channel time series signals (the original data is two-dimensional data matrix data), and the use of Euclidean distance to calculate the domain is not applicable, so a method that is more suitable for representing time series distances is used for reconstruction, using DTW. The main application area of SMOTE is not on time series signals.), for EEG signals of multi-channel time series signals, it can more accurately reflect the relationship between samples, thereby more accurately obtaining the domain information of EEG signal samples. The samples are judged using the domain sample information, and the samples are divided into three categories: danger, safe, and noise, where noise is regarded as a noise sample, safety is regarded as an irrelevant sample, and danger is regarded as a boundary sample. For deep learning, in order to achieve better predictions, most classification algorithms try to learn the boundaries of each class as accurately as possible during the training process. Therefore, data enhancement of boundary samples can effectively change the sample distribution, thereby improving the generalization ability of deep learning models. At the same time, the new samples are synthesized using an amplitude-frequency noise method, which can ensure that the amplitude and phase in the samples are not destroyed when the new samples are effectively synthesized, and also ensure the integrity of the time-frequency domain information contained in the signal, and to a certain extent improve the robustness of the deep learning model. The present invention can effectively expand the number of samples in the EEG signal data set while ensuring the quality of the synthesized samples, thereby improving the accuracy of feature extraction and classification of EEG signals based on deep learning methods at the data level.
[0053] Innovation:
[0054] 1. The original SMOTE algorithm uses Euclidean distance to find the domain of samples (mostly used for one-dimensional samples), but EEG signals are multi-channel time series signals (the original data is two-dimensional data matrix data), and the direct use of Euclidean distance cannot accurately and truly represent the domain information. Therefore, a method more suitable for representing time series distance is used for reconstruction, using DTW. The original SMOTE algorithm is suitable for unbalanced data sets, while EEG signal data does not belong to the category of unbalanced data sets. In other words, the domain of the original SMOTE algorithm does not include EEG signal sample expansion.
[0055] 2. The original SMOTE algorithm directly synthesizes samples. This synthesis method easily causes sample overlap and chaotic sample distribution. When deep learning is used for classification learning, the sample characteristics at the junction of samples with different labels have a greater impact on the network parameters. Therefore, the sample selection conditions are increased, and the samples at the junction of samples with different labels are screened out as raw data for artificial synthesis, thereby increasing the number of samples at the junction and changing the distribution of samples as a whole to make it suitable for deep learning methods.
[0056] 3. The original SMOTE method directly takes a point on the path of two samples with the same label as a new sample. This new sample synthesis technology is completely unsuitable for EEG signals. This method will change the time domain and frequency domain information and features contained in the original signal. In order to ensure that the newly synthesized sample is different from the original sample and retain its characteristics, the amplitude-frequency noise method is used for sample synthesis. The current sample expansion method is inspired by data enhancement in image recognition, mainly slicing, time domain exchange and other methods, and some directly add noise to the original sample. However, although the above method is simple to generate new samples, it will destroy the features contained in the original signal for time series signal samples. In order to ensure that the newly synthesized sample is not destroyed and the generated sample is different from the original sample, the amplitude-frequency noise method is used. This method can meet the above requirements to the greatest extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 The present invention provides a flowchart of a method for expanding EEG signal samples based on an improved SMOTE algorithm in a preferred embodiment. DETAILED DESCRIPTION
[0058] The following will describe the technical solutions in the embodiments of the present invention in detail in conjunction with the accompanying drawings in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention.
[0059] The technical solution of the present invention to solve the above technical problems is:
[0060] The present invention proposes an EEG signal sample expansion method based on an improved SMOTE algorithm, which effectively selects samples and generates new samples based on the original sample set. The purpose of the present invention is to improve the SMOTE method, select samples preferentially, screen high-quality samples based on the training data set and expand them, effectively solve the problem of small number of EEG signal data sets and low quality of new samples generated by traditional EEG sample expansion methods, and change the sample distribution of the original data set to a certain extent, which is conducive to improving the model learning effect of machine learning and deep learning. The expanded training data set can effectively improve the generalization ability of the deep learning model and thus improve the classification accuracy.
[0061] The technical solution of the present invention is: Figure 1 As shown, a method for expanding EEG signal samples based on an improved SMOTE algorithm comprises the following steps: (1) using an EEG signal acquisition instrument to collect EEG signal data of different subjects: 5 healthy subjects are selected to use an EEG signal acquisition instrument to collect EEG data, wherein the electrodes of the EEG signal acquisition instrument are placed according to the international 10-20 standard, the sampling frequency is 1000 Hz, and the sampling channel is 32. The acquisition process is as follows: the subject wears an electrode cap with electrodes installed and sits on a chair to relax, and the technician applies conductive paste; the subject observes the image on the screen and performs left and right hand movement imagination training, which lasts for a period of time, and the data collected at this time is not used as experimental data; after the subject is fully prepared, the formal acquisition process begins, and the acquisition cycle of each data is 5 seconds, wherein the first 2 seconds are rest time, and the picture (left hand imagination and right hand imagination) that the subject needs to imagine is displayed on the monitor at the beginning of the 3rd second, and a collection cycle ends at the end of the 5th second. Among the data collected between the beginning of the 3rd second and the end of the 5th second, a stable 1-second signal is selected as a sample. The left hand movement imagination label and the right hand imagination label samples are collected 180 times.
[0062] (2) EEG signals contain various noises and electromyographic artifacts. The present invention uses the following method to preprocess EEG signals. First, the Butterworth filter is used to perform 8-32Hz bandpass filtering on the EEG signals, which can effectively remove power frequency interference and most electrooculographic artifacts. Then, the first 0.5 seconds of each signal sample is selected as the baseline signal, and the information in the last 1 second is used as the sample and baseline calibration is performed on it to obtain a 1-second signal sample after baseline calibration, and finally it is normalized. The preprocessed signals are formed into a data set and divided into a test data set and a training data set in a ratio of 3:7.
[0063] (3) Use the improved SMOTE method to find the domain of the preprocessed EEG signal training data set. First, the EEG signal S n ∈R C×T (C represents different electrodes, T represents the EEG signals collected on the electrodes) using a one-dimensional time series S n ={s1,s2,…,s i}(s i represents the signal collected by electrode i); then the dynamic time warping (DTW) algorithm is used to calculate the distance between EEG signal samples, and then S is calculated as follows: n The field samples are obtained by n The most recent k samples.
[0064]
[0065] In the above formula, g (with sample length i) and h (with sample length j) are two time-series samples.
[0066] (4) Most classification algorithms attempt to accurately learn the boundaries of each class during the training process. Therefore, in order to make the synthesized artificial samples similar to the samples on the boundary, it is necessary to classify the samples according to the k-neighborhood information of the samples: taking the sample S as an example, among the k samples, the neighborhood samples with different labels from the sample S are k - n, and the neighborhood samples with the same label as the sample S are n. The ratio of the neighborhood samples with the same label to k is used as the judgment parameter c; set the interval A = [a1, a2] (where 0 < a1 < a2 < 1); if c < a1, then the sample S is considered a noise-class sample; if c > a2, then the sample S is considered a safe-class sample; if c ∈ A, then the sample S is considered a danger-class sample. Among them, the danger-class samples represent the samples on the boundary. Repeat step (3) and step (4) for each sample in the training dataset to obtain the danger-class sample set.
[0067] (5) Use the danger-class sample set as the original dataset for sample augmentation, and use the amplitude-frequency noise addition technique to synthesize artificial samples based on the original samples. First, use the STFT algorithm to extract the spectral image of the EEG signal record, and represent x(t) as the time series collected from an electrode of the EEG signal sample x i The STFT of the signal x(t) is defined as follows:
[0068]
[0069] where ω(t - τ) is the window function, and Z(t, f) is a two-dimensional complex matrix containing the amplitude and phase information of x(t) at time t and frequency f. Represent the amplitude and phase of each time t and frequency f obtained in Z(t, f) as a t,f , The Gaussian noise is represented as e ∼ N(μ, σ), and then the noise is added to the amplitude, that is The new amplitude and the original phase are reconstructed to obtain the new time-series x(t). Apply this step to each electrode, and finally obtain new samples. If different intensities of noise are added, multiple artificial samples can be synthesized based on one original sample. Repeat the operation in step (5) for each sample in the original dataset, and at most 3 - 4 times the sample size of the original dataset can be artificially synthesized.
[0070] (6) The new training data set is used as input to pre-train the convolutional neural network. Before training, the parameters in the convolutional neural network are initialized and the data in the training data set are sent to the network for iterative training. The convolutional neural network updates the parameters according to the training data until the classification accuracy meets the requirements during training. Then the training is stopped and the network parameters are saved.
[0071] (7) Finally, the test data set is used as the input of the pre-trained convolutional neural network, and the output value is compared with the label of the test data set to obtain the classification accuracy of the EEG signal.
[0072] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0073] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0074] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0075] The above embodiments should be understood to be only used to illustrate the present invention and not to limit the protection scope of the present invention. After reading the contents of the present invention, technicians can make various changes or modifications to the present invention, and these equivalent changes and modifications also fall within the scope defined by the claims of the present invention.
Claims
1. A method for expanding EEG signal samples based on an improved SMOTE algorithm, characterized in that: It includes the following steps: Collect electroencephalogram (EEG) signal data using an EEG signal acquisition instrument; Preprocess the EEG signals using methods including band-pass filtering, baseline calibration, and normalization. The preprocessed signals form a dataset and are divided into a test dataset and a training dataset; Use the improved Synthetic Minority Over-sampling Technique (SMOTE) to screen the preprocessed EEG signals as the original samples. The improved SMOTE algorithm: First, the original SMOTE algorithm uses the traditional Euclidean distance to calculate the neighborhood of samples. However, the Euclidean distance is not applicable to time series samples. Therefore, in order to better obtain the neighborhood information of time series samples, the Dynamic Time Warping (DTW) algorithm is used to calculate the neighborhood information of samples. Then, in order to make the distribution of the newly synthesized artificial samples controllable, the samples are divided into three types: safe, danger, and noise according to certain conditions to prepare for the synthesis of artificial samples; Use the amplitude-frequency noise addition technique to synthesize artificial samples based on the original samples, thereby realizing the sample expansion of the dataset. The artificial samples are combined with the divided training dataset to form a new training dataset; Use a convolutional neural network for performance testing; The use of the improved SMOTE algorithm to screen the preprocessed EEG signals as the original samples specifically includes: The EEG signal S n ∈R C×T Using one-dimensional time series S n ={s1,s2,…,s i } to represent, s i represents the signal collected by electrode i; C represents different electrodes, and T represents the EEG signal collected on the electrode; S is obtained in the following way n The field samples are obtained by n The most recent k samples; In the original SMOTE algorithm, the Euclidean distance is used to calculate the sample distance, and its formula is: In this algorithm, the input samples are time series samples. Therefore, the DTW algorithm is used to calculate the distance between EEG signal samples, and its formula is: In the above formula, g i and h j are two time series samples, i and j are sample lengths respectively; The division of the samples into three types: safe, danger, and noise according to certain conditions specifically includes the following steps: In order to make the synthesized artificial samples similar to the samples at the boundary, it is necessary to classify the samples according to the k-neighborhood information of the samples. For sample S, if there are k-n neighborhood samples with different labels from sample S among the k samples, then there are n neighborhood samples with the same label as sample S. The ratio of the neighborhood samples with the same label to k is used as the judgment parameter c. Set the interval A = [a1, a2], where 0 < a1 < a2 < 1. If c < a1, then sample S is considered a noise-type sample; if c > a2, then sample S is considered a safe-type sample; if c ∈ A, then sample S is considered a danger-type sample. Among them, the danger-type samples represent the samples at the boundary. Repeat the above steps for each sample in the training dataset to obtain the danger-type sample set; The use of the amplitude-frequency noise addition technique to synthesize artificial samples based on the original samples, thereby realizing the sample expansion of the dataset. The artificial samples are combined with the divided training dataset to form a new training dataset specifically includes: The danger sample set is used as the original data set for sample expansion, and the amplitude-frequency noise technology is used to synthesize artificial samples based on the original samples. The STFT algorithm is first used to extract the spectrum image of the EEG signal recording, and x(t) is represented as the spectrum image obtained from the EEG signal sample x i The STFT of the signal x(t) is defined as follows: Where ω(t-τ) is the window function, Z(t,f) is a two-dimensional complex matrix containing the amplitude and phase information of x(t) at time t and frequency f; the amplitude and phase of each time t and frequency f obtained in Z(t,f) are represented as a t,f , Gaussian noise is represented as e~N(μ,σ), and then the noise is added to the amplitude, that is, The new amplitude With the original phase Reconstruct the new time series x(t); apply this step to each electrode to finally obtain a new sample; if noise of different intensities is added, multiple artificial samples can be synthesized based on an original sample; repeat the above steps for each sample in the original data set to obtain artificially synthesized samples that are 3-4 times the sample size of the original data set.
2. The method for expanding EEG signal samples based on the improved SMOTE algorithm according to claim 1, characterized in that: The method of using an EEG signal acquisition instrument to collect EEG signal data of different subjects specifically includes the following steps: selecting 5 healthy subjects and using the EEG signal acquisition instrument to collect EEG data, wherein the EEG signal acquisition instrument has 32 electrode channels, the electrodes are evenly distributed on the brain, the sampling frequency is 1000 Hz, a single sample acquisition cycle lasts 5 seconds, and the data collected in the 1.5 second time period after the 3rd second is selected as the initial sample, wherein each label sample is collected 180 times.
3. The method for expanding EEG signal samples based on the improved SMOTE algorithm according to claim 1, characterized in that: The preprocessing of the EEG signal specifically includes the following steps: preprocessing the obtained data set, first using a Butterworth filter to perform 8-32Hz bandpass filtering on the EEG signal to remove power frequency interference and most of the electrooculogram artifacts; then selecting the first 0.5 seconds of each signal sample as the baseline signal, and the information in the last 1 second as the sample and performing a baseline calibration on it to obtain a 1-second signal sample after baseline calibration, and finally normalizing it; the preprocessed signals are formed into a data set and divided into a test data set and a training data set in a ratio of 3:
7.
4. The method for expanding EEG signal samples based on the improved SMOTE algorithm according to claim 1, characterized in that: The performance test using the convolutional neural network specifically includes: The new training data set is used as input to pre-train the convolutional neural network. Before training, the parameters in the convolutional neural network are initialized and the data in the training data set are sent to the network for iterative training. The convolutional neural network updates the parameters according to the training data until the classification accuracy during training reaches the requirement, then the training is stopped and the network parameters are saved.
5. The method for expanding EEG signal samples based on the improved SMOTE algorithm according to claim 4, characterized in that: The method also includes the steps of obtaining the classification accuracy of the EEG signal, specifically: The test data set is used as the input of the pre-trained convolutional neural network, and the output value is compared with the label of the test data set to obtain the classification accuracy of the EEG signal.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for expanding EEG signal samples based on the improved SMOTE algorithm as described in any one of claims 1 to 5 is implemented.
7. A device for executing the method according to any one of claims 1 to 5, comprising the following steps: Acquisition module: used to collect EEG signal data using an EEG signal acquisition instrument; Preprocessing module: used to preprocess EEG signals using methods including bandpass filtering, baseline verification, and normalization. The preprocessed signals form a data set and are divided into a test data set and a training data set; Sample screening and classification module: used to use the improved SMOTE algorithm to screen samples of the preprocessed EEG signals and use them as original samples. The improved SMOTE algorithm: First, the original SMOTE algorithm uses the traditional Euclidean distance to obtain the domain of the samples, but the Euclidean distance is not suitable for time series samples. Therefore, in order to better obtain the domain information of time series samples, the dynamic time warping algorithm is used to obtain the sample domain information; then, in order to make the distribution of the newly synthesized artificial samples controllable, the samples are divided into three types: safe, danger and noise according to certain conditions, in preparation for the synthesis of artificial samples; Sample expansion module: Use amplitude-frequency noise addition technology to synthesize artificial samples based on the original samples, thereby expanding the sample of the data set, and merging the artificial samples with the divided training data set into a new training data set; Testing module: used to perform performance testing using convolutional neural networks; Comparison module: It is used to use the test data set as the input of the pre-trained convolutional neural network, compare the output value with the label of the test data set, and obtain the classification accuracy of the EEG signal.
Citation Information
Patent Citations
Emotion recognition method based on expanded high-quality electroencephalogram sample
CN112084935A
Electroencephalogram signal feature extraction and classification method of combining DAE (denoising auto encoder) and CNN (convolutional neural network)
CN107844755A
Data enhancement method and system for electroencephalogram signal classification and recognition
CN112545532A
System and method for smart, secure, energy-efficient IoT sensors
WO2019140047A1
GPDC graph convolutional neural network-based fatigue detection method, apparatus, and storage medium
WO2021237918A1
