## 3 State of the Art
### Enhancing EEG in Collaborative Robot Control with Reinforcement Learning
Once the entire learning phase is completed, the agent will have acquired a behavior based on the probabilities in that table. In the training phase, the objective is to update the State-Action Probability Matrix (SAPM) to optimize actions for given states. This requires error signal detection and management using classifiers [48]. Unlike traditional BCI systems, training occurs both online and offline. On one hand, offline training involves subjects performing sessions to gather data, with a portion used to train classifiers, using around 12,000 instances of brain signals. On the other hand, online training then adapts the SAPM using reinforcement learning. After training, the agent's behavior, particularly the robot arm's action planning, is tested. This process involves data acquisition, offline classifier training, and SAPM adaptation [45]. The study conducts a two-stage training with the Jaco robot arm. The first phase is offline, using EEG data for classifier training with 18,000 instances, including ERD/ERS and ErrP signals. The second phase is online, adapting the SAPM with visual and audio stimuli for learning and correction. The test phase compares the performance of children trained by the robot to those trained by humans [45]. In general, the study is quite innovative since it allows detecting when a user performs an experiment in the wrong way. Then the robot's behavior will be modified in order to teach the user to perform the experiment correctly. One of the aspects to highlight in this case is that the behavior of the robot is not directly influenced by the EEG signals, rather it will choose an action to be taken when the agent determines, either to replicate one of the movements or to throw the ball again. One of the future lines to point out could be the training of the agent in the task of throwing the ball and then, depending on the degree of error from the user, modify its behavior in a more direct way [45]. Although there are points that could be improved in the previous article, there are other very notable studies that aim to modify the total behavior of a robot based on the measured EEG signals. In addition, the authors only explored the possibility of detecting errors in certain tasks to carry out training of different agents. However, the possibility of detecting different feelings and emotions is something that can be distinctive to modify the behavior of a robot [49]. Other interesting approach was published in 2021 under the name \"Emotion-Driven Analysis and Control of Human-Robot Interactions in Collaborative Applications\" [33]. The authors focus on the behavior of a robot and the ability of the robot to adapt to different situations depending on the brain signals that are received from an EEG sensor. The research is based on the application of fuzzy logic rules to modify certain critical variables of the robot motion such as speed or motion delay. The rules are created from the beginning by focusing on stress. Nevertheless, a trial-and-error process will be carried out to establish representative relationships between the robot's speed and the user's emotions. The interesting thing about this study is that it is possible to modify the robot's behavior in a relatively simple way. While it is true that only motion-related variables are modified through the applied rules, the robot can modify its behavior based on measured EEG signals. The experimentation process including the EEG sensor, the collaborative robot and the human can me appreciated in Figure 5. It is also noteworthy that no reinforcement learning is used during this research, the fact that it is possible to use brain signals and relate them directly to emotions such as stress, anxiety, and depression, is a very important aspect of this work that could lead to the use of these signals in reinforcement learning investigations. Once it is established the possibility to modify the behavior of a robot based on the emotions that the user is feeling, new paradigms and new research areas appear.