Signal identification method, electronic device, storage medium and computer program product
By preprocessing the frequency characteristics and extracting the features of EEG signals and combining them with the signal recognition model, the problem of insufficient recognition and classification accuracy in SSVEP signal processing is solved, and higher EEG signal recognition and classification accuracy is achieved.
Patent Information
- Application Number
- CN202510722293.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-10-03
AI Technical Summary
Existing SSVEP signal processing methods have deficiencies in recognition and classification accuracy, resulting in low accuracy in EEG signal recognition and classification.
By acquiring the original EEG signal, preprocessing is performed based on frequency characteristics, including scaling, baseline drift correction, filtering, and window truncation to remove noise interference. Feature extraction and signal recognition models are then used for identification, and a feature matrix and training data set are constructed. The signal recognition model is then used for identification and classification.
It effectively eliminates irrelevant frequency interference in EEG signals, improves the accuracy of signal recognition and classification, and improves the effect of signal recognition.
Smart Images

Figure CN120744595A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of brain-computer interfaces, and in particular to a signal recognition method, electronic equipment, storage medium, and computer program product. Background Art
[0002] With the rapid development of brain-computer interface (BCI) technology, Steady-State Visual Evoked Potential (SSVEP), a non-invasive BCI paradigm, has garnered widespread attention due to its high information transmission rate and superior user experience. SSVEP is a synchronized, periodic EEG activity generated in the cerebral cortex when the human eye is stimulated by flickering lights of varying frequencies. This EEG activity can be captured by non-invasive devices such as EEG caps and then decoded through signal processing and pattern recognition techniques, enabling the transmission of human intent or the control of external devices.
[0003] However, due to the complexity of brain activity and individual differences, current SSVEP signal processing methods have limited effect on improving the quality of SSVEP signals, resulting in low accuracy in identifying and classifying SSVEP signals.
[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0005] The embodiments of the present invention provide a signal recognition method, electronic device, storage medium and computer program product to at least solve the technical problem of low accuracy in recognition and classification of EEG signals in related technologies.
[0006] According to one aspect of an embodiment of the present invention, a signal recognition method is provided, comprising: obtaining an original EEG signal of a test subject; preprocessing the original EEG signal based on the frequency characteristics of the original EEG signal to obtain a target EEG signal, wherein the frequency characteristics are used to characterize the distribution and intensity of the frequency components of the original EEG signal; extracting features from the target EEG signal to obtain signal features of the target EEG signal; inputting the signal features into a signal recognition model, and using the signal recognition model to recognize the target EEG signal to obtain a signal recognition result, wherein the signal recognition result is used to characterize the behavioral intention of the test subject.
[0007] Furthermore, the original EEG signal is preprocessed based on its frequency characteristics to obtain a target EEG signal, including: scaling the original EEG signal based on a preset proportional factor to obtain a scaled EEG signal; performing baseline drift correction on the scaled EEG signal to obtain a corrected EEG signal; filtering the corrected EEG signal based on its frequency characteristics to obtain a filtered EEG signal; and windowing the filtered EEG signal to obtain a target EEG signal.
[0008] Furthermore, the method also includes: obtaining the full-scale voltage, maximum digital count and amplification factor of a preset converter, wherein the preset converter is used to convert the original EEG signal from an analog signal to a digital signal; obtaining a first quotient value based on the quotient of the full-scale voltage and the maximum digital count; and obtaining a preset proportional factor based on the quotient of the first quotient value and the amplification factor.
[0009] Furthermore, the scaled EEG signal is corrected for baseline drift to obtain a corrected EEG signal, including: detecting the scaled EEG signal, determining the signal to be corrected from the scaled EEG signal, wherein the signal to be corrected is used to characterize the area where the baseline drift occurs in the scaled EEG signal; performing feature extraction on the signal to be corrected to obtain signal characteristics of the signal to be corrected; based on the signal characteristics, selecting a target correction method from a correction method library, wherein the target correction method removes the baseline drift occurring in the scaled EEG signal; and correcting the scaled EEG signal based on the target correction method to obtain a corrected EEG signal.
[0010] Furthermore, the scaled EEG signal is corrected based on the target correction method to obtain a corrected EEG signal, including: in response to the target correction method being a preset correction method, obtaining the signal sampling frequency and expected smoothness of the scaled EEG signal; constructing a moving average window based on the signal sampling frequency and the expected smoothness; and correcting the scaled EEG signal based on the moving average window to obtain a corrected EEG signal.
[0011] Furthermore, the corrected EEG signal is filtered based on the frequency characteristics to obtain a filtered EEG signal, including: filtering the corrected EEG signal based on a target notch filter to obtain an initial filtered signal; filtering the initial filtered signal based on a target bandpass filter to obtain a filtered EEG signal.
[0012] Furthermore, the method also includes: obtaining the noise frequency of the power frequency noise corresponding to the original EEG signal; constructing a quality factor based on the noise frequency and the preset filter stopband width; constructing a notch filter coefficient based on the quality factor and the noise frequency; and adjusting the initial notch filter based on the notch filter coefficient to obtain a target notch filter.
[0013] Furthermore, the method also includes: analyzing the signal frequency of the original EEG signal to obtain the signal frequency characteristics; selecting an initial band-pass filter from a band-pass filter library based on the signal frequency characteristics; determining the cutoff frequency of the initial band-pass filter based on the signal frequency characteristics; and adjusting the initial band-pass filter based on the cutoff frequency to obtain a target band-pass filter.
[0014] Furthermore, the filtered EEG signal is window-truncated to obtain a target EEG signal, including: obtaining a signal length and a sampling rate corresponding to the filtered EEG signal; determining a truncation length of the filtered EEG signal based on the signal length and the sampling rate; and truncating the filtered EEG signal based on the truncation length to obtain a target EEG signal.
[0015] Furthermore, feature extraction is performed on the target EEG signal to obtain signal features of the target EEG signal, including: segmenting the target EEG signal to obtain multiple segmented EEG signals, wherein different segmented EEG signals are located in different frequency bands; performing correlation detection on the multiple segmented EEG signals with preset reference signals to obtain multiple correlation coefficients, wherein the correlation coefficients are used to reflect the similarity between different segmented EEG signals and the preset reference signal; and constructing signal features based on the multiple correlation coefficients.
[0016] Furthermore, the method also includes: constructing at least one feature matrix based on the eigenvalues of the signal features; fusing at least one feature matrix to obtain a feature representation of the signal features; constructing a training data set based on the feature representation, wherein the training data set includes: training samples, verification samples and test samples, and the size of the training samples matches the feature representation; training the initial recognition model based on the training samples, verification samples and test samples to obtain a signal recognition model.
[0017] Furthermore, the signal recognition model includes at least: a feature extraction module and a signal classification module; inputting the signal features into the signal recognition model, using the signal recognition model to recognize the target EEG signal, and obtaining a signal recognition result, including: processing the signal features based on the signal recognition model to obtain at least one initial recognition result; obtaining the extraction identifier of the feature extraction module and the classification identifier of the signal classification module; voting on at least one initial recognition result based on the extraction identifier and the classification identifier to obtain at least one voting result; and selecting a signal recognition result from at least one initial recognition result based on at least one voting result.
[0018] According to another aspect of an embodiment of the present invention, a signal recognition device is also provided, including: a signal acquisition module for acquiring the original EEG signal of a test subject; a signal processing module for preprocessing the original EEG signal based on the frequency characteristics of the original EEG signal to obtain a target EEG signal, wherein the frequency characteristics are used to characterize the distribution and intensity of the frequency components of the original EEG signal; a feature extraction module for extracting features from the target EEG signal to obtain signal features of the target EEG signal; a signal recognition module for inputting the signal features into a signal recognition model, and using the signal recognition model to recognize the target EEG signal to obtain a signal recognition result, wherein the signal recognition result is used to characterize the behavioral intention of the test subject.
[0019] According to another aspect of an embodiment of the present invention, an electronic device is provided, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods of various embodiments of the present invention when running.
[0020] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.
[0021] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0022] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0023] According to another aspect of the embodiments of the present invention, a computer program is provided. When the computer program is executed by a processor, the methods in various embodiments of the present invention are implemented.
[0024] In an embodiment of the present invention, the original EEG signal of the test object is obtained; the original EEG signal is preprocessed based on the frequency characteristics of the original EEG signal to obtain a target EEG signal; the target EEG signal is feature extracted to obtain the signal characteristics of the target EEG signal; the signal characteristics are input into a signal recognition model, and the target EEG signal is recognized by using the signal recognition model to obtain a signal recognition result. The original EEG signal is preprocessed to eliminate the interference of irrelevant frequency signals, and on the basis of the preprocessing, the original EEG signal is feature extracted to extract the signal characteristics in the original EEG signal that are more relevant to the signal recognition task. Subsequently, the signal characteristics are input into the signal recognition model to identify and classify the preprocessed signal characteristics to obtain the target recognition result, thereby achieving the purpose of eliminating the interference of irrelevant frequency signals in the EEG signal, thereby realizing the technical effect of improving the accuracy of recognition and classification of EEG signals, and further solving the technical problem of low accuracy of recognition and classification of EEG signals in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0026] Figure 1 is a flow chart of a signal recognition method according to an embodiment of the present invention;
[0027] Figure 2 is a flowchart of an optional raw EEG signal preprocessing according to an embodiment of the present invention;
[0028] Figure 3 is a schematic diagram of an optional EEG decoding model according to an embodiment of the present invention;
[0029] Figure 4 is a schematic diagram of an optional voting mechanism according to an embodiment of the present invention;
[0030] Figure 5 is a schematic diagram of an optional signal recognition method according to an embodiment of the present invention;
[0031] Figure 6 is a schematic diagram of a signal recognition device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] According to an embodiment of the present invention, an embodiment of a signal recognition method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0035] Figure 1 is a flow chart of a signal recognition method according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps:
[0036] Step S102: obtaining the original EEG signal of the test subject.
[0037] The test subjects can be volunteers or patients participating in the experiment. They can wear EEG data acquisition equipment, such as an EEG cap, which is typically equipped with multiple electrodes to record electrophysiological activity in the cerebral cortex. The test subjects can perform cognitive or physiological activities in accordance with the experimental requirements, such as looking at flickering stimuli on a screen, performing pre-set thinking tasks, or remaining quiet, in order to collect EEG data related to these activities.
[0038] The above-mentioned raw EEG signals can be unprocessed brain electrical activity data obtained directly from the EEG acquisition device. The above-mentioned activity data are tiny voltage changes captured by electrodes on the scalp, reflecting the electrophysiological activity of the brain's neuron groups. The above-mentioned raw signals usually contain the original waveform of EEG activity, but due to the complexity of brain activity and interference from the external environment, the above-mentioned raw EEG signals may be mixed with noise, muscle activity signals, heartbeat signals, eye movement signals and other artifacts.
[0039] In an optional embodiment, an EEG cap can be used as a brain-computer acquisition device. After the above-mentioned test subject wears the EEG cap correctly, the staff can connect the EEG cap to a signal recognition system (hereinafter referred to as the recognition system) by wired or wireless means. Before collecting the signal, the above-mentioned recognition system can be calibrated first to check whether the contact quality between the electrode and the scalp is good, and whether the device parameters such as sampling rate, gain and filter settings are properly set. Once the above-mentioned equipment is ready, the test subject can start to perform the experimental task. During this process, the EEG cap can continuously collect the EEG signals of the above-mentioned test subject and import them into the recognition system, so that the recognition system can accurately obtain the EEG signals of the test subject, which are the above-mentioned original electrical signals.
[0040] In another optional embodiment, the above-mentioned test subject can use an encrypted transmission method or a secure cloud storage service to upload the pre-collected raw EEG signals to a pre-built database. The recognition system can extract the encrypted data file provided by the test subject from the above-mentioned database and decrypt it. Subsequently, the recognition system can check whether the data format of the raw EEG signal uploaded by the test subject meets the requirements of the recognition system. If the format does not match, the recognition system needs to first convert the format of the raw EEG signal data with unmatched format and then store it locally. If the format matches, the recognition system can directly store the above-mentioned raw EEG signal locally for subsequent EEG signal recognition and classification.
[0041] It should be noted that the above-mentioned raw EEG signal collection and recognition process complies with relevant laws, regulations and ethical principles. During the above process, the privacy of the test subjects will be effectively protected.
[0042] Step S104 , preprocessing the original EEG signal based on the frequency characteristics of the original EEG signal to obtain a target EEG signal, wherein the frequency characteristics are used to characterize the distribution and intensity of the frequency components of the original EEG signal.
[0043] The above-mentioned frequency characteristics may refer to the distribution of different frequency components in the EEG signal and the characteristics of their respective intensities, which are used to help the recognition system analyze different patterns and states of brain activity.
[0044] In an optional embodiment, considering that the above-mentioned original EEG signal contains a large amount of noise, this noise may come from the external environment, such as electromagnetic interference, power supply noise, etc., or it may come from the inside of the atomic body, such as muscle activity, heartbeat, eye movement, etc. The above-mentioned noise will reduce the signal-to-noise ratio of the signal, thereby affecting the accuracy of subsequent analysis by the recognition system. Therefore, in order to improve the recognition effect of the recognition system, the recognition system can first use notch filters, low-pass filters and other equipment to denoise the above-mentioned original EEG signal. Then, the recognition system can limit the frequency of the original EEG signal to the required range through band-pass filtering based on the frequency characteristics of the above-mentioned original EEG signal, that is, the distribution and intensity of the frequency components of the above-mentioned original EEG signal, so that the recognition system can extract the EEG signal corresponding to the required signal frequency from the denoised original EEG signal. After completing the above-mentioned band-pass filtering, the recognition system can segment and standardize the extracted EEG signal to obtain the above-mentioned target EEG signal.
[0045] In another optional embodiment, in order to enhance the processing effect of the preprocessing process on the non-stationary signal in the above-mentioned original EEG signal, the recognition system can use continuous wavelet transform (CWT) to process the above-mentioned original EEG signal. Specifically, based on the frequency characteristics of the above-mentioned original EEG signal, the recognition system can convert the original EEG signal from a single time dimension into a two-dimensional time-frequency dimension. In this process, each wavelet coefficient corresponds to the signal intensity at a fixed time and frequency. Subsequently, the recognition system can perform threshold denoising on the original EEG signal after CWT processing according to the amplitude of the above-mentioned wavelet coefficient, and remove the lower energy part. This step can accurately screen out the signal components that are closely related to the frequency required for subsequent recognition and classification, and retain the key information of the original EEG signal. Finally, the recognition system can return the original EEG signal after threshold denoising to the time domain through inverse wavelet transform, so as to obtain the above-mentioned target EEG signal by reconstruction, so as to achieve purification and feature enhancement of the original EEG signal.
[0046] In another optional embodiment, in order to ensure the integrity of the frequency characteristics of the above-mentioned original EEG signal as much as possible and to improve the subsequent recognition accuracy of the original EEG signal, the recognition system can also use adaptive filtering technology to implement denoising processing of the original EEG signal. Specifically, the recognition system can first identify and separate the noise components in the signal, and then the recognition system can use adaptive filtering technology, such as Least Mean Squares (LMS) or adaptive noise suppression algorithm, to process the random noise in the signal to obtain the above-mentioned target EEG signal. Adaptive filtering technology can adjust the filtering parameters according to the frequency characteristics of the original EEG signal to ensure effective noise suppression while retaining the original frequency characteristics of the original EEG signal as much as possible.
[0047] Step S106: extract features of the target EEG signal to obtain signal features of the target EEG signal.
[0048] The signal features may be features that can effectively distinguish different brain states or activity patterns. For example, the signal features may be time domain features, frequency domain features, statistical features, and spatial features of the target EEG signal, but are not limited thereto.
[0049] In an optional embodiment, considering that the above-mentioned target EEG signal is essentially nonlinear, time-varying and highly complex, and the signal contains a large amount of subtle information related to various brain functions, by performing feature extraction on the above-mentioned target EEG signal, information useful for signal recognition can be separated from this complex mixed signal, thereby improving the clarity and signal-to-noise ratio of the target EEG signal. Therefore, after the above-mentioned original EEG signal has been preprocessed and the target EEG signal is obtained, the recognition system can use methods such as fast Fourier transform, wavelet transform, power spectral density calculation, etc. to analyze the energy distribution of the target EEG signal at different frequencies to extract frequency domain features such as the frequency response intensity of the above-mentioned target EEG signal. At the same time, the recognition system can also calculate the mean, variance, zero-crossing rate, etc. of the above-mentioned target EEG signal to extract the time domain features of the above-mentioned target EEG signal, and can further apply methods such as independent component analysis, principal component analysis or canonical correlation analysis to analyze the spatial distribution of the above-mentioned target EEG signal to extract the coherence features of the above-mentioned target EEG signal. Then, the recognition system can construct a feature set based on the extracted multiple feature information, and can select features from the feature set that can better characterize signal characteristics and distinguish different states through methods such as correlation analysis, principal component analysis or recursive feature elimination. Finally, the recognition system can reduce the dimension and fuse the selected features to obtain the signal characteristics of the target EEG signal.
[0050] For example, the target EEG signal can be an SSVEP signal. The recognition system can obtain the signal characteristics of the SSVEP signal in the following manner: Based on the characteristic of a certain degree of coherence between the SSVEP signal and the stimulation signal, the recognition system can calculate the correlation coefficient or coherence coefficient between the SSVEP signal and the stimulation signal to obtain the signal's coherence characteristics. The system can then identify the stimulation frequency of the signal based on the magnitude or direction of the coherence characteristics. Subsequently, the recognition system can filter the SSVEP signal using a filter bank, i.e., using a set of different bandpass filters to filter each signal separately to obtain multiple filtered signals. This extracts the characteristics of the SSVEP signal in different frequency bands, enhances the signal's frequency resolution, reduces the signal's dimensionality, and reduces the computational complexity. To extract the similarity between the signal and the reference signal, enhance the signal's classification capability, improve the signal-to-noise ratio, and increase the recognition rate, the recognition system can perform canonical correlation analysis on the filtering results of each group. i.e., using the CCA (Canonical Correlation Analysis) method, the system calculates the correlation between each filtered signal and a preset reference signal, obtaining the correlation coefficient as a characteristic value. Finally, in order to comprehensively utilize the characteristics of different frequency bands, enhance the robustness of the signal, improve the accuracy of the signal, and optimize the expression of the signal, the recognition system can combine the eigenvalues of all groups to obtain a feature matrix as the result of feature extraction. The result is the signal feature of the above-mentioned SSVEP signal.
[0051] In another optional embodiment, in order to improve the accuracy of feature extraction, the recognition system can also use a pre-trained deep learning model to extract features from the target EEG signal. For example, the above-mentioned deep learning model can be a convolutional neural network model or a recursive neural network model, but is not limited to this. During the training phase, the above-mentioned deep learning model has learned how to identify and extract complex features related to preset brain states or activities from the original signal. The recognition system can first normalize the above-mentioned target EEG signal, thereby constructing the above-mentioned target EEG signal into a form suitable for deep learning model input. Subsequently, the recognition system can input the normalized target EEG signal into the above-mentioned deep learning model, and the model can execute its internally designed feature extraction process. The above-mentioned extraction process can include multi-layer convolution, pooling and full connection operations. After completing the above-mentioned operations, the model can output the signal characteristics of the above-mentioned target EEG signal.
[0052] In another optional embodiment, the recognition system can also apply the empirical mode decomposition (EMD) algorithm to decompose the above-mentioned target EEG data to obtain a series of intrinsic mode functions (IMFs). After completing the above decomposition, the recognition system can apply fast Fourier transform or wavelet transform to each IMF to obtain frequency distribution characteristics, or use Hilbert-Huang transform (HHT) to calculate the time domain characteristics such as instantaneous frequency and instantaneous amplitude of the IMF. In addition, the recognition system can also perform statistical analysis on the IMF, such as calculating statistical characteristics such as mean, variance, and peak value. These characteristics can reflect the stability and strength of the target EEG signal. After completing the above analysis and calculation, the recognition system can use feature selection algorithms such as recursive feature elimination and feature selection based on information gain to select features that have a greater influence on SSVEP recognition from the above frequency domain, time domain and statistical analysis features. After completing the above feature selection, the recognition system can fuse the selected features to form a comprehensive feature, which can be used as the signal feature of the above target EEG signal. The above feature fusion process can be implemented in various ways, such as simply concatenating the features of each IMF, or using weighted sum, principal component analysis and other methods to merge these features to reduce the dimension and retain information that is more important for subsequent EEG signal recognition.
[0053] Step S108 , inputting the signal features into a signal recognition model, using the signal recognition model to recognize the target EEG signal, and obtaining a signal recognition result, wherein the signal recognition result is used to characterize the behavioral intention of the test subject.
[0054] The signal recognition model can be used to recognize and classify EEG signals, particularly the signal features obtained from the preprocessing and feature extraction stages, to infer the test subject's behavioral intention or brain state. For example, the signal recognition model can be a linear classifier, a neural network model, an ensemble learning model, etc., but is not limited to these. The signal recognition result can be the decision or classification information output by the signal recognition model, which is used to characterize the test subject's behavioral intention.
[0055] In an optional embodiment, in order to reduce the error of manual recognition and improve the accuracy of recognition of target EEG signals, the recognition system can use a neural network model to recognize the above-mentioned target EEG signals. In this embodiment, it can be assumed that the above-mentioned neural network model has been trained and verified in advance, and the recognition system can first normalize the signal features (such as frequency response intensity, phase locking value, spatial pattern, etc.) extracted in the above steps, so as to organize the above-mentioned signal features into an input format corresponding to the neural network model to ensure the stability and recognition accuracy of the model. After completing the normalization of the above-mentioned signal features, the recognition system can input the organized signal features into the neural network model, and then the above-mentioned neural network model can complete the recognition of the target EEG signal through calculation. Finally, the model can output the signal recognition results used to characterize the behavioral intentions of the test subject to the recognition system.
[0056] In an embodiment of the present invention, the original EEG signal of the test object is obtained; the original EEG signal is preprocessed based on the frequency characteristics of the original EEG signal to obtain a target EEG signal; the target EEG signal is feature extracted to obtain the signal characteristics of the target EEG signal; the signal characteristics are input into a signal recognition model, and the target EEG signal is recognized by using the signal recognition model to obtain a signal recognition result. The original EEG signal is preprocessed to eliminate the interference of irrelevant frequency signals, and on the basis of the preprocessing, the original EEG signal is feature extracted to extract the signal characteristics in the original EEG signal that are more relevant to the signal recognition task. Subsequently, the signal characteristics are input into the signal recognition model to identify and classify the preprocessed signal characteristics to obtain the target recognition result, thereby achieving the purpose of eliminating the interference of irrelevant frequency signals in the EEG signal, thereby realizing the technical effect of improving the accuracy of recognition and classification of EEG signals, and further solving the technical problem of low accuracy of recognition and classification of EEG signals in related technologies.
[0057] Furthermore, the original EEG signal is preprocessed based on its frequency characteristics to obtain a target EEG signal, including: scaling the original EEG signal based on a preset proportional factor to obtain a scaled EEG signal; performing baseline drift correction on the scaled EEG signal to obtain a corrected EEG signal; filtering the corrected EEG signal based on its frequency characteristics to obtain a filtered EEG signal; and windowing the filtered EEG signal to obtain a target EEG signal.
[0058] The above-mentioned preset proportional factor may be a fixed coefficient set in advance for adjusting the amplitude of the original EEG signal. The above-mentioned scaling process may refer to the process of adjusting the amplitude of the above-mentioned original EEG signal according to the above-mentioned preset proportional factor. The above-mentioned baseline drift may refer to the phenomenon that the average value of the signal of the above-mentioned original EEG signal changes slowly due to various factors (such as poor electrode contact, muscle movement, skin temperature change, etc.) during the long-term acquisition process. The above-mentioned window truncation may refer to the process of dividing the continuous signal into shorter time periods (usually called windows) in signal processing to facilitate independent analysis of the signal in each window.
[0059] In an optional embodiment, in order to convert the original signal from the digital counting unit collected by the device into the physical quantity unit, the recognition system can scale the original EEG signal based on the gain of the EEG acquisition device and the ADC (Analog-to-Digital Converter) resolution using the above-mentioned preset scaling factor to obtain a scaled EEG signal. Subsequently, considering that the baseline drift will cause the original EEG signal to gradually deviate from the original level during the acquisition process, thereby affecting subsequent signal processing and analysis, in order to eliminate this baseline drift, the device system can use a moving average method to average the above-mentioned scaled EEG signal, and then subtract this average value from the signal one by one to correct the baseline of the scaled EEG signal, thereby obtaining a more stable corrected EEG signal. Next, in order to further purify the above-mentioned corrected EEG signal, remove noise interference and highlight the frequency characteristics of the SSVEP signal, the recognition system can filter the above-mentioned corrected EEG signal. Specifically, the recognition system can use a notch filter to remove the power frequency noise in the corrected EEG signal to reduce the impact of the external electromagnetic field on the signal. Subsequently, the recognition system can also use a bandpass filter to accurately retain the frequency range of the SSVEP signal and filter out irrelevant high-frequency and low-frequency noise, thereby obtaining a purer filtered EEG signal that is more focused on the SSVEP frequency. Finally, in order to facilitate subsequent feature extraction and classification, the recognition system can perform window truncation on the above-mentioned filtered EEG signal. The purpose of the above-mentioned window truncation is to cut the continuous signal stream into segments of fixed length, thereby helping to eliminate edge effects that may occur during filtering processing and facilitating subsequent real-time analysis. It should be noted that the above-mentioned edge effect refers to the phenomenon that the edge part of the signal is distorted or fluctuates due to the convolution of the impulse response of the filter and the signal during the filtering process. In this embodiment, the recognition system can select a reasonable window length of x seconds, and then cut out a series of signal segments with a length of x seconds from the filtered signal. Through this window truncation method, the recognition system can remove the above-mentioned edge effect and improve the purity and computational efficiency of the filtered signal. After completing the above-mentioned window truncation step, the signal segment cut out by the recognition system is the above-mentioned target EEG signal, which can be used as the basis for subsequent feature extraction and classification. Through the above-mentioned preprocessing steps, the original EEG signal is converted into the target EEG signal. The above-mentioned target EEG signal has a higher signal-to-noise ratio, clearer frequency characteristics and better stability, which provides an accurate data basis for subsequent feature extraction and signal recognition.
[0060] For ease of understanding, Figure 2 is a flow chart of an optional raw EEG signal preprocessing according to an embodiment of the present invention, such as Figure 2As shown, first, the recognition system can scale the above-mentioned original EEG signal according to the preset scale factor. Then, considering that baseline drift will affect the analysis and recognition of the signal, especially for steady-state visual evoked potentials such as SSVEP, baseline drift will change the frequency characteristics of the signal, reduce the signal-to-noise ratio of the signal, and cause classification errors, the recognition system needs to remove the baseline drift of the original EEG signal after the above-mentioned scaling process. In addition, considering that power frequency noise will have a serious impact on the analysis and recognition of EEG signals, reduce the signal-to-noise ratio of EEG signals, and cause classification errors, the recognition system can use 50 and 100 Hz notch filters and 6-70 Hz zero-phase bandpass filters to remove power frequency noise. After completing the above filtering process, further considering that edge effects will affect the authenticity and reliability of the signal, especially for time-varying and non-stationary signals such as EEG signals, edge effects will cause changes in the frequency and amplitude characteristics of the signal, reduce the signal-to-noise ratio of the signal, and cause analysis errors, the recognition system can use a window cutoff of 0.25 seconds to remove the edge effects of the filtered EEG signal.
[0061] It should be noted that the specific values of the above filter frequency and window cutoff time are only for illustrative purposes. The staff can set them according to actual needs and are not limited here.
[0062] Furthermore, the method also includes: obtaining the full-scale voltage, maximum digital count and amplification factor of a preset converter, wherein the preset converter is used to convert the original EEG signal from an analog signal to a digital signal; obtaining a first quotient value based on the quotient of the full-scale voltage and the maximum digital count; and obtaining a preset proportional factor based on the quotient of the first quotient value and the amplification factor.
[0063] The preset converter can be a device for converting collected continuous analog electrical signals into discrete digital data so that a computer can understand and process them. For example, the preset converter can be an ADC, but is not limited to this. The full-scale voltage can refer to the voltage range that the preset converter can accurately convert. This full-scale voltage is determined by the design specifications of the preset converter, determines the dynamic range of the input signal, and is one of the parameters used to calculate the preset scale factor. The maximum digital count can refer to the maximum digital output value that the preset converter can produce at the full-scale voltage. This value depends on the resolution of the preset converter, that is, the number of different voltage levels that the preset converter can distinguish. The maximum digital count is combined with the full-scale voltage to calculate the preset scale factor. The amplification factor can refer to the multiple by which the signal is amplified during the signal acquisition process. During EEG measurement, because the raw EEG signal is relatively weak, it often requires amplification by a preamplifier to be effectively captured by the preset converter. The amplification factor is determined by the amplifier's gain setting.
[0064] In an optional embodiment, to accurately calculate the preset scaling factor, the recognition system can first obtain the full-scale voltage of the preset converter. The full-scale voltage defines the voltage range that the preset converter can accurately convert. The preset converter can accurately convert any analog voltage within this range into a corresponding digital count. Subsequently, the recognition system can determine the maximum digital count of the preset converter, which reflects the upper limit of the digital output value that the preset converter can produce at the full-scale voltage. Next, considering that the signal often needs to pass through the amplifier for gain adjustment before entering the preset converter to ensure that the weak raw EEG signal can be effectively captured, the recognition system can obtain the amplifier's amplification factor. The amplification factor is determined by the settings of the signal acquisition device. For example, in an OpenBCI (OpenBrain-Computer Interface) EEG cap, the amplifier's amplification factor can be set to 24. After obtaining the above parameters, the recognition system can gradually calculate the preset scaling factor. This calculation process can be divided into two steps. First, the recognition system can obtain a first quotient value based on the quotient of the full-scale voltage and the maximum digital count. This quotient value reflects the voltage increment corresponding to each unit digital count, i.e., the voltage resolution of the preset converter. After obtaining the above-mentioned first quotient value, the recognition system can perform the second step of calculation, that is, based on the quotient of the first quotient value and the amplification factor, obtain the above-mentioned preset proportional factor. This step takes into account the gain multiple of the signal when passing through the preamplifier, ensuring that the digital signal obtained from the preset converter can be accurately restored to the signal voltage before amplification.
[0065] For example, the preset converter may be an ADC, and the preset scaling factor may be expressed as follows:
[0066] ScaleFactor(Volts / count)=4.5Volts / gain / (2 23 -1);
[0067] In the formula, ScaleFactor (Volts / count) represents the preset scale factor, 4.5Volts represents the full-scale voltage, and the full-scale voltage of the ADC is usually ±2.25V. That is, the ADC can accurately convert any analog voltage between -2.25V and +2.25V into a digital output. The full-scale voltage usually needs to consider the sum of the positive and negative ranges. Therefore, the above full-scale voltage can be 4.5V. Gain represents the amplifier gain factor, (2 23 -1) represents the maximum count value of the ADC.
[0068] Furthermore, the scaled EEG signal is corrected for baseline drift to obtain a corrected EEG signal, including: detecting the scaled EEG signal, determining the signal to be corrected from the scaled EEG signal, wherein the signal to be corrected is used to characterize the area where the baseline drift occurs in the scaled EEG signal; performing feature extraction on the signal to be corrected to obtain signal characteristics of the signal to be corrected; based on the signal characteristics, selecting a target correction method from a correction method library, wherein the target correction method removes the baseline drift occurring in the scaled EEG signal; and correcting the scaled EEG signal based on the target correction method to obtain a corrected EEG signal.
[0069] The signal to be corrected may be a region of the scaled EEG signal that exhibits baseline drift characteristics. Signal values in these regions do not fluctuate around a constant baseline but instead systematically shift over time. The correction method library may be a set of predefined algorithms and strategies for correcting baseline drift, and the correction method library may include multiple correction methods. The target correction method may be a correction method selected from the correction method library after analyzing the characteristics of the signal to be corrected that is most suitable for the current signal conditions.
[0070] In an optional embodiment, in order to eliminate the influence of baseline drift on the signal recognition result, the recognition system can perform a simple inspection or data analysis on the scaled EEG signal to identify the area where baseline drift exists, and then determine the signal to be corrected from the scaled EEG signal. For example, the recognition system can observe whether there is a trend of signal value gradually shifting over time by drawing a time series diagram of the signal. After determining the above-mentioned signal to be corrected, in order to better understand the characteristics of baseline drift and thus select a more appropriate correction method, the recognition system can extract key signal features that can describe the drift characteristics from the signal to be corrected. These features may include the amplitude, direction, speed and whether there is periodicity of the drift. Since the above-mentioned correction method library contains a variety of algorithms, such as moving average, adaptive filtering, linear regression, etc., the recognition system can further select a more appropriate target correction method from the preset correction method library based on the extracted signal features, and correct the scaled EEG signal based on the selected target correction method to remove the baseline drift in the signal, thereby obtaining a more stable and reliable corrected EEG signal.
[0071] Furthermore, the scaled EEG signal is corrected based on the target correction method to obtain a corrected EEG signal, including: in response to the target correction method being a preset correction method, obtaining the signal sampling frequency and expected smoothness of the scaled EEG signal; constructing a moving average window based on the signal sampling frequency and the expected smoothness; and correcting the scaled EEG signal based on the moving average window to obtain a corrected EEG signal.
[0072] The preset correction method can be a correction algorithm that is predetermined for baseline drift correction. For example, the preset correction method can be a moving average correction, but is not limited thereto. The signal sampling frequency can refer to the number of times per second that a signal is measured and recorded during the signal digitization process. For EEG signals, the signal sampling frequency is often higher to ensure that the high-frequency details of the signal can be captured. The desired smoothness can be a subjectively set parameter used to control the strength of the moving average correction. A higher desired smoothness means that a wider moving average window needs to be applied to obtain a smoother signal, which will result in a greater averaging of rapid changes in the signal, while a lower desired smoothness means using a narrower moving average window to retain more signal details. The moving average window can refer to a fixed-size observation window that slides across the data sequence and is used to calculate the average value over the data points covered by the window. The size of the moving average window (i.e., the number of data points covered) can be a preset parameter.
[0073] In an optional embodiment, to improve the correction effect of the scaled EEG signal, the recognition system can first confirm the sampling frequency of the scaled EEG signal from data records or device manuals, that is, the number of signal points collected per second to capture the rapid dynamic changes in brain activity. Secondly, the recognition system can preset a desired smoothness based on the recognition requirements or EEG signal characteristics. The desired smoothness can indicate that the recognition system wants to smooth the signal on a time scale to remove slowly changing baseline drift. After determining the sampling frequency and desired smoothness, the recognition system can calculate the size required to construct a moving average window. Then, the recognition system can construct a moving average window based on this size and apply the window to the scaled EEG signal. For example, the recognition system can continuously slide the window and calculate the average of all data points within the current window until the moving average window covers the entire scaled EEG signal sequence, thus completing the correction of the scaled EEG signal and obtaining the corrected EEG signal. In this embodiment, by precisely controlling the signal sampling frequency and desired smoothness, the moving average window technique is used to remove baseline drift in the scaled EEG signal, thereby improving the purity and stability of the signal, thereby improving the accuracy of subsequent EEG signal recognition.
[0074] For example, the recognition system can use the moving average method as the above-mentioned target correction method to remove baseline drift. The principle of this method is to replace the current value of the signal with the average value of the signal over a period of time, thereby eliminating the long-term trend of the signal and retaining the short-term fluctuation of the signal. Specifically, the calculation formula of the moving average can be shown as follows:
[0075]
[0076] Where y t Represents the signal value after moving average, x t represents the original signal value, n represents the window length of the moving average, that is, taking n points of the signal to calculate the average value of the signal, x t-i represents the original signal value at time point ti, where i ranges from 0 to n-1. The window length of the moving average can be selected based on the signal characteristics and requirements. Generally speaking, a larger window length improves baseline drift removal, but it also causes loss of signal detail. Therefore, the recognition system needs to find a balance between removing baseline drift and preserving signal detail.
[0077] Furthermore, the corrected EEG signal is filtered based on the frequency characteristics to obtain a filtered EEG signal, including: filtering the corrected EEG signal based on a target notch filter to obtain an initial filtered signal; filtering the initial filtered signal based on a target bandpass filter to obtain a filtered EEG signal.
[0078] The target notch filter can be a filter used to eliminate interference at a specified frequency. In EEG signal processing, a typical interference frequency is power frequency noise, which comes from the AC frequency of the power grid. Since power frequency noise significantly interferes with the frequency components of EEG signals, the target notch filter can be designed to accurately suppress power frequency noise while minimizing the impact on other frequencies. The target bandpass filter can be a filter used to select a specified frequency range in the EEG signal and attenuate frequency components outside the range. In SSVEP signal processing, the target bandpass filter can be used to remove interference from low-frequency (such as slow-wave sleep signals) and high-frequency (such as electromyographic interference, electrode noise) components.
[0079] In an optional embodiment, for the corrected EEG signal that has undergone preliminary denoising and baseline drift correction, the recognition system also needs to eliminate the power frequency noise in the EEG signal. The power frequency noise usually originates from the alternating current of the power grid and is a common interference source in EEG signal processing. In order to effectively remove the power frequency noise, the recognition system can design and apply a target notch filter. Specifically, the recognition system can first determine the notch frequency of the target notch filter and further use digital signal processing technology to design a second-order wireless impulse response notch filter. After the design is completed, the recognition system can apply the designed target notch filter to the EEG signal after baseline drift correction to filter out the interference of the power frequency noise, thereby obtaining a preliminary clean EEG signal, that is, the initial filtered signal. This operation ensures that the initial filtered signal is not affected by the power frequency noise, laying a cleaner foundation for subsequent EEG signal recognition and processing. After completing the processing of the target notch filter, in order to focus on the frequency band of the SSVEP signal, the recognition system can apply the target bandpass filter to the initial filtered signal to isolate and enhance the frequency characteristics of the SSVEP signal. Specifically, the recognition system can now select a bandpass frequency band as the working frequency band of the target bandpass filter based on the characteristics of the SSVEP signal. The lower limit of the frequency band can avoid the interference of slow-wave EEG components, while the upper limit can exclude high-frequency noise, such as signals generated by muscle activity. After completing the determination of the bandpass frequency band, the recognition system can also use digital signal processing technology to design a zero-phase bandpass filter to ensure that no additional phase delay is introduced when the signal passes through the filter. After completing the design of the above-mentioned target bandpass filter, the recognition system can apply the filter to the above-mentioned initial filtered signal to further eliminate the components of the non-SSVEP signal frequency band, thereby obtaining a signal with a purer frequency band, that is, the above-mentioned filtered EEG signal. This operation improves the signal-to-noise ratio of the filtered EEG signal, making the filtered EEG signal more suitable for subsequent feature extraction and classification tasks.
[0080] Furthermore, the method also includes: obtaining the noise frequency of the power frequency noise corresponding to the original EEG signal; constructing a quality factor based on the noise frequency and the preset filter stopband width; constructing a notch filter coefficient based on the quality factor and the noise frequency; and adjusting the initial notch filter based on the notch filter coefficient to obtain a target notch filter.
[0081] The above-mentioned preset filter stopband width may refer to the bandwidth range that the notch filter is to suppress in the frequency domain. The above-mentioned quality factor may be an indicator for measuring the filter selection performance and bandwidth. In a notch filter, the Q value defines the narrowness of the stopband, that is, the ability of the filter to suppress noise at the target frequency. A higher Q value means a narrower stopband, which can more accurately suppress the noise frequency, but may also increase edge effects and phase distortion. Generally speaking, the Q value is calculated based on the target frequency and the stopband width. The above-mentioned notch filter coefficient may be a parameter used for calculation in the notch filter.
[0082] In an optional embodiment, the recognition system can first identify the noise frequency of the power frequency noise in the original EEG signal. After determining the above noise frequency, based on the noise frequency to be suppressed and the desired filtering performance, the recognition system can preset a filter stopband width, which determines the frequency range that the filter needs to suppress. Then, based on the above noise frequency and the preset stopband width, the recognition system can further construct a quality factor. Based on the constructed quality factor and the noise frequency, the recognition system can construct a notch filter coefficient. Finally, the recognition system can adjust the above initial notch filter based on the constructed notch filter coefficient, thereby obtaining the above target notch filter, so as to achieve precise suppression of power frequency noise, ensure the purity and stability of the output signal of the target notch filter, and provide a high-quality signal foundation for subsequent adjustment, extraction, and classification and recognition.
[0083] Specifically, in this embodiment, the recognition system can use a notch filter designed by the iirnotch (Infinite Impulse Response Notch Filter) method to remove 50 Hz and 100 Hz power frequency noise, wherein the iirnotch method is a design method based on infinite impulse response (IIR) filter, which can calculate the filter coefficient according to the given frequency and quality factor (Q). The above-mentioned Q is a parameter representing the stopband width of the filter. The larger the Q, the narrower the stopband and the better the filtering effect, but the greater the phase delay. Optionally, a notch filter with a Q of 3 can be selected to achieve a balance between removing power frequency noise and retaining signal details.
[0084] It should be noted that the specific values of the frequency of the power frequency noise and the Q value are only for illustrative purposes. The staff can set them according to actual needs and no limitation is made here.
[0085] Furthermore, the method also includes: analyzing the signal frequency of the original EEG signal to obtain the signal frequency characteristics; selecting an initial band-pass filter from a band-pass filter library based on the signal frequency characteristics; determining the cutoff frequency of the initial band-pass filter based on the signal frequency characteristics; and adjusting the initial band-pass filter based on the cutoff frequency to obtain a target band-pass filter.
[0086] The signal frequency characteristics may refer to the frequency domain representation of the raw EEG signal, including its component frequency components, intensity distribution, and the relative relationship between frequencies. The cutoff frequency may be a parameter of a bandpass filter, including a low-frequency cutoff frequency and a high-frequency cutoff frequency, which define the frequency range of the signal passed by the bandpass filter.
[0087] In an optional embodiment, the recognition system can perform in-depth frequency analysis on the collected raw EEG signal, aiming to reveal the distribution and intensity of different frequency components in the raw EEG signal and obtain detailed signal frequency characteristics. Specifically, this analysis can be performed using a fast Fourier transform (FFT), which converts the time-domain EEG signal into a frequency-domain form, forming a spectrum corresponding to the raw EEG signal. The recognition system can then identify the energy distribution of each frequency component in the raw EEG signal from this spectrum. Based on the obtained signal frequency characteristics, the recognition system can select an initial bandpass filter from an existing bandpass filter library based on the distribution range of the SSVEP or other frequency components of interest. The goal of this step is to ensure that the spectral response of the initial bandpass filter covers the main effective frequency band of the signal while minimizing interference from background noise and non-correlated signals. The recognition system can then determine the low- and high-frequency cutoff frequencies of the initial bandpass filter and use the determined cutoff frequencies to precisely adjust the initial bandpass filter to obtain the target bandpass filter. This target bandpass filter can preserve the SSVEP signal as much as possible while effectively reducing the influence of low-frequency brain waves and high-frequency noise.
[0088] For example, to further remove noise, the recognition system can use a zero-phase second-order Butterworth bandpass filter with cutoff frequencies of 6 Hz and 70 Hz. This filter is characterized by passing signals within a specified frequency range while attenuating signals at other frequencies, thereby achieving the purpose of noise removal. It should be noted that there is no specific order in which the notch filter and bandpass filter are used. In the processing of this embodiment, the notch filter can be used first, followed by the bandpass filter.
[0089] Furthermore, the filtered EEG signal is window-truncated to obtain a target EEG signal, including: obtaining a signal length and a sampling rate corresponding to the filtered EEG signal; determining a truncation length of the filtered EEG signal based on the signal length and the sampling rate; and truncating the filtered EEG signal based on the truncation length to obtain a target EEG signal.
[0090] The above-mentioned signal length can be the duration of the EEG signal on the time axis or the number of time points it contains. Since EEG signals are usually acquired in the form of continuous sampling points, the signal length can be expressed as the total number of sampling points. The above-mentioned sampling rate can refer to the number of times the data acquisition system captures the signal per second, that is, the number of samples collected per second. The above-mentioned truncation length can refer to the signal segment length set in the preprocessing stage to remove signal edge effects or meet subsequent processing requirements. The above-mentioned edge effects usually appear at the boundaries of signal processing. For example, in filtering operations, the beginning and end parts of the signal may be distorted due to the impulse response of the filter. By truncation, that is, removing the beginning and end parts of the signal, this distortion can be eliminated, thereby ensuring the accuracy and reliability of signal processing. The above-mentioned truncation length is usually determined based on the signal length and sampling rate to ensure that sufficient signal information can be retained while avoiding distortion.
[0091] In an optional embodiment, the recognition system needs to read the basic parameters of the above-mentioned filtered EEG signal to obtain the signal length and sampling rate of the filtered EEG signal. Next, in order to eliminate the edge effects that may occur during the filtering process, the recognition system can determine a truncation length. Specifically, the above-mentioned edge effect is mainly caused by the interaction between the impulse response of the filter and the edge of the signal, which causes signal distortion. This distortion is particularly obvious at the beginning and end of the signal. In order to eliminate the above-mentioned signal distortion, based on the signal length and sampling rate, the recognition system can select a truncation length that is equal to or slightly greater than the impulse response length of the filter to truncate the filtered EEG signal. That is, according to the selected truncation length, a corresponding number of acquisition points are removed from the beginning and end of the filtered EEG signal to complete the truncation of the filtered EEG signal, thereby obtaining the above-mentioned target EEG signal. By executing the above steps, the recognition system can remove the edge effects introduced in the filtering process, ensure the purity and authenticity of the filtered EEG signal data, and thus provide more reliable input data for subsequent feature extraction, signal classification and other advanced processing.
[0092] For example, the recognition system can determine the range of window truncation based on the length of the filter's impulse response and the signal sampling rate of 250Hz. Specifically, 0.125*250 points can be truncated before and after each signal, that is, the window can be truncated by 0.25 seconds to achieve a balance between removing edge effects and retaining signal details.
[0093] It should be noted that the specific values of the sampling rate and window length of the above signals are only for illustrative purposes. Staff can set them according to actual needs and are not limited here.
[0094] Furthermore, feature extraction is performed on the target EEG signal to obtain signal features of the target EEG signal, including: segmenting the target EEG signal to obtain multiple segmented EEG signals, wherein different segmented EEG signals are located in different frequency bands; performing correlation detection on the multiple segmented EEG signals with preset reference signals to obtain multiple correlation coefficients, wherein the correlation coefficients are used to reflect the similarity between different segmented EEG signals and the preset reference signal; and constructing signal features based on the multiple correlation coefficients.
[0095] The preset reference signal can be a pre-set signal template, which typically corresponds to the stimulation frequency used in the brain-computer interface system. The preset reference signal is designed to be compared with the actual received segmented EEG signal to detect the correlation between the segmented EEG signal and the preset reference signal, thereby identifying the SSVEP component in the segmented EEG signal. The correlation coefficient can be a statistical indicator used to measure the degree of similarity between two signals.
[0096] In an optional embodiment, the recognition system can perform segmented processing on the target EEG signal, that is, decompose the target EEG signal into signals of multiple frequency bands based on its frequency characteristics. This step can be achieved by using a set of preset bandpass filters, each filter corresponding to a fixed frequency range, so that segmented EEG signals of different frequency components in the target EEG signal can be separated. Then, the recognition system can use a preset reference signal to perform correlation detection with each segmented EEG signal. The preset reference signal is essentially a signal template in the form of a sine wave that matches the SSVEP stimulation frequency, which is used to characterize the SSVEP response of a fixed frequency. Specifically, the recognition system can use canonical correlation analysis to calculate the correlation coefficient between the segmented EEG signal and the preset reference signal, thereby quantifying the similarity between the segmented EEG signal and the above template. Finally, the recognition system can construct signal features based on the correlation coefficient obtained from each segmented signal.
[0097] Furthermore, the method also includes: constructing at least one feature matrix based on the eigenvalues of the signal features; fusing at least one feature matrix to obtain a feature representation of the signal features; constructing a training data set based on the feature representation, wherein the training data set includes: training samples, verification samples and test samples, and the size of the training samples matches the feature representation; training the initial recognition model based on the training samples, verification samples and test samples to obtain a signal recognition model.
[0098] In an optional embodiment, based on the signal eigenvalues extracted in the aforementioned steps, the recognition system can construct at least one feature matrix. For example, the eigenvalues of each segmented EEG signal can serve as elements of the feature matrix. Each row of the feature matrix can represent a feature set for a sample, and each column can contain the values of all samples for a specified feature. After constructing the feature matrix, the recognition system can fuse the constructed feature matrix to obtain a more compact and representative signal feature representation. This feature fusion can employ various strategies, such as feature weighting, feature dimensionality reduction, or feature selection, to reduce redundant information and enhance feature effectiveness. Based on the fused feature representation, the recognition system can construct a training dataset, which can include samples for training, validation, and testing models. The training dataset can be a paired set of feature representations and corresponding labels used to learn the initial recognition model. The validation dataset can be used to monitor overfitting during the initial recognition model training process and adjust the parameters of the initial training model. The testing dataset can be independent of the training and validation datasets and used to evaluate the final performance of the model. Finally, the recognition system can use the constructed training, validation and test data sets to train the initial recognition model and ultimately obtain the above-mentioned signal recognition model.
[0099] For ease of understanding, Figure 3 is a schematic diagram of an optional EEG decoding model according to an embodiment of the present invention, such as Figure 3 As shown in the figure, the model combines EEG signal frequency band decomposition, CCA and Convolutional Neural Network (CNN) technology to decode SSVEP signals efficiently and accurately. Specifically, the EEG window segment X is fed into multiple subbands (SB, only SB1, SB2, SB3 and SBN are shown in the figure), each subband is based on the reference signal Through CCA analysis, the linear relationship between the EEG window segment and the reference information is calculated to quantify the correlation between the EEG signal and multiple stimulation frequencies. Subsequently, the recognition system can perform CCA output of each sub-band (only the and ) is weighted summed to obtain a comprehensive eigenvalue, which can be expressed as follows:
[0100]
[0101] Where, represents the comprehensive characteristic value under the kth stimulation frequency, k represents different stimulation frequencies, N represents the total number of sub-bands, represents the nth CCA output, w(n) represents the weight corresponding to the nth CCA output. For example, through the above steps, the comprehensive characteristic values under the 1st to 40th stimulation frequencies can be obtained (only the 1st is shown in the figure). and ), this process aims to integrate information from different frequency bands to improve the model's classification performance for EEG signals. The fused feature matrix can be input into a lightweight CNN, as shown in the following formula, for further feature learning and classification:
[0102]
[0103] In the above steps, the specific process of calculating the correlation between different frequency band signals and the stimulation frequency reference signal through CCA can be expressed as follows:
[0104]
[0105] Where Y i represents the reference signal vector, f i represents a fixed stimulation frequency, k represents an integer index used to expand the dimension of the reference signal vector, and t represents the time point, which is usually determined by the sampling frequency F s and the number of sampling points N s Sure, Represents an EEG signal segment With reference signal The correlation coefficient between express and The covariance between Respectively and The variance between u and v is the CCA vector, u T and v T Respectively represent and The transpose of the CCA vector found in , E(XX T ) and E(YY T ) respectively represent and The expected value matrix of .
[0106] For example, it can be assumed that the recognition system fuses the obtained feature matrices to obtain (3, 28, 24). This data can be used as a feature dataset. In this case, the recognition system can divide the data in this dataset into a training set, a validation set, and a test set according to a certain ratio. It can be further assumed that the recognition system constructs an original dataset in the format of (28, 20, 3, 28, 24), where the first dimension represents the data of each category, the second dimension represents the number of samples, and the size of each sample is (3, 28, 24). After completing the construction of the above training set, validation set, and test set, the recognition system can use the Adam adaptive gradient descent algorithm to calculate the cross-entropy loss function during the training process to implement the training of the initial recognition model. Specifically, during the training process of the initial recognition model, the initial learning rate can be 0.001, the batch size can be 32, the epoch size can be 50, and the variable type of the training process can be torch.float16.
[0107] It should be noted that the specific values of the above dataset, initial learning rate, batch size, epoch size, variable type, etc. are only for illustrative purposes. Staff can set them according to actual needs and are not limited here.
[0108] Furthermore, the signal recognition model includes at least: a feature extraction module and a signal classification module; inputting the signal features into the signal recognition model, using the signal recognition model to recognize the target EEG signal, and obtaining a signal recognition result, including: processing the signal features based on the signal recognition model to obtain at least one initial recognition result; obtaining the extraction identifier of the feature extraction module and the classification identifier of the signal classification module; voting on at least one initial recognition result based on the extraction identifier and the classification identifier to obtain at least one voting result; and selecting a signal recognition result from at least one initial recognition result based on at least one voting result.
[0109] The extraction identifier may be an identifier assigned by the feature extraction module to each feature or group of features when processing the input signal. The classification identifier may be part of the output of the signal classification module in the signal recognition model, representing the signal recognition model's predicted category for the input signal. The voting result may refer to the comprehensive consideration of multiple classification decisions made by the signal recognition model through a voting mechanism to obtain a more stable and reliable final classification result.
[0110] In an optional embodiment, the recognition system can input the signal features obtained from the preprocessing and feature extraction stages into the feature extraction module in the signal recognition model. The module can further refine and convert the feature values so that the signal classification module can better understand and classify them. After the feature extraction module, the signal classification module can use the processed signal features as input and use a pre-trained classification algorithm to classify the above signal features, thereby obtaining several initial recognition results. Subsequently, the recognition system can obtain the extraction identifier of the feature extraction module and the classification identifier of the signal classification module, and based on the above extraction identifier and classification identifier, use a voting mechanism to comprehensively evaluate the above initial classification results. Through the voting mechanism, the support and probability of different classification results for each signal segment can be calculated, thereby determining at least one voting result. After comprehensively considering all voting results, the recognition system can select a recognition result with a higher probability from the above initial recognition results as the above signal recognition result.
[0111] For ease of understanding, Figure 4 is a schematic diagram of an optional voting mechanism according to an embodiment of the present invention, such as Figure 4 As shown in the figure, the purpose of the above voting mechanism is to improve the robustness and accuracy of EEG signal recognition. By integrating the classification results of EEG signals in multiple continuous time windows, the negative impact of transient noise or signal fluctuations can be reduced. Specifically, in real-time applications of brain-computer interfaces, EEG signal recognition can be updated in a fixed time window (for example, the window can be set to 250ms). Assume that within the current time window, the SSVEP signal recognition model makes continuous classification decisions on the signals collected by the EEG cap, that is, the sequence "aaabcc#..." shown in the figure, where symbols such as a, b, and c represent the recognition results of different SSVEP frequency responses, and # represents unrecognized data. This sequence reflects the dynamic recognition status of the signal recognition model over a period of time. In order to improve the accuracy of signal recognition results, the recognition system can use a voting window, which can be a time period containing two consecutive classification decisions. In this embodiment, the voting window can be set to bc, and the window direction is from left to right. The classification results within this window can be used for statistical and comprehensive analysis to determine the final recognition result. For example, by counting the classification results within the current voting window, the recognition system can use a hard voting method to select the category with a higher number of occurrences as the final recognition output. In this embodiment, if c appears more frequently than other recognition results during the entire recognition process, the final recognition result can be determined as c. This decision-making process effectively filters out accidental errors in single recognition and improves the overall recognition stability.
[0112] Figure 5is a schematic diagram of an optional signal recognition method according to an embodiment of the present invention, such as Figure 5 As shown in the figure, first, the collected real-time EEG signal is preprocessed, and then FBCA (FilterBank Canonical Correlation Analysis) feature extraction is performed based on the preprocessed signal. The extracted features are passed to FPGA (Field-Programmable Gate Array) for calculation, and the calculation results are passed to CNN for CNN feature classification, and finally the results are output.
[0113] According to an embodiment of the present invention, an embodiment of a signal recognition device is provided. It should be noted that the device can be used to perform the above-mentioned signal recognition method. The specific implementation and application scenarios are the same as those of the above-mentioned embodiment and will not be described in detail here.
[0114] Figure 6 is a schematic diagram of a signal recognition device according to an embodiment of the present invention. Figure 6 As shown, the device includes:
[0115] The signal acquisition module 602 is used to acquire the original EEG signal of the test subject.
[0116] The signal processing module 604 is used to pre-process the original EEG signal based on the frequency characteristics of the original EEG signal to obtain a target EEG signal, wherein the frequency characteristics are used to characterize the distribution and intensity of the frequency components of the original EEG signal.
[0117] The feature extraction module 606 is used to extract features from the target EEG signal to obtain signal features of the target EEG signal.
[0118] The signal recognition module 608 is used to input the signal features into the signal recognition model, use the signal recognition model to recognize the target EEG signal, and obtain a signal recognition result, wherein the signal recognition result is used to characterize the behavioral intention of the test subject.
[0119] Furthermore, the signal processing module is also used to: scale the original EEG signal based on a preset scaling factor to obtain a scaled EEG signal; perform baseline drift correction on the scaled EEG signal to obtain a corrected EEG signal; filter the corrected EEG signal based on frequency characteristics to obtain a filtered EEG signal; and window-truncate the filtered EEG signal to obtain a target EEG signal.
[0120] Furthermore, the device also includes: a parameter acquisition module, used to obtain the full-scale voltage, maximum digital count and amplification factor of a preset converter, wherein the preset converter is used to convert the original EEG signal from an analog signal to a digital signal; a first calculation module, used to obtain a first quotient value based on the quotient of the full-scale voltage and the maximum digital count; and a second calculation module, used to obtain a preset proportional factor based on the quotient of the first quotient value and the amplification factor.
[0121] Furthermore, the signal processing module is also used to: detect the scaled EEG signal, determine the signal to be corrected from the scaled EEG signal, wherein the signal to be corrected is used to characterize the area where the baseline drift occurs in the scaled EEG signal; perform feature extraction on the signal to be corrected to obtain the signal characteristics of the signal to be corrected; based on the signal characteristics, select a target correction method from a correction method library, wherein the target correction method removes the baseline drift occurring in the scaled EEG signal; and correct the scaled EEG signal based on the target correction method to obtain a corrected EEG signal.
[0122] Furthermore, the signal processing module is also used to: in response to the target correction method being a preset correction method, obtain the signal sampling frequency and expected smoothness of the scaled EEG signal; construct a moving average window based on the signal sampling frequency and the expected smoothness; and correct the scaled EEG signal based on the moving average window to obtain a corrected EEG signal.
[0123] Furthermore, the signal processing module is also used to: filter the corrected EEG signal based on the target notch filter to obtain an initial filtered signal; and filter the initial filtered signal based on the target bandpass filter to obtain a filtered EEG signal.
[0124] Furthermore, the device also includes: a frequency acquisition module, used to obtain the noise frequency of the power frequency noise corresponding to the original EEG signal; a first construction module, used to construct a quality factor based on the noise frequency and a preset filter stopband width; a second construction module, used to construct a notch filter coefficient based on the quality factor and the noise frequency; and a first adjustment module, used to adjust the initial notch filter based on the notch filter coefficient to obtain a target notch filter.
[0125] Furthermore, the device also includes: a first analysis module, used to analyze the signal frequency of the original EEG signal to obtain the signal frequency characteristics; a first selection module, used to select an initial band-pass filter from the band-pass filter library based on the signal frequency characteristics; a first determination module, used to determine the cutoff frequency of the initial band-pass filter based on the signal frequency characteristics; and a second adjustment module, used to adjust the initial band-pass filter based on the cutoff frequency to obtain the target band-pass filter.
[0126] Furthermore, the signal processing module is also used to: obtain the signal length and sampling rate corresponding to the filtered EEG signal; determine the truncation length of the filtered EEG signal based on the signal length and sampling rate; and truncate the filtered EEG signal based on the truncation length to obtain the target EEG signal.
[0127] Furthermore, the feature extraction module is also used to: segment the target EEG signal to obtain multiple segmented EEG signals, wherein different segmented EEG signals are in different frequency bands; perform correlation detection on the multiple segmented EEG signals with preset reference signals to obtain multiple correlation coefficients, wherein the correlation coefficients are used to reflect the similarity between different segmented EEG signals and the preset reference signal; and construct signal features based on multiple correlation coefficients.
[0128] Furthermore, the device also includes: a third construction module, used to construct at least one feature matrix based on the eigenvalues of the signal features; a feature fusion module, used to fuse at least one feature matrix to obtain a feature representation of the signal features; a fourth construction module, used to construct a training data set based on the feature representation, wherein the training data set includes: training samples, verification samples and test samples, and the size of the training samples matches the feature representation; a model training module, used to train the initial recognition model based on the training samples, verification samples and test samples to obtain a signal recognition model.
[0129] Furthermore, the signal recognition model includes at least: a feature extraction module and a signal classification module; the signal recognition module is also used to: process the signal features based on the signal recognition model to obtain at least one initial recognition result; obtain the extraction identifier of the feature extraction module and the classification identifier of the signal classification module; vote on at least one initial recognition result based on the extraction identifier and the classification identifier to obtain at least one voting result; and select a signal recognition result from at least one initial recognition result based on at least one voting result.
[0130] An embodiment of the present application further provides an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods of various embodiments of the present invention when running.
[0131] An embodiment of the present application further provides a computer-readable storage medium, which includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.
[0132] An embodiment of the present application further provides a computer program product, including a computer program, which implements the methods in various embodiments of the present invention when executed by a processor.
[0133] An embodiment of the present application further provides a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.
[0134] The embodiments of the present application further provide a computer program, which implements the methods in the above-mentioned embodiments of the present invention when executed by a processor.
[0135] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0136] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0137] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0138] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0139] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.
[0140] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A signal recognition method, characterized in that: include: Obtaining the original EEG signals of the test subject; Preprocessing the original EEG signal based on a frequency characteristic of the original EEG signal to obtain a target EEG signal, wherein the frequency characteristic is used to characterize the distribution and intensity of the frequency components of the original EEG signal; Performing feature extraction on the target EEG signal to obtain signal features of the target EEG signal; The signal features are input into a signal recognition model, and the target EEG signal is recognized using the signal recognition model to obtain a signal recognition result, wherein the signal recognition result is used to characterize the behavioral intention of the test subject.
2. The method according to claim 1, characterized in that Preprocessing the original EEG signal based on the frequency characteristics of the original EEG signal to obtain a target EEG signal includes: Scaling the original EEG signal based on a preset scaling factor to obtain a scaled EEG signal; performing baseline drift correction on the scaled EEG signal to obtain a corrected EEG signal; performing filtering processing on the corrected EEG signal based on the frequency characteristic to obtain a filtered EEG signal; Window truncation is performed on the filtered EEG signal to obtain the target EEG signal.
3. The method according to claim 2, characterized in that The method further comprises: Obtaining a full-scale voltage, a maximum digital count, and an amplification factor of a preset converter, wherein the preset converter is used to convert the raw EEG signal from an analog signal to a digital signal; obtaining a first quotient value based on a quotient of the full-scale voltage and the maximum digital count; The preset scale factor is obtained based on the quotient of the first quotient value and the amplification coefficient.
4. The method according to claim 2, characterized in that Performing baseline drift correction on the scaled EEG signal to obtain a corrected EEG signal, comprising: detecting the scaled EEG signal and determining a signal to be corrected from the scaled EEG signal, wherein the signal to be corrected is used to characterize an area in the scaled EEG signal where a baseline drift occurs; Performing feature extraction on the signal to be corrected to obtain signal features of the signal to be corrected; selecting a target correction method from a correction method library based on the signal characteristics, wherein the target correction method removes baseline drift present in the scaled EEG signal; The scaled EEG signal is corrected based on the target correction method to obtain the corrected EEG signal.
5. The method according to claim 4, characterized in that Correcting the scaled EEG signal based on the target correction method to obtain the corrected EEG signal includes: In response to the target correction mode being a preset correction mode, obtaining a signal sampling frequency and an expected smoothness of the scaled EEG signal; constructing a moving average window based on the signal sampling frequency and the desired smoothness; The scaled EEG signal is corrected based on the moving average window to obtain the corrected EEG signal.
6. The method according to claim 2, characterized in that The method further comprises: filtering the corrected EEG signal based on the frequency characteristic to obtain a filtered EEG signal, including: Performing filtering processing on the corrected EEG signal based on a target notch filter to obtain an initial filtered signal; The initial filtered signal is filtered based on a target bandpass filter to obtain the filtered EEG signal.
7. The method according to claim 6, characterized in that The method further comprises: Obtaining the noise frequency of the power frequency noise corresponding to the original EEG signal; constructing a quality factor based on the noise frequency and a preset filter stopband width; constructing notch filter coefficients based on the quality factor and the noise frequency; An initial notch filter is adjusted based on the notch filter coefficient to obtain the target notch filter.
8. The method according to claim 6, characterized in that The method further comprises: Analyzing the signal frequency of the original EEG signal to obtain a signal frequency characteristic; Based on the signal frequency characteristics, selecting an initial band-pass filter from a band-pass filter library; determining a cutoff frequency of the initial bandpass filter based on the signal frequency characteristic; The initial band-pass filter is adjusted based on the cutoff frequency to obtain the target band-pass filter.
9. The method according to claim 2, characterized in that Windowing the filtered EEG signal to obtain the target EEG signal includes: Obtaining the signal length and sampling rate corresponding to the filtered EEG signal; determining a truncation length of the filtered EEG signal based on the signal length and the sampling rate; The filtered EEG signal is truncated based on the truncation length to obtain the target EEG signal.
10. The method according to any one of claims 1 to 9, characterized in that Extracting features of the target EEG signal to obtain signal features of the target EEG signal includes: Segmenting the target EEG signal to obtain a plurality of segmented EEG signals, wherein different segmented EEG signals are located in different frequency bands; Performing correlation detection on the multiple segmented EEG signals and a preset reference signal respectively to obtain multiple correlation coefficients, wherein the correlation coefficients are used to reflect the similarity between different segmented EEG signals and the preset reference signal; The signal signature is constructed based on the plurality of correlation coefficients.
11. The method according to any one of claims 1 to 9, characterized in that The method further comprises: constructing at least one feature matrix based on the eigenvalues of the signal features; fusing the at least one feature matrix to obtain a feature representation of the signal feature; Constructing a training data set based on the feature representation, wherein the training data set includes: a training sample, a validation sample, and a test sample, and the size of the training sample matches the feature representation; An initial recognition model is trained based on the training samples, the verification samples, and the test samples to obtain the signal recognition model.
12. The method according to any one of claims 1 to 9, characterized in that The signal recognition model includes at least: a feature extraction module and a signal classification module; the signal features are input into the signal recognition model, and the target EEG signal is recognized using the signal recognition model to obtain a signal recognition result, including: Processing the signal features based on the signal recognition model to obtain at least one initial recognition result; Obtaining an extraction identifier of the feature extraction module and a classification identifier of the signal classification module; Voting on at least one initial recognition result based on the extraction identifier and the classification identifier to obtain at least one voting result; The signal recognition result is selected from the at least one initial recognition result based on the at least one voting result.
13. An electronic device, characterized in that: include: a memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 12 when running.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 12.
15. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 12.