Abstract:
A direct neural interface system comprised of electrodes for acquiring electrophysiological signals representative of a neuronal activity of a subject&#39;s brain; a pre-processor for conditioning, digitizing and preprocessing the electrophysiological signals; a processor for processing the digitized and preprocessed electrophysiological signals and generating command signals; and an output for outputting said command signals; wherein the processor is adapted for: representing the electrophysiological signals acquired over an observation time window in the form of a N-way data tensor, N being greater or equal to three; and generating command signals corresponding to the observation time window by applying a multi-way regression model over the data tensor. A method of calibrating the direct neural interface system.

Description:
FIELD 
     The invention relates to a direct neural interface system, to a method of calibrating such a system and to a method of interfacing a subject&#39;s brain to an external device. 
     BACKGROUND 
     Direct neural interface systems, also known as brain-computer interfaces (BCI) allow using electrophysiological signals issued by the cerebral cortex of a human or animal subject for driving an external device. BCI have been the subject of intense research since the seventies. At present, a human subject or an animal can drive “by the thought” a simple device, such as a cursor on a computer screen. In 2006, a tetraplegic subject has even been able to drive a robotic arm through a BCI. See the paper by Leigh R. Hochberg et al. “Neuronal ensemble control of prosthetic devices by a human with tetraplegia”, Nature 442, 164-171 (13 Jul. 2006). 
     Until now, the best results in this field have been obtained using invasive systems based on intracortical electrodes. Non-invasive systems using electroencephalographic (EEG) signals have also been tested, but they suffer from the low frequency resolution of these signals. Use of electrocorticographic (ECoG) signals, acquired by intracranial electrodes not penetrating the brain cortex, constitutes a promising intermediate solution. 
     Conventional BCI systems use a limited number of “features” extracted from EEG or ECoG signals to generate command signals for an external device. These features can be related e.g. to the spectral amplitudes, in a few determined frequency bands, of ECoG signals generated by specific regions of the cortex when the subject imagine performing predetermined action. As a result, only a few features of the signal are used, while the other features of the signal are not taken into account. 
     For example, in the paper by Schalk G., Kubanek J., Miller K. J., Anderson N. R., Leuthardt E. C., Ojemann J. G., Limbrick D., Moran D. W., Gerhardt L. A. and Wolpaw J. R. “Decoding two-dimensional movement trajectories using electrocorticographic signals in humans” J. Neural. Eng. 4 (2007), 264-75, a subject has been trained to modulate the spectral amplitude of the signals issued by a few Brodmann regions of its cortex in several frequency bands. 
     This approach is not completely satisfactory as, for any different command signal to be generated (e.g. vertical or horizontal movement of a cursor on a screen) it is necessary to identify different features, associated to different actions imagined by the subject and substantially uncorrelated from each other. Especially if the number of different commands signals to be generated is greater than two or three, this can get very complicated. Moreover, this approach is intrinsically inefficient as only a small amount of the information carried by the acquired ECoG signals is exploited. 
     The paper by K. Nazarpour et al. “Parallel Space-Time-Frequency Decomposition of EEG Signals of Brain Computer Interfacing”, Proceedings of the 14 th  European Signal Processing Conference (EUSIPCO 2006), Florence, Italy, Sep. 4-8, 2006 discloses a method of processing EEG signals, based on multi-way analysis. In the method described by this paper, EEG signals are acquired by 15 electrodes disposed on a subject&#39;s scalp. The acquired signals are preprocessed, which includes spatial filtering, digitization and wavelet transform. Preprocessed data are arranged in a three-way tensor, the three ways corresponding to space (i.e. electrode location on the subject&#39;s scalp), time and frequency. A tensor corresponding to signals acquired over a 3-second observation window during which the subject imagines moving either the left of the right index is decomposed using the well-known PARAFAC (PARallel FACtors) technique. Then classification is performed using SVM Method (Support Vector Machine). As traditional classification methods, SVM enables the classification of observation vectors. This is why the tensor corresponding to signals is projected on one dimension, namely the spatial dimension, before the classification is carried out. The spatial signatures of the first two PARAFAC factors are fed to a suitable classifier which discriminates between a left index and right index imaginary movement. This method suffers from a few important drawbacks. 
     First of all, as only the spatial signatures of the PARAFAC factors are used, a large amount of the available information is lost. Furthermore PARAFAC is applied to decompose EEG signal tensor before and independently of classification. Being a generalization of principal component analysis (PCA), PARAFAC projects the tensor to a low dimensional space trying to explain the variability of observations (EEG), keeping the dominant (i.e. most informative) components of signal, but without taking into account their relevance for discrimination. Otherwise stated, non event-related information (useless for discrimination) can be retained, while event-related (and therefore useful for discrimination) components having low amplitude can be lost. 
     Moreover, a “human” intervention is still required to associate the classifier output to the left or to the right index movement. In other words, this step, the so-called calibration procedure, is not carried out automatically. 
     Also, only a rather narrow frequency band is considered (μ band). This band is known to be usable in EEG-based BCI. Otherwise stated, like in “classical” method there is a pre-selection of only a small portion of the available information. 
     Most prior art BCI systems—including the previously-described one by K. Nazarpour et al.—are based on a “cue-paced”, or synchronized, approach where subjects are waiting for an external cue that drives interaction. As a result users are supposed to generate commands only during specific periods. The signals outside the predefined time windows are ignored. However, in a real-life environment this restriction would be very burdensome. As opposed to the “cue-paced” systems, no stimulus is used by “self-paced” BCIs. However, the performances of prior-art self-paced BCIs are not suitable for practical application in particular because of a high level of false system activation, which causes frustration of users and limits the application of the system. Moreover, prior art self-paced BCI experiments were carried out in laboratory conditions, which differ significantly from natural environment where users are not concentrated properly, can be disturbed by external noises, etc. In the majority of prior art self-paced experiments, session time does not exceed several minutes, which is not enough to verify BCI performance. Finally, duration of experiment series is short enough to neglect long-term brain plasticity effects. For examples of prior art self-paced BCI, see e.g.:
         C. S. L. Tsui, J. Q. Gan, S. J. Roberts “A self paced brain-computer interface for controlling a robot simulator: an online event labeling paradigm and an extended Kalman filter based algorithm for online training”, Med Biod Eng Comput (2009) 47:257-265   Fatourechi, R. K. Ward and G. E. Birch, “A self-paced brain-computer interface system with a low false positive rate,” J Neural Eng 5:9-23. doi:10.1088/1741-2560/5/1/002.       

     SUMMARY 
     The invention aims at overcoming at least some of the drawbacks of the prior art. In particular, the invention aims at allowing better utilization of the available information, and/or at avoiding the need for human intervention for associating electrophysiological activity to intended or motor action. 
     An object of the present invention is a direct neural interface system comprising:
         signal acquisition means for acquiring electrophysiological signals representative of a neuronal activity of a subject&#39;s brain;   preprocessing means for conditioning, digitizing and preprocessing said electrophysiological signals;   processing means for processing the digitized and preprocessed electrophysiological signals and for generating command signals as a function thereof; and   output means for outputting said command signals;       

     wherein said processing means are adapted for:
         representing the electrophysiological signals acquired over an observation time window in the form of a N-way data tensor, N being greater or equal to two, and preferably greater or equal to three; and   generating command signals corresponding to said observation time window by the application of a multi-way regression model over said data tensor.       

     The multi-way regression model can result from a specific calibration procedure, which will be defined below. 
     In the inventive direct neural interface system, command signals are generated by applying a multi-way regression over a N-way (two-way or more, and preferably three-way or more) input data tensor. This allows efficient exploitation of the information content of the acquired signals. 
     In a preferred embodiment of the invention, the data tensor associated to each observation time window can be a three-way data tensor, said three ways corresponding to time, frequency and space (i.e. electrode location). Greater dimensions may be used, for example when the electrodes location is determined by two or more spatial coordinates. Conversely, the data tensor can only be two-way, e.g. if only one measurement electrode is used. 
     Multi-way regression can be linear. In this case, it can advantageously be based on the well-known N-way Partial Least Squares (or NPLS, or N-PLS) method. As indicated by its name, this technique is based on the minimization of a quadratic error; as it will be understood by the person skilled in the art of signal processing, alternative and more robust methods can minimize e.g. an absolute-value error. 
     Advantageously, the method of the invention can be carried out on EcOG signal, but this is not essential. Intracortical, EEG and even magneto-encephalographic signals could also be used. 
     NPLS, PARAFAC and other multi-way data analysis techniques suitable for carrying out the invention are described in the detail in the monograph “MULTI-WAY ANALYSIS IN THE FOOD INDUSTRY—Models, Algorithms &amp; Applications&gt;&gt;by Rasmus Bro, freely available on the Internet at URL: 
     http://www.iasbs.ac.ir/chemistry/chemometrics/history/4th/brothesis.pdf. 
     See also: R. Bro. Multiway calibration. Multi-linear PLS.  J. of Chemometrics.  1996, 10 (1): 47-61. 
     Another object of the present invention is a method of calibrating such a direct neural interface system, this method comprising the steps of:
         a. Acquiring electrophysiological signals over a plurality of observation time windows and representing them in the form of a N+1-way tensor, called an observation tensor;   b. Acquiring data indicative of an action performed by said subject during each of said observation time windows, and organizing them in a vector or tensor, called an output vector or tensor; and   c. Determining a multi-way (e.g. multilinear) regression function of said output vector or tensor on said observation tensor.       

     According to an advantageous embodiment of the invention, step c. of this method can include performing multilinear decomposition of said observation tensor on a “score” vector, having a dimension equal to the number of said observation time windows, and N “weight” vectors. In particular, said “weight” vectors can be chosen such as to maximize the covariance between said “score” vector and said output vector or tensor. Even more particularly, said step c. can include performing PARAFAC decomposition of a covariance tensor representing the covariance of said observation tensor and said output vector or tensor. This decomposition gives rise to N so called “weight vectors”. The observation tensor is then decomposed according to these N weight vectors. 
     Such a calibration method has the advantage of being carried out entirely automatically. 
     Still another object of the invention is a method of interfacing a subject&#39;s brain to an external device by a direct neural interface system as described above, said method comprising the steps of:
         acquiring, conditioning, digitizing and preprocessing electrophysiological signals representative of a neuronal activity of said subject&#39;s brain over at least one observation time window; and   generating at least one command signal for said external device by processing said digitized and preprocessed electrophysiological signals;       

     wherein said step of generating command signals comprises:
         representing the electrophysiological signals acquired over said or each observation time window in the form of a N-way data tensor, N being greater or equal to two (and preferably greater or equal to three); and   generating an output signal corresponding to said or each observation time window by performing multi-way regression over said or each data tensor.       

     This method can comprise a calibration step as described above. 
     The method of the invention is particularly well-suited for self-paced BCI. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
       Additional features and advantages of the present invention will become apparent from the subsequent description, taken in conjunction with the accompanying drawings, which show: 
         FIG. 1 , a functional scheme of a direct neural interface system according to an embodiment of the invention; 
         FIG. 2 , a plot of the acquired electrophysiological signals; 
         FIG. 3 , a plot of a signal indicative of a voluntary action performed by said subject during the acquisition of the electrophysiological signals represented on  FIG. 2 ; 
         FIGS. 4 and 5 , schematic illustrations of the signal representation and decomposition used in an embodiment of the invention; 
         FIGS. 6A, 6B and 7  illustrate an experimental validation of the concept of invention. 
     
    
    
     DETAILED DESCRIPTION 
       FIG. 1  illustrates the general structure of a direct neural interface system according to an exemplary embodiment of the invention. In this embodiment, an intention of a (human or animal) subject to perform a simple action (e.g. press a pedal) is chosen as a specific behavior used for controlling an external device. To collect the data, the brain B of the subject is implanted with fourteen electrodes of measure (references  2 - 15 ) and three reference electrodes (reference  1 ). As it is commonly known, the aim of these reference electrodes is to provide a “common signal”. By “common signal”, it is meant an electrical signal that affects all or most of measurement electrodes. As this signal is less specific to actions, it is usually preferable to evaluate it, as precisely as possible, so as to remove it. In this purpose, one or more reference electrodes may be operated. The ECoG signals acquired by the electrodes are pre-processed by pre-processing means PPM, and then processed by processing means PM for generating command signals driving an external device ED (e.g. a manipulator). The pre-processing and processing means can be implemented in the form of application-specific integrated circuits, programmable circuits, microprocessor cards, suitably programmed general-purpose computers, etc. 
     Pre-processing comprises amplifying and filtering the raw signals acquired by the electrodes, sampling them at 13 KHz, converting the sample to digital format, decimating the digitized samples to a rate of 1.3 kHz. It also comprises applying a Common Average Reference (CAR) filter:
 
CAR( x   i ( t ))= x   i ( t )−Σ i=1   m   x   i ( t )/ m, m= 14
 
     where x i (t) is the time-dependent signal acquired by the i-th electrode. The application of this common average reference yields to a reduction of a common signal measured by all electrodes. 
     Processing comprises performing Mayer wavelet decomposition of the preprocessed signals over sliding windows [t−Δt, t], Δt=2 sec, for the set of frequency bins f={10, 12, 14, . . . , 300} Hz for all the electrodes. 
     As a result, each observation time window (duration of 2 seconds) is associated to a third-order (or “three-way”) tensor—or “data cube”— x (t) ε R I     1     ×I     2     ×I     3    of independent variables. The dimension I 1  corresponds to the sliding window, time epoch of 2 sec. The dimension I 2  is determined by the range of frequency bins {10, 12, 14, . . . , 300} Hz, I 3  is determined by number of electrodes. Time, frequency and space are also called the “modes” of analysis. In the example described below, time-frequency analysis is performed using wavelet transform. 
     Processing also comprises generating command signals s(t) for driving the external device ED by performing multi-way regression over each data tensor  x (t) corresponding to an observation time window. This step can simply consist in unfolding said tensor in vector form and multiplying it by a “regression coefficients vector” stored in a memory device of the processing means (see below for details). The command signal generated for each observation time window can be a Boolean scalar (i.e. a on/off command), a real scalar (i.e. an analog command), a vector (e.g. for driving a movement of a multi-axis robotic arm) or even a tensor. In the specific example considered here, the command signal is a Boolean scalar, suitable for driving the (non-progressive) opening or closure of a robotic arm. 
     The “regression coefficients vector” (or, more generally, the regression equation applied by the processing means to generate the command signal) is determined through calibration, which is an important part of the invention. 
     For calibration, electrophysiological signals x(t) are acquired together with a binary signal y(t) indicating if the predetermined action has been performed by the subject. A value of y=1 indicates that the action has been performed. 
     If the act is performed at time t*, i.e. y(t*)=1, the elecrophysiological signal x(t) is acquired over a time window of Δt duration, said time window preferably including t*. For example, said time window can range between t*−Δt and t*. Wavelet transform of a signal during a given time windows requires the knowledge of some signals before and after said time window. In other words, the frequency analysis of the electrophysiological signal x(t) within time window [t*−Δt, t*] is performed on the electrophysiological signal x(t) stored during an extended time windows, whose duration is Δt′, with Δt′=Δt+δt. For example, said extended time windows ranges between t*−Δt−δt/2 and t*+δt/2. 
     As a result, the frequency analysis of all signals x(t) during the temporal window [t*−Δt, t*] requires the recording of signals during the temporal window [t*−Δt−δt/2, t*+δt/2], i.e. a time span Δt′ with Δt′=Δt+δt. 
     Based on this analysis, a tensor  x (t) is built, corresponding to the temporal window Δt=2 sec. 
     This way, a three-way tensor  x (t) is associated to each detection time t*. A Boolean variable y(t*) is also associated to time t* and to the data tensor  x (t). Variable y will be called an “output” variable; actually, it is an input of the calibration algorithm, but it corresponds to the “output variable” of the multi-way regression used for generating the command signal. 
     This analysis is carried out when an action is performed (in this case, y(t*)=1), as well as when no action is performed (y(t*)=0). This results in data tensors  x (t) which can be associated to an action (i.e. tensors x(t) with y(t)=1), and data tensors  x (t) which are associated with no action (i.e. x(t) with y(t)=0). 
     For a relevant calibration, a few hundreds to a few thousands tensors  x (t) and variables y(t) can be determined. 
       FIG. 2  represents the neuronal signal acquired by the 14 electrodes (or “channels”) and the corresponding “y” binary signal (inverted on the figure). 
       FIG. 3  represents in detail the structure of the signal “y”, showing the meaning of t*, Δt, Δt′, δt. 
       FIG. 4  illustrates the data structure corresponding to one point of observation, said data structure consisting of a “data cube”  x (t) and of a scalar y. It is recalled that in more complex embodiments of the invention y could be real instead of Boolean, and/or be multidimensional. 
     A set of “n” observations, each one corresponding to a three-way tensor x(t), forms a forth order (or four-way) tensor  X  ε R n×I     1     ×I     2     ×I     3    and a vector y ε R n  corresponding to the “y(t)” variable. 
     The overall goal of the calibration operation is the regression of variable y(t) on the tensor of observation  x (t). Multilinear PLS (or NPLS) has been chosen as a preferred embodiment of the invention because of its efficiency in the case of highly correlated observations. 
     Partial Least Squares (PLS) is a statistical method for vector-based analyses of high dimensionality data. PLS properly treats situations when a matrix of observations X contains more variables then observations, and said variables are highly correlated. A predictive model is constructed by means of a latent variable t which is derived from X in such a way that covariance between t and dependent variables vector y is maximized. PLS is applied for both regression/classification and for dimensional reduction of the data. As opposed to other widely used projection based methods like Principal Component Analysis (PCA), PLS uses not only independent, but also dependent variables for factorization, which makes it more efficient. 
     NPLS is a generalization of PLS to the case of tensor independent  X  and/or dependent  Y  variables, as PARAFAC is a generalization of PCA when the order of the tensor to decompose exceeds two. 
     Without loss of generality, only the case of a fourth order observation tensor  X  ε R n×I     1     ×I     2     ×I     3    and a vector y ε R n  is considered in detail. Generalization is straightforward. 
     NPLS models tensor  X  by means of a “latent variable” t ε R n  extracted from the first mode of  X  in such way that covariance between t and y is maximized. In addition to vector t, the algorithm forms a set of “weight” or “loading” vectors {w 1 ε R I     1   , w 2  ε R I     2   , w 3  ε R I     3   } related to the second, the third, and the forth modality of  X , respectively. Finally the vector y is updated according to vector t, and this procedure is repeated a pre-defined number F of times. 
     Both  X  and y are centered along the first dimension, i.e. their mean value in time is set equal to zero. 
     The first step of NPLS consists in decomposing  X  into a “score” vector t ε R n  and a set of “weight” (or “loading”) vectors w k  ε R I     k   , k=1,2,3. An important feature of the invention is that the weight vectors result from the decomposition of a covariance tensor  Z , said tensor expressing a covariance between data tensor  X  and y
 
 x   j,i     1     ,i     2     ,i     3     =t   j   w   i     1     1   w   i     2     2   w   i     3     3   +e   j,i     1     ,i     2     ,i     3   .  (1)
 
     In tensor notation  X =t∘(w 1 ∘w 2 ∘w 3 )+ E , where ∘ is the tensors product. Decomposition is generally not exact; this is accounted for by the residual tensor  E . This decomposition is illustrated schematically on  FIG. 5 . 
     Each weight w k  corresponds to a mode of analysis: w 1  represents a time signature, w 1  represents a spectral signature ad w 3  represents a spatial signature. 
     For given set of w k  
 
t j =Σ i     1     ,i     2     ,i     3   x j,i     1     ,i     2     ,i     3   w i     1     1 w i     2     2 w i     3     3   (2)
 
     provides the least squares solution for (1) under the constrains ∥w 1 ∥=∥w 3 ∥=∥w 3 ∥=1. 
     In matrix notation
 
 t=X ( w   1               w   2             w   2 ),  (2*)

     where             is the Kronecker product.
     The Kronecker product of vectors a and b is defined as: 
     
       
         
           
             
               a 
               ⊗ 
               b 
             
             = 
             
               [ 
               
                 
                   
                     
                       
                         a 
                         1 
                       
                       ⁢ 
                       b 
                     
                   
                 
                 
                   
                     … 
                   
                 
                 
                   
                     
                       
                         a 
                         n 
                       
                       ⁢ 
                       b 
                     
                   
                 
               
               ] 
             
           
         
       
     
     Multilinear PLS consists in finding a decomposition (set of weights w k ) that maximizes the covariance between t and y. It can by formalized as the following optimization problem: 
     
       
         
           
             
               
                 
                   
                     max 
                     
                       
                          
                         
                           w 
                           1 
                         
                          
                       
                       = 
                       
                         
                            
                           
                             w 
                             2 
                           
                            
                         
                         = 
                         
                           
                              
                             
                               w 
                               3 
                             
                              
                           
                           = 
                           1 
                         
                       
                     
                   
                   ⁢ 
                   
                     ( 
                     
                       
                         
                           
                             ∑ 
                             
                               j 
                               = 
                               1 
                             
                             n 
                           
                           ⁢ 
                           
                             
                               t 
                               j 
                             
                             ⁢ 
                             
                               y 
                               j 
                             
                           
                         
                         ❘ 
                         
                           t 
                           j 
                         
                       
                       = 
                       
                         
                           ∑ 
                           
                             
                               i 
                               1 
                             
                             , 
                             
                               i 
                               2 
                             
                             , 
                             
                               i 
                               3 
                             
                           
                         
                         ⁢ 
                         
                           
                             x 
                             
                               j 
                               , 
                               
                                 i 
                                 1 
                               
                               , 
                               
                                 i 
                                 2 
                               
                               , 
                               
                                 i 
                                 3 
                               
                             
                           
                           ⁢ 
                           
                             w 
                             
                               i 
                               1 
                             
                             1 
                           
                           ⁢ 
                           
                             w 
                             
                               i 
                               2 
                             
                             2 
                           
                           ⁢ 
                           
                             w 
                             
                               i 
                               3 
                             
                             3 
                           
                         
                       
                     
                     ) 
                   
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
           
         
       
     
     that can be written in the form 
     
       
         
           
             
               
                 
                   
                     
                       max 
                       
                         
                            
                           
                             w 
                             1 
                           
                            
                         
                         = 
                         
                           
                              
                             
                               w 
                               2 
                             
                              
                           
                           = 
                           
                             
                                
                               
                                 w 
                                 3 
                               
                                
                             
                             = 
                             1 
                           
                         
                       
                     
                     ⁢ 
                     
                       ( 
                       
                         
                           ∑ 
                           
                             
                               i 
                               1 
                             
                             , 
                             
                               i 
                               2 
                             
                             , 
                             
                               i 
                               3 
                             
                           
                         
                         ⁢ 
                         
                           
                             z 
                             
                               
                                 i 
                                 1 
                               
                               , 
                               
                                 i 
                                 2 
                               
                               , 
                               
                                 i 
                                 3 
                               
                             
                           
                           ⁢ 
                           
                             w 
                             
                               i 
                               1 
                             
                             i 
                           
                           ⁢ 
                           
                             w 
                             
                               i 
                               2 
                             
                             2 
                           
                           ⁢ 
                           
                             w 
                             
                               i 
                               3 
                             
                             2 
                           
                         
                       
                       ) 
                     
                   
                   ⁢ 
                   
                     
 
                   
                   ⁢ 
                   where 
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
             
               
                 
                   
                     z 
                     
                       
                         i 
                         1 
                       
                       , 
                       
                         i 
                         2 
                       
                       , 
                       
                         i 
                         3 
                       
                     
                   
                   = 
                   
                     
                       ∑ 
                       
                         j 
                         = 
                         1 
                       
                       n 
                     
                     ⁢ 
                     
                       
                         y 
                         j 
                       
                       ⁢ 
                       
                         x 
                         
                           j 
                           , 
                           
                             i 
                             1 
                           
                           , 
                           
                             i 
                             2 
                           
                           , 
                           
                             i 
                             3 
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
           
         
       
     
     Elements z i     1     ,i     2     ,i     3    form the tensor  Z  which represents the covariance of  X  and y. Weight vectors w k  are found by factorizing tensor  Z . To this end, the PARAFAC algorithm is applied. PARAFAC is a multi-way generalization of principal component analysis (PCA). Note that other tensor factorizing algorithms exist (see the above-referenced monograph by R. Bro) and could be applied to the invention. 
     PARAFAC is an iterative algorithm, which is initialized by initial weight vectors w k . Random or predetermined initial vectors are used. 
     Residual  E  can also be decomposed, resulting in a second set of “score” and “weight” vectors, and so on. Each of these sets is called a “factor” of the decomposition. This iterative procedure is known as deflation. 
     At each deflation step, new values of dependent and independent variables are given by:
 
   X     new   = X −t∘w   1   ∘w   2   ∘w   3  (i.e.    X     new   = E   )  (6a)
 
 y   new   =y−Tb   (6b)
 
     where matrix T=[t 1 | . . . |t f ] is composed from all score vectors obtained on the previous f steps, b is defined as: b=(T T T) −1 T T y (“T” exponent means transposition, “−1” exponent means inversion). Residuals  X   new  and y new  are used to find the next set of weights and score (loading) vectors. 
     In other words,  X   f+1 = X   f −t f ∘w f   1 ∘w f   2 ∘w f   3    
     and y f+1 =y f −T f b f    
     The index f indicating the iteration rank (1≦f≦F). 
     Equation (6b) provides a linear relation between output variable y and latent variables (T). A non linear equation might be applied as well. 
     After F steps, the regression equation becomes:
 
 ŷ=t   1   b   1   +[t   1   t   2   ]b   2   + . . . +[t   1   t   2    . . . t   F   ]b   F   (7)
 
     which can be rewritten more compactly as:
 
ŷ=T{circumflex over (b)}  (8)
 
     It is to be noticed that the dimension of each vector b f  is f. 
     In equation (8):
         ŷ is the “predictor” of y, i.e. its estimated value determined as a function of observations,       

     
       
         
           
             
               
                 b 
                 ^ 
               
               = 
               
                 
                   ∑ 
                   
                     f 
                     = 
                     1 
                   
                   F 
                 
                 ⁢ 
                 
                   b 
                   f 
                   F 
                 
               
             
             ; 
           
         
       
     
     During this step, each vector b f   F  is obtained from vector b f  by adding the relevant number (i.e. F−f) of “0” so that the dimension of each vector b f   F  is F while the dimension of each vector b f  is f.
         T is a matrix whose dimensions are (n, F), where n is the number of observations and F the number of iterations (and therefore the number of factors).The number of iterations F can be initially set up. It can also be found out using a cross validation procedure or another criterion known in structural modeling, for example Akaike Information Criteria.       

     Equation (8) can be rewritten in the form of the regression of y on  X . Matrix R, of dimensions (I 1 ·I 2 ·I 3 )×F, is defined as: 
     
       
         
           
             
               
                 
                   
                     R 
                     = 
                     
                       [ 
                       
                         
                           w 
                           1 
                         
                         ❘ 
                         
                           
                             ( 
                             
                               I 
                               - 
                               
                                 
                                   w 
                                   1 
                                 
                                 ⁢ 
                                 
                                   w 
                                   1 
                                   T 
                                 
                               
                             
                             ) 
                           
                           ⁢ 
                           
                             w 
                             2 
                           
                           ⁢ 
                           
                              
                             
                                 
                             
                             ⁢ 
                             … 
                             ⁢ 
                             
                                 
                             
                              
                           
                           ⁢ 
                           
                             
                               ∏ 
                               1 
                               
                                 F 
                                 - 
                                 1 
                               
                             
                             ⁢ 
                             
                               
                                 ( 
                                 
                                   I 
                                   - 
                                   
                                     
                                       w 
                                       i 
                                     
                                     ⁢ 
                                     
                                       w 
                                       i 
                                       T 
                                     
                                   
                                 
                                 ) 
                               
                               ⁢ 
                               
                                 w 
                                 k 
                               
                             
                           
                         
                       
                       ] 
                     
                   
                   , 
                 
               
               
                 
                   ( 
                   9 
                   ) 
                 
               
             
             
               
                 
                   
                     w 
                     i 
                   
                   = 
                   
                     
                       w 
                       i 
                       1 
                     
                     ⊗ 
                     
                       w 
                       i 
                       2 
                     
                     ⊗ 
                     
                       
                         w 
                         i 
                         3 
                       
                       . 
                     
                   
                 
               
               
                 
                   ( 
                   
                     9 
                     * 
                   
                   ) 
                 
               
             
           
         
       
     
     It can be shown that T=XR, where matrix X is obtained by unfolding tensor  X  so that each line of matrix X gathers all data of each tensor  x (t). If n is the temporal dimension of tensor  X , i.e. the number of tensors  x (t) that are included in tensor  X , the dimension of matrix X is (n, I 1 *I 2 *I 3 ), where I 1 , I 2  and I 3  are the dimensions of tensor x(t) as previously stated. 
     It follows that ŷ=XR{circumflex over (b)}. The regression coefficients vector {circumflex over (b)} pls  is defined as {circumflex over (b)} pls =R{circumflex over (b)}. Then, the regression equation becomes
 
ŷ=X{circumflex over (b)} pls    (10)
 
     Equation (10) allows the use of neuronal signals to drive an external device. For each point of observation, neuronal signals are acquired and preprocessed, a tensor  x (t) is formed and the predicted value of y(t) is calculated as: ŷ(t)=x(t){circumflex over (b)} pls , were x(t) is the unfolded tensor  x (t). The command signal s(t) is then determined as a function of ŷ(t), e.g. by thresholding. 
     In practice, it is often preferred to use equation (8) instead of equation (10). In this case, the F sets of “score” and “weight” vectors {w i   1 ,w i   2 ,w i   3 } i=1,F  generated by PARAFAC decomposition are stored in a memory of the processing means PM, together with the F coefficients {circumflex over (b)}. 
     Deflation (equation (6)) is applied to the newly-acquired observation tensor  x (t) ε R 1×I     1     ×I     2     ×I     3   : scalar coefficients t i  are computed as t i =xw i ; these coefficients form T new  (1×F). The coefficients {circumflex over (b)}(F×1) are known. Then equation (8) can be applied: ŷ=T new {circumflex over (b)}. 
     Although it makes the computation of ŷ somehow more complex, this method is often advantageous because it is less memory consuming. 
     One of the main problems of the practical application of the NPLS method consists in the huge amount of data to be processed, which requires corresponding memory capacity. This problem can be mitigated by using a modified algorithm (“INPLS”, for Iterative NPLS) adapted to the large data set. The main idea of this modified algorithm consists in consecutive adjustments of tensor  Z  factorization. It can be achieved dividing the whole training data into subsets with consecutive adjustments of the searched values. Let training data  X  ε R n×I     1     ×I     2     ×I     3   , y ε R n  be divided on p subsets { X   (l)  ε R n     l     ×I     1     ×I     2     ×I     3   ,y (l)  ε R n     l   } l=1   p ;Σn l =n. 
     For weights vectors computation, a modified version of the PARAFAC algorithm is applied. As in the standard version of PARAFAC, numerical optimization is used for tensor  Z  factorization, which requires initialization. In the standard version of PLS PARAFAC, random or constant predetermined initial vectors are used for all the iteration. Instead, in the modified algorithm, previously found solutions are used as initial vectors. 
     The modified algorithm takes as its inputs  X , y, the number p of subsets { X   (l) ,y (l) } l=1   p ;Σn l =n, the number F of factors. Its outputs are the F sets of weight vectors, the regression coefficients vector {circumflex over (b)} pls  and/or the coefficients {circumflex over (b)}. 
     Let f=1 (first iteration).
         1. The first set of weight vectors w f   1 ,w f   2 ,w f   3  has to be determined.
           Let l=1 (first subset);
               The weight vectors are initialized as unit vectors (w f   j ) l=1 =I, j=1,2,3.
 
   X     f=1   (l)   =X   (l)     l    
 
 y   f=1   (l)   =y   (l)  
   Deflation:
 
   X     f   (l)   = X     (l) −Σ i=1   f−1   t   i   ∘w   i   1   ∘w   i   2   ∘w   i   3  
     Z   l , covariance tensor of { X   f   (l) ,y f   (l) } is computed using equation (5)   The current approximation of w f   1 ,w f   2 ,w f   3  is computed by factorizing  Z   l  using {w f   1 ,w f   2 ,w f   3 } l−1  as initialization vectors:
 
{ w   f   1   ,w   f   2   ,w   f   3 } l =TensorFactorization(   Z     l   ,{w   f   1   ,w   f   2   ,w   f   3 } l−1 )
   “TensorFactorization” is an algorithm which takes as its inputs  Z   l  ε R I     1     ×I     2     ×I     3   ,{w f   1 ,w f   2 ,w f   3 } l−1 , and training subset number l:
                   intermediate vectors {w current   1 w current   2 w current   3 } are obtained by performing PARAFAC decomposition of  Z   l  using {w f   1 ,w f   2 ,w f   3 } l−1  as initialization vectors;
 
{ w   f   1   ,w   f   2   ,w   f   3 } 1 =( w   current   m +(1−1){ w   m } 1−1 )/   1 ,m= 1,2,3
   Otherwise stated, {w f   1 ,w f   2 ,w f   3 } l  (the weight vectors for the l-th data subset) are obtained as a linear combination of:    the weight vectors w current   m  obtained by PARAFAC decomposition of the corresponding partial correlation tensor  Z   l , said decomposition being initialized by the weight vectors {w m } l−1  obtained for the previous subset; and    the weight vectors {w m } l−1  obtained for the previous subset themselves.   Using directly the w current   m  vectors as the result of the “TensorFactorization” algorithm would result in giving excessive weight to the last data subset to be processed.   
                   
               Then l is incremented, until it takes the value p, meaning that all the data subsets have been processed.   
           2. The last weight vectors obtained, which take into accounts all the data subsets, are normalized:
 
{ w   f   1   ,w   f   2   ,w   f   3 } p   ={w   f   1   /∥w   f   1   ∥,w   f   2   /∥w   f   2   ∥,w   f   3   /∥w   f   3 ∥}
   3. t f  is calculated as follows:
           Let i=1;   x f (i) is calculated for the current point x(i) using equation (6)   The current element (t f ) i  of t f  for x f (i) is calculated using equation (2)   i is incremented until it takes the value n, meaning that all the observation points have been taken into account   
           4. T f =[t l | . . . |t f ]   5. b f =(T f   T T f ) −1 T f   T y   6. y f+1 =y f −T f b f      7. f is incremented until it takes the value F, meaning that all the required factors have been computed.   8. {circumflex over (b)} pls  and/or {circumflex over (b)} can then be computed.       

     The method of the invention has been tested on laboratory rats implanted with 14 electrodes (plus three reference electrodes, as shown in  FIG. 1 ). A general scheme of the experiment is illustrated on  FIGS. 6A and 6B . 
     Each implanted rat is free to move in a cage, and has the opportunity to push a pedal mounted on the wall of the cage. Every pushing event activates the food dispenser and the rat obtains a reward (food pellet). The rat is trained to press the pedal without any cue or conditioning stimulus. 
     The experiment consists of two stages. The first one is Training Stage, illustrated on  FIG. 6A . During this stage, a training set of data is collected for calibration purposes. The ECoG signal x(t) and a signal y(t) indicating activation of the pedal are recorded simultaneously, the food dispenser being activated by the pedal. Data collection last up to one hour. Training sets which contain less than 50 pushes are neglected. Records are collected to be used to perform off-line calibration as described above. 
     During the second stage, Close Loop Real-Time BCI, the predictor ŷ is computed in real-time from acquired ECoG signal. The rat continues pressing the pedal, but it obtains the reward only when the predictor detects a pushing event. 
     The method was tested on the laboratory rat during more than six month. Namely three series of 5-10 experiments were carried out three months each after other. The results are summarized in the following tables. Detection rate remains very high (90% or more) for more than three months, and still exceeds 50% 6 months after calibration. The false positive rate remains very low (of the order of 1% or less) even after 6 months. 
     
       
         
               
               
               
               
               
               
               
             
               
               
               
               
               
               
               
             
           
               
                   
               
               
                   
                 False 
                 False 
                 False 
                 False 
                   
                   
               
               
                   
                 positive 
                 positive 
                 negative 
                 negative 
                 Event 
                   
               
               
                 Date 
                 amount 
                 rate 
                 amount 
                 rate 
                 amount 
                 Time, sec 
               
               
                   
               
             
             
               
                   
               
             
          
           
               
                 9 Jul. 2009 
                 12 
                 1.19% 
                 3 
                  4.41% 
                 68 
                 537.5 
               
               
                 9 Jul. 2009 
                 2 
                 0.18% 
                 4 
                  5.48% 
                 73 
                 592 
               
               
                 9 Jul. 2009 
                 7 
                 0.41% 
                 8 
                 10.81% 
                 74 
                 895.5 
               
               
                 16 Jul. 2009 
                 12 
                 1.46% 
                 1 
                  3.03% 
                 33 
                 427 
               
               
                 16 Jul. 2009 
                 2 
                 0.34% 
                 4 
                 10.81% 
                 37 
                 310.5 
               
               
                 13 Oct. 2009 
                 4 
                 0.35% 
                 3 
                  6.12% 
                 49 
                 599.5 
               
               
                 20 Oct. 2009 
                 38 
                 0.54% 
                 16 
                  9.47% 
                 169 
                 3600 
               
               
                 23 Oct. 2009 
                 33 
                 0.94% 
                 13 
                 11.40% 
                 114 
                 1808.5 
               
               
                 6 Nov. 2009 
                 32 
                 1.61% 
                 8 
                 28.57% 
                 28 
                 1005 
               
               
                 27 Nov. 2009 
                 10 
                 0.77% 
                 21 
                 38.18% 
                 55 
                 670 
               
               
                 1 Feb. 2010 
                 38 
                 1.01% 
                 39 
                 46.99% 
                 83 
                 1919.5 
               
               
                 25 Feb. 2010 
                 50 
                 1.04% 
                 67 
                 44.08% 
                 152 
                 2481.5 
               
               
                   
               
             
          
         
       
     
       FIG. 7  illustrates the temporal and frequency modes of three of five factors which were extracted by INPLS. It can be noticed that that high frequencies give the main contribution to decision rule, as well as the time interval [−0.6, 0] seconds before the event.