ADAPTIVE TRAINING METHOD OF A BRAIN COMPUTER INTERFACE USING A PHYSICAL MENTAL STATE DETECTION
20220207424 · 2022-06-30
Assignee
Inventors
Cpc classification
G06F2203/011
PHYSICS
G06F3/015
PHYSICS
A61B5/37
HUMAN NECESSITIES
A61B5/165
HUMAN NECESSITIES
International classification
Abstract
The present invention relates to an adaptive training method of a brain computer interface. The ECoG signals expressing the neural command of the subject are preprocessed to provide at each observation instant an observation data tensor to a predictive model that deduces therefrom a command data tensor making it possible to control a set of effectors. A satisfaction/error mental state decoder predicts at each epoch a satisfaction or error state from the observation data tensor. The mental state predicted at a given instant is used by an automatic data labelling module to generate on the fly new training data from the pair formed by the observation data tensor and the command data tensor at the preceding instant. The parameters of the predictive model are subsequently updated by minimising a cost function on the training data thus generated.
Claims
1. A method for training a brain computer interface configured to receive a plurality of electrophysiological signals expressing a neural command of a subject, during a plurality of observation windows associated with observation instants, he electrophysiological signals being preprocessed in a preprocessing module to form at each observation instant an observation data tensor, the brain computer interface using a predictive model to deduce at each observation instant a command data tensor from the observation data tensor, the command data being configured to control at least one effector to perform a trajectory, the training method comprising: at each observation instant, decoding a satisfaction/error mental state of the subject from the observation data tensor using a mental state decoder trained beforehand, the mental state being representative of a conformity of the trajectory with the neural command; generating training data from the satisfaction/error decoded at a given observation instant, and from a pair formed by the observation data tensor and the command data tensor at a preceding observation instant; and updating parameters of the predictive model by minimising a cost function on the generated training data.
2. The method for training a brain computer interface according to claim 1, comprising training the mental state decoder in a previous phase by presenting simultaneously to the subject a movement setpoint and a trajectory, the observation data tensor being labelled with a satisfaction mental state when the trajectory is in accordance with the setpoint and with an error mental state when it deviates therefrom.
3. The method for training a brain computer interface according to claim 2, wherein the mental state decoder provides at each observation instant a prediction of the mental state in a form of a binary value ({tilde over (y)}.sub.D,mental_state.sup.t) as well as an estimation of a degree of certainty of the prediction (|{tilde over (y)}.sub.mental_state.sup.t|).
4. The method for training a brain computer interface according to claim 3, wherein the prediction made by the predictive model is based on a classification, the command data tensor being obtained from a most probable class predicted by the predictive model.
5. The method for training a brain computer interface according to claim 4, comprising, if the mental state predicted at an observation instant is a satisfaction state, generating the training data only from the observation data tensor and from the command data tensor at the preceding observation instant, if the degree of certainty of the predicted mental state is greater than a first predetermined threshold value.
6. The method for training a brain computer interface according to claim 4, comprising, if the mental state predicted at an observation instant is an error state, generating the training data only from the observation data tensor and from the command data tensor at the preceding observation instant, if the degree of certainty of the predicted mental state is greater than a second predetermined threshold value.
7. The method for training a brain computer interface according to claim 4, wherein if the mental state predicted at an observation instant is an error state, the training data generated comprise the observation data tensor at the preceding observation instant as well as a command data tensor obtained from a second most probable class predicted by the predictive model at the preceding observation instant.
8. The method for training a brain computer interface according to claim 4, wherein the cost function used for updating the parameters of the predictive model expresses a square deviation between the command data tensor predicted by the model and that provided by the training data, the square deviation being weighted by a degree of certainty predicted by the mental state decoder during the generation of the training data, the square deviation thus weighted being added to the training data set.
9. The method for training a brain computer interface according to claim 3, wherein the prediction made by the predictive model is based on a linear or multilinear regression.
10. The method for training a brain computer interface according to claim 9, wherein if the mental state predicted at an observation instant is an error state, the training data are not generated and that if the predicted mental state is a satisfaction state, the training data are only generated from the observation data tensor and from the command data tensor at the preceding observation instant, if the degree of certainty of the predicted mental state is greater than a first predetermined threshold value.
11. The method for training a brain computer interface according to claim 9, wherein regardless of the state predicted at an observation instant, the training data are generated from the observation data tensor and from the command data tensor at the preceding observation instant, the training data then being associated with the degree of certainty of the prediction of the predicted mental state (|{tilde over (y)}.sub.mental_state.sup.t|).
12. The method for training a brain computer interface according to claim 9, wherein the cost function used for updating the parameters of the predictive model depends on a square deviation between the command data tensor predicted by the predictive model and that provided by the training data, the dependency with the square deviation being increasing when the mental state predicted during the generation of the training data was a satisfaction state and decreasing when the mental state is an error signal, the square deviation being weighted by a factor depending increasingly on the degree of certainty of the predicted mental state, associated with the training data.
Description
BRIEF DESCRIPTION OF THE FIGURES
[0035] Other features and advantages of the invention will become apparent upon reading a preferable embodiment of the invention, described with reference to the appended figures, wherein:
[0036]
[0037]
[0038]
[0039]
DESCRIPTION OF EMBODIMENTS
[0040] It will be considered in the following a brain computer interface (BCI) such as presented in the introductory part.
[0041] The electrophysiological signals from the various electrodes are sampled and assembled by data blocks, each block corresponding to an observation sliding window of width ΔT. Each observation window is defined by an observation instant or epoch at which the window in question starts.
[0042] The electrophysiological signals may be subject to a preprocessing. This preprocessing may particularly include an elimination of the average taken on the set of electrodes, then a time-frequency analysis is carried out on each of the observation windows.
[0043] The time-frequency analysis may be based on a breakdown into wavelets, for example into Morlet wavelets or a CCWT (Continuous Complex Wavelet Transform) breakdown. The person skilled in the art will nevertheless understand that other types of time-frequency analysis may be envisaged by the person skilled in the art.
[0044] These results of the time-frequency analysis may further be subject to a frequency smoothing or a decimation.
[0045] Thus, an observation data tensor of order 3, denoted , is associated with each observation window, or observation instant t, of which the first mode corresponds to the temporal positions of the wavelets, the second mode corresponds to the frequency, in other words to the number of frequency bands used for the breakdown into wavelets on an observation window and the fourth mode corresponds to the space, in other words to the sensors (electrodes). Thus,
∈
.sup.τ×f×s and the complete tensor of the observation data, that is to say the history of observations, is denoted X∈
where N is the number of epochs, τ is the number of temporal positions of the wavelets (temporal features), if applicable after averaging on a plurality of successive temporal positions, f is the number of frequency bands (frequency features), and s is the number of sensors (spatial features). More generally, the observation data tensor,
, relating to the epoch t may be of order P. In this case, the observation tensor
is of dimension I.sub.1× . . . ×I.sub.P. Nevertheless, without loss of generality, the invention will be described in the aforementioned case P=3.
[0046] In the same way, the trajectory of the movement imagined, observed or performed at the instant may be described by an output tensor (or command tensor) of order , denoted
, of dimension J.sub.1× . . . ×J.sub.Q, the various modes of which correspond to the commands of various effectors (or to the various degrees of freedom of a multi-axis robot).
[0047] More specifically, the output tensor provides command data blocks, each block making it possible to generate the command signals relating to the various effectors or degrees of freedom. Thus, it will be understood that the dimension of each data block may depend on the use case envisaged and particularly on the number of degrees of freedom of the effector. Without loss of generality, it will be assumed in the following that the command tensor is of order Q=1. In other words,
where M is the number of degrees of freedom of the command (or of the effector).
[0048] The predictive model making it possible to change from the observation tensor to the command tensor may be based on a classification and/or a regression. In the case of a classification, the command tensor may indicate for example a movement direction (left, right, front, back), in the case of a regression the command tensor may give the command data of the various effectors.
[0049]
[0050] The elements bearing the references 210 to 240 are identical to the elements 110 to 140 described above. The BCI represented further comprises a mental state decoder 250, trained beforehand, receiving the observation data tensor, at the epoch t and estimating from this tensor a state vector representative of the mental state of the subject at this same instant. Mental state at an instant t, means here a satisfaction state or an error state detected from electrophysiological signals (typically ECoG signals) collected by electrodes placed on the motor cortex of the subject. More specifically, this mental state indicates if the subject is satisfied or not of the evolution of the trajectory (of a cursor, of an effector or of a multi-axis robot for example) in other words if the command tensor
produced by the predictive model and applied to the effector at the instant t−1 is indeed in accordance with the setpoint trajectory desired by the subject.
[0051] It is important to clearly make the distinction here between the decoding of an error mental state in the context of the present invention, on the one hand, and the detection of an error potential, on the other hand. An error potential or ErrP (error-related potential) signal is a cerebral signal observed in response to a discrete event, for example an occasional erroneous action. In other words, such an ErrP signal is triggered by an error occurring at a given instant and does not result from a continuous action such as a deviation observed over time in relation to a setpoint trajectory. In practice, the ErrP signals manifest in the form of a negative potential deflection in a fronto-central area of the scalp (appearing approximately 50 to 100 ms after the occurrence of the discrete event), followed by a positive potential deflection in the fronto-parietal area. They may be recorded by simple cutaneous electrodes placed on the scalp whereas the ECoG signals are obtained from electrodes located on the motor cerebral cortex of the subject.
[0052] The mental state decoder is trained in a supervised manner during a distinct phase prior to the phase for using the BCI. During this training phase the subject may, for example, be simultaneously presented with a movement setpoint as well as a trajectory. At the same time, the observation data tensors output from the preprocessing module are stored in a mental state training database.
[0053] If the trajectory is in accordance with (or tends to move closer to) the setpoint, the observation data tensor is labelled as a satisfaction mental state of the setpoint. Conversely, when the trajectory is not in accordance with (or tends to move away from) the setpoint, the observation data tensor is labelled as an error mental state. In a particularly simple example of embodiment, the setpoint may be a start/stop command. Thus, an avatar may be shown on a screen simultaneously with a symbol indicating the setpoint. If the avatar starts when the setpoint is a stop instruction or if the avatar is immobile when the setpoint is a start instruction, the corresponding observation data tensors are labelled with an error mental state label. On the other hand, if the avatar starts and stops according to the instructions given by the setpoint, the observation data tensors are labelled with a satisfaction mental state label. Of course, other mental state training types may be envisaged by the person skilled in the art according to the nature of the command, without in as much departing from the scope of the present invention. Thus, the setpoint may be a direction instruction (left, right, front, back), or also an instruction indicating the limb to move (left foot, right foot, right hand, left hand). When the movement of the avatar is in accordance with the instruction given by the setpoint, the mental state label associated with the observation data tensors corresponds to a satisfaction mental state. Failing this, when the movement of the avatar differs from the instruction given by the setpoint, the mental label associated with the observation data tensors corresponds to an error mental state. The satisfaction/error mental state at the instant t may be represented by a signed binary value or a Boolean (classifier in 2 classes), denoted y.sub.D,mental_state. The training data set of the mental state decoder then consists of the pairs (, {tilde over (y)}.sub.D,mental_state.sup.t) in a plurality of observation instants t (the tilde sign indicates the fact that this involves training data).
[0054] The error state decoder may be for example implemented by means of an artificial neural network or a SVM classifier, or even an algorithm of the NPLS type.
[0055] After its training phase, the mental state decoder 250 may predict the satisfaction/error mental state from an observation data tensor, .
[0056] According to a first variant, the satisfaction/error mental state predicted at the instant t by the decoder 250 is in the form of a binary value, denoted {tilde over (y)}.sub.D,mental_state.sup.t. For example, a satisfaction mental state will be indicated by {tilde over (y)}.sub.D,mental_state.sup.t=1 and an error mental state will be indicated by {tilde over (y)}.sub.D,mental_state.sup.t=−1.
[0057] According to a second variant, the satisfaction/error mental state predicted at the instant t by the decoder 250 is in the form of a real value, denoted {tilde over (y)}.sub.mental_state.sup.t indicating the probability that the mental state belongs to one class rather than to another. For example, the real value may be a ratio logarithm of the probability of belonging to one class rather than to another. Thus, a positive value of {tilde over (y)}.sub.mental_state.sup.t may translate a satisfaction mental state and a negative value {tilde over (y)}.sub.mental_state.sup.t may then translate an error mental state, the degree of certainty of the forecast being given in both cases by |{tilde over (y)}.sub.mental_state.sup.t|.
[0058] During the use of the BCI, the mental state decoder may provide each epoch t with a prediction of the mental state of the subject from the observation data tensor . This mental state prediction is used by an automatic data labelling module 260, to construct on the fly new training data from the pair formed by the observation data tensor and from the command data tensor at the preceding epoch, namely (
,
).
[0059] This creation of training data is not generally systematic at each epoch but may occur during training phases occurring periodically or asynchronously. Without loss of generality, it will be assumed that a training phase of index u starts at the epoch n(u−1)+1 and ends at the epoch nu. The observation data may be represented by the observation tensors at the consecutive instants t=n(u−1)+1, . . . nu and therefore by a tensor
of order P+1=4,
∈
, such as
=
t=n(u=1)+1, . . . nu where
represents the deployment of
according to the first mode. Similarly, the command data at these same instants may be represented by a tensor of order Q+1=2,
∈
such as
=
, t=n(u−1)+1, . . . nu where
represents the deployment of
according to the first mode. Finally, {tilde over (y)}.sub.mental_state.sup.u represents the tensor of order 1, in other words the vector of
.sup.n the elements of which are {tilde over (y)}.sub.mental_state.sup.t, t=n(u−1)+1, . . . nu.
[0060] Generally, at each training phase, the automatic labelling module automatically constructs training data defined by the pair (,
), such that:
[Math. 1]
=Φ(
,{tilde over (y)}.sub.mental_state.sup.u) (1-1)
[Math. 2]
=
(1-2)
where Φ is an application of ×
.fwdarw.
. More specifically, to automatically construct training data, the automatic labelling module uses the observation data tensors of the phase u and associates with them the command data tensors modified by the function Φ when the mental states observed during this phase comprise at least one error mental state. More specifically, the modification of a command tensor at an epoch t.sub.c of the phase u may depend on the mental states predicted at instants t.sub.c+1, . . . ,nu+1 or even also on states before t.sub.c.
[0061] Without loss of generality, it will be assumed in the following that a command tensor at an epoch t only depends on the mental state predicted at the following instant t+1. In other words, when the subject receives sensory feedback at the instant t+1 (correction or error of the trajectory) after the command data tensor has been applied, the labelling module modifies (or corrects) the command data tensor relating to the preceding instant, t, which may be expressed by:
[Math. 3]
=
(2-1)
[Math. 4]
=φ(
,({tilde over (y)}.sub.mental_state.sup.t+1)t=n(u−1)+1, . . . nu (2-2)
where φ is an application of ×
×
.
[0062] The application φ (or plus generally the application Φ) may take various forms depending on the type of prediction made by the predictive model 210. In any case, its object is to update the training data set with the pair (,
) thanks to the predicted satisfaction/error mental state, {tilde over (y)}.sub.mental_state.sup.t+1 at at least the following instant of the training phase. If the mental state predicted for at least this following instant corresponds to an error mental state, the command data tensor
is corrected by the application φ to generate the new training data (
,
). On the other hand, if all the earlier mental states {tilde over (y)}.sub.mental_state.sup.t=1, . . . , {tilde over (y)}.sub.mental_state.sup.nu+1 are satisfaction states, the pair may be (
,
) may be incorporated as is in the training data set.
[0063] According to a first embodiment, the prediction made by the predictive model is based on a classification operation providing a vector y.sub.class=(y.sub.1.sup.t, y.sub.2.sup.t, . . . y.sub.M.sup.t).sup.T of probabilities of belonging to M possible classes, and the command vector () provided by the predictive model is given by:
where
and (e.sub.m).sub.m−1, . . . ,M is the canonical basis of . In other words the command vector corresponds to the class of highest probability.
[0064] The automatic labelling module updates the training data set by incorporating the pair (,
)=(
,{tilde over (y)}.sup.t) defined by:
[Math. 6]
=
(4-1)
[Math. 7]
{tilde over (t)}.sup.1=φ(y.sub.control.sup.t,{tilde over (y)}.sub.mental_state.sup.t+1) (4-2)
where:
φ(y.sub.control.sup.t,{tilde over (y)}.sub.mental_state.sup.t+1)=y.sub.control.sup.t (5-1)
if the mental state is a satisfaction mental state ({tilde over (y)}.sub.D,mental_state.sup.t+1=+1 or {tilde over (y)}.sub.mental_state.sup.t+1<0); and
if the mental state is an error mental state
T.sub.m.sub.tm.sub.
In other terms, if the mental state at the following instant is an error state, the command vector is given by the second most probable class.
According to one variant, the incorporation of new training data is selective. More specifically, in this case, a pair (,
) will only be incorporated into Ω.sup.u insofar as the degree of certainty of the satisfaction mental state in (5-1) exceeds a predetermined threshold value, that is to say if {tilde over (y)}.sub.mental_state.sup.t+1<Th.sub.mental_state.sup.1<0. Similarly, the correction made in (5-2) may also be selective and only be performed insofar as {tilde over (y)}.sub.mental_state.sup.t+1<Th.sub.mental_state.sup.2<0 where Th.sub.mental_state.sup.2 is a second predetermined threshold value.
The predictive model 220 is updated by means of new training data provided by the automatic labelling module. This update does not necessarily occur the moment that these new training data are available. Indeed, the latter may be stored locally for a later update, performed periodically or as soon as the number of new training data reaches a predetermined threshold.
The update of the parameters of the predictive model is performed by minimising a cost function giving the square deviation between the predictions of the model and the labels for the data of the training set, i.e.:
where Θ designates the set of parameters of the predictive model, Θ.sup.u designates the set of parameters minimising the cost function during the update u, F(.Math.;Θ) is the prediction function of the model depending on the set of parameters Θ, Ω.sup.u=Ω.sup.u−1∪{(,
); t=(u−1)n+1, . . . , un } is the training data set during the update u.
[0065] The cost function may involve a weight depending on the degree of certainty of the mental state prediction to weight the prediction square deviation of the command tensor, i.e.:
where w({tilde over (y)}.sub.mental_state.sup.t+1) is an increasing function of the degree of certainty for {tilde over (y)}.sub.mental_state.sup.t+1>0, in other words when the mental state is a satisfaction mental state. In other terms, the cost function will give more weight to training data having a higher probability of corresponding with a satisfaction mental state.
[0066] The following may be taken for example:
[Math. 11]
w({tilde over (y)}.sub.mental_state.sup.t+1)=max({tilde over (y)}.sub.mental_state.sup.t+1−−Th.sub.mental_state.sup.1,0) (8-1)
or
[Math. 12]
w({tilde over (y)}.sub.mental_state.sup.t+1)=h({tilde over (y)}.sub.mental_state.sup.t+1−−Th.sub.mental_state.sup.1) (8-2)
where h(.Math.) is the Heaviside step. It will be noted that the choice of a weighting function according to (8-2) is equivalent to the selective incorporation into the training set according to the aforementioned variant.
[0067] According to a second embodiment, the prediction made by the predictive model is based on a regression operation, for example a linear or multilinear regression:
[Math 13]
=
+
(9)
where is a prediction coefficient tensor
∈
and
is a skew tensor
∈
. The set of parameters of the predictive model here consists of the coefficients of the tensors
and
, Θ={
,
}. The tensor
provided by the predictive model is used directly for the command.
[0068] Alternatively, the prediction may be performed by means of a non-linear regression for example by means of an artificial neural network.
[0069] Regardless of the regression type, according to a first variant, the automatic labelling module updates the training data set Ω.sup.u by incorporating thereto the pair (,
)=(
,
) if the degree of certainty of the satisfaction mental state exceeds a predetermined threshold value ({tilde over (y)}.sub.mental_state.sup.t>Th.sub.mental_state.sup.1). Failing this, the labelling is not carried out and the pair (
,
) is not incorporated into Ω.sup.u.
[0070] As in the first embodiment, the update of the parameters of the predictive model may be performed by minimising a cost function giving the square deviation between the predictions of the model and the labels for the data of the training set:
where) F(.Math.;Θ) is the regression function.
[0071] According to a second alternative embodiment, the automatic labelling module updates the training data set Ω.sup.u by incorporating thereto the pair (,
) and (
,
) regardless of whether the predicted mental state is a satisfaction mental state or an error state. In this case, the update of the parameters on the training set is done by minimising a cost function giving more weight to the training data that correspond to a mental state having a higher degree of certainty (regardless of whether this mental state is a satisfaction or error mental state) than to the training data for which the predicted mental state is uncertain, namely:
with:
[Math. 16]
w({tilde over (y)}.sub.mental_state.sup.l+1)=|{tilde over (y)}.sub.mental_state.sup.l+1| if {tilde over (y)}.sub.menatl_state.sup.t+1≤Th.sub.− or {tilde over (y)}.sub.mental_state.sup.t+1≥Th.sub.+ (12-1)
and
[Math. 17]
w({tilde over (y)}.sub.mental_state.sup.l+1)=0 if Th.sub.−<{tilde over (y)}.sub.mentaal_state.sup.t−1<Th.sub.+ (.sub.12-.sub.2)
where Th.sub.− and Th.sub.+ are respectively a negative threshold value and a positive threshold value.
[0072] Due to the presence of the signed binary value, {tilde over (y)}.sub.D,mental_state.sup.t+1, in the expression (11), the minimisation of the cost function tends to reduce the square deviation of the prediction on the training data corresponding to a satisfaction mental state and to increase this deviation on the training data corresponding to an error mental state. The contribution to the reduction or to the increase of the square deviation depends on the degree of certainty of the prediction of the mental state, |{tilde over (y)}.sub.mental_state.sup.t+1|.
[0073] Equivalently, the consideration of a zero weight in the expression (12-2) may be implemented by only incorporating into the training data set the pairs of tensors (,
) for which the degree of certainty of the predicted mental state, |{tilde over (y)}.sub.mental_state.sup.t+1|, is sufficiently high.
[0074] The update of the parameters of the model depends on the type of predictive model. For example, if the predictive model is produced by means of a neural network the update of the parameters may be conventionally obtained by back propagation of the gradient. When the predictive model is based on a linear or multilinear regression, the update of the parameters may be performed according to the REW-PLS (Recursive Exponentially Weighted Partial Least Squares) or REW-NPLS (Recursive Exponentially Weighted N-way Partial Least Squares) algorithm, the cost function minimisation then being applied at each step of the Alternate Least Squares (ALS) method of the PARAFAC breakdown.
[0075] A description of the REW-PLS and REW-NPLS algorithms may be found in the article by A. Eliseyev et al. entitled “Recursive exponentially weighted N-way Partial Least Squares regression with recursive validation of hyper-parameters in Brain-Computer Interface applications” published in Scientific Reports, vol. 7, no. 1, p. 16281, November 2017 as well as in the patent application FR-A-3 061 318. These algorithms are advantageous insofar as they do not need to store the history of the training data but only those that have been labelled since the last update.
[0076] In the embodiment of
[0077]
[0078] The elements 310, 330, 340, 350 and 360 are respectively identical to the elements 210, 230, 240, 250 and 260 of
[0079] The adaptive brain computer interface of from the observation data tensor
by means of the prediction function F(.Math.;Θ) but itself does not carry out the update of the parameters Θ. This is delegated to the training module 370 that receives the training data from the automatic labelling module 360. For example, when a new set of parameters Θ.sup.u is available at the end of a new training phase u, the training module notifies this to the prediction module by means of an interruption to its CPU. The prediction module may then download the new set of parameters without disturbing any parameters of the command.
[0080] The person skilled in the art will understand that the brain computer interface described above is adaptive insofar as it adapts to the non-stationary condition of neural signals. It does not require a dedicated training phase, the training being able to be performed on training data obtained by an automatic labelling process using a prediction of the satisfaction/error mental state of the user. Furthermore, the labelled data correspond to tasks that the user actually carries out and not to tasks that are imposed on them during supervised training. Finally, it should be noted that the automatic labelling of observation data makes it possible to generate significant amounts of labelled data that may be used in an off-line training method. Thus, training databases can be obtained by crowd-sourcing without needing long expensive and demanding training sessions for the user.