Hybrid brain-computer interface system for realizing intention understanding by fusing LLM
By combining the weighted fusion of EEG and eye movement signals and the large language model to generate intent options, the problem of decoding accuracy and interaction efficiency in brain-computer interface technology is solved, asynchronous communication and more efficient user intent expression are achieved, and the system is improved. applicability and user experience.
Patent Information
- Application Number
- CN202410831021.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-09-10
AI Technical Summary
Existing brain-computer interface technology has deficiencies in decoding accuracy, user adaptability, and interaction efficiency. In particular, systems based on the SSVEP and P300 paradigms perform poorly in complex intent expression and rapid response, and lack asynchronous selection functions, which affects User experience and system flexibility.
Adopting a brain-computer interface system that integrates LLM, by combining EEG and eye movement signals, SSVEP decoding algorithm and statistical methods are used for signal weighted fusion to achieve asynchronous communication, and multiple intention options are generated through a large language model to improve the accuracy of user intention expression. Accuracy and efficiency.
Significantly improves the accuracy and reliability of EEG decoding, realizes asynchronous communication capabilities, improves the naturalness and convenience of user interaction, and enhances the scope of application and flexibility of the system, especially in medical assistance and emergency response scenarios Provide faster and more accurate support.
Smart Images

Figure CN118625934A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of brain-computer interface spelling technology, and in particular to a hybrid brain-computer interface system integrating LLM to realize intention understanding. Background Art
[0002] Brain-computer interface technology uses neurobiological principles to control external devices by directly monitoring brain activity, without the need for traditional neuromuscular intervention, to capture and analyze brain signals. In the medical field, BCI technology supports many innovative applications, including helping paralyzed patients control wheelchairs or computers, and assisting aphasia patients as a communication aid. In the field of BCI-based character spelling, SSVEP relies on the EEG response of users when they receive visual stimulation of a specific frequency. By presenting visual stimulation that flashes at different frequencies to the user, and detecting the frequency components in the EEG signal during stimulation, the user's choice is decoded.
[0003] Electroencephalogram (EEG) data is widely used in brain-computer interface systems due to its high temporal resolution. However, there are usually many challenges when relying solely on EEG data for decoding. First, EEG signals themselves have high noise levels and large individual differences, which makes it complicated to extract reliable intent information from these signals. Secondly, there is a certain proportion of users (known as BCI blind) whose EEG patterns are difficult to be effectively decoded by current algorithms, which limits the universality of the technology. In addition, environmental factors such as interference from electronic devices and the quality of skin contact of electrodes can also significantly affect signal quality, thereby affecting the performance and stability of the overall system.
[0004] The SSVEP and P300 paradigms are designed to use visual stimulus responses to achieve intent recognition, and they are widely used in speller systems. However, to accurately convey complex intentions or communicate long sentences through these paradigms, users often need to perform a large number of selection and input operations. This process is not only time-consuming but also prone to user fatigue, especially in medical environments where fast and accurate responses are crucial, and the inefficiency of current system interactions is particularly prominent. For example, in emergency medical situations, patients may need to quickly express pain or request help, but existing BCI systems may not be able to provide a fast enough response speed.
[0005] Traditional SSVEP and P300 paradigms are mainly synchronous in design, that is, users need to respond to specific visual stimuli to make a selection, which limits the user's ability to make autonomous choices without external stimulus prompts. This approach may lead to an unnatural and mechanical user experience in daily use, especially when frequent and natural user input is required. The lack of asynchronous selection function limits the flexibility of these systems in practical applications, and users cannot operate according to their personal rhythm and needs, which may affect overall user satisfaction and acceptance.
[0006] In summary, although brain-computer interface technology, especially the spelling paradigm based on SSVEP and P300 and eye tracking technology, provides new possibilities for communication and control, these technologies still need significant improvements and optimization in decoding accuracy, user adaptability and interaction efficiency. Summary of the invention
[0007] The present invention provides a hybrid brain-computer interface system that integrates LLM to realize intention understanding, so as to solve the technical problems mentioned in the background technology.
[0008] To achieve the above object, the technical solution of the present invention is achieved as follows:
[0009] The present invention provides a hybrid brain-computer interface system integrating LLM to realize intention understanding, comprising:
[0010] A signal acquisition module, including an EEG signal acquisition device worn on the user's brain and used to acquire EEG signals, and an eye tracker installed under a computer monitor and used to acquire eye movement data;
[0011] The EEG-eye movement keyword spelling module is connected to the signal acquisition module to obtain EEG and eye movement data streams in real time. The EEG-eye movement keyword spelling module first determines whether the user has the intention to spell characters or select instructions based on the eye movement data analysis. If yes, the SSVEP stimulation is presented to the user through the SSVEP-eye movement Chinese spelling interface and the EEG and eye movement data during the stimulation are collected. The confidence of the target square selected by the two data is calculated based on the EEG data and eye movement data of the user during the stimulation through the SSVEP decoding algorithm and the statistical method. Then, the confidence of the EEG and eye movement signals is weighted and fused based on the EEG-eye movement confidence fusion strategy to determine the user's spelling target, thereby completing the spelling of the keyword;
[0012] The intention generation module is connected to the EEG-eye movement keyword spelling module, and based on the keywords spelled by the user, a large language model is used to generate multiple candidate intentions for the user to choose from.
[0013] Further, the EEG signal acquisition device includes a plurality of active electrodes, a reference electrode, and an EEG cap worn on the user's brain;
[0014] Among them, multiple active electrodes are installed in the slots of the EEG cap according to the international 10-20 lead standard, and the reference electrode is pasted on the mastoid behind the left ear.
[0015] Further, analyzing and determining whether the user has the intention to spell characters or select instructions specifically includes the following steps:
[0016] Step a1, detecting the gaze state and the scanning state by using the eye movement velocity threshold method;
[0017] Step a2: If it is a gaze state, the current gaze point position information (x, y) is added to the sampling point queue, and the process proceeds to step a3; if it is a saccade state, the current gaze point position information (x, y) is not added to the sampling point queue, thereby filtering out irrelevant eye movement data, and the process proceeds to step a3;
[0018] Step a3, determine whether there is a to-be-selected instruction or character area in the sampling point queue, in which the ratio of the sampling point to the queue length is greater than the set threshold. If so, it is determined that the user has the intention to spell characters or select instructions, otherwise it is determined that there is no intention to spell characters or select instructions.
[0019] Furthermore, the implementation method in step a1 is:
[0020] First, the gaze state and the glance state are detected by the following formula:
[0021]
[0022] Where Δd represents the difference between the eye movement data at the previous moment and the next moment; (x t-1 ,y t-1 ) and (x t ,y t ) are the eye movement position information at the previous moment and the next moment respectively; Δt represents the time difference between the eye movement data at the previous moment and the next moment; v is the scanning speed;
[0023] If the scanning speed v is less than the eye movement speed threshold δ, it is considered to be a gaze state, otherwise it is considered to be a scanning state.
[0024] Furthermore, the confidence of the target square selected by the user at different SSVEP stimulation frequencies is determined based on the FBCCA algorithm, which specifically includes the following steps:
[0025] Step b1: filter the collected EEG data S(t) through a bandpass filter group to decompose the EEG data S(t) into multiple sub-band signals Si (t);
[0026] S i (t) = F i *S(t)
[0027] Among them, * represents the convolution operation, F i represents the bandpass filter of the i-th frequency band;
[0028] Step b2: Then, for each target square target stimulation frequency fj, construct a reference signal R j (t), where j = 1, 2, ..., m, to simulate the expected SSVEP response;
[0029] R j (t) = sin(2πf j t+φ j )
[0030] Among them, φ j For different reference signals R j (t) is the phase shift, where t represents time;
[0031] Step b3: Apply canonical correlation analysis to calculate each sub-band signal S i (t) and the jth reference signal R j (t) correlation coefficient;
[0032] Specifically, first, for the sub-band signal S i (t) and the reference signal R j (t), respectively through the matrix W s and W r Projecting both into a one-dimensional vector, the i-th sub-band signal S i (t) and the jth reference signal R j The correlation coefficient of (t) is expressed as:
[0033]
[0034] in, Respectively represent the sub-band signal S i (t) and the reference signal R j The projection matrix of (t), the superscript T represents the transpose, and E(·) represents the mathematical expectation of ·; S i represents the sub-band signal S i (t); R j Represents the reference signal R j (t);
[0035] Step b4: Then, all sub-band signals S obtained by decomposing the EEG signal are i(t) and the jth reference signal R j (t) is weighted squared to obtain the correlation coefficient between the EEG data S(t) and the jth reference signal R j (t) confidence level;
[0036]
[0037] Where W(i) is the weighting coefficient corresponding to the ith sub-band, and the weighting coefficient is determined by the following formula:
[0038] W(i)=i -a +6, (i=1...N)
[0039] Among them, a and b are the hyperparameters to be determined through offline experiments;
[0040] Step b5: loop steps b3 to b4 for m times, and calculate the EEG data S(t) and each reference signal R j (t) confidence; This step obtains the reference signal R j (t) has the same number of confidences, where the confidence of the EEG data S(t) relative to the i-th target is expressed as
[0041] Furthermore, determining the confidence of eye movement data for different target squares based on statistical methods specifically includes the following steps:
[0042] Step c1: for the eye movement data during stimulus presentation, firstly count the number of eye movement sampling points located in different target blocks to be selected;
[0043] Step c2: Calculate the confidence of the eye movement data relative to the i-th target to be selected This step obtains the confidence of m eye movement data relative to different candidate targets.
[0044] Furthermore, the number of eye movement sampling points in step c1 located in different target squares to be selected is determined by the following formula, which indicates that when the sampling point is located in the target square to be selected, the number of statistical points is increased by 1:
[0045]
[0046] Among them, x width To set the length and width of the target square to be selected; (posx i ,posy i ) is the center position of the i-th space to be selected.
[0047] Furthermore, the confidence of the eye movement data in step c2 relative to the i-th target to be selected is Calculated by the following formula:
[0048]
[0049] Among them, n all Indicates the total number of sampling points.
[0050] Furthermore, the implementation method of weighted fusion of the confidence of the two signals based on the EEG-eye movement fusion strategy is as follows:
[0051] The m confidences obtained in step b5 are weighted and fused with the m confidences obtained in step c2 by using the following formula. After a total of m weighted fusions, the target to be selected corresponding to the maximum confidence is the target selected by the user.
[0052]
[0053] Among them, ω EEG and ω ET are the weights of EEG data S(t) and eye movement data in fusion, Refers to the confidence of the i-th candidate target after weighted fusion.
[0054] Furthermore, generating multiple candidate intentions for the user to select specifically includes the following steps:
[0055] Step d1: Before the hybrid brain-computer interface system is run, a large-scale instruction-output pair dataset is first constructed, and the pre-trained large language model is fine-tuned using the Lora algorithm based on the dataset to obtain an adjusted large language model for generating intent text;
[0056] Step d2, using Jieba word segmentation to separate the keywords selected by the user after weighted fusion and input them into the prompt words of the adjusted large language model;
[0057] Step d3. Finally, the fine-tuned large language model will understand the user's intention based on the prompt words containing keywords input in step d2, and generate multiple candidate intentions for the user to choose.
[0058] Beneficial effects of the present invention:
[0059] 1. The present invention improves the accuracy and reliability of EEG decoding, enhances the accuracy of the expression of the user's intention of the brain-computer interface and the efficiency of communication with the outside world by integrating a large language model, and realizes the asynchronous communication capability of the brain-computer interface.
[0060] 2. The present invention brings innovations in the naturalness and convenience of user interaction and the scope of application of the system, providing a broader prospect for the application of brain-computer interface technology.
[0061] 3. The present invention uses eye movement and EEG signals at the same time and takes advantage of the complementarity of the two signals to significantly reduce the impact of noise, thereby improving the accuracy and robustness of signal decoding. In addition, the system further optimizes the decoding results by weighted fusion of the two modal signals and dynamically adjusting the weights according to the real-time data quality.
[0062] 4. The present invention can understand complex user input and generate multiple intent options that are highly relevant to it. This not only greatly improves the naturalness and convenience of user interaction, but also enables the system to provide more accurate and rapid user support in complex application scenarios, such as medical assistance and emergency response.
[0063] 5. The asynchronous input function of the present invention significantly improves the user experience and system flexibility. By monitoring the user's eye movement state to determine his spelling intention, the present invention allows the user to input at any time according to his personal rhythm without waiting for system prompts or operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 It is the overall framework of the present invention;
[0065] Figure 2 A flowchart of a method for using the hybrid brain-computer interface system of the present invention;
[0066] Figure 3 This is a schematic diagram of the SSVEP-eye movement Chinese spelling interface in an embodiment of the present invention;
[0067] Figure 4 It is a schematic diagram of multiple optional intentions in an embodiment of the present invention. DETAILED DESCRIPTION
[0068] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Preferred embodiments of the present invention are provided in the drawings. However, the present invention can be implemented in many other different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive.
[0069] Reference Figure 1 The embodiment of the present application provides a hybrid brain-computer interface system integrating LLM to realize intention understanding, including:
[0070] A signal acquisition module, including an EEG signal acquisition device worn on the user's brain and used to acquire EEG signals, and an eye tracker installed under a computer monitor and used to acquire eye movement data;
[0071] The EEG-eye movement keyword spelling module is connected to the signal acquisition module to obtain EEG and eye movement data streams in real time. The EEG-eye movement keyword spelling module first determines whether the user has the intention to spell characters or select instructions based on the eye movement data analysis. If yes, the SSVEP stimulation is presented to the user through the SSVEP-eye movement Chinese spelling interface and the EEG and eye movement data during the stimulation are collected. The confidence of the target square selected by the two data is calculated based on the EEG data and eye movement data of the user during the stimulation through the SSVEP decoding algorithm and the statistical method. Then, the confidence of the EEG and eye movement signals is weighted and fused based on the EEG-eye movement confidence fusion strategy to determine the user's spelling target, thereby completing the spelling of the keyword;
[0072] The intention generation module is connected to the EEG-eye movement keyword spelling module, and based on the keywords spelled by the user, a large language model is used to generate multiple candidate intentions for the user to choose from.
[0073] Specifically, in this embodiment, the EEG-eye movement keyword spelling module uses a character spelling system based on initials and finals, with the purpose of spelling keywords corresponding to the intentions of Chinese users. The overall interface includes 5×6 spaces and each space is placed with different characters and instructions to be selected, and each space corresponds to a specific frequency of visual stimulation.
[0074] In some embodiments, the EEG signal acquisition device includes a plurality of active electrodes, a reference electrode, and an EEG cap worn on the user's brain;
[0075] Among them, multiple active electrodes are installed in the slots of the EEG cap according to the international 10-20 lead standard, and the reference electrode is pasted on the mastoid behind the left ear.
[0076] When in use, you need to wear an EEG cap and inject conductive paste into the preset active electrodes and reference electrodes to reduce impedance and improve the signal-to-noise ratio of EEG signals. When the impedance is reduced to 15kΩ, EEG data is collected in real time. The real-time EEG data is filtered out of power frequency interference through a 50Hz notch filter, and then band-pass filtered through a 0.5-80Hz band-pass filter to collect as much frequency range as possible.
[0077] In addition, in this embodiment, the EEG signal acquisition device uses the actiCHampPlus EEG acquisition system of the German Brain Product Company, and the eye tracker uses the Tobii Nano eye tracking device, a research product of the Tobii Company.
[0078] In some embodiments, analyzing and determining whether the user intends to spell a character or select an instruction specifically includes the following steps:
[0079] Step a1, detecting the gaze state and the scanning state by using the eye movement velocity threshold method;
[0080] Step a2: If it is a gaze state, the current gaze point position information (x, y) is added to the sampling point queue, and the process proceeds to step a3; if it is a saccade state, the current gaze point position information (x, y) is not added to the sampling point queue, thereby filtering out irrelevant eye movement data, and the process proceeds to step a1;
[0081] Step a3, determine whether there is a to-be-selected instruction or character area in the sampling point queue, in which the ratio of the sampling point to the queue length is greater than the set threshold. If so, it is determined that the user has the intention to spell characters or select instructions, otherwise it is determined that there is no intention to spell characters or select instructions.
[0082] In some embodiments, the implementation method in step a1 is:
[0083] First, the gaze state and the glance state are detected by the following formula:
[0084]
[0085] Where Δd represents the difference between the eye movement data at the previous moment and the next moment; (x t-1 ,y t-1 ) and (x t ,y t ) are the eye movement position information at the previous moment and the next moment respectively; Δt represents the time difference between the eye movement data at the previous moment and the next moment; u is the scanning speed;
[0086] If the scanning speed v is less than the eye movement speed threshold δ, it is considered to be a gaze state, otherwise it is considered to be a scanning state.
[0087] In some embodiments, the confidence level of the target squares selected by the user at different SSVEP stimulation frequencies is determined based on the FBCCA algorithm, specifically including the following steps:
[0088] Step b1: filter the collected EEG data S(t) through a bandpass filter group to decompose the EEG data S(t) into multiple sub-band signals S i (t);
[0089] S i (t) = F i *S(t)
[0090] Among them, * represents the convolution operation, F i represents the bandpass filter of the i-th frequency band;
[0091] Step b2: Then, for each target square target stimulation frequency fj, construct a reference signal R j(t), where j = 1, 2, ..., m, to simulate the expected SSVEP response;
[0092] R j (t) = sin(2πf j t+Φ j )
[0093] Among them, φ j For different reference signals R j (t) is the phase shift, where t represents time;
[0094] Step b3: Apply canonical correlation analysis to calculate each sub-band signal S i (t) and the jth reference signal R j (t) correlation coefficient;
[0095] Specifically, first, for the sub-band signal S i (t) and the reference signal R j (t), respectively through the matrix W s and W r Projecting both into a one-dimensional vector, the i-th sub-band signal S i (t) and the jth reference signal R j The correlation coefficient of (t) is expressed as:
[0096]
[0097] in, Respectively represent the sub-band signal S i (t) and the reference signal R j The projection matrix of (t), the superscript T represents the transpose, and E(·) represents the mathematical expectation of ·; S i represents the sub-band signal S i (t); R j Represents the reference signal R j (t);
[0098] Step b4: Then, all sub-band signals S obtained by decomposing the EEG signal are i (t) and the jth reference signal R j (t) is weighted squared to obtain the correlation coefficient between the EEG data S(t) and the jth reference signal R j (t) confidence level;
[0099]
[0100] Where W(i) is the weighting coefficient corresponding to the ith sub-band, and the weighting coefficient is determined by the following formula:
[0101] W(i)=i -a+b, (i=1...N)
[0102] Among them, a and b are the hyperparameters to be determined through offline experiments;
[0103] Step b5: loop steps b3 to b4 for m times, and calculate the EEG data S(t) and each reference signal R j (t) confidence; This step obtains the reference signal R j (t) has the same number of confidences, where the confidence of the EEG data S(t) relative to the i-th target is expressed as
[0104] In some embodiments, determining the confidence of eye movement data for different target squares based on a statistical method specifically includes the following steps:
[0105] Step c1: for the eye movement data during stimulus presentation, firstly count the number of eye movement sampling points located in different target blocks to be selected;
[0106] Step c2: Calculate the confidence of the eye movement data relative to the i-th target to be selected This step obtains the confidence of m eye movement data relative to different candidate targets.
[0107] In some embodiments, the number of eye movement sampling points in step c1 located in different target squares to be selected is determined by the following formula, which indicates that when the sampling point is located in the target square to be selected, the number of statistical points is increased by 1:
[0108]
[0109] Among them, x width To set the length and width of the target square to be selected; (posx i ,posy i ) is the center position of the i-th space to be selected.
[0110] In some embodiments, the confidence of the eye movement data in step c2 relative to the i-th target to be selected Calculated by the following formula:
[0111]
[0112] Among them, n all Indicates the total number of sampling points.
[0113] In some embodiments, the weighted fusion of the confidences of the two signals based on the EEG-eye movement fusion strategy is implemented as follows:
[0114] The m confidences obtained in step b5 are weighted and fused with the m confidences obtained in step c2 by using the following formula. After a total of m weighted fusions, the target to be selected corresponding to the maximum confidence is the target selected by the user.
[0115]
[0116] Among them, ω EEG and ω ET are the weights of EEG data S(t) and eye movement data in fusion, Refers to the confidence of the i-th candidate target after weighted fusion.
[0117] In some embodiments, generating multiple candidate intentions for user selection specifically includes the following steps:
[0118] Step d1: Before the hybrid brain-computer interface system is run, a large-scale instruction-output pair dataset is first constructed, and the pre-trained large language model is fine-tuned using the Lora algorithm based on the dataset to obtain an adjusted large language model for generating intent text;
[0119] During the fine-tuning process, an Adaptor module is introduced to add a small number of trainable parameters to the large language model to fine-tune the model, thereby obtaining the adjusted large language model for subsequent generation of intent text.
[0120] Step d2: Use Jieba word segmentation to separate the keywords selected by the user after weighted fusion and input them into the prompt words of the adjusted large language model; the input prompt words are converted into a data format that can be processed by the language model through text-to-vector conversion;
[0121] Step d3. Finally, the fine-tuned large language model will understand the user's intention based on the prompt words containing keywords input in step d2, and generate multiple candidate intentions for the user to choose.
[0122] The present invention improves the accuracy and reliability of EEG decoding, enhances the accuracy of brain-computer interface user intention expression and the efficiency of communication with the outside world by integrating a large language model, and realizes the asynchronous communication capability of the brain-computer interface.
[0123] On the other hand, the present invention also provides a working method of a hybrid brain-computer interface system integrating LLM to realize intention understanding, see Figure 2 , specifically including the following steps:
[0124] S1. The user collects EEG data and eye movement data through EEG acquisition equipment and eye tracker, and completes EEG data preprocessing and eye tracker calibration;
[0125] First, you need to wear an EEG cap and inject conductive paste into the preset active electrode and reference electrode to reduce impedance and improve the signal-to-noise ratio of the EEG signal. When the impedance is reduced to 15k Ω, the EEG data is collected in real time. The real-time EEG data is filtered out of power frequency interference through a 50Hz notch filter, and then band-pass filtered through a 0.5-80Hz band-pass filter to collect as much frequency range as possible;
[0126] On the other hand, before using the brain-computer interface system described in the present invention, it is necessary to calibrate the eye tracking device to obtain accurate eye movement data. In this specific embodiment, the eye tracking device is calibrated in the EyeTrackerManager of the Tobii Nano eye tracking device, and a series of predefined calibration points or markers are presented on the display. These calibration points are distributed in a certain space on the screen, covering the entire visible area. When the user looks at these calibration points, the eye tracker records the corresponding eye movement data, including eye movement and gaze position. Through the correspondence between the known calibration points and the eye movement captured by the eye tracker, the parameters of the eye tracker are adjusted to ensure that the subsequent eye movement data can accurately reflect the user's gaze position.
[0127] S2, the user gazes at the character square to be spelled on the EEG-eye movement Chinese keyword spelling interface, and the EEG-eye movement spelling system analyzes the eye movement data to determine whether the user has the intention to spell characters or select instructions. If so, the SSVEP is used to present flashing stimuli and perform keyword spelling;
[0128] Specifically, in this embodiment, a gaze point detection method based on a speed threshold is used to detect the scanning state and the gaze state. When the user gazes at the target square, the current gaze point position information (x, y) is added to a queue with a time length of t and a total of t×SamplingRate sampling points. The number of sampling points of different selected instructions or characters on the screen in the queue is counted. When the number of sampling points located at a certain selected instruction or character is higher than 80% of the queue length, the SSVEP spelling paradigm is started to spell the selected character.
[0129] When 80% of the sampling points in the queue are located on a certain instruction or character to be selected on the screen, it is considered that the user has the intention to execute the instruction, that is, the intention to spell the character or select the instruction. The steady-state visual evoked potential (SSVEP) spelling paradigm is started to spell characters or select commands. This method can solve the failure of spelling intention expression caused by eye movement data jumps and reduce the time of asynchronous system startup.
[0130] S3. The user spells the initial consonant / final vowel / character of the keyword according to the keyword he needs to spell in the SSVEP-Eye Movement Chinese Spelling Interface and enters a confirmation command;
[0131] Specifically, in S2, the user uses the eye tracker to achieve asynchronous initiation of the spelling paradigm, and then the hybrid BCI system presents a 5-row 6-column SSVEP-eye-tracking Chinese spelling interface, see Figure 3 The interface contains 23 initial consonant selection squares, a selection square for A / O / E representing vowel Chinese characters, a "delete" command key for deleting the currently spelled Chinese character, a space command key for separating keywords during spelling, an output command key for keyword confirmation, and the remaining three squares display associative words based on word frequency. After the hybrid brain-computer interface system presents the Chinese spelling interface to the user, the user looks at the square corresponding to the "h" displayed in it, and then the screen will present different frequencies of flashing in each square to induce SSVEP stimulation signals. These frequencies range from 8Hz to 15Hz, with a frequency interval of 0.2Hz between each frequency to avoid harmonic interference. When the square flashes, the user's brain will produce EEG frequency components corresponding to the observed flashing frequency. The hybrid brain-computer interface system confirms the character or instruction that the user intends to enter by matching the frequency with the pinyin square. Once the system confirms the user's choice (in this case, "h"), the corresponding character will be entered into the text box. The hybrid BCI system provides visual or auditory feedback to inform the user that the selection has been successfully recognized and entered.
[0132] S4, using the decoder built into the EEG-eye movement keyword spelling module, decoding the confidence of the EEG data for different target squares based on the FBCCA algorithm, and determining the confidence of the eye movement data for different target squares based on a statistical method;
[0133] Specifically, firstly, a group of bandpass filters are used to process the electroencephalogram (EEG) signal after the S1 preprocessing. Specifically, N sub-bands are set, the bandpass filter range of the nth sub-band is [8n, 8(N+1)], and the electroencephalogram signals of the N sub-bands are extracted by bandpass filtering.
[0134] For each target square, the target stimulation frequency f j , construct a series of reference signals R j (t), where j = 1, 2, ..., m, to simulate the expected SSVEP response.
[0135] Then, for each sub-band signal and the reference signal obtained above, the canonical correlation analysis (CCA) is applied to calculate the correlation coefficient. According to the correlation coefficient of the sub-band signal obtained above for different reference signals, the weighted square sum of the correlation coefficients of N sub-bands is used as the confidence of EEG data decoding.
[0136] On the other hand, for the eye movement data during stimulus presentation, the total number of sampling points n all , set the length and width of the selected block to be x width , the center position of the i-th space to be selected is (pox i ,posy i ), count the number of eye movement sampling points located in different candidate blocks; and calculate the confidence of the EEG data S(t) relative to the i-th candidate target And the confidence of the eye movement data relative to the i-th candidate target
[0137] S5. The EEG-eye movement spelling system uses an EEG-eye movement fusion strategy to achieve confidence weighted fusion, by adjusting the weights of the EEG and eye movement decoding results to adjust the decoding importance of the two modal signals;
[0138] Specifically, the confidence of EEG data S(t) relative to the i-th candidate target The confidence of the eye movement data relative to the i-th candidate target These two confidences respectively measure the extent to which the information obtained from EEG signals and eye movement behavior supports that the current square is the user's intended target;
[0139] In the EEG-eye movement fusion strategy, a weighted average method is used to integrate the confidence of the two modalities. The specific formula is as follows:
[0140]
[0141] Among them, ω EEG and ω ET are the weights of EEG and eye movement data in fusion, Refers to the confidence after weighted fusion. These weights reflect the importance and reliability of each modality in the current context. The target corresponding to the maximum confidence after weighted fusion is the target selected by the user.
[0142] In multimodal fusion, the setting of weights is crucial, as it determines the influence of different signals in the final decision. The weights can be adjusted dynamically according to the reliability of each modal signal. For example, when the user's cognitive state is more focused, the confidence of the EEG signal may be higher; and when the user's gaze moves frequently, the confidence of the eye movement data may be more accurate.
[0143] S6. After the user enters the keyword, he / she selects the "Confirm" button in the SSVEP keyword spelling paradigm interface to send the keyword to the large language model. The SSVEP-Eye Movement Chinese Spelling interface will enter the candidate intent selection interface. After the keyword is entered into the large language model, the candidate intent text will be generated, giving multiple user intents understood by the model.
[0144] Specifically, after the user inputs a keyword, this embodiment takes the keyword "throat" as an example. After spelling the word "throat", the user gazes at the space command key in the selection box to separate the keyword, and then spells another keyword "dry". After spelling, the user gazes at and selects the confirmation key to send the keyword as the input of the large language model.
[0145] Before the keywords enter the large language model, in order to ensure that in an emergency, the keyword recognition can still be accurate when the user does not enter the separator, the precise mode of Jieba word segmentation is used in the present invention to separate the input text as finely as possible.
[0146] Then, a prompt suitable for input into the large language model is constructed based on the selected keywords. These keywords are integrated into a coherent sentence or question so that the large language model can understand the context of these words and generate relevant content. In this embodiment, the following prompt template is used: "The scenario you are facing is the intention understanding of hospital patients. Please generate the intention that the current patient wants to express for me based on the keywords {Keyword1, Keyword2...} given by the following patients. Please only give the relevant intention text and use / as the delimiter of each intention text."
[0147] Input the constructed prompt into the locally adjusted pre-trained model. Set the maximum generation length to control the nature and length of the generated text. The model will generate text based on the input prompt. Process and parse the output of the model, separate different user intent texts by detecting delimiters, and display them on the SSVEP-Eye Movement Chinese Spelling interface as options for selecting intents. In this embodiment, the number of user intents is four, see Figure 4 .
[0148] S7. After the SSVEP-Eye Movement Chinese Spelling interface is updated, the user selects the text option that is most relevant to his current intention, and determines the current target through a method similar to S2-S5, selects one of the multiple user intentions, and sends the intention text to the server via TCP / IP.
[0149] Specifically, after obtaining four user intentions in S6, the user makes a selection through the SSVEP spelling paradigm. However, since there are few options at this time, four flickering stimuli with large frequency differences can be set. In this embodiment, four frequencies of 8.6 Hz, 10.2 Hz, 11.8 Hz, and 13.4 Hz are used for stimulation to improve the SSVEP decoding performance.
[0150] Once the user's choice is decoded, the information is forwarded to the server. The server may be a monitoring center or a mobile device of professionals such as doctors and nurses. This ensures that the professional team can monitor the patient's status and intentions in real time and respond or adjust the treatment plan in a timely manner.
[0151] After receiving the user's selection, the server can perform further data analysis and recording, and adjust treatment or communication according to the user's selection. For example, if the user selects the option that says "I feel a sore throat and am very thirsty and need to drink water", the server can immediately notify the on-site medical staff to intervene.
[0152] The present invention significantly improves the accuracy of EEG signal decoding by integrating eye tracking technology and EEG decoding technology. Traditional brain-computer interface systems mainly rely on a single signal source, such as EEG, which is often affected by high noise levels and individual differences, resulting in unstable decoding performance. The present invention uses eye movement and EEG signals at the same time, taking advantage of the complementarity of the two signals, significantly reducing the impact of noise, thereby improving the accuracy and robustness of signal decoding. In addition, the system further optimizes the decoding results by weighted fusion of the two modal signals and dynamically adjusting the weights according to real-time data, ensuring the system's high sensitivity and responsiveness to user intentions.
[0153] Secondly, the present invention uses advanced natural language processing technology to fine-tune instructions based on a pre-trained language model, deeply understand the user's intentions and generate corresponding intention texts to be selected. This is something that traditional brain-computer interface systems do not have. Traditional systems can usually only recognize simple instructions or choices, while the present invention can understand complex user inputs and generate multiple intention options that are highly relevant to them. This not only greatly improves the naturalness and convenience of user interaction, but also enables the system to provide more precise user support in complex application scenarios, such as medical assistance, emergency response, etc.
[0154] Finally, the asynchronous input function of the present invention significantly improves the user experience and system flexibility. By monitoring the user's eye movement state to determine his spelling intention, the present invention allows the user to input at any time according to his personal rhythm without waiting for system prompts or operations. This asynchronous operation mode not only reduces the user's waiting time and improves input efficiency, but also enables the system to maintain a high degree of responsiveness and adaptability without the need for continuous user attention.
[0155] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered within the protection scope of the present invention. In addition, the technical solutions between the various embodiments of the present invention can be combined with each other, but it must be based on the ability of ordinary technicians in the field to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A hybrid brain-computer interface system integrating LLM to realize intention understanding, characterized in that: include: A signal acquisition module, including an EEG signal acquisition device worn on the user's brain and used to acquire EEG signals, and an eye tracker used to acquire eye movement data; The EEG-eye movement keyword spelling module is connected to the signal acquisition module to obtain EEG and eye movement data streams in real time; the EEG-eye movement keyword spelling module first determines whether the user has the intention to spell characters or select instructions based on the eye movement data analysis, and if so, presents SSVEP stimulation to the user through the SSVEP-eye movement Chinese spelling interface and collects EEG and eye movement data during the stimulation, and calculates the confidence of the target square selected based on the EEG data and eye movement data of the user during the stimulation through the SSVEP decoding algorithm and the statistical method, and then performs weighted fusion of the confidence of the EEG and eye movement signals based on the EEG-eye movement confidence fusion strategy to determine the user's spelling target, thereby completing the spelling of the keyword; The intention generation module is connected to the EEG-eye movement keyword spelling module, and based on the keywords spelled by the user, a large language model is used to generate multiple candidate intentions for the user to choose from.
2. The hybrid brain-computer interface system according to claim 1, characterized in that: The EEG signal acquisition device includes a plurality of active electrodes, a reference electrode, and an EEG cap worn on the user's brain; Among them, multiple active electrodes are installed in the slots of the EEG cap according to the international 10-20 lead standard, and the reference electrode is pasted on the mastoid behind the left ear.
3. The hybrid brain-computer interface system according to claim 1, characterized in that: Analyzing and determining whether the user has the intention to type a character or select an instruction specifically includes the following steps: Step a1, detecting the gaze state and the scanning state by using the eye movement velocity threshold method; Step a2: If it is in the gaze state, add the current gaze point position information (x, y) to the sampling point queue and proceed to step a3; If it is a scanning state, the current gaze point position information (X, y) is not added to the sampling point queue, thereby filtering out irrelevant eye movement data and entering step a3; Step a3: determine whether there is a to-be-selected instruction or character area in the sampling point queue. If so, it is determined that the user has the intention to spell characters or select instructions. Otherwise, it is determined that there is no intention to spell characters or select instructions.
4. The hybrid brain-computer interface system according to claim 3, characterized in that: The implementation method of step a1 is: First, the gaze state and the glance state are detected by the following formula: Where Δd represents the difference between the eye movement data at the previous moment and the next moment; (x t-1 ,y t-1 ) and (x t ,y t ) are the eye movement position information at the previous moment and the next moment respectively; Δt represents the time difference between the eye movement data at the previous moment and the next moment; v is the scanning speed; If the scanning speed v is less than the eye movement speed threshold 6, it is considered to be a gaze state, otherwise it is considered to be a scanning state.
5. The hybrid brain-computer interface system according to claim 4, characterized in that: Determining the confidence of the target squares selected by the user at different SSVEP stimulation frequencies based on the FBCCA algorithm specifically includes the following steps: Step b1: filter the collected EEG data S(t) through a bandpass filter group to decompose the EEG data S(t) into multiple sub-band signals S i (t); S i (t)=F i *S(t) Among them, * represents the convolution operation, F i represents the bandpass filter of the i-th frequency band; Step b2: Then, for each target square, the target stimulation frequency f j , construct the reference signal R j (t), where j = 1, 2, ..., m, to simulate the expected SSVEP response; R j (t)=sin(2πf j t+φ j ) Among them, φ j For different reference signals R j (t) is the phase shift, where t represents time; Step b3: Apply canonical correlation analysis to calculate each sub-band signal S i (t) and the jth reference signal R j (t) correlation coefficient; Specifically, first, for the sub-band signal S i (t) and the reference signal R j (t), respectively through the matrix W s and W r Projecting both into a one-dimensional vector, the i-th sub-band signal S i (t) and the jth reference signal R j The correlation coefficient of (t) is expressed as: in, Respectively represent the sub-band signal S i (t) and the reference signal R j The projection matrix of (t), the superscript T represents the transpose, and E(·) represents the mathematical expectation of ·; S i represents the sub-band signal S i (t); R j Represents the reference signal R j (t); Step b4: Then, all sub-band signals S obtained by decomposing the EEG signal are i (t) and the jth reference signal R j (t) is weighted squared to obtain the correlation coefficient between the EEG data S(t) and the jth reference signal R j (t) confidence level; Where W(i) is the weighting coefficient corresponding to the ith sub-band, and the weighting coefficient is determined by the following formula: W(i)=i -a +b,(i=1...N) Among them, a and b are the hyperparameters to be determined through offline experiments; Step b5: loop steps b3 to b4 for m times, and calculate the EEG data S(t) and each reference signal R j (t) confidence; This step obtains the reference signal R j (t) has the same number of confidences, where the confidence of the EEG data S(t) relative to the i-th target is expressed as 6. The hybrid brain-computer interface system according to claim 5, characterized in that: Determining the confidence of eye movement data for different target squares based on statistical methods specifically includes the following steps: Step c1: for the eye movement data during stimulus presentation, firstly count the number of eye movement sampling points located in different target blocks to be selected; Step c2: Calculate the confidence of the eye movement data relative to each candidate target This step obtains the confidence of m eye movement data relative to different candidate targets.
7. The hybrid brain-computer interface system according to claim 6, characterized in that: The number of eye movement sampling points in step c1 located in different target blocks to be selected is determined by the following formula: Among them, x width To set the length and width of the target square to be selected; (posx i ,posy i ) is the center position of the i-th space to be selected.
8. The hybrid brain-computer interface system according to claim 7, characterized in that: The confidence of the eye movement data in step c2 relative to the i-th target to be selected Calculated by the following formula: Among them, n all Indicates the total number of sampling points.
9. The hybrid brain-computer interface system according to claim 8, characterized in that: The implementation method of weighted fusion of the confidence of the two signals based on the EEG-eye movement fusion strategy is as follows: The m confidences obtained in step b5 are weighted and fused with the m confidences obtained in step c2 by using the following formula. After a total of m weighted fusions, the target to be selected corresponding to the maximum confidence is the target selected by the user. Among them, ω EEG and ω ET are the weights of EEG data S(t) and eye movement data in fusion, Refers to the confidence of the i-th candidate target after weighted fusion.
10. The hybrid brain-computer interface system according to any one of claims 1 to 9, characterized in that: Generating multiple candidate intents for the user to select specifically includes the following steps: Step d1: Before the hybrid brain-computer interface system is run, a large-scale instruction-output pair dataset is first constructed, and the pre-trained large language model is fine-tuned using the Lora algorithm based on the dataset to obtain an adjusted large language model for generating intent text; Step d2, using Jieba word segmentation to separate the keywords selected by the user after weighted fusion and input them into the prompt words of the adjusted large language model; Step d3. Finally, the fine-tuned large language model will understand the user's intention based on the prompt words containing keywords input in step d2, and generate multiple candidate intentions for the user to choose.
Citation Information
Cited By
Fusion intention prediction method, device and system, storage medium and program product
CN121256665A
Chinese spoken language intention recognition brain-computer interface system based on pronunciation-meaning integration double models
CN121560160A
