scieee AI-readable full text Open interactive document viewer

Dynamic m-class angle compression for cursor control in 2D using brain interfaces

Garau Burguera, Pere

Abstract

The purpose of this project is to present an environment where a cursor can be controlled on a 2D screen by using a brain computer interface (BCI). For this purpose, and by using a probability model that determines which regions are the ones the user will eventually want to move to, and after applying information theory theorems which lead us to the desired result, the interface lets the user choose among m compressed versions of the angle at any particular point, dividing the space into m circular sectors around the current position, in an optimal way. Dynamic updates, which take into account the EEG evidence at the moment the subject selects where they want to go, are performed, in order to make the cursor get to the destination using less selection steps.

Full text

DYNAMIC M-CLASS ANGLE COMPRESSION FOR CURSOR CONTROL USING BRAIN INTERFACES A Degree Thesis Submitted to the Faculty of the Escola Tècnica d'Enginyeria de Telecomunicació de Barcelona Universitat Politècnica de Catalunya by Pere Garau Burguera In partial fulfilment of the requirements for the degree in CITTEL ENGINEERING Advisor: Deniz Erdogmus Xavier Giró Nieto Barcelona, October 2017 1 Abstract The purpose of this project is to present an environment where a cursor can be controlled on a 2D screen by using a brain computer interface (BCI). For this purpose, and by using a probability model that determines which regions are the ones the user will eventually want to move to, and after applying information theory theorems which lead us to the desired result, the interface lets the user choose among m compressed versions of the angle at any particular point, dividing the space into m circular sectors around the current position, in an optimal way. Dynamic updates, which take into account the EEG evidence at the moment the subject selects where they want to go, are performed, in order to make the cursor get to the destination using less selection steps. 2 Resum L’objectiu d’aquest projecte es presentar un entorn on és possible poder controlar un cursor damunt una pantalla bidimensional a través d’una interfície ordinadorcervell (BCI). Per aquest propòsit, i mitjançant un model probabilístic que determina a quines regions l’usuari tendrà intenció de moure’s, després d’aplicar teoremes de teoria de l’informació, la interfície deixa triar entre m versions comprimides de l’angle, a cada punt de la pantalla, dividint així l’espai entre m sectors circulars al voltant de la posició en cada moment, tot això de manera òptima. Es realitzen actualitzacions dinàmiques per tal de fer arribar el cursor al punt desitjat en el menor nombre de passes, amb l’ajuda de la informació del senyal EEG just en el moment en què l’usuari fa la selecció del sector al qual es vol moure. 3 Resumen El objetivo de este proyecto es presentar un entorno donde es posible poder controlar un cursor en una pantalla bidimensional a través de una interfaz ordenador-cerebro (BCI). Para este propósito, y mediante un modelo probabilístico que determina a qué regiones el usuario va a tener intención de moverse, y después de aplicar teoremas de teoría de la información, la interfaz deja elegir entre m versiones comprimidas del ángulo, a cada punto de la pantalla, dividiendo así el espacio en m sectores circulares alrededor de la posición en cada momento, de manera óptima. Se realizan actualizaciones dinámicas para hacer llegar el cursor al punto deseado en el menor número de pasos, con la ayuda de la información de la señal EEG al momento en el que el usuario hace la selección del sector al cual quiere moverse. 4 Acknowledgements I would like to thank Deniz and Xavier, and the whole CSL team at Northeastern. 5 Revision history and approval record Revision Date Purpose 0 29/09/2016 Document creation DOCUMENT DISTRIBUTION LIST Name e-mail Pere Garau Burguera [email protected] Deniz Erdogmus erdogm[email protected].edu Xavier Giró Nieto Xavier[email protected] Written by: Pere Garau Burguera Reviewed and approved by: Date 29/09/2016 Date Name Name Position Project Author Position Project Supervisor 6 Table of contents Abstract ................................................................................................................................. 1 Resum .................................................................................................................................. 2 Resumen .............................................................................................................................. 3 Acknowledgements .............................................................................................................. 4 Revision history and approval record................................................................................... 5 Table of contents .................................................................................................................. 6 List of Figures ....................................................................................................................... 7 1. Background ................................................................................................................... 8 2. Introduction .................................................................................................................. 12 3. State of the art of the technology used or applied in this thesis ................................ 13 4. Methodology/project development .............................................................................. 20 4.1. Probability model ................................................................................................. 13 4.2. Description of the problem ................................................................................... 14 4.3. Moving the cursor ................................................................................................ 17 5. Results: Environment .................................................................................................. 20 6. Budget ......................................................................................................................... 24 7. Conclusions and future development: ........................................................................ 25 Bibliography: ....................................................................................................................... 27 Glossary .............................................................................................................................. 28 7 List of Figures Figure 1 2D compression ............................................................................................... 10 Figure 2 4 directions approach ...................................................................................... 11 Figure 3 First step, vertical scan ................................................................................... 11 Figure 4 Second step, horizontal scan……………………………………………….11 Figure 5 Angle compression .......................................................................................... 12 Figure 6 Probability density function in the 2 dimensions ......................................... 14 Figure 7 Notation used for this problem ....................................................................... 15 Figure 8 Optimal angle partition .................................................................................... 18 Figure 9 Optimal angle partition showing the actual possible directions of movement ......................................................................................................................... 19 Figure 10 Updates after selecting sector in green...................................................... 20 Figure 11 General view of the cursor control environment: ...................................... 21 Figure 12 Comparison between all 4 classes of SSVEP signals used ................... 22 Figure 13 Arrows showing the locations of the objects ............................................. 22 Figure 14 Detail of how partitions are shown around the cursor position ............... 23 Figure 15 Sectors after moving towards the destination ........................................... 24 Figure 16 Sectors reset after clicking and opening menu ......................................... 24 8 1. Background Controlling a computer mouse has become nowadays a task most people do on a daily basis. Therefore, offering the possibility of controlling a computer mouse (by which one is able to use most of the functions of a basic computer) to people with motor disabilities who cannot utilize a computer normally, could be an important change into improving their quality of life. One solution which has been already used and tested in many different studies and situations is BCI. It stands for Brain Computer Interface, and allows people with mobility impairments interact with a computer and potentially control, with more or fewer functionalities, devices such as wheelchairs, personal computers, lighting control in a room… BCIs record brain activity by means of EEG, nonintrusively, by collecting the electric activity on the scalp of a person. In the following chapters, a form of controlling a computer mouse will be presented, and in the future it will be able to be easily operated with a BCI, therefore giving people with mobility limitations an improvement in their day to day life. 15 Another way of looking at the relation between s and ŝ is considering s as the input of a channel (and let σ1 to σM be the different symbols each one with its probability), and ŝ as the output of that channel, so depending on the confusion matrix (channel model), the probabilities of the different symbols at the output are then: The problem to be solved is the following: find ɣ such that the mutual information between the estimated sector and the actual angle is maximized. 16 The problem can be simplified if we note the following: If θ is given, then s is determined. There is no uncertainty in s if we know theta, we know the particular sigma for any given theta with a probability of one, and all the other sigmas have probability 0. With this in mind, the problem can be simplified, and at the end, the problem gets reduced to the following: The maximum mutual information for s and ŝ (with a channel in between) depending on the distribution of probabilities of s (the input of the channel) is what is usually referred to as channel capacity. This problem then becomes easy to solve with an algorithm that calculates the theoretical channel capacity (and the distribution of probabilities at the input of the channel) e.g. Blahut-Arimoto algorithm. This algorithm will take the channel (i.e. the confusion matrix) and, by performing recursive operations, will find the distribution of probabilities at the input (s) which maximizes the mutual information between the input (s) and the output (ŝ). Once the distribution of s is found, then ɣ needs to be adjusted so each of the sectors has the probabilities calculated by the algorithm. After ɣ is found, the consequent solution will look like the following: 17 Figure 8: Optimal angle partition. Note that θ = 0 is always the start point for finding the optimal gammas, so we will always have a border at θ = 0. This is because of the way the coding is done, and as far as finding the maximum mutual information is concerned, this starting point could be located at any given angle, or randomly changed at every step. 4.3. Moving the cursor The cursor is located at a certain point on the screen. The optimal compression of the angle has been calculated, given a previously found confusion matrix. Next step is make the subject select a sector, and move in a particular angle inside that sector. Two questions may arise; the first one has to do with the actual angle of movement, that is, when a sector is selected, in what angle the cursor will move. The second one is, after the subject has selected one of the M options, how the probability density function changes so that the system can make it easier to reach a particular destination. 18 Figure 9: Optimal angle partition showing the actual possible directions of movement. The actual directions of movement are given by the expected value inside the selected sector. We assume the estimated sector is the one the user has actually chosen, even when it is not the case. The reason for this is that the cursor should always move in the direction given by an angle that is actually inside the sector that has been estimated, not necessarily true if that condition is not imposed (and it would be confusing for the subject). After the user has selected a sector, the 2D function that determines the probability density in the 2 dimensions of the screen is going to be updated by using the EEG data collected when making that decision. et corresponds to the EEG evidence at time t, M is the selected sector at time t. g is a function that corresponds to the normal distribution of the SSVEP data. This dynamic update, after each time the user selects and the cursor moves can be seen in the following figure: 19 Figure 10: Updates after selecting the sector in green. In figure 10 the subject has selected σ. Therefore, the cursor will move towards the direction that corresponds to σ1. The 2D function will get updated, so the area that corresponds to the selected sector will get boosted, and the remaining probability (in red) will get dimmed down, all of this depending on the EEG evidence that has been generated in order to make the selection. After the update, all the probability will be normalized so it adds up to one again. In addition to giving the subject M choices to choose from, a reset/click option will be added. Whenever the user wants to click, the probability density function over the screen will get back to the original one, forgetting all the successive previous updates. This also works if the subject decides to change their intended destination, for the previous updates may play against them because the probability of the new intended destination can be rather low. Another important thing to have in mind is step size. In other words, how far the cursor moves after every step. The easiest way would be having a fixed step size, so every time the cursor would move the same amount. Other solutions with dynamic step size can be more interesting, for example one that depends on how certain the system is about the user actually willing to move in that direction. 20 5. Results: Environment Figure 11: General view of the cursor control environment. In this chapter the environment used to test the cursor control system will be presented. This environment consists of a text “sample text”, which can change its size, font, and style, by having the subject perform some actions. The areas the subject will most likely want to go to are the 7 buttons on the left side of the screen, and the menu on the right side. The red dot near the top right corner represents the current position of the cursor. Coming out of it, 4 lines are drawn. They represent the borders between the sectors. Therefore, the user has 4 sectors to choose from. In other words, the angle is compressed into four parts. The subjects can identify which sector they want to move easily, knowing that the count starts at θ = 0 (horizontal-right), so sectors will be assigned numbers 1-4 in a counterclockwise manner. To select any of the sectors, the user will need to press the numbers 1-4 on the keyboard, and to perform a mouse click (or/and reset back to the original probability density function), key 0 must be pressed. The step size has two different values, small and large. The small step size is used whenever the cursor is close to any of the peaks that form the probability density function. While the cursor is not close to any of the peaks, the step size changes to its largest value. This way, when the cursor has to be more precise in its movements, for example when trying to select among the different options of the dropdown menu, a smaller step size can be more convenient. This way of having two different values for the step size is one of the most basic ones, and a fixed value is set in order to make the distinction of when the cursor is close to the 21 peaks (and small step size used), and when it is further away so the step size switches back to its large value. When a sector is selected, an artificial EEG signal corresponding to the selected sector is generated. That signal is the one used to update the probability density function of the bi-dimensional space. After this, the system decides which class that particular sequence belongs to and moves towards the corresponding angle. In particular, SSVEP 4 class data is used, in response to an m-sequence based flickering at a rate of 60 Hz with sequences of 31 bit, which results in 133 samples. Figure 12: Comparison between all 4 classes of SSVEP signals used. Figure 13: Arrows showing the locations of the objects. 22 The black arrows point to where the peaks of the probability density function are located. Each circle is centered at one peak, and the size of it represents how high it is. In this case, we have a total of 7 peaks that would correspond to the 7 buttons on the left side, and 2 larger peaks that correspond to the dropdown menu on the right side (there is a peak which is slightly below the dropdown menu, which corresponds to when, after the subject clicking on it, it is displaying all the options below). Let us suppose that, with the cursor being at the position shown in figure 13, we want to move to the dropdown menu on the right side of the screen. In this situation, and provided that the cursor is located where the red dot is (top right), the subject could either choose sectors 3 or 4, since the menu spans inside these two sectors. Figure 14: Detail of how the partitions are shown around the cursor position. Let’s suppose the subject selects sector #3 to reach the menu. 23 Figure 15: Sectors after moving towards the destination. Figure 15 corresponds to the cursor after selecting sector #3 for 3 consecutive steps. Note that all the probability has been concentrated between sectors 2 and 3 after the updates, leaving sectors 1 and 4 (the larger ones) with a low probability inside. Figure 16: Sectors reset after clicking and opening menu. In figure 16, after reaching the menu and clicking, the function has been reset (it resets every time key 0 is pressed) and now the sectors are restored so it’s easier to move to any new direction, for example move to one of the seven buttons on the left side of the screen. 24 6. Budget This thesis has been completed after 6 months. If we consider working full time for 6 months (most of the time programming, rest for literature review, meetings, thinking new ideas…). 10,000€ would be a sensible price for the time worked. The environment has been made using MATLAB, whose student license is 69€. It already includes most of the toolboxes. The potential final clients this finished product (and many others that use BCIs) would have are persons with mobility impairments. Specifically, people suffering from locked-in syndrome. Patients suffer from complete paralysis in nearly all muscles of the body, except for eye movements or blinking. Therefore, the product will have to be adapted to every individual, depending on their condition and their needs. Also, it will be important to collect data from the experience of all users, so that changes can be made to further adapt to each one’s needs. Medical research centers (or similar) are going to be the potential clients of the prototype described in this thesis, complete knowledge of the medical condition a person suffers is very important in order to slowly introduce the final product into the daily life of a person. This will lead to the development of a more suitable product not just for testing but for daily use.