We performed an initial recording to set a membership function based on the maximum/minimum of the real inputted values. For example, a template can be composed of inputs having features of different types such as“ EEG power of Oz measurement site in the α wave frequency band ” and “ amplitude of the surface electromyography (EMG) signal of right lower limb”. Here, the BCI classifies input EEG signals into several categories linked to cognitive states. It also controls external equipment in real time. Consequently, the delay of recognition should be suppressed as much as possible. Therefore, the consequent clause should be not a fuzzy set but a singleton, while the consequent clause of ordinal Mamdani ’s reasoning is a fuzzy set. In the conventional fuzzy reasoning, the calculation of the center of gravity requires for much time. Simplified fuzzy- reasoning is used to avoid such related difficulties [20]. For this study, L-FTM method includes 12 inputs and 2 fuzzy labels. Therefore, the number of fuzzy rules is 2 to the power of 12, 4096. Fast Fourier Transform (FFT) was applied to EEG signal detected from each electrode. The summation of the value of power in the range of the selected frequency band was obtained and used as the input value for the BCI. Depending on the task, the measurement sites and the frequency bands were selected. The following two frequency bands were conceivable as subjects for recognition; α band (8~13 Hz) and β band (14 ~ 50 Hz). As mentioned above, L-FTM is an application of leaning-type-simplified-fuzzy reasoning to template matching method. Therefore, calculations are same those of leaning-type-simplified-fuzzy-reasoning. EEG power was inputted to the membership function of the defined fuzzy label of j-th input of the i-th fuzzy rule, and the multiplied outputs of all the membership functions of i-th fuzzy rule, Gj, is obtained as compatibility degree of i-th fuzzy rule, µi Eq.(1).
\(\mu_i=\Pi_{j=0}^nG_j\) (1)
The output value Z was calculated as the weighted average of the consequent values of all rules, here Zi is the consequent part value of i th rule Eq.(2).
\(Z=\frac{\Sigma_{i=1}^n\left(\mu\cdot Z_i\right)}{\Sigma_{i=1}^n\mu_i}\) (2)
2.2 Learning process of consequent part values
In this L-FTM, consequent values were set up by learning process. Using the steepest descent method, Z approximated to the target value of the teacher signal T Eq.(3). Zi’ is consequent value before updating, which is different from Zi. ρ is a learning coefficient.
\(Z_i=Z'_i+\rho\cdot\mu_i\cdot\left(T-Z\right)\) (3)
The teacher signal is allowed to be any values if the values can be linked to several distinct states. For example, 0 was a label for EEG of the resting state and 5 was a label for EEG expressed during foot movement. In the learning process, consequent values of the rules with high compatibility degree for a certain state are modified to the teacher signal corresponding to the state, thereby producing effective rules (templates) for recognition of the specific status. In other words, recognized EEG features during a cognitive task were extracted from the rule set consisting of the combination of EEG inputs and labels. Therefore, this learning process corresponds to a searching process.
2.3 Pruning
Fuzzy rule sets are EEG feature patterns routinely from combination of input and fuzzy labels such as high and low. Therefore, rules with a high compatibility degree for EEG during both task and non-task status were expected to be included. Such fuzzy rules compatible to both states is expected to reduce the identification accuracy. In order to avoiding the matter, we implemented “pruning” to the developed BCI system. The pruning process deleted inadequate fuzzy rules with high degree of compatibility for both states and retained only rules with high degree of compatibility for either a task state or a non-task state. The maximum value of compatibility degree of i-th fuzzy rule during the task situation, Ob(i) was calculated
for each rule Eq.(4).
\(Ob_{\left(i\right)}=\max\left\{\sum_{t=1}^{te}Ot_{\left(i,t\right)},\sum_{t=1}^{te}O_{n\left(i,t\right)}\right\}\) (4)
In that equation, t represents the time of input data, te represents the last time. In addition, Ot(i;t) represents compatibility degree of i-th rule at time t during the task status. Similarly, On(i;t) represents compatibility degree of i-th rule at time t during the non-task status. Then the difference between the total value of each compatibility degree during task and non-task situations was calculated. Its absolute value is Os(i) Eq.(5).
\(Os_{\left(i\right)}=\left|\Sigma Ot_{\left(i\right)}-\Sigma On_{\left(i\right)}\right|\) (5)
If the value of Os(i) normalized with Os(i) is smaller than the adequately set threshold th, then i th rule was a rule with high compatibility degree in both states and was deleted. If the difference is large, the i th rule is judged as with high compatibility degree for only task or non-task status, and the rule was retained Eq.(6).
\(\Pr uning\left(R_{\left(i\right)}\right)=\left\{_{delete,\ if\left(\frac{Os_{\left(i\right)}}{Ob_{\left(i\right)}}<th\right)}^{retain,\ if\left(\frac{Os_{\left(i\right)}}{Ob_{\left(i\right)}}\ge th\right)}\ \ \ \ \right\}\) (6)
Using only retained subsets of rules, the learning process was performed again with input values of the stored learning data. The consequent values were rearranged. Using the new template set increased accuracy of identification of the two states.
3. Ankle rehabilitation device
3.1 Mechanisms design
For this study, an ankle joint rehabilitation device developed as shown in Figure 2 [21] [22].