Auto-adaptative Robot-aided Therapy based in 3D Virtual Tasks controlled by a Supervised and Dynamic Neuro-Fuzzy System

This paper presents an application formed by a classification method based on the architecture of ART neural network (Adaptive Resonance Theory) and the Fuzzy Set Theory to classify physiological reactions in order to automatically and dynamically adapt a robot-assisted rehabilitation therapy to the patient needs, using a three-dimensional task in a virtual reality system. Firstly, the mathematical and structural model of the neuro-fuzzy classification method is described together with the signal and training data acquisition. Then, the virtual designed task with physics behavior and its development procedure are explained. Finally, the general architecture of the experimentation for the auto-adaptive therapy is presented using the classification method with the virtual reality exercise.


I. INTRODUCTION
HERE are a great number of literature about the growing importance of the use of robotic systems in the neurorehabilitation field [1] , [2]. Particularly in the assisted robotic devices for motor retraining in subjects who have suffered neurological injuries such as stroke or Parkinson. It is known that this kind of rehabilitation therapies produce a beneficial effects in those patients [3]. Many researchers intend to include them in a control loop [4] to increase the efficiency and effectiveness of such systems. Thus, robotassisted systems are able to decide the difficulty level that can be made during the different rehabilitation therapies taking into account the emotional and physiological aspects of the subject.
Currently, the adaptation of the robotic systems behavior using psycho-physiological measures is analyzed by the scientific community. A large number of classification methods and emotional estimation are compared in [5]. However, there are few studies about the utilization of neurofuzzy methods in these subjects. The hypothesis that neural network help us to estimate the emotional state of the patients is supported due to the network theory can be applied into the neural computing of the emotions, as is described conceptually in [6], and the architecture of cognitive networks, affective networks and evaluation layers is proposed in [7].
Furthermore, the virtual reality is a technology that allows developing rehabilitation environments such as virtual therapies based on activities of daily living (ADL), intended for stroke patients [8]. In other research, it was compared the virtual rehabilitation with the classical rehabilitation with two different post stroke groups [9]. The result was that the group exposed to the virtual rehabilitation shown a better improvement in the motor deficits of the upper limb than the other group. For this reasons, the adaptive robot-assisted rehabilitation therapy can be beneficial for the patient.
This paper proposes a neuro-fuzzy architecture combined with 3D virtual reality in the development of an upper-limb rehabilitation application to study the potential usefulness of neural networks, fuzzy logic and three-dimensional environments based in physical principles. This method can be dynamically modify and can adapt the robot-assisted rehabilitation therapy according to the emotional state of the patient, following the psycho-physiological computing processing as defined in [5].

II. CLASSIFICATION METHOD
In this section, an analysis of the classification method, used to differentiate the emotional state of the user during the proposed robot-assisted rehabilitation therapy, the acquisition data process and the extraction features of physiological signals are explained. Further information about the learning algorithm and validation test is also presented.
A. Neuro-fuzzy System: S-dFasArt S-dFasArt [10] is a classification method based on the architecture provided by the ART neural network [11], where fundamentals of the Fuzzy Sets theory are applied in the different processing stages of the classification algorithm. The neuro-fuzzy architecture takes the advantages of both techniques, the learning and adaptability capacity of the neural networks, and the robustness, the interpretability and the fault tolerance of the fuzzy systems.
To improve the convergence speed and the update mode of the fuzzy weights dynamical equations are used. Moreover, this classification method allows a fast, supervised and competitive learning, keeping the accumulated knowledge. All nodes or output categories are actuated by the input data due to its competitive property, but only the neuron with the highest response level is activated. Therefore, the winner category generates the classifier output on the current input pattern.
The architecture of the proposed method is shown in Fig. 1. This model is formed by three layers or levels and an orientation subsystem.  The Input Level is used to receive the input data in a vector form, with the most important features of the physiological signals. Furthermore, in this level it is also applied an activation-membership function to determine the membership degree of each input attribute on the generated categories [12].  The Supervisory Level presents the output pattern for the association with the input pattern.  The Category Level is formed by a several nodes that represent the fuzzy units or categories and it contains the classification results with activation and reset levels. This level stores the association between the input sequences and its corresponding supervision vector.  The Orientation Subsystem is responsible to create categories during the learning and the generalization of the similar categories.

B. Training data acquisition
To test the possibilities of the proposed classification method it is necessary the acquisition of the training data. The process to obtain the physiological signals is done as it is explained in [14] A robotic device designed for upper-limb assisted therapy called PUPArm, which is commercialized by Instead Technologies Inc, is used during the therapy. It has a signal acquisition system provided by g.tec medical engineering GmbH with different sensors and a virtual reality system. The physiological signal of the subject, such a pulse rate, respiration rate, skin conductance level (SCL), skin conductance response (SCR) and skin temperature [15], were recorded in real-time.To test the possibilities of the proposed classification method it is necessary the acquisition of the training data. The process to obtain the physiological signals is done as it is explained in [14]. A robotic device designed for upper-limb assisted therapy called PUPArm, which is commercialized by Instead Technologies Inc, is used during the therapy. It has a signal acquisition system provided by g.tec medical engineering GmbH with different sensors and a virtual reality system. The physiological signal of the subject, such a pulse rate, respiration rate, skin conductance level (SCL), skin conductance response (SCR) and skin temperature [15], were recorded in real-time.
The integrated virtual reality system encourages different psycho-physiological states of the patient. The activity is formed by a series of rectangular elements of different sizes that they move randomly across the screen with different speeds inside a defined area. Meanwhile, the user control a pointer with the robotic device in order to avoid the collision with the rectangular elements. Three different levels of difficulty (relax level, medium level and stress level) were defined using the number and speed of the rectangular elements shown in screen.
Once the physiological signals are acquired, a data processing, based on normalization of the features, was performed to get the final set of training data with its respective supervision measures. The emotional states of the patient are collected in these supervision data.

C. Learning algorithm
In this section, the S-dFasArt neuro-fuzzy learning algorithm is explained briefly showing the required steps to train the neuro-fuzzy network nodes. Detailed explanation about this algorithm can be found in [13]. (1) The input training data and its corresponding supervision labels are received through the classifier at the Input Level and Supervisory Level respectively. Next, the activation level (1) and the reset level (2) of all nodes that form the Category Level are calculated.
Then, the winner category is determined by comparing the activation levels values (3) and selecting the node with the highest value. If this activation value is null the classifier add a new uncommitted category. (3) In the next step, it is necessary to check the reset level to determinate if the winner category accomplishes the necessary conditions of similarity with the input vector using a vigilance threshold. If it overtakes the threshold, the category whose level activation is the next highest, is searched. Once the winner category exceeds activation and reset conditions, its supervision label is compared with the supervision label received to confirm if it is a correct prediction. If it is not satisfied, the next category is sought.
To perform the update of the weights nodes of the neurofuzzy network the following dynamic equations (4) are used in case of an existing category. (4) In case of a new category, the weights nodes are initialized (5) using the input vector.

D. Validation Test
At this point, a functional classification model has been implemented to distinguish correctly in real time the input patterns generated by the physiological signals of the patient and they are processed for features extraction. To get this functional model, an adjustment process of the SdFasArt neuro-fuzzy classifier have been applied following three phases [10]: 1. Initialization of the static value parameters linked to the dynamic equations. 2. Learning the weights whose values represent the diffuse categories generated by the presentation of the input pattern data to the classifier, using the learning algorithm explained in the previous subsection. 3. Setting the most influential parameters of the neurofuzzy network, σ and A T , related to the diffuse character and the activation speed of the classifier categories, checking the values that provide better classification results.
Once the possible values of σ y $A_{T}$ are analyzed, the functional classification model is completed. This model has been tested using the Leave-one-out validation technique to evaluate the classification results and ensure that they are independent of the partition between training and test data. Finally, the accuracy level has been calculated obtaining a performance results of 92.38% with 34 diffuse categories.

III. 3D VISUAL TASKS ARCHITECTURE
The virtual task developed to perform the robot-assisted rehabilitation therapy has been designed following the scheme of programming routines. The general architecture is shown in Fig. 2. The graphic content required for the virtual scene is generated using Blender [16], a modeling software. This modeling tool can generate 3D meshes files with an appropriate format for an easy installation. Thus, the polygon mesh of the stage and the interacting elements are obtained. A file with the distribution of all scene elements is also generated.
These visual elements implemented are interpreted by the application core to build the virtual environment providing a characteristic behavior to each element. The core is responsible for controlling the application execution to organize all components of each of the blocks of the general scheme. The open source software called Ogre3D [17] has been used as a graphics engine. Ogre3D provides a flexible and object-oriented programming and, through its high level interface written in C++, it offers a series of intuitive methods that facilitates the preparation of 3D visualization applications with quite realistic, interactive and real-time environments on any kind of platform.
The physical engine is an important component that has been added. In this case, to simulate elements with some realism degree the NVIDIA PhysX \cite{physx} has been used. This engine tries to predict the physics effects within a scene subject to various conditions of speed, force, friction, mass and many more physics variables. Its main function is the collision detect algorithms able to calculate the interaction between all elements of the physics scene and the forces generation. Then, the rendering loop of the graphic engine updates the temporal evolution of the physics elements. It is also responsible for the visual representation of the behavior of each physics model by moving its corresponding graphical model. Each physics model consists in a simplified geometry of each specific graphical model to provide the main core the collision detect within the simulated physics space.
A sounds engine has been also incorporated to play sound effects depending on the task objectives. This engine helps in realism of the application and immerse the user in the virtual environment. The robotic system is controlled by the patient to manage the position of a virtual tool, whose movement affects in the collisions detect generated by the physics engine, depending of the simulated tool geometry. Meanwhile, the user has a visual feedback of everything happening in the application.

A. Whack a Rabbit
In this paper, an example of virtual task has been designed using the procedure explained previously. The main objective of this task is to find items, in this case rabbits, which appear randomly on the scene. The user should use the robotic system to control the virtual tool and hit these targets. In Fig. 3 the implemented virtual task is shown.
To complete the experimentation different difficulty levels have been implemented in the virtual task for automatic level changes depending of the emotional state of the patient.
 Only one rabbit appears and stays on stage for 10 seconds.  Only one rabbit appears and stays ion stage for 5 seconds.  Two rabbits appear at the same time, and they stay on stage for 10 seconds.  Two rabbits appear asynchronously, and everyone stays on stage for 5 seconds.  Three rabbits appear at the same time, and they stay on stage for 10 seconds.  Three rabbits appear asynchronously, and everyone stays on stage for 5 seconds. The physic and visual elements used to develop the virtual task are explained in the following subsections.

1) Static bodies
The static bodies are the elements of PhysX that are used in this application. These elements are placed in a particular localization in the scene and they are kept immobile during all simulation, while the remaining elements are influenced by the collision forces inside the stage during the exercise. In this virtual task the static elements have been designed to represent a garden with lawn, a wooden fence and 9 rabbit burrows. Also, a garden tools have been added to introduce the patient on the virtual reality.

2) Kinematic bodies
The kinematic bodies are objects that the user can freely move within defined work range, and do not act under the influence of forces response, gravity and collisions. The movement of the kinematic bodies are produced getting the coordinates generated by the robotic system. In this task, a hammer has been designed as kinematic body, which generates an hit animation when the hammer is closed to the target.

3) Soft bodies
To provide more realism when the collision with the target occurs, the PhysX feature of soft bodies generating has been used. These deformable and volumetric elements have a elastic topology formed structurally by tetrahedral meshes that encapsulate all the 3D object surfaces. The stretching and bending constraints maintain subjected the vertices of this mesh type. The vertex positions are modified because of the internal forces of the soft body and the external forces generated in the physical engine.
Each tetrahedron of the soft body involves a number of vertices in the visual mesh. These vertices are attached to the behavior of the corresponding tetrahedron. Once the physics are updated, the new vertices positions are calculated and the graphic engines change the vertices positions of the visual mesh depending on the displacement suffered by the soft body. Thus, the 3D soft visualization body is updated. Also, PhysX offers different parameters that influence the internal physics of these bodies such as density, friction or damping, whose values can cause varying impact on the overall response of the element.
In this task, the bodies that move randomly in the scene are the soft bodies and they are shaped like a rabbit. Whenever a body is hit by the virtual tool, it color changes to indicate the success. Therefore, thanks to this functionality, the user is aware of the impact moment against the target and force direction.

IV. AUTOADAPTATIVE EXPERIMENTATION
The final application, based on adaptive robot-assisted rehabilitation therapy according with the specific psychophysiological state of each patient, is defined in this section. A good performance has been observed in the classification method used in this experimentation, explained in the section II.
The general diagram of the autoadaptive experimentation is shown in Fig. 4, it is formed by four functional blocks. The sensors are connected to the user to record his/her physiological signals while controlling the interaction system. The explained rehabilitation robotic device and the virtual reality subsystem are included in this interaction system. The user has three feedback types (visual, audio and force). When the user starts using the robotic system, his physiological signals are processed to extract the most important features. These features are sent to the functional model of the neurofuzzy classifier. Three possible states are generated by the classification block processing, the input information to check the psycho-physiological state of the user and decide the modification to be made in the deployed task (up level, down level or maintain level). This proportionate classification state is sent to the interaction system to complete the experiment of automatic difficulty level changes in the virtual task explained in section II, where six levels have been defined. The aim of the experimentation is to maintain an intermediate difficulty level along the task period.
The extraction and processing of the signals features have been performed in a Simulink scheme, while the classification block has been designed with Matlab. A UDP protocol is used to communicate the classifier with the virtual task software. This communication is applied every 30 seconds to send three possible action commands and changing the difficulty level of the virtual task: 1. If the user has an over-stressed level, one difficulty level is reduced in the virtual task. 2. If the user has stable state, the virtual task does not change the difficulty level. 3. If the user is relaxed, the actual difficulty level is increased. Currently, several subjects are doing these experiments, who were informed of the work purpose. The subjects must perform an adaptation period of few minutes. Then, the subjects signals in relaxed state for 5 min are recorded to obtain baseline measurements. Finally, the subjects perform the task for 10 minutes, starting in the first difficulty level of the virtual task.

V. CONCLUSSION
In this paper, a classification model based on a neural network architecture and the fuzzy logic is presented to classify three different states of the user's reactions physiological in an assisted system of robotic rehabilitation. This method has obtained a quite good performance results (92.38% in LOOCV) that allow an efficient classification in real-time.
On the other side, a graphical application based on 3D virtual reality has been implemented. The aim of this issue is to increase the sense immersion of the user inside of the virtual environment, checking the patients behavior in front of scenes in three dimensions. Ogre3D has been used for visualization. The physics engine adds realism to the scene providing performance energies on elements that have different physical behaviors. These software tools offer a great versatility and flexibility to implement all type of virtual exercises with visually and physically realistic environments.

ACKNOWLEDGMENT
This work has been supported by the Spanish Government through the project ``Interpretation of the human intention and performance through biomedical signals and analysis of kinematic and dynamic motion" (DPI2011-29660-C04-04), by CIBER BBN and by MAT2012-39290-C02-01.