Method and apparatus for processing electroencephalogram signal, computer-readable medium, and computer device
By dividing multiple time nodes in the EEG signal data segment and predicting action intentions, the problem of insufficient accuracy of EEG signal analysis in the existing technology is solved, and higher action intention prediction accuracy and device control accuracy are achieved.
Patent Information
- Application Number
- PCT/CN2023/128995
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-20
- Filing Date
- 2023-11-01
- Publication Date
- 2024-08-29
AI Technical Summary
Existing EEG signal analysis methods process EEG signals as a whole, resulting in the accuracy of analysis results that needs to be improved. Especially in motor imagery brain-computer interfaces, there are shortcomings in accurate prediction of action intentions.
By obtaining the EEG signal data segment of a specified duration, dividing multiple time nodes according to preset time intervals, predicting action intentions based on each time node, and determining the target action intention based on the prediction results of multiple time nodes, improving the prediction of action intentions. accuracy.
The prediction accuracy of action intentions is improved, the action intentions of the target object can be reflected in a more fine-grained manner, and the accuracy of device control is enhanced.
Smart Images

Figure CN2023128995_29082024_PF_FP_ABST
Abstract
Description
Method, device, computer-readable medium, and computer equipment for processing electroencephalogram signals
[0001] Related applications
[0002] This application claims priority to Chinese patent application number 2023101715551, filed on February 20, 2023, entitled “Method, device, computer-readable medium and computer equipment for processing electroencephalogram signals,” the entire text of which is incorporated herein by reference. Technical Field
[0003] The present application belongs to the field of computer technology, and specifically relates to a method, apparatus, computer-readable medium, and computer equipment for processing electroencephalogram (EEG) signals. Background Art
[0004] A brain-computer interface (BCI) creates a direct connection between a subject's brain and an external device, enabling direct communication between the two. A motor imagery (MI) BCI is a type of BCI focused on motor functions. Its primary process involves acquiring EEG signals generated by a subject and analyzing them to control the movement of the corresponding device.
[0005] Currently, EEG signal analysis is typically achieved by training a neural network model. After extracting features and performing correlation processing on a segment of the input EEG signal, the trained neural network model outputs the analysis results. However, neural network models typically process the input EEG signal holistically, leaving room for improvement in the accuracy of their analysis results.
[0006] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to ordinary technicians in this field.
[0007] Summary of the Invention
[0008] According to an embodiment of the present application, a method and apparatus for processing an electroencephalogram (EEG) signal, a computer-readable medium, and a computer device are provided.
[0009] In one aspect, the present application provides a method for processing an EEG signal, which is executed by a computer device and comprises:
[0010] Acquire an EEG signal, wherein the EEG signal includes an EEG signal data segment of a specified duration;
[0011] Determining a plurality of time nodes in the EEG signal data segment according to a preset time interval;
[0012] Based on the EEG signal data segments, predicting the action intention corresponding to each of the time nodes, and obtaining action intention prediction results corresponding to each of the multiple time nodes;
[0013] The target action intention is determined according to the action intention prediction results corresponding to each of the multiple time nodes.
[0014] In another aspect, the present application provides an electroencephalogram (EEG) signal processing device, comprising:
[0015] A data acquisition module, configured to acquire an EEG signal, wherein the EEG signal includes an EEG signal data segment of a specified duration;
[0016] A time node division module is used to determine a plurality of time nodes in the EEG signal data segment according to a preset time interval;
[0017] An action intention prediction module is used to predict the action intention corresponding to each of the time nodes based on the EEG signal data segment, and obtain action intention prediction results corresponding to each of the multiple time nodes;
[0018] The target intention determination module is used to determine the target action intention based on the action intention prediction results corresponding to each of the multiple time nodes.
[0019] In another aspect, the present application provides a computer-readable medium having computer-readable instructions stored thereon, which, when executed by a processor, implements the method for processing EEG signals as in the above technical solution.
[0020] In another aspect, a computer device is provided, comprising: a processor; and a memory for storing computer-readable instructions of the processor; wherein the processor executes the computer-readable instructions so that the computer device executes the method for processing EEG signals as in the above technical solution.
[0021] In another aspect, a computer program product or computer program is provided, comprising computer-readable instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer-readable instructions from the computer-readable storage medium and executes the computer-readable instructions, causing the computer device to perform the EEG signal processing method described in the above technical solution.
[0022] The details of one or more embodiments of the present application are set forth in the accompanying drawings and the description below. Other features and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the following briefly introduces the drawings required for use in the embodiments or the conventional technology descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without any creative work.
[0024] FIG1 schematically shows a block diagram of an exemplary system architecture applying the technical solution of the present application.
[0025] FIG2 schematically shows a schematic diagram of an application scenario of the technical solution of the present application.
[0026] FIG3 schematically shows an exemplary system architecture block diagram applying the technical solution of the present application.
[0027] FIG4 schematically shows a flow chart of a method for processing an EEG signal provided in one embodiment of the present application.
[0028] FIG5 schematically shows a flow chart of a method for processing an EEG signal provided in one embodiment of the present application.
[0029] FIG6 schematically shows a flow chart of a method for processing an EEG signal provided by an embodiment of the present application.
[0030] FIG7 schematically shows a flow chart of an EEG signal sample preprocessing process provided by an embodiment of the present application.
[0031] FIG8 schematically shows a schematic diagram of a model training process provided by an embodiment of the present application.
[0032] FIG9 schematically shows a structural block diagram of a prediction model provided by an embodiment of the present application.
[0033] FIG10 schematically shows a flow chart of a method for processing EEG signals provided in one embodiment of the present application.
[0034] FIG11 schematically shows a schematic diagram of an action intention prediction model training framework provided in one embodiment of the present application.
[0035] FIG12 schematically shows a structural block diagram of an electroencephalogram signal processing device provided in an embodiment of the present application.
[0036] FIG13 schematically shows a structural block diagram of an electroencephalogram signal processing device provided in an embodiment of the present application.
[0037] FIG14 schematically shows a block diagram of a computer system structure of a computer device suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0039] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner.In the following description, many specific details are provided so as to provide a full understanding of the embodiments of the present application. However, it will be appreciated by those skilled in the art that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps etc. can be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0040] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0041] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.
[0042] It is understandable that in the specific implementation of this application, when it involves object information (such as the EEG signals of the target object) and other related data, when the above embodiments of this application are applied to specific products or technologies, it is necessary to obtain the object's permission or consent, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0043] FIG1 schematically shows a block diagram of an exemplary system architecture applying the technical solution of the present application.
[0044] As shown in Figure 1, system architecture 100 may include terminal device 110, network 120, and server 130. Terminal device 110 may include a smartphone, tablet computer, laptop computer, intelligent voice interaction device, smart home appliance, in-vehicle terminal, etc. Server 130 may be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services. Network 120 may be a communication medium of various connection types capable of providing a communication link between terminal device 110 and server 130, such as a wired communication link or a wireless communication link.
[0045] Depending on implementation needs, the system architecture in the embodiments of the present application can have any number of terminal devices, networks, and servers. For example, server 130 can be a server group consisting of multiple server devices. In addition, the technical solutions provided in the embodiments of the present application can be applied to terminal device 110, server 130, or can be implemented by both terminal device 110 and server 130, and this application does not impose any special restrictions on this.
[0046] For example, the technical solution of the present application is implemented by the terminal device 110. The terminal device 110 obtains an EEG signal and determines an EEG signal data segment of a specified duration based on the EEG signal. For example, the terminal device 110 can be connected to an EEG signal acquisition device, which can acquire EEG signals and send the EEG signals as EEG signals to the terminal device 110 for processing. Then, the terminal device 110 determines multiple time nodes in the EEG signal data segment according to a preset time interval, and predicts the action intention corresponding to each time node based on the EEG signal data segment, and obtains the action intention prediction results corresponding to each of the multiple time nodes. For example, the EEG signal is an EEG signal data segment with a duration of 4s. The time axis of the EEG signal data segment is divided with a preset time interval of 0.5, so that the EEG signal data segment has 7 time nodes. Then, the EEG signal is predicted for action intention based on these 7 time nodes, and the action intention prediction results corresponding to the EEG signal data segment at these 7 time nodes can be obtained. Finally, the terminal device 110 determines the target action intention of the target object based on the action intention prediction results corresponding to each time node. For example, the action intention prediction result with the highest prediction accuracy is selected from each time node as the target action intention, or the action intention prediction result of the time node closest to the current moment is selected as the target action intention.
[0047] For example, FIG2 schematically shows a schematic diagram of an application scenario of the technical solution of the present application.
[0048] As shown in Figure 2, the application scenario of the technical solution of the present application includes a target object 210, an EEG signal acquisition device 220, an EEG signal processing device 230 and a target device 240. The target object 210 is a subject that generates EEG signals, such as a human or an animal. The EEG signal acquisition device 220 is used to collect the EEG signals generated by the target object 210. For example, the EEG signal acquisition device 220 can be an EEG cap. The EEG signal processing device 230 is used to process the EEG signals according to the technical solution of the present application to obtain the target action intention of the target object 210. The EEG signal processing device 230 can be configured in a server or a terminal device, such as the server 130 or the terminal device 110 shown in Figure 1. The target device 240 is used to perform corresponding actions according to the target action intention of the target object 210, such as raising the arm, moving forward, walking to the right, etc.
[0049] In the application scenario of the technical solution of the present application, the target subject 210 wears the EEG signal acquisition device 220 that establishes a communication connection with the EEG signal processing device 230 and then performs motor imagery. For example, the target subject 210 imagines himself walking forward, or imagines himself controlling the target device 240 to walk forward. The action of "walking forward" does not actually occur, but the brain of the target subject 210 will generate an EEG signal of "walking forward". The EEG signal is an electrical signal generated by the activity of the brain. When performing motor imagery, the EEG signal is generally a continuous time series signal. The EEG signal acquisition device 220 captures the EEG signal generated by the target subject 210, and then transmits the captured EEG signal to the EEG signal processing device 230. The EEG signal processing device 230 can intercept an EEG signal data segment of a specified length from the EEG signal transmitted by the EEG signal acquisition device 220 as the EEG signal, or it can periodically send a request to the EEG signal acquisition device 220 to obtain an EEG signal containing an EEG signal data segment of a specified length.
[0050] After acquiring the EEG signal, the EEG signal processing device 230 determines multiple time nodes in the EEG signal data segment at preset time intervals, and predicts the action intention corresponding to each time node based on the EEG signal data segment, thereby obtaining action intention prediction results corresponding to each of the multiple time nodes. Finally, the EEG signal processing device 230 determines the target action intention of the target object 210 based on the action intention prediction results corresponding to each time node. For example, the action intention prediction result corresponding to the time node closest to the current moment is selected as the target action intention of the target object 210.
[0051] After determining the target action intention of the target object 210, the EEG signal processing device 230 sends the target action intention to the target device 240, and the target device 240 converts the target action intention into a corresponding action control instruction and executes the corresponding target action according to the action control instruction. For example, if the EEG signal processing device 230 detects that the target action intention of the target object 210 is "walking forward", then after the target device 240 receives the target action intention, it converts it into an action control instruction of "walking forward". After executing the action control instruction, the target device realizes the actual action of "walking forward". According to the technical solution of the present application, the target object 210 can control the target device 240 through motor imagination. For example, an object with limited mobility can control the movement of the device through motor imagination to perform rehabilitation, improve life convenience, etc.
[0052] For example, FIG3 schematically shows an exemplary system architecture block diagram applying the technical solution of the present application.
[0053] As shown in Figure 3, the system architecture includes a target object 310, a signal acquisition device 320, a data processing module 330, and a device instruction module 340. The process by which the target object 310 generates an EEG signal is equivalent to the process by which the target object 310's brain encodes the action imagined by the target object 310, namely, "information encoding." The signal acquisition device 320 performs signal acquisition on the target object 310, obtains the EEG signal generated by the target object 310, and transmits the EEG signal to the data processing module 330. The data processing module 330 performs signal decoding and information processing. Signal decoding refers to parsing the EEG signal transmitted by the signal acquisition device 320 to identify the target action intention of the target object 310. The data processing module 330 can implement signal decoding through the technical solution of the present application. Information processing refers to converting the identified target action intention into a signal that can be recognized by the device, for example, it can be the conversion of communication protocols, signal format conversion, etc. The device instruction module 340 is used to execute the target action indicated by the target action intention, such as a robot, mechanical equipment, etc. The device instruction module 340 converts the target action intention into a control instruction executable by the device and executes it, thereby executing the corresponding target action. After the device instruction module 340 executes the corresponding target action, the result of its action execution is an excitation signal that causes the target object 310 to generate the next segment of EEG signals (such as performing the next step of motor imagination), which is equivalent to a feedback signal. For example, after the device instruction module 340 executes the action of "walking forward", the target object 310 continues to perform motor imagination for the next action of the device instruction module 340 based on the result of the action execution. For example, continuing motor imagination can be imagining controlling the device to "walk right", "walk left" or continue "walking forward", etc.
[0054] The following describes in detail the method for processing EEG signals provided in this application in conjunction with specific implementation methods.
[0055] FIG4 schematically shows a flow chart of a method for processing EEG signals provided in one embodiment of the present application. The method for processing EEG signals provided in the embodiment of the present application can be implemented by an EEG signal processing device. The specific implementation process of the method will be described below using the EEG signal processing device as the method execution subject. As shown in FIG4 , the method for processing EEG signals provided in the embodiment of the present application includes steps 410 to 440, which are as follows:
[0056] Step 410: Acquire an EEG signal, and determine an EEG signal data segment of a specified duration based on the EEG signal.
[0057] Specifically, the target object is a subject that generates EEG signals, such as a human, a bionic robot, or an animal. The EEG signal can be an EEG signal generated when the brain of the target object performs a certain activity, such as an EEG signal generated by motor imagery. Motor imagery refers to the target object imagining a certain movement or action while the target object does not actually perform the movement or action. The EEG signal is an electrical signal generated by the activity of the brain and is a continuous time series signal. When the target object generates an EEG signal, the EEG signal processing device obtains the EEG signal data segment generated by it containing a specified time length as the EEG signal, that is, the EEG signal is a data segment with a certain time length, rather than an EEG signal generated at a certain moment.
[0058] In some embodiments, the EEG signal is collected by a signal acquisition device and transmitted to an EEG signal processing device. The EEG signal processing device can intercept an EEG signal data segment of a specified duration from the EEG signal transmitted by the signal acquisition device as the EEG signal. For example, the EEG signal processing device obtains the EEG signal from the EEG signal transmitted by the signal acquisition device using a sliding window of a specified duration, or samples the EEG signal transmitted by the signal acquisition device according to a preset sampling period using a fixed window of a specified duration to obtain the EEG signal. The EEG signal processing device can also request the signal acquisition device to transmit an EEG signal data segment of a specified duration at predetermined intervals to obtain the EEG signal. In order to ensure the real-time nature of EEG signal prediction, the EEG signal is the EEG signal data segment of the specified duration closest to the current moment, that is, the EEG signal is the EEG signal data segment of the most recent k seconds. k can be set as needed and can be an integer or a non-integer, such as 1 second, 2 seconds, 5 seconds, 10 seconds, 30 seconds, 60 seconds, etc.
[0059] Step 420: Determine multiple time nodes in the EEG signal data segment according to preset time intervals.
[0060] Specifically, the preset time interval is used to divide the EEG signal data segment in time, so that the EEG signal data segment is divided into multiple time nodes in time. For example, the EEG signal is an EEG signal data segment with a length of 4s, the start time of the EEG signal data segment is recorded as 0s, and the end time is recorded as 4s. The EEG signal data segment is divided with a preset time interval of 0.5s. After the division, the time nodes of the EEG signal data segment include: 0.5s, 1s, 1.5s, 2s, 2.5s, 3s, and 3.5s, among which the start time of the EEG signal data segment is generally not included in the time node, and the end time of the EEG signal data segment can be included in the time node or not, and can be set according to actual needs.
[0061] Step 430: Based on the EEG signal data segment, predict the action intention corresponding to each time node, and obtain the action intention prediction results corresponding to multiple time nodes.
[0062] Specifically, predicting action intentions of EEG signals based on multiple time nodes refers to predicting the action intentions corresponding to each time node in the EEG signal.
[0063] In some embodiments, when performing action intention prediction, the EEG signal can be divided into multiple data segments according to multiple time nodes, so that one time node corresponds to one data segment, and then action intention prediction is performed for each data segment separately to obtain the action intention prediction results corresponding to each time node.
[0064] In some embodiments, when dividing an EEG signal into multiple data segments according to multiple time nodes, a sliding window can be used to slide in the EEG signal data segment, and the data segments selected during the window sliding process are used as data segments. The window length of the sliding window can be twice the preset time interval, and the sliding step length is the preset time interval. For example, after a 4s EEG signal data segment is divided into a preset time interval of 0.5s, it can be recorded as [0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4], the window length of the sliding window is 1s, and the sliding step length is 0.5s. The resulting data segments include a data segment of 0-1s, a data segment of 0.5-1.5s, a data segment of 1-2s, a data segment of 1.5-2.5s, a data segment of 2-3s, a data segment of 2.5-3.5s, and a data segment of 3-4s. When predicting action intention, the action intention prediction result corresponding to the data segment is the action intention prediction result corresponding to the time node at the middle moment of the data segment. For example, the action intention prediction result of the data segment from 0 to 1s is the action intention prediction result corresponding to the time node 0.5s, the action intention prediction result of the data segment from 0.5 to 1.5s is the action intention prediction result corresponding to the time node 1s, and so on. In this way, when predicting the action intention prediction result of each time node, the data before and after the time node is used for prediction, which is equivalent to predicting the action intention based on the context data of the time node, which can improve the accuracy of the prediction result corresponding to the time node.
[0065] In some embodiments, after dividing the EEG signal into multiple data segments according to multiple time nodes, feature extraction can be performed on each data segment to obtain the EEG signal features corresponding to each time node, and then action intention prediction can be performed based on the EEG signal features to obtain the action intention prediction results corresponding to each time node. When performing feature extraction, a sliding window can be slid through the EEG signal data segment, and feature extraction can be performed on the data segments selected during the window sliding process to obtain EEG signal features, wherein the window length of the sliding window can be set to two data segments, and the sliding step length can be set to one data segment. For example, a 4-second EEG signal data segment can be divided into a preset time interval of 0.5 seconds and recorded as [0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4]. Among them, [0, 0.5], [0.5, 1], [1, 1.5], [1.5, 2], [2, 2.5], [2.5, 3], [3, 3.5], and [3.5, 4] are recorded as data segments respectively. When performing feature extraction, feature extraction is performed based on the data segments [0, 0.5] and [0.5, 1] to obtain the EEG signal features corresponding to the time node 0.5s. Feature extraction is performed based on the data segments [0.5, 1] and [1, 1.5] to obtain the EEG signal features corresponding to the time node 1s. And so on, the EEG signal features corresponding to each time node are obtained. Then, action intention prediction is performed based on the EEG signal features of each time node to obtain the corresponding action intention prediction results.
[0066] In some embodiments, time node division and action intention prediction can be achieved through a machine learning model. Machine Learning (ML) is a multi-disciplinary interdisciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their own performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.
[0067] Step 440: Determine the target action intention of the target object according to the action intention prediction results corresponding to each time node.
[0068] Specifically, the action intention prediction result corresponding to a time node indicates the action that the target object wants to perform at that time node. According to the action intention prediction results corresponding to each time node, we can clearly understand the actions that the target object needs to perform at each time node, and we can also see the changes in the actions that the target object needs to perform.
[0069] In some embodiments, an action intention prediction result corresponding to a time node may be selected from the action intention prediction results corresponding to various time nodes as the target action intention. For example, the action intention prediction result corresponding to the time node at the middle moment of the EEG signal may be selected as the target action intention, or the action intention prediction result corresponding to the time node closest to the current moment may be selected as the target action intention.
[0070] In some embodiments, when selecting the action intention prediction result corresponding to a certain time node as the target action intention, the time length corresponding to the EEG signal can be used as a reference, that is, the length of the specified time length can be considered. When the specified time length is short, it is not enough to perform action switching, and the action intention prediction result corresponding to any time node can be selected as the target action intention. When the specified time length is long, there may be action switching, then the action intention prediction result corresponding to the time node closest to the current moment can be selected as the target action intention.
[0071] In some embodiments, voting can be performed based on the action intention prediction results corresponding to each time node, and the action intention prediction result with the largest number is used as the target action intention.
[0072] In the technical solution provided in the embodiment of the present application, multiple time nodes are determined in the EEG signal data segment corresponding to the EEG signal according to a preset time interval, and the action intention corresponding to each time node is predicted based on the EEG signal data segment, and the action intention prediction results corresponding to each of the multiple time nodes are obtained, and then the target action intention of the target object is determined according to the action intention prediction results corresponding to each time node. The action intention prediction results corresponding to each time node are equivalent to dense predictions of the action intention corresponding to the EEG signal, so that the action intention of the target object has a more fine-grained prediction and embodiment, and the accuracy of the action intention prediction is improved; at the same time, in the process of action intention prediction, the action intention can be predicted by referring to the context information corresponding to each time node, further improving the accuracy of the action intention prediction; further, the action intention prediction results corresponding to each time node can clearly reflect the action switching intention of the target object within the specified time length corresponding to the EEG signal, and thus can more accurately determine the moment when the action switching is required, which can effectively improve the subsequent control of the device.
[0073] FIG5 schematically shows a flow chart of a method for processing an EEG signal provided by an embodiment of the present application. This embodiment is a further refinement of the above embodiment. As shown in FIG5 , the method includes steps 510 to 560, which are as follows:
[0074] Step 510: Acquire an EEG signal, and determine an EEG signal data segment of a specified duration based on the EEG signal.
[0075] Step 520: Determine multiple time nodes in the EEG signal data segment according to preset time intervals.
[0076] Steps 510 - 520 are the same as the corresponding steps in the aforementioned embodiment and will not be repeated here.
[0077] Step 530: Extract features from the EEG signal to obtain a first EEG feature.
[0078] Specifically, feature extraction is used to map EEG signals into a vector space and extract features that characterize the intended action, thereby reducing the data dimension of the EEG signals during subsequent data processing and improving data processing efficiency. Feature extraction from EEG signals can be achieved using a CNN (Convolutional Neural Network).
[0079] In some embodiments, feature extraction is performed on the EEG signal data segment to obtain a first EEG feature, including: performing convolution processing on the EEG signal data segment in the time dimension to obtain an EEG signal time feature; performing convolution processing on the EEG signal time feature in the space dimension to obtain an EEG signal space feature; normalizing the EEG signal space feature to obtain a normalized processing result, and generating an EEG signal intermediate feature based on the normalized processing result; pooling the EEG signal intermediate feature to obtain an EEG signal pooling feature; and performing logarithmic operation mapping on the EEG signal pooling feature to obtain the first EEG feature.
[0080] In some embodiments, when extracting features from EEG signals, the EEG signals are first convolved in the time dimension to obtain the EEG signal's time features. The convolution processing in the time dimension is to aggregate neighborhood information from the time dimension through a set convolution kernel, which is equivalent to aggregating data that are close in the time dimension to obtain the EEG signal's time features. In the embodiment of the present application, the convolution kernel in the time dimension is expressed as 1*m, where m is the set convolution kernel length.
[0081] After obtaining the EEG signal's temporal features, we continue to perform spatial convolution on them to obtain the EEG signal's spatial features. Spatial convolution aggregates neighborhood information using a set convolution kernel, effectively aggregating data that is close in spatial distance to obtain the EEG signal's temporal features.
[0082] When acquiring EEG signals, an EEG signal acquisition device typically includes multiple signal collectors. For example, if the signal collectors are electrodes, multiple signal collectors are placed on the target subject's brain to collect the target subject's EEG signals. Each signal collector can then collect the EEG signal at its location. Each signal collector is equivalent to a signal acquisition channel, and the EEG signal collected by a signal collector is equivalent to the EEG signal corresponding to one channel in the target subject's EEG signal. Therefore, the EEG signal includes EEG signal data segments from multiple channels.
[0083] When performing convolution processing on the EEG signal in the time dimension, the convolution processing on the time dimension is performed on the EEG signal data segment of each channel respectively, and the EEG signal time feature obtained also includes the EEG signal time features of multiple channels. Next, the EEG signal time feature is convolved in the spatial dimension. The spatial dimension is also the channel dimension, which is equivalent to aggregating data that are close in the channel dimension to obtain the EEG signal time feature. In the embodiment of the present application, the convolution kernel of the spatial dimension is expressed as C*1, where C corresponds to the number of channels of the EEG signal.
[0084] After obtaining the spatial features of the EEG signal, continue to normalize the spatial features of the EEG signal to obtain the normalization results, and generate the intermediate features of the EEG signal according to the normalization results. Normalization is used to normalize the specific data contained in the spatial features of the EEG signal to a certain range, so as to eliminate the adverse effects of abnormal data in the spatial features of the EEG signal on subsequent calculations, and also to speed up the convergence speed of the subsequent calculation process. In an embodiment of the present application, the spatial features of the EEG signal are normalized by batch normalization (BN), which refers to dividing the data into multiple batches and then performing normalization on each batch separately. In some cases, the spatial features of the EEG signal can also be normalized by group normalization (GN). The normalized data can be used as the intermediate features of the EEG signal for the next calculation.
[0085] In some embodiments, after normalization, the normalized data may be squared, and the result of the square operation may be used as an intermediate feature of the EEG signal. Since the oscillation frequency and amplitude changes of EEG signals (such as motor imagery EEG signals) are more significant features, the square operation can focus more on the amplitude-frequency characteristic changes of the oscillation signal during the action intention prediction process, thereby improving the accuracy of action intention prediction.
[0086] After obtaining the intermediate features of the EEG signal, the intermediate features of the EEG signal are pooled to obtain the pooled features of the EEG signal. The pooling process includes two parameters: the pooling step size (stride / step) and the pooling kernel (kernel / filter). The pooling process is to traverse the intermediate features of the EEG signal through the pooling kernel, aggregate the feature data covered by the pooling kernel during the traversal process, and obtain the pooled features of the EEG signal, wherein the pooling kernel moves with the set pooling step size during the traversal process. Aggregating the feature data covered by the pooling kernel can be to obtain the average value, maximum value, etc. of the feature data covered by the pooling kernel.
[0087] After obtaining the EEG signal pooling feature, logarithmic operation mapping is performed on the EEG signal pooling feature to obtain the first EEG feature. Logarithmic operation mapping refers to calculating the EEG signal pooling feature using the logarithmic function Log(x). The calculated result is the first EEG feature.
[0088] Step 540: Divide the first EEG feature into a plurality of first EEG feature segments according to a plurality of time nodes, and perform feature extraction on the plurality of first EEG feature segments to obtain a second EEG feature.
[0089] Specifically, feature extraction does not change the time dimension of the EEG signal. That is, the time length corresponding to the first EEG feature is the same as the time length corresponding to the EEG signal, both of which are specified time lengths. Then, dividing the first EEG feature into multiple first EEG feature segments based on multiple time nodes is equivalent to segmenting the first EEG feature based on multiple time nodes. Each segment after segmentation is a first EEG feature segment, and the time length corresponding to the first EEG feature segment is the preset time interval.
[0090] After obtaining multiple first EEG feature fragments, feature extraction is performed on the multiple first EEG feature fragments, that is, feature extraction is further performed on the first EEG feature fragments. The feature extraction can be performed on each first EEG feature fragment separately, and the second EEG feature is combined according to the separately extracted features; or it can be performed on multiple first EEG feature fragments in a unified manner to obtain the second EEG feature.
[0091] In some embodiments, the feature extraction of the multiple first EEG feature segments to obtain the second EEG feature includes: obtaining each group of first EEG feature segments determined based on the multiple first EEG feature segments, each group of first EEG feature segments containing adjacent first EEG feature segments in the multiple first EEG feature segments; feature extraction of each group of first EEG feature segments to obtain second EEG feature segments corresponding to each group of first EEG feature segments; and generating a second EEG feature based on the second EEG feature segments corresponding to each group of first EEG feature segments.
[0092] In some embodiments, the feature extraction of the multiple first EEG feature segments to obtain the second EEG feature includes: obtaining each group of first EEG feature segments determined based on the multiple first EEG feature segments, each group of first EEG feature segments containing adjacent first EEG feature segments in the multiple first EEG feature segments; feature extraction of each group of first EEG feature segments to obtain second EEG feature segments corresponding to each group of first EEG feature segments; and generating a second EEG feature based on the second EEG feature segments corresponding to each group of first EEG feature segments.
[0093] In this embodiment, when performing feature extraction, the computer device may first divide the plurality of first EEG feature segments into a plurality of groups of first EEG feature segments, referred to as feature segment groups, each of which includes two adjacent first EEG feature segments, and the difference between the two adjacent groups of first EEG feature segments is a distance of one first EEG feature segment. Feature extraction is then performed on the first EEG feature segments in each feature segment group to obtain the second EEG feature segments corresponding to each group of first EEG feature segments. The term "adjacent" here refers to temporal proximity.
[0094] For example, assuming that the first EEG feature segment includes A1[0, 0.5], A2[0.5, 1], A3[1, 1.5], A4[1.5, 2], A5[2, 2.5], A6[2.5, 3], A7[3, 3.5], and A8[3.5, 4], wherein A1[0, 0.5] represents the first first EEG feature segment, and its time length is 0 to 0.5s. When grouping, the first EEG feature segment A1 and the first EEG feature segment A2 are the first group of first EEG feature segments, the first EEG feature segment A2 and the first EEG feature segment A3 are the second group of first EEG feature segments, the first EEG feature segment A3 and the first EEG feature segment A4 are the third group of first EEG feature segments, and so on, 7 groups of first EEG feature segments can be obtained. Then, feature extraction is performed on the first group of first EEG feature segments to obtain the first second EEG feature segment B1; feature extraction is performed on the second group of first EEG feature segments to obtain the second second EEG feature segment B2; feature extraction is performed on the third group of first EEG feature segments to obtain the third second EEG feature segment B3; and so on, 7 second EEG feature segments B1 to B7 can be obtained, corresponding to the 7 time nodes of 0.5s, 1s, 1.5s, 2s, 2.5s, 3s, and 3.5s respectively.
[0095] After obtaining the second EEG feature segments, the second EEG feature can be generated based on the second EEG feature segments corresponding to each group of first EEG feature segments. For example, the second EEG feature segments can be spliced together in chronological order to obtain the second EEG feature.
[0096] From this, it can be seen that the second EEG feature segment corresponding to each time node includes both the feature data in the first EEG feature segment before the time node and the feature data in the first EEG feature segment after the time node. This is equivalent to the second EEG feature segment corresponding to each time node being obtained with reference to the context information of the time node. As a result, the action intention prediction structure of each time node is predicted based on the context information of the corresponding time node, thereby improving the accuracy of the prediction results.
[0097] Step 550: Predict the action intention based on the second EEG feature to obtain the action intention prediction results corresponding to the EEG signal data segment at each time node.
[0098] Specifically, the action intention prediction based on the second EEG feature can be achieved through LSTM (Long Short-Term Memory).
[0099] In some embodiments, action intention is predicted based on the second EEG feature to obtain action intention prediction results corresponding to the EEG signal data segment at each time node, including: predicting action intention based on the second EEG feature segment and the context feature of the second EEG feature segment to obtain action intention prediction features of the time node corresponding to the second EEG feature segment; performing linear transformation on the action intention prediction features of the time node corresponding to each second EEG feature segment to obtain action intention prediction results corresponding to the EEG signal data segment at each time node.
[0100] When predicting action intention, the LSTM combines the second EEG feature segment and its contextual features to predict action intention, obtaining the action intention prediction features for the time node corresponding to the second EEG feature segment. The contextual features of the second EEG feature segment are determined by the LSTM during the action intention prediction process. The LSTM is a neural network composed of multiple cells, each of which includes a forget gate, an input gate, and an output gate. The forget gate of the i-th cell determines the portion of the state information of the i-1th cell to be forgotten, filtering out the portion of the state information of the i-1th cell to be retained for calculation. The input gate of the i-th cell determines what new information to add to the state information of the i-th cell, i.e., determines the updated information, based on the action intention prediction features of the i-th and i-1th second EEG feature segments. The portion determined by the forget gate to be retained is combined with the updated information determined by the input gate to obtain the state information of the i-th cell. The output gate is used to derive a judgment condition based on the action intention prediction features of the i-th second EEG feature segment and the i-1-th second EEG feature segment. This judgment condition is then fused with the i-th cell state information to obtain the action intention prediction features for the i-th second EEG feature segment. It can be seen that the LSTM references the information of the i-1-th second EEG feature segment when analyzing the action intention of the i-th second EEG feature segment. This means that the LSTM combines the second EEG feature segment and its contextual features to predict action intention, effectively improving the accuracy of action intention prediction while ensuring long-term accuracy.
[0101] After obtaining the action intention prediction features for the time nodes corresponding to each second EEG feature segment, each action intention prediction feature is linearly transformed to obtain the action intention prediction results corresponding to each EEG signal data segment at each time node. The action intention prediction results corresponding to each time node include the probability that the action intention at the corresponding time node is a preset action. Assuming there are four preset actions, the action intention prediction result corresponding to a certain time node includes the probabilities that the action intention at that time node is each of the four preset actions, and the sum of the probabilities of these four preset actions is 1.
[0102] Step 560: Determine the target action intention of the target object according to the action intention prediction results corresponding to each time node.
[0103] In some embodiments, the action intention prediction result corresponding to the time node closest to the current moment among multiple time nodes can be used as the target action intention. For example, if action intention prediction is performed to obtain action intention prediction results for time nodes such as 0.5s, 1s, 1.5s, 2s, 2.5s, 3s, and 3.5s, and the time node closest to the current moment is 3.5s, the action intention prediction result corresponding to 3.5s is used as the target action intention.
[0104] In some embodiments, the action intention prediction results corresponding to the EEG signal data segment at each time node include the probability that the action intention corresponding to each time node is a preset action. Then, the target action intention of the target object is the preset action with the highest probability in the action intention prediction results corresponding to the time node closest to the current moment. Exemplarily, the action intention prediction results corresponding to the time node 3.5s include [0.7, 0.1, 0.1, 0.1], indicating that the probability of the action intention at the time node 3.5s being the first preset action is 0.7, the probability of being the second preset action is 0.1, the probability of being the third preset action is 0.1, and the probability of being the fourth preset action is 0.1. Obviously, the probability of the first preset action is the highest, so the target action intention of the target object is the first preset action.
[0105] In the technical solution provided in the embodiments of the present application, based on the division method and feature extraction method of the first EEG feature segments, the second EEG feature segments corresponding to each time node are obtained by referring to the context information of the time node, so that the action intention prediction structure of each time node is predicted based on the context information of the corresponding time node, thereby improving the accuracy of the prediction results.
[0106] In some embodiments, after obtaining the action intention prediction results corresponding to each time node, the technical solution of the present application may also include: filtering the action intention prediction results corresponding to the EEG signal data segment at each time node to obtain the filtered action intention prediction results corresponding to the EEG signal data segment at each time node; determining the target action intention of the target object based on the filtered action intention prediction results corresponding to each time node.
[0107] Specifically, the filtering method can be median filtering, Kalman filtering, etc. Taking into account the adverse effects of algorithm jitter in the action intention prediction process, by filtering the action intention prediction results corresponding to the EEG signal data segment at each time node, a smooth transition can be achieved between the filtered action intention prediction results corresponding to each time node, thereby eliminating the influence of abnormal data and further improving the accuracy of the target action intention determined by the target object.
[0108] In some embodiments, the method for processing EEG signals further includes: obtaining EEG signal samples of known action intentions; determining multiple sample time nodes in the EEG signal samples according to a preset time interval, and generating action intention labels corresponding to each sample time node according to the known action intention; performing feature extraction and mapping processing on the EEG signal samples through a prediction model to obtain action prediction results corresponding to the EEG signal samples at each sample time node; updating the model parameters of the prediction model according to the action prediction results corresponding to the EEG signal samples at each sample time node and the action intention labels to obtain an action intention prediction model; wherein the action intention prediction model is used to predict the action intention of the EEG signal data segment, or the action intention prediction model is used to divide the EEG signal data segment into time nodes and predict the action intention. This embodiment will be described in detail in subsequent embodiments.
[0109] In some embodiments, the action intention prediction results corresponding to the EEG signal data segment at each time node include the probability that the action intention corresponding to each time node is various preset actions, and the EEG signal processing method further includes: obtaining the maximum probability value in the action intention prediction results corresponding to each time node; when the minimum value of the maximum probability values corresponding to each time node is greater than or equal to a preset probability threshold, the preset action corresponding to the maximum probability value corresponding to each time node is used as the action intention label of the corresponding time node; and adding the EEG signal with the action intention label to a historical data set, and the historical data set is used to train the action intention prediction model. This embodiment will be described in detail in subsequent embodiments.
[0110] In some embodiments, when the amount of data in the historical data set is greater than a preset amount and the usage time of the action intention prediction model reaches a preset time, data corresponding to each preset action is obtained from the historical data set to generate a training data set, wherein the difference between the amount of data corresponding to any two preset actions obtained is less than or equal to a preset threshold; the action intention prediction model is trained using the training data set to update the model parameters of the action intention prediction model. This embodiment will be described in detail in subsequent embodiments.
[0111] In some embodiments, obtaining an EEG signal sample of a known action intention includes: obtaining an original EEG signal of a known action intention, wherein the original EEG signal includes EEG signals of multiple channels; performing bandpass filtering, downsampling, and channel data normalization on the original EEG signal in sequence to obtain a first preprocessed EEG signal; calculating the mean of the channel data corresponding to each moment in the first preprocessed EEG signal, and subtracting the corresponding channel data mean from the EEG signal of each channel at each moment to obtain a second preprocessed EEG signal; traversing the second preprocessed EEG signal through a sliding window of a specified time length to obtain a candidate EEG signal, wherein the sliding step length of the sliding window is less than the specified time length; aligning the candidate EEG signals to obtain an EEG signal sample of the known action intention. This embodiment will be described in detail in subsequent embodiments.
[0112] In some embodiments, the method for processing EEG signals also includes: filtering the action intention prediction results corresponding to the EEG signal data segment at each time node to obtain the filtered action intention prediction results corresponding to the EEG signal data segment at each time node; determining the target action intention based on the action intention prediction results corresponding to each of the multiple time nodes, including: determining the target action intention of the target object based on the filtered action intention prediction results corresponding to each time node.
[0113] In some embodiments, determining the target action intention based on the action intention prediction results corresponding to each of the multiple time nodes includes: taking the action intention prediction result corresponding to the time node closest to the current moment among the multiple time nodes as the target action intention.
[0114] In some embodiments, the action intention prediction results corresponding to the EEG signal data segment at each time node include the probability that the action intention corresponding to each time node is a preset action; the action intention prediction results corresponding to the time node closest to the current moment among the multiple time nodes are used as the target action intention, including: using the preset action with the highest probability in the action intention prediction results corresponding to the time node closest to the current moment as the target action intention.
[0115] FIG6 schematically shows a flow chart of a method for processing EEG signals provided by an embodiment of the present application. This embodiment is a further refinement of the above embodiment. As shown in FIG6 , the method includes steps 610 to 670, which are as follows:
[0116] Step 610: Obtain an EEG signal sample of a known action intention.
[0117] Specifically, the EEG signal samples are EEG signals used as samples for training the action intention prediction model.
[0118] In some embodiments, when obtaining EEG signal samples, the EEG signal samples may also be preprocessed. FIG7 schematically shows a flowchart of an EEG signal sample preprocessing process provided by an embodiment of the present application. As shown in FIG7 , the preprocessing process includes steps 710 to 750, specifically including:
[0119] Step 710: Acquire an original EEG signal of a known action intention, where the original EEG signal includes EEG signals of multiple channels.
[0120] Specifically, the EEG signal of one channel in the original EEG signal represents the EEG signal data collected by one signal collector in the EEG signal collection device. Usually, the signal collection device has multiple signal collectors, so the original EEG signal includes EEG signals of multiple channels.
[0121] Step 720: Perform bandpass filtering, downsampling, and channel data normalization on the original EEG signal in sequence to obtain a first preprocessed EEG signal.
[0122] Specifically, bandpass filtering is used to remove high- and low-frequency noise from the original EEG signal. For example, by filtering with a 2Hz-40Hz bandpass filter, noise data with frequencies below 2Hz and above 40Hz in the original EEG signal can be removed.
[0123] Downsampling is used to reduce the amount of raw EEG data to facilitate subsequent calculations. For example, a raw EEG signal at 1000Hz can be downsampled to 250Hz.
[0124] Channel data normalization processing refers to converting the EEG signal of each channel in the original EEG signal into a distribution with an average value of a first preset value and a standard deviation of a second preset value to solve the problem of signal drift.
[0125] In some embodiments, the Exponential Moving Average (EMA) algorithm can be used to normalize channel data. For example, the normalization of the EEG signal of a channel is performed with x k represents the EEG signal of the channel after normalization at time k, represents the EEG signal of the channel at time k, μ k represents the mean value of the channel at time k, σ k represents the variance of the channel at time k, then:
[0126] Among them, β is the update factor. The larger β is, the slower the update speed of the mean and variance is. The value range of β is (0,1], and it is generally set between 0.99-0.999.
[0127] Step 730: Calculate the mean value of the channel data corresponding to each moment in the first preprocessed EEG signal, and subtract the corresponding channel data mean value from the EEG signal of each channel at each moment to obtain a second preprocessed EEG signal.
[0128] Specifically, the mean value of the channel data corresponding to each moment in the first preprocessed EEG signal is obtained by dividing the sum of all channel data by the total number of channels at each moment. For example, assuming there are c channels C1 to Cc, and the data of channel i at moment t is denoted as Cit, then the mean value of the channel data at moment t is
[0129] Then, the EEG signal of each channel at each time is subtracted from the corresponding channel data mean. For example, taking channel i as an example, the channel data mean of channel i at time t is yi, then the EEG signal of channel i at time t in the second preprocessed EEG signal is Cit-yi.
[0130] Step 740: traverse the second pre-processed EEG signal through a sliding window of a specified duration to obtain a candidate EEG signal, wherein the sliding step of the sliding window is less than the specified duration.
[0131] Specifically, data extraction is performed on the second pre-processed EEG signal by traversing a sliding window of a specified duration to obtain candidate EEG signals of a specified duration. Since the sliding step of the sliding window is less than the specified duration, repeated EEG signal data segments may exist between the candidate EEG signals.
[0132] Step 750: Perform alignment processing on the candidate EEG signals to obtain EEG signal samples with known action intentions.
[0133] Specifically, when aligning candidate EEG signals, the reference matrix of the candidate EEG signals is first calculated as follows:
[0134] in, Indicates the start time or end time is T n Candidate EEG signals, For T n The reference matrix at time, For T n-1The reference matrix at the moment. α is the update factor. The larger α is, the slower the update speed of the mean and variance. The value range of α is (0,1], and it is generally set between 0.99-0.999. α and β can be the same or different. β reflects the update speed of the mean and variance in a channel, while α reflects the update speed of the mean and variance of all channels of the candidate EEG signal.
[0135] After calculating the reference matrix, the candidate EEG signals can be aligned as shown in the following formula:
[0136] in, Represents candidate EEG signals Aligned data. After alignment, it is guaranteed that the average channel covariance matrix for all data is close to the unit matrix.
[0137] By preprocessing the EEG signal samples, abnormal data can be removed, which is conducive to improving the accuracy of subsequent model training. It can be understood that when predicting action intentions based on EEG signals, the EEG signals can also be preprocessed as shown in Figure 7.
[0138] Continuing to refer to FIG6 , in step 620 , a plurality of sample time nodes are determined in the EEG signal sample according to a preset time interval, and an action intention label corresponding to each sample time node is generated according to a known action intention.
[0139] Specifically, the process of dividing EEG signal samples into sample time nodes according to preset time intervals is the same as the process of dividing EEG signals into time nodes, and will not be repeated here. Since the action intention of the EEG signal sample is known, the action intention corresponding to each sample time node is also known, and the action intention label corresponding to each sample time node can be generated.
[0140] Continuing to refer to FIG6 , in step 630 , feature extraction and mapping processing are performed on the EEG signal samples through the prediction model to obtain action prediction results corresponding to the EEG signal samples at each sample time node.
[0141] Specifically, the process of extracting features from EEG signal samples by the prediction model can refer to the aforementioned process of predicting action intentions from EEG signals, which will not be repeated here.
[0142] Continuing to refer to FIG6 , in step 640 , the model parameters of the prediction model are updated according to the action prediction results and action intention labels corresponding to the EEG signal samples at each sample time node to obtain an action intention prediction model.
[0143] Specifically, since each sample time node has an action intention label, after obtaining the action prediction result corresponding to the sample time node, the difference between the action prediction result and the action intention label can be used to determine whether the model's action intention for the sample time node is accurate. The difference between the action prediction result and the action intention label is equivalent to the model's loss function. When the loss function is less than the preset threshold, it means that the model prediction result is not accurate enough. At this time, the model parameters should be updated and the model should continue to be trained until the loss function is less than the preset threshold, or the number of model iterations reaches the preset number, and a trained action intention prediction model is obtained. Subsequently, the action intention prediction model can be used to predict the action intention of the EEG signal, or the action intention prediction model can be used to divide the EEG signal into time nodes and predict the action intention.
[0144] In some embodiments, when calculating the loss function, the loss function of each sample time node should be calculated separately according to the action prediction results and action intention labels of each sample time node, and then the loss function of each sample time node is used to calculate the model loss function.
[0145] Exemplarily, FIG8 schematically shows a schematic diagram of the model training process provided by an embodiment of the present application. The preset actions of this embodiment include moving the left hand (Left), moving the right hand (Right), moving both feet (Feet) and resting (Rest), and the corresponding action intention labels are L, R, F, and Re, respectively. As shown in FIG8 , for the original EEG signal 810 of known action intention that has been preprocessed, an EEG signal sample 820 is obtained therefrom through a sliding window 811 of a specified duration. Assuming that the time length of the EEG signal sample 820 is 4s, multiple time nodes in the EEG signal sample 820 are determined at intervals of 0.5s, and an action intention label is assigned to each time node. For example, as shown in FIG8 , an R label is assigned at 0.5s and an F label is assigned at 3s.
[0146] The EEG signal samples 820 with multiple action intention labels are then input into the prediction model. The structural block diagram of the prediction model is shown in FIG9 . The prediction model includes a CNN feature extraction module 910 (CNN-Extractor), a feature extraction module 920 (Slicing), and an LSTM prediction module 930. The CNN feature extraction module 910 includes a temporal convolution layer (Conv_time), a spatial convolution module layer (Conv_spatial), a batch normalization layer (BatchNorm), a square operation layer (Square), a pooling layer (Pooling), and a logarithmic operation mapping layer (Log). The LSTM prediction module includes an LSTM prediction layer (LSTM) and a linear transformation layer (Linear).
[0147] Referring to Figures 8 and 9, EEG signal samples 820 with multiple action intention labels are first input into the CNN feature extraction module 910, which then performs feature extraction on the EEG signal samples 820. During the feature extraction process, the EEG signal samples undergo temporal convolution, spatial convolution, batch normalization, squaring, pooling, and logarithmic mapping, yielding the first sample EEG feature. The temporal convolution has a feature dimension of 40, and the convolution kernel is 1*25. The spatial convolution has a feature dimension of 40, and the convolution kernel is C*1, where C is the number of channels in the EEG signal sample. In the pooling layer, the pooling stride is (1, 15), and the pooling kernel is (1, 75). The "1" in these two parameters indicates that the number of rows involved in the calculation is 1, meaning the stride is 15 and the pooling kernel is 75. The first sample EEG feature can be represented as N*40*7, where N is the number of the EEG signal sample 820, 40 represents the data dimension, and 7 indicates that there are 7 time nodes.
[0148] After obtaining the first sample EEG feature, feature extraction is performed through the feature extraction module 920 (Slicing). Specifically, the first sample EEG feature is divided into multiple segments, and then two adjacent first sample EEG feature segments are taken as a group. Feature extraction is performed on each group to obtain the second sample EEG feature segments, and they are spliced into the second sample EEG feature 830.
[0149] Finally, the LSTM prediction module 930 performs action intention prediction on the second sample EEG feature 830, outputting a sample action intention prediction result 840 (Output). The sample action intention prediction result 840 can be expressed as N*cls*m, where cls is the total number of preset actions, which is 4 here, and m is the number of dense points, that is, the total number of time nodes, which is 7 here.
[0150] Since the oscillation frequency and amplitude changes of EEG signals (such as motor imagery EEG signals) are more significant characteristics, adding a square operation layer to the model can strengthen the model's focus on the amplitude-frequency characteristics of the oscillation signal; adding a logarithmic operation mapping layer can stabilize model training and thus improve the prediction effect.
[0151] Continuing with FIG6 , step 650 , an EEG signal is acquired, and an EEG signal data segment of a specified duration is determined based on the EEG signal.
[0152] Continuing to refer to Figure 6, step 660, the action intention prediction model is used to determine multiple time nodes in the EEG signal data segment according to preset time intervals, and based on the EEG signal data segment, the action intention corresponding to each time node is predicted to obtain the action intention prediction results corresponding to each of the multiple time nodes.
[0153] Continuing to refer to FIG. 6 , step 670 , the target action intention of the target object is determined based on the action intention prediction results corresponding to each time node.
[0154] Steps 650-670 are the same as the corresponding processes in the aforementioned embodiment and will not be repeated here.
[0155] Figure 10 schematically shows a flow chart of a method for processing EEG signals provided in one embodiment of the present application. This embodiment is a further optimization of the above embodiment. As shown in Figure 10, the method for processing EEG signals in this embodiment includes steps 1010 to 1070, which are as follows:
[0156] Step 1010: Acquire an EEG signal, and determine an EEG signal data segment of a specified duration based on the EEG signal.
[0157] Step 1020: Determine multiple time nodes in the EEG signal data segment according to preset time intervals through the action intention prediction model, and predict the action intention corresponding to each time node based on the EEG signal data segment to obtain action intention prediction results corresponding to each of the multiple time nodes.
[0158] Steps 1010-1020 are the same as the corresponding steps in the aforementioned embodiment and will not be repeated here.
[0159] Step 1030: Obtain the maximum probability value in the action intention prediction results corresponding to each time node.
[0160] Specifically, the action intention prediction result corresponding to each time node includes the probability that the action intention corresponding to each time node is the preset action, and the sum of all probabilities corresponding to a time node is 1. The preset action corresponding to the maximum probability value of a time node is the action intention corresponding to that time node.
[0161] Step 1040: When the minimum value among the maximum probability values corresponding to each time node is greater than or equal to the preset probability threshold, the preset action corresponding to the maximum probability value corresponding to each time node is used as the action intention label of the corresponding time node.
[0162] Specifically, the action intention corresponding to a time node is the preset action indicated by the maximum probability value corresponding to the time node. When the maximum probability value of a time node is greater than or equal to the preset probability threshold, it indicates that the model can clearly identify the action intention corresponding to the target time node, which means that the action intention prediction model is more accurate in predicting the action intention of the target time node. Then, when the maximum probability values corresponding to each time node are greater than or equal to the preset probability threshold, that is, the minimum value of the maximum probability values corresponding to each time node is greater than or equal to the preset probability threshold, it means that the action intention prediction model is more accurate in predicting the action intention of the EEG signal data segment at each time node. Therefore, the preset action indicated by the maximum probability value corresponding to each time node can be set as the action intention label of the corresponding time node, and the EEG signal with the label set can be added to the historical data set later.
[0163] For example, there are four preset actions. Assuming that the action intention prediction result at time node 1 is (0.7, 0.1, 0.1, 0.1), and the preset probability threshold is set to 0.5, it can be seen that the maximum probability value of 0.7 at time node 1 is greater than the preset probability threshold of 0.5. This also shows that the difference between the maximum probability value and the other probability values is large. The action intention prediction model recognizes that the action intention at this time node is more likely to be the first preset action, and less likely to be the other three preset actions. This shows that the model can be more certain about the action intention at time node 1, and it can be considered that the model's prediction result for time node 1 is more accurate. If the maximum probability value in time node 1 is the minimum value of the maximum probability values of each time node of the EEG signal, then the action intention prediction label can be set for each time node according to the maximum probability value. Assuming that the action intention prediction result at time node 2 is (0.3, 0.2, 0.3, 0.2), it can be seen that the maximum probability value of time node 2, 0.3, is less than the preset probability threshold of 0.5. This also indicates that the difference between the maximum probability value and the other probability values is small. The action intention prediction model believes that the probability of the action intention at time node 2 being the four preset actions is similar, which means that the action intention prediction model cannot accurately identify the action intention corresponding to time node 2. In other words, the action intention prediction result is inaccurate, and it is not appropriate to assign an action intention label based on the action intention prediction result. If the maximum probability value of each time node of the EEG signal is less than the preset probability threshold, for example, there is an action intention prediction result corresponding to time node 2, then the EEG signal is not suitable for setting an action intention label.
[0164] Step 1050: Add the EEG signal with the action intention label to the historical data set, and the historical data set is used to train the action intention prediction model.
[0165] Specifically, EEG signals with action intention labels are added to the historical data set as EEG signal samples, and then the action intention prediction model can be trained using the EEG signal samples in the historical data set. In this way, the sample data for model training can be expanded while reducing the pressure of obtaining sample data.
[0166] Step 1060: When the amount of data in the historical data set is greater than the preset amount and the usage time of the action intention prediction model reaches the preset time, the data corresponding to each preset action is obtained from the historical data set to generate a training data set, wherein the difference between the amount of data corresponding to any two preset actions obtained is less than or equal to the preset threshold.
[0167] Specifically, when the amount of data in the historical data set is greater than the preset number, it means that the action intention prediction model has predicted the action intention of a large number of EEG signals, and when the usage time of the action intention prediction model reaches the preset time, it means that the model parameters obtained from the previous training of the action intention prediction model have been used for a long time. At this time, a training data set can be generated to update the model parameters to ensure the prediction accuracy of the action intention prediction model in subsequent use.
[0168] Considering the accuracy of the model's predictions for the data corresponding to various preset actions, when generating the training data set, the EEG signal samples corresponding to each preset action should be obtained from the historical data set. At the same time, it is also necessary to ensure that the amount of data corresponding to each preset action is the same, that is, the difference between the amount of data corresponding to any two preset actions obtained is less than or equal to the preset threshold. This allows the model training process to learn the same amount of information for each preset action, giving the model the same predictive ability for each preset action, avoiding the situation where some preset actions can be accurately predicted while others are not accurately predicted.
[0169] In some embodiments, when generating a training dataset, in addition to obtaining data from a historical dataset, data may also be obtained from sample data used to train the model previously, for example, data may be obtained from sample data used in the initial training of the model.
[0170] Step 1070: Train the action intention prediction model using the training data set to update the model parameters of the action intention prediction model.
[0171] Specifically, after obtaining the training data set, the training data set can be used to retrain the action intention model, new model parameters can be obtained according to the training results, and the parameters can be updated based on the new model parameters. Subsequently, the action intention prediction model with updated parameters can be used to predict action intentions from EEG signals.
[0172] The technical solution provided in the embodiment of the present application expands the sample data for model training by adding EEG signals with action intention labels to historical data sets to constitute a data set for training the model, thereby effectively reducing the pressure of obtaining sample data; at the same time, when the amount of data in the historical data set is greater than a preset number and the usage time of the action intention prediction model reaches a preset time, the model is retrained to update the model parameters, so that the model parameters can continuously learn the characteristics of the currently predicted EEG signals, thereby improving the accuracy of the model's long-term online prediction.
[0173] Figure 11 schematically shows a schematic diagram of the action intention prediction model training framework provided by an embodiment of the present application. As shown in Figure 11, the training process of the action intention prediction model includes two stages: an offline training stage and an online training stage.
[0174] During the offline training phase, the AI (Artificial Intelligence) model is trained using offline training data, which includes EEG signal samples with known action intentions. The trained AI model then serves as the action intention prediction model, predicting action intentions from EEG signals. The offline training phase generates the initial model parameters for the action intention prediction model to be used online.
[0175] During the online training phase, EEG signals are acquired through the online data collection process, and then the trained AI model is used to infer and predict the EEG signals. Based on the AI model's prediction results of the EEG signal's action intention, the maximum probability value of each time node is determined. When the maximum probability value of each time node is greater than the preset probability threshold, that is, the minimum value of the maximum probability value of each time node is greater than the preset probability threshold K, that is, The preset action corresponding to the maximum probability value of each time node is used as the action intention label of the corresponding time node, and then the EEG signal after the action intention label is assigned is added to the historical data pool (i.e., the historical data set) as the sample data for the next model training. When the amount of data in the historical data pool is greater than the preset amount, and the usage time of the action intention prediction model (that is, the time from the last update of the model parameters of the AI model) reaches the preset time, data sampling is performed from the historical data pool and the offline training data respectively, so that the difference between the data amounts corresponding to any two preset actions obtained is less than or equal to the preset threshold, constituting the online training data. Finally, the AI model is trained with the online training data to obtain the updated parameters of the AI model, and the updated parameters are used to update the parameters of the AI model for inference prediction.
[0176] The technical solution of the present application can reduce the error caused by data offset after the model usage time continues to increase by updating the model parameters online, thereby ensuring the prediction accuracy of the model during long-term use.
[0177] The AI model in the embodiments of this application involves artificial intelligence (AI) technology. Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making.
[0178] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0179] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, autonomous driving, drones, robots, smart medical care, smart customer service, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0180] It should be noted that although the steps of the method of the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all steps must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0181] The following introduces an embodiment of the device of the present application, which can be used to execute the method for processing EEG signals in the above-mentioned embodiment of the present application.
[0182] Figure 12 schematically illustrates a block diagram of the structure of an EEG signal processing device provided in an embodiment of the present application. As shown in Figure 12, the EEG signal processing device 1200 provided in this embodiment includes an online data calibration module 1210, a dense sequence prediction module 1220, a post-processing module 1230, a historical data pool 1240, and an online learning module 1250.
[0183] The input data for the online data calibration module 1210 is an EEG signal, which can be an EEG signal generated by motor imagery. Motor imagery EEG signals can also be called motor imagery EEG (Electroencephalography) signal data or motor imagery EEG sequence signals. Motor imagery EEG sequence signals are acquired via an EEG signal acquisition device and can be EEG signal samples of a known motor intention or EEG signals.
[0184] Before inputting the motor imagery EEG sequence signal into the online data calibration module 1210, it is necessary to extract data from the motor imagery EEG sequence signal so that after inputting it into the online data calibration module 1210, the online data calibration module 1210 can determine the EEG signal data segment of a specified time length based on the EEG signal. For example, the EEG signal processing device can request the EEG signal acquisition device to transmit the data of the most recent k seconds every s seconds, such as at T n Always get T n -k to T n data, k is the specified duration.
[0185] After receiving input data, the online data calibration module 1210 performs preprocessing operations such as filtering, denoising, and alignment, as shown in Figure 7. The online data calibration module 1210 then transmits the data to the dense sequence prediction module 1220, which includes an action intention prediction model. If the input data is EEG signal samples, the action intention prediction model is trained using these samples; if the input data is EEG signals, the action intention prediction model predicts action intention based on the EEG signals.
[0186] Next, the post-processing module 1230 performs post-processing operations such as filtering on the action intention prediction results output by the dense sequence prediction module 1220 to eliminate the influence of the algorithm jitter of the prediction model, and finally outputs the motor imagery sequence prediction result, which includes the probability P that the target action intention of the target object is the preset action. i .
[0187] After obtaining the motor imagery sequence prediction results, the EEG signals to be identified whose maximum probability value in the prediction results is greater than or equal to the preset probability threshold are assigned an action intention label and added to the historical data pool 1240. At the same time, EEG signal samples processed by the online data calibration module 1210 can also be added to the historical data pool 1240.
[0188] When the model parameter update conditions are met, such as when the amount of data in the historical data pool 1240 is greater than the preset amount and the usage time of the action intention prediction model reaches the preset time, the data in the historical data pool 1240 is sampled to form a training data set, and then the training data set is trained and learned through the online learning module 1250 to obtain new model parameters, and the new model is used to update the model parameters of the action intention prediction model in the dense sequence prediction module 1220, so that the action intention prediction model with updated parameters can be used to predict action intention in the future.
[0189] FIG13 schematically shows a block diagram of the structure of the EEG signal processing device provided in an embodiment of the present application. As shown in FIG13 , the EEG signal processing device provided in an embodiment of the present application includes:
[0190] The data acquisition module 1310 is used to acquire an EEG signal, wherein the EEG signal includes an EEG signal data segment of a specified duration;
[0191] A time node division module 1320 is configured to determine a plurality of time nodes in the EEG signal data segment according to a preset time interval;
[0192] The action intention prediction module 1330 is used to predict the action intention corresponding to each of the time nodes based on the EEG signal data segment, and obtain the action intention prediction results corresponding to each of the multiple time nodes;
[0193] The target intention determination module 1340 is used to determine the target action intention based on the action intention prediction results corresponding to each of the multiple time nodes.
[0194] In some embodiments, the action intention prediction module 1330 includes:
[0195] a feature extraction unit, configured to extract features from the EEG signal data segment to obtain a first EEG feature;
[0196] a feature extraction unit, configured to divide the first EEG feature into a plurality of first EEG feature segments according to the plurality of time nodes, and perform feature extraction on the plurality of first EEG feature segments to obtain a second EEG feature;
[0197] The action intention prediction unit is used to predict the action intention based on the second EEG feature, and obtain the action intention prediction result corresponding to the EEG signal data segment at each time node.
[0198] In some embodiments, the feature extraction unit is specifically configured to:
[0199] Performing feature extraction on each group of first EEG feature segments in the plurality of first EEG feature segments to obtain second EEG feature segments corresponding to each group of first EEG feature segments, wherein each group of first EEG feature segments includes two adjacent first EEG feature segments;
[0200] The second EEG feature is generated according to the second EEG feature segments corresponding to the groups of first EEG feature segments.
[0201] In some embodiments, the action intention prediction unit is specifically used to:
[0202] Predicting action intention based on the second EEG feature segment and the context feature of the second EEG feature segment to obtain an action intention prediction feature for the time node corresponding to the second EEG feature segment;
[0203] Performing a linear transformation on the action intention prediction features of the time nodes corresponding to each of the second EEG feature segments, and obtaining the action intention prediction results corresponding to the EEG signal data segments at each time node.
[0204] In some embodiments, the feature extraction unit is specifically configured to:
[0205] Performing convolution processing on the EEG signal data segment in a time dimension to obtain EEG signal time features;
[0206] Performing convolution processing on the temporal features of the EEG signal in a spatial dimension to obtain spatial features of the EEG signal;
[0207] Normalizing the spatial features of the EEG signal to obtain a normalized processing result, and generating an intermediate feature of the EEG signal based on the normalized processing result;
[0208] Performing pooling processing on the intermediate features of the EEG signal to obtain pooled features of the EEG signal;
[0209] Perform logarithmic operation mapping on the pooled features of the EEG signal to obtain the first EEG features.
[0210] In some embodiments, the apparatus further comprises:
[0211] The sample acquisition module is used to obtain EEG signal samples of known action intentions;
[0212] a sample label generation module, configured to determine a plurality of sample time nodes in the EEG signal sample according to a preset time interval, and generate an action intention label corresponding to each sample time node according to the known action intention;
[0213] A sample prediction module is used to perform feature extraction and mapping processing on the EEG signal samples through a prediction model to obtain the action prediction results corresponding to the EEG signal samples at each sample time node;
[0214] The first model parameter updating module is used to update the model parameters of the prediction model according to the action prediction results corresponding to the EEG signal samples at each sample time node and the action intention label to obtain an action intention prediction model; the action intention prediction model is used to predict the action intention of the EEG signal data segment; or, the action intention prediction model is used to divide the EEG signal data segment into time nodes and predict the action intention.
[0215] In some embodiments, the prediction results of the action intention corresponding to each time node of the EEG signal data segment include the probability that the action intention corresponding to each time node is various preset actions; the device further includes:
[0216] A maximum probability value determination module is used to obtain the maximum probability value in the action intention prediction results corresponding to each time node;
[0217] a label determination module, configured to, when a minimum value among the maximum probability values corresponding to the respective time nodes is greater than or equal to a preset probability threshold, use the preset action corresponding to the maximum probability value corresponding to the respective time nodes as the action intention label corresponding to the target time node;
[0218] The historical data set construction module is used to add the EEG signal with the action intention label to the historical data set, and the historical data set is used to train the action intention prediction model.
[0219] In some embodiments, the apparatus further comprises:
[0220] a training data set generation module, configured to, when the amount of data in the historical data set is greater than a preset amount and the usage time of the action intention prediction model reaches a preset time, obtain data corresponding to each preset action from the historical data set to generate a training data set, wherein the difference between the amount of data corresponding to any two preset actions obtained is less than or equal to a preset threshold;
[0221] The second model parameter updating module is used to train the action intention prediction model using the training data set to update the model parameters of the action intention prediction model.
[0222] In some embodiments, the sample acquisition module is specifically configured to:
[0223] Acquiring an original EEG signal of a known action intention, wherein the original EEG signal includes EEG signals of multiple channels;
[0224] performing bandpass filtering, downsampling, and channel data normalization on the original EEG signal in sequence to obtain a first preprocessed EEG signal;
[0225] Calculating the mean value of the channel data corresponding to each moment in the first preprocessed EEG signal, and subtracting the corresponding channel data mean value from the EEG signal of each channel at each moment to obtain a second preprocessed EEG signal;
[0226] Traversing the second preprocessed EEG signal through a sliding window of a specified time length to obtain a candidate EEG signal, wherein the sliding step length of the sliding window is less than the specified time length;
[0227] Alignment processing is performed on the candidate EEG signals to obtain EEG signal samples of the known action intention.
[0228] In some embodiments, the apparatus further comprises:
[0229] A post-processing module is used to filter the action intention prediction results corresponding to the EEG signal data segment at each time node to obtain the filtered action intention prediction results corresponding to the EEG signal data segment at each time node;
[0230] The target intention determination module 1340 is specifically used to:
[0231] The target action intention of the target object is determined according to the filtered action intention prediction results corresponding to the various time nodes.
[0232] In some embodiments, the target intention determination module 1340 is specifically configured to:
[0233] The action intention prediction result corresponding to the time node closest to the current moment among the multiple time nodes is used as the target action intention.
[0234] In some embodiments, the action intention prediction results corresponding to the EEG signal data segments at each time node include the probability that the action intention corresponding to each time node is a preset action; the target intention determination module 1340 is further configured to:
[0235] The preset action with the highest probability in the action intention prediction results corresponding to the time node closest to the current moment is used as the target action intention.
[0236] The specific details of the EEG signal processing device provided in each embodiment of the present application have been described in detail in the corresponding method embodiments and will not be repeated here.
[0237] FIG14 schematically shows a block diagram of a computer system structure of a computer device for implementing an embodiment of the present application.
[0238] It should be noted that the computer system 1400 of the computer device shown in FIG14 is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present application.
[0239] As shown in Figure 14, the computer system 1400 includes a central processing unit (CPU) 1401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1402 or the program loaded from the storage part 1408 into the random access memory (RAM) 1403. Various programs and data required for system operation are also stored in the random access memory 1403. The CPU 1401, the read-only memory 1402, and the random access memory 1403 are connected to each other via a bus 1404. An input / output interface 1405 (i.e., an I / O interface) is also connected to the bus 1404.
[0240] The following components are connected to the input / output interface 1405: an input section 1406 including a keyboard, a mouse, and the like; an output section 1407 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 1408 including a hard disk; and a communication section 1409 including a network interface card such as a local area network card or a modem. The communication section 1409 performs communication processing via a network such as the Internet. A drive 1410 is also connected to the input / output interface 1405 as needed. Removable media 1411, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 1410 as needed, so that computer programs read therefrom can be installed into the storage section 1408 as needed.
[0241] In particular, according to embodiments of the present application, the processes described in the various method flow charts can be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising computer-readable instructions carried on a computer-readable medium, the computer-readable instructions being used to execute the methods shown in the flow charts. In such embodiments, the computer-readable instructions can be downloaded and installed from a network via the communication portion 1409 and / or installed from a removable medium 1411. When the computer-readable instructions are executed by the central processing unit 1401, the various functions defined in the system of the present application are executed.
[0242] It should be noted that the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0243] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more computer-readable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer-readable instructions.
[0244] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiment of the application, the features and functions of two or more modules or units described above can be concretized in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0245] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
[0246] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0247] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A method for processing an electroencephalogram signal, executed by a computer device, comprising: Acquire an electroencephalogram signal, wherein the electroencephalogram signal includes an electroencephalogram signal data segment of a specified duration; Determining a plurality of time nodes in the EEG signal data segment according to a preset time interval; Based on the EEG signal data segment, predict the action intention corresponding to each of the time nodes, and obtain the action intention prediction results corresponding to each of the multiple time nodes; and The target action intention is determined according to the action intention prediction results corresponding to each of the multiple time nodes.
2. The method for processing EEG signals according to claim 1, wherein the step of predicting the action intention corresponding to each of the time nodes based on the EEG signal data segments, and obtaining the action intention prediction results corresponding to each of the multiple time nodes, comprises: Extracting features from the EEG signal data segment to obtain a first EEG feature; Dividing the first EEG feature into a plurality of first EEG feature segments according to the plurality of time nodes, and performing feature extraction on the plurality of first EEG feature segments to obtain a second EEG feature; The action intention is predicted according to the second EEG feature to obtain the action intention prediction result corresponding to the EEG signal data segment at each time node.
3. The method for processing EEG signals according to claim 2, wherein extracting features from the plurality of first EEG feature segments to obtain second EEG features comprises: Acquire each group of first EEG feature segments determined based on the plurality of first EEG feature segments, each group of first EEG feature segments including adjacent first EEG feature segments in the plurality of first EEG feature segments; Performing feature extraction on each group of first EEG feature segments to obtain second EEG feature segments corresponding to each group of first EEG feature segments; A second EEG feature is generated according to the second EEG feature segments corresponding to each group of first EEG feature segments.
4. The method for processing EEG signals according to claim 3, wherein the step of performing action intention prediction based on the second EEG feature to obtain action intention prediction results corresponding to the EEG signal data segment at each time node comprises: Predicting the action intention according to the second EEG feature segment and the context feature of the second EEG feature segment, to obtain the action intention prediction feature of the time node corresponding to the second EEG feature segment; The action intention prediction features of the time nodes corresponding to each of the second EEG feature segments are linearly transformed to obtain the action intention prediction results corresponding to the EEG signal data segments at each time node.
5. According to the method for processing EEG signals according to any one of claims 2 to 4, the step of extracting features from the EEG signal data segment to obtain a first EEG feature comprises: Performing convolution processing on the EEG signal data segment in the time dimension to obtain the EEG signal time feature; Performing convolution processing on the temporal features of the EEG signal in the spatial dimension to obtain spatial features of the EEG signal; Normalizing the spatial features of the EEG signal to obtain a normalized processing result, and generating an intermediate feature of the EEG signal according to the normalized processing result; Performing pooling processing on the intermediate features of the EEG signal to obtain pooled features of the EEG signal; Perform logarithmic operation mapping on the pooled features of the electroencephalogram signal to obtain the first electroencephalogram feature.
6. The method for processing an electroencephalogram signal according to any one of claims 1 to 5, further comprising: Obtain EEG signal samples of known action intentions; Determining a plurality of sample time nodes in the EEG signal sample according to a preset time interval, and generating an action intention label corresponding to each sample time node according to the known action intention; Performing feature extraction and mapping processing on the EEG signal samples through the prediction model to obtain the action prediction results corresponding to the EEG signal samples at each sample time node; updating the model parameters of the prediction model according to the action prediction results corresponding to the EEG signal samples at each sample time node and the action intention label to obtain an action intention prediction model; The action intention prediction model is used to predict the action intention of the EEG signal data segment, or The action intention prediction model is used to divide the EEG signal data segments into time nodes and predict action intentions.
7. The method for processing EEG signals according to claim 6, wherein the prediction results of the action intentions corresponding to the EEG signal data segments at each time node include the probabilities that the action intentions corresponding to each time node are various preset actions, and the method further comprises: Obtain the maximum probability value in the action intention prediction results corresponding to each time node; When the minimum value among the maximum probability values corresponding to the respective time nodes is greater than or equal to the preset probability threshold, the preset action corresponding to the maximum probability value corresponding to the respective time nodes is used as the action intention label of the corresponding time node; The EEG signal with the action intention label is added to the historical data set, and the historical data set is used to train the action intention prediction model.
8. The method for processing electroencephalogram signals according to claim 7, further comprising: When the amount of data in the historical data set is greater than a preset amount and the usage time of the action intention prediction model reaches a preset time, data corresponding to each preset action is obtained from the historical data set to generate a training data set, wherein the difference between the amount of data corresponding to any two preset actions obtained is less than or equal to a preset threshold; The action intention prediction model is trained using the training data set to update model parameters of the action intention prediction model.
9. The method for processing EEG signals according to claim 6, obtaining EEG signal samples of known action intentions, comprising: Acquire an original EEG signal of a known action intention, wherein the original EEG signal includes EEG signals of multiple channels; The original EEG signal is subjected to bandpass filtering, downsampling and channel data normalization processing in sequence to obtain a first preprocessed EEG signal; Calculating the mean value of the channel data corresponding to each moment in the first preprocessed EEG signal, and subtracting the corresponding channel data mean value from the EEG signal of each channel at each moment to obtain a second preprocessed EEG signal; Traversing the second preprocessed EEG signal through a sliding window of a specified time length to obtain a candidate EEG signal, wherein the sliding step length of the sliding window is less than the specified time length; The candidate EEG signals are aligned to obtain EEG signal samples of the known action intention.
10. The method for processing an electroencephalogram signal according to any one of claims 1 to 9, further comprising: Filtering the action intention prediction results corresponding to the EEG signal data segments at each time node to obtain filtered action intention prediction results corresponding to the EEG signal data segments at each time node; The step of determining the target action intention according to the action intention prediction results corresponding to each of the multiple time nodes includes: The target action intention of the target object is determined according to the filtered action intention prediction results corresponding to the various time nodes.
11. The method for processing EEG signals according to any one of claims 1 to 10, wherein determining the target action intention according to the action intention prediction results corresponding to each of the multiple time nodes comprises: The action intention prediction result corresponding to the time node closest to the current moment among the multiple time nodes is used as the target action intention.
12. The method for processing EEG signals according to claim 11, wherein the prediction results of the action intentions corresponding to the EEG signal data segments at each time node include the probability that the action intentions corresponding to each time node are preset actions; The step of taking the action intention prediction result corresponding to the time node closest to the current moment among the multiple time nodes as the target action intention includes: The preset action with the highest probability in the action intention prediction results corresponding to the time node closest to the current moment is used as the target action intention.
13. A device for processing electroencephalogram signals, comprising: The data acquisition module is used to acquire EEG signals, wherein the EEG signals contain EEG signal data of a specified duration. part; A time node division module is used to determine a plurality of time nodes in the EEG signal data segment according to a preset time interval; An action intention prediction module, used to predict the action intention corresponding to each of the time nodes based on the EEG signal data segment, and obtain the action intention prediction results corresponding to each of the multiple time nodes; and The target intention determination module is used to determine the target action intention based on the action intention prediction results corresponding to each of the multiple time nodes.
14. A computer-readable medium having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by a processor, implement the method for processing electroencephalogram signals as claimed in any one of claims 1 to 12.
15. A computer device comprising: processor; as well as a memory for storing computer readable instructions for the processor; The processor executes the computer-readable instructions so that the computer device executes the method for processing EEG signals as described in any one of claims 1 to 12.
Citation Information
Patent Citations
Motor imagery electroencephalogram signal processing method and device, and storage medium
CN110531861A
Portable brain-controlled hand electrical stimulation rehabilitation system based on deep learning
CN114504730A
Cerebral stroke limb rehabilitation method, device and system based on multi-layer perceptron model
CN114626469A
Electroencephalogram signal identification method based on adaptive multi-view deep learning framework
CN115607169A
Electroencephalogram signal processing method and device, computer readable medium and electronic equipment
CN116956108A
Cited By
Electroencephalogram signal real-time decoding and intention recognition method and equipment for attention glasses
CN119740102A
Electroencephalogram signal self-adaptive processing method, device and equipment for attention glasses
CN119740106A
Emotion calculation-oriented electroencephalogram feature visual analysis method and system
CN119918014A
An EEG Feature Visual Analysis Method and System for Affective Computing
CN119918014B
Artificial intelligence-based implantation regulation electroencephalogram signal enhancement method and computer system
CN120030320A
