It is a kind of based on P300 brain power mode without threshold value brain method of switching
Technical field
The present invention relates to brain-computer interface field, in particular to it is a kind of based on P300 brain power mode without threshold value brain switch side
Method.
Background technique
Brain-computer interface (brain computer interface, BCI) is that one kind does not depend on peripheral neverous system and muscle
Tissue, and that establishes between brain and external device directly exchange and control channel, is the new human-machine interface technology of one kind,
Life auxiliary and rehabilitation of the technology in disabled person (such as amyotrophic lateral sclerosis ALS, brain stem apoplexy, spinal cord injury SCI etc.)
Treatment aspect plays a significant role, and at home and abroad causes extensive concern at present.Brain power mode for brain-computer interface is main
There are Mental imagery, P300, SSVEP, single mode brain-computer interface can be constituted with one such mode, or combine therein more
Kind mode forms multi-mode brain-computer interface.It can be worked using the brain-computer interface of P300 brain power mode in synchronization
(synchronous) or asynchronous (asynchronous) state, synchronous brain-computer interface need given user to carry out cerebration
At the beginning of, and asynchronous brain-computer interface then allows user to start cerebration at any time as needed, it is clear that asynchronous brain-computer interface
Practicability it is stronger, but since asynchronous brain-computer interface needs continuous detection user to be in state of a control or idle state, institute
It is much larger with the more synchronous brain-computer interface of the difficulty of realization.
Brain switch is a kind of typical asynchronous brain-computer interface, it can be used for controlling the ON/OFF of another synchronous brain-computer interface, or
Person directly controls the ON/OFF of external equipment, such as TV, electric light, air-conditioning.The brain switching requirements of one function admirable are at user
It reports by mistake when idle state, is quickly responded as far as possible when user is in state of a control less as far as possible.At present both at home and abroad
Have some based on Mental imagery, has been based on SSVEP, or brain is realized based on the multi-mode brain-computer interface of a variety of brain power modes
The function of switch.But these existing methods require to rely on one or more threshold values and carry out decisions, i.e., when it is calculated some
Value is determined as state of a control when being more than the threshold value of setting, is otherwise idle state.This way has the shortcomings that following three: the
One, threshold value itself is difficult to determine, since it is desired that true positive rate and false positive rate the considerations of compromise;Second, usually selected with ROC curve
Threshold value is selected, so relatively great amount of training data is needed, than relatively time-consuming;Third, selected threshold value are unable to prolonged use, because
There is variability for EEG signals itself.
Summary of the invention
The purpose of the present invention is to overcome the shortcomings of the existing technology and deficiency, provides a kind of nothing based on P300 brain power mode
The asynchronous brain method of switching of threshold value, while guaranteeing that it has with existing method quite or more preferably than existing method performance.I.e.
Brain method of switching of the present invention does not need to set any threshold value, while guaranteeing the low false positive rate and control shape of idle state
The high true positive rate of state.
The purpose of the invention is achieved by the following technical solution:
It is a kind of that detection method is switched without threshold value brain based on P300 brain power mode, including the following steps:
S1, the initialization of brain wave acquisition hardware system and the starting of electrical brain stimulation interface;
S2, it acquires user respectively by the brain wave acquisition hardware system and is in state of a control and idle state hypencephalon electricity
Training data;
S3, off-line training, respectively to the time series brain electricity training data under state of a control and idle state of acquisition
It is split, obtains feature vector and its corresponding class label, and the feature vector based on extraction and class label training
SVM1 classifier and SVM2 classifier;
S4, online processing in real time, acquire the EEG signals data of currently used person in real time, extract feature vector, lead to respectively
First time categorised decision and second of categorised decision are crossed, converts control external equipment " ON/OFF " for the EEG signals of user
Control command.
Further, the electrical brain stimulation interface includes 4 flashing keys, and one of key is on & off switch, the other three key
For pseudo- key, the flashing key is located at the lower right corner, the upper left corner, the upper right corner and the lower left corner at the electrical brain stimulation interface, and with
Random manner flashes the EEG signals with P300 brain power mode for inducing user.
Further, the discrete training of step S3 specifically includes:
Brain electricity training data is carried out bandpass filtering and standardization by S31, pretreatment;
S32, feature extraction carry out feature to the brain electricity training data under state of a control and idle state respectively and mention
It takes, the feature includes feature vector and class label, wherein described eigenvector extraction process are as follows: from selected " O1 ",
" Oz ", " O2 ", " P3 ", " Pz ", " P4 ", " CP3 ", " CPz ", " CP4 ", " C3 ", " Cz ", " C4 ", " FC3 ", " FCz " and " FC4 "
It is that each key flash extracts one section of initial characteristics signal in 15 channels, by 15 channels after 1/6th times of down-sampling
Data concatenating at a P300 brain power mode feature vectorWherein i, k, r respectively represent i-th of key, k-th
Round (i.e. kth wheel flash, hereinafter referred to as k-th of round) and r-th trial (are tested for i.e. the r times, hereinafter referred to as r-th
Trial, wherein each trial includes 10 round), i ∈ { 1 ..., 4 }, k ∈ { 1 ..., 10 }, r ∈ { 1 ..., 20 };
S33, classifier training utilize the feature vector of the P300 brain power modeAnd its described in class label training
Then SVM1 classifier is surveyed with the feature vector of the P300 brain power mode of SVM1 classifier round each to each trial
Examination, obtains corresponding score value Si, and Si progress minimax is normalized to obtainBy four of each roundWith 1,2,3,4
Sequence composition characteristic vectorFor training the SVM2 classifier.
Further, processing specifically includes the step S4 in real time online:
S40, real-time data acquisition, the EEG signals data of nearest 3 round of the provisional preservation of extract real-time;
EEG signals data are carried out bandpass filtering and standardization by S41, pretreatment;
S42, feature extraction carry out characteristic vector pickup, extraction process to EEG signals data are as follows: from selected " O1 ",
" Oz ", " O2 ", " P3 ", " Pz ", " P4 ", " CP3 ", " CPz ", " CP4 ", " C3 ", " Cz ", " C4 ", " FC3 ", " FCz " and " FC4 "
It is the characteristic signal for the EEG signals data that each key flash extracts nearest 3 round in 15 channels, through 1/6th times
Down-sampling after by the data concatenating in 15 channels at the feature vector of a P300 brain power mode, recently three times by each key
The feature vector for flashing corresponding P300 brain power mode is overlapped the average P300 feature vector as current flashing key;
S43, first layer categorised decision, the SVM1 classifier for calling the step S3 off-line training to obtain are online to four
P300 feature vector is tested, and 4 score values are obtained, and is positive and is the largest if corresponding to the score value of on & off switch,
Step S44 is turned to, otherwise, current state decision is idle state;
S44, second layer categorised decision, 4 score values that the step S43 is obtained constitute score value feature vector, and call
The SVM2 classifier that the step S3 off-line training obtains is tested, and a new score value is obtained.If the score value be it is positive,
Then current state decision is state of a control, is otherwise idle state, if user is consecutively detected 3 secondary control states,
Export the control command of one " ON/OFF ".
Further, the minimax method for normalizing in the step S3 off-line training are as follows:
Wherein Si andSVM score value before and after respectively normalizing.
Further, the key flash of 4 flashing keys on the electrical brain stimulation interface is as unit of round, and one
Round refers to that 4 keys are each glittering primary with random sequencing, and each glittering duration is 100ms, and each key dodges
Bright gap 100ms, therefore each round duration 800ms.
Further, the length in state of a control and idle state hypencephalon electricity training data is 20 trial,
Wherein, trial indicates the unit of training data length, and a trial includes the key flash of 10 round.
Further, the bandpass filtering used band is 0.5-30Hz, signal amplitude after the standardization be [- 1,
1]。
The present invention has the following advantages and effects with respect to the prior art:
1) maximum advantage is existing without setting threshold value than existing methods for asynchronous brain method of switching disclosed by the invention
Method is based on SSVEP whether based on Mental imagery, or is required to be manually set one or more threshold values based on multi-modal
For decision, and threshold value has selection relatively difficult, selects the time long, the disadvantages of cannot using for a long time.
2) method of the invention utilizes two layers of SVM classifier, and first to switch key progress, whether there is or not the inspections of P300, then to by 4
The new feature that a score value is constituted is made whether the inspection for control state, finally directly carries out decision by the score value of two SVM,
Without threshold value, this has been largely overcoming the deficiency of existing method.
Detailed description of the invention
Fig. 1 is the application schematic diagram without threshold values brain method of switching disclosed by the invention based on P300 brain power mode;
Fig. 2 is the process step figure without threshold values brain method of switching disclosed by the invention based on P300 brain power mode;
Fig. 3 is the electrical brain stimulation surface chart without threshold values brain method of switching disclosed by the invention based on P300 brain power mode.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer and more explicit, right as follows in conjunction with drawings and embodiments
The present invention is further described.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and do not have to
It is of the invention in limiting.
Embodiment
Referring to Figure 1, Fig. 1 be disclosed in the present embodiment one based on P300 brain power mode without threshold values brain method of switching
Application schematic diagram.Application without threshold values brain method of switching shown in FIG. 1 based on P300 brain power mode passes through completely new brain first
Electro photoluminescence interface gives user visual stimulation, the brain wave acquisition hardware system being then made of electrode cap and eeg amplifier
The EEG signals of user are acquired, then by, without threshold values brain method of switching, EEG signals being turned based on P300 brain power mode
Turn to the order of control external equipment " ON/OFF ".As shown in Fig. 2, it should be examined based on being switched without threshold value brain for P300 brain power mode
Survey method the following steps are included:
Step S1, the initialization of brain wave acquisition hardware system and the starting of electrical brain stimulation interface.
Above-mentioned brain wave acquisition hardware system includes electrode cap and eeg amplifier, above-mentioned brain wave acquisition hardware system initialization
It is primarily referred to as equipment connection, the scalp brain electricity of user is acquired by electrode cap, eeg amplifier, the sample rate of signal
For 250Hz, EEG signals, which are passed to, after acquisition carries out decision conversion without threshold values brain switching algorithm based on P300 brain power mode.
The electrical brain stimulation interface includes 4 flashing keys, and one of key is on & off switch, and the other three key is pseudo- key, no
Any switch control functions are played, any control command are not corresponded to, for providing real time contrast on & off switch and sentencing subsequent
For constituting new feature in disconnected.
Electrical brain stimulation interface in the present embodiment is referred to shown in attached drawing 3, and corresponding 1 on & off switch is located at the lower right corner,
Corresponding 3 pseudo- keys are located at the upper left corner, the upper right corner, the lower left corner, and 4 flashing keys are flashed in a random way for inducing tool
There are the EEG signals of P300 brain power mode.
For the key flash of 4 flashing keys on the electrical brain stimulation interface as unit of round, a round refers to 4
Key is each glittering primary with random sequencing, and each glittering duration is 100ms, the glittering gap of each key
100ms, therefore each round duration 800ms, the attribute of flashing are color.
Step S2, user's brain electricity training data is acquired.
Step S2 acquisition user's brain electricity training data refer to two sections of users of acquisition be respectively at state of a control and
The length of brain electricity training data when idle state, every segment data is 20 trial, and trial is the usual table in brain-computer interface field
Show the unit of training data length, a trial includes the key flash of 10 round in the embodiment of the present invention.It is i.e. each
The trial duration is 8s, between trial between be divided into 2S, so the acquisition time of every section of training data is about 200s.
In step S2 acquisition user's brain electricity training data, require to watch brain electricity thorn attentively when user is in state of a control
Swash the on & off switch on interface, does not watch any flashing key on electrical brain stimulation interface when being in idle condition attentively then.
Step S3, off-line training.
The step S3 off-line training includes three S31 pretreatment, S32 feature extraction and S33 classifier training main portions
Point, wherein data prediction improves signal-to-noise ratio mainly for eliminating noise;Feature extraction is mainly according to the original of P300 brain power mode
Reason, is split the time series EEG signals of acquisition, obtains feature vector and its corresponding class label;Classifier training
It is to train two SVM classifiers with the feature vector and class label extracted, for step S4, real-time processing stage is called online.
The S31 pretreatment of the step S3 off-line training, which refers to, carries out bandpass filtering and standardization, band logical for EEG signals
Filtering used band is 0.5-30Hz, and the signal amplitude after standardization is [- 1,1].
Feature extraction S32 in the step S3 off-line training refers to that from the resulting training data concentration of step S2 be each
Feature vector and class label that a P300 brain power mode is extracted in key flashing are flashed, for training SVM classifier (wherein,
SVM:Support Vector Machine, Chinese name: support vector machines), it is that common one kind has supervision to learn in machine learning
Model is practised, pattern-recognition, classification and regression analysis are commonly used in, SVM is used to classify by the present invention.With the training of state of a control
For data set, specific practice are as follows: first, from 15 selected channels (" O1 ", " Oz ", " O2 ", " P3 ", " Pz ", " P4 ",
" CP3 ", " CPz ", " CP4 ", " C3 ", " Cz ", " C4 ", " FC3 ", " FCz ", " FC4 ") it is that each key flash extracts one section initially
Characteristic signal, specific practice are that the EEG signals extracted in the 100ms-500ms period after the key flash occurs are used as just
The feature vector of beginning, but each key actually only glittering 100ms.Wherein, above-mentioned 15 channels are according to international electroencephalology meeting
The electrode position that 10/20 standard defines is selected from pillow page, top page and the middle section for being easy to occur P300 brain power mode.The
Two, EEG signals obtained are carried out to 1/6th times of down-sampling, and by the data concatenating in 15 channels at a P300
The feature vector of brain power modeThe flashing of corresponding flashing key, wherein i, k, r respectively represent i-th of key, k-th
Round and r-th of trial.Because each trial includes 10 round, all keys can be glittering in each round
Once, and one-stage control state or the data of idle state include 20 trial, so i ∈ { 1 ..., 4 } here, k ∈
{ 1 ..., 10 }, r ∈ { 1 ..., 20 }.Therefore, from the training data of state of a control, each key extracts 200 P300
The feature vector (20 trial × 10 round × 1 target glint key) of brain power mode.The training dataset of idle state
Also make same processing.
S33 classifier training in the step S3 off-line training refers to two SVM classifier models of training (respectively
SVM1 classifier and SVM2 classifier), specific practice are as follows: first, with from the training dataset under state of a control and idle state
The feature vector of the P300 brain power mode of middle extractionAnd its class label (1 and -1) training SVM1 classifier.Second, use SVM1
The feature vector of the P300 brain power mode of classifier round each to each trial is tested, and corresponding score value Si is obtained,
Si progress minimax is normalized to obtainBy four of each roundWith 1,2,3,4 sequence composition characteristic vectorThe flashing of a corresponding round, wherein k, r respectively represent k-th of round and r-th of trial.In this way from state of a control and
The training data concentration of idle state respectively obtains 200Feature vector, class label is respectively 1 and -1, for training
SVM2。
The minimax method for normalizing that model training in step 3 off-line training is used are as follows:
Wherein Si andSVM score value before and after respectively normalizing.
Step S4, online processing in real time.
Step S4 mainly includes five parts, i.e., real-time data acquisition, pretreatment, feature extraction, first layer categorised decision and
Second layer categorised decision.Wherein pretreatment is consistent with step S3, and feature extraction and the difference of step S3 are each key most
Corresponding P300 feature vector is closely flashed three times and is overlapped the average feature as the key, and first layer classification invocation step three is instructed
Whether the SVM1 classifier perfected is positive for judging the score value of switch key and maximum, when first layer classifier judging result is
Fictitious time thinks it is currently Idle state, does not need to carry out second layer classification, otherwise carries out second layer classification, the i.e. training of invocation step three
Good SVM2 classifier is for judging whether current round belongs to control state.
Class label is unknown when online processing in real time, and user was likely at any time in state of a control or free time
State, the process of classification are exactly to identify the process of its class label in fact.
The step S4 is handled as unit of round in real time online, i.e., every 800ms (round) decision is primary.Decision
Process particularly may be divided into following steps:
S40 real-time data acquisition only needs the EEG signals of provisional nearest 3 round of preservation online when processing in real time
Data, and updated after each round.
S41 pretreatment, it is consistent with being pre-processed in the step S3.
S42 feature extraction, similar with the feature extraction of the step S3 off-line training, difference is each key is nearest
The feature vector for flashing corresponding P300 brain power mode three times is overlapped the average P300 feature vector as current flashing key,
The feature vector of an online P300 brain power mode is extracted for each key in current round flashing in this way.
Data have been collected in training stage, 200 flashings in total of each key, corresponding 200 feature vectors,
These feature vectors are all used for SVM classifier training.Step S4 needs real-time judge, specific practice when processing in real time online
Be it is every to have dodged round judgement primary, a round includes 4 key flash, and each key dodges primary, thus corresponds to 4
Feature vector, so judgement is all to go to judge with 4 new feature vectors every time.The feature vector of each key is only corresponded at this time
The not instead of data of present single flashing, what the eeg data superposed average flashed three times recently obtained.
S43 first layer categorised decision, the SVM1 classifier for calling the step S3 off-line training to obtain are online to four
P300 feature vector is tested, and 4 score values are obtained.If the score value for corresponding on & off switch is positive and is the largest,
Step S44 is turned to, otherwise, current state decision is Idle state.
S44 second layer categorised decision, 4 score values that step S43 is obtained according to the step S3 off-line training method
Score value feature vector is constituted, and is tested with SVM2 classifier, a new score value is obtained.If the score value be it is positive,
Current state decision is control state, is otherwise Idle state.Finally, being exported if user is consecutively detected 3 secondary control states
The control command of one " ON/OFF ".
Above-mentioned second layer categorised decision is to be pressed on the basis of first time categorised decision by four to current round
The corresponding SVM1 classifier score value of key is classified again, further judges whether current round belongs to control state.The mesh done so
Be reduce judgement error rate.
The above embodiment is a preferred embodiment of the present invention, but embodiments of the present invention are not by above-described embodiment
Limitation, other any changes, modifications, substitutions, combinations, simplifications made without departing from the spirit and principles of the present invention,
It should be equivalent substitute mode, be included within the scope of the present invention.