Fuzzy Computing Model of Activity Recognition on WSN Movement Data for Ubiquitous Healthcare Measurement

Ubiquitous health care (UHC) is beneficial for patients to ensure they complete therapeutic exercises by self-management at home. We designed a fuzzy computing model that enables recognizing assigned movements in UHC with privacy. The movements are measured by the self-developed body motion sensor, which combines both accelerometer and gyroscope chips to make an inertial sensing node compliant with a wireless sensor network (WSN). The fuzzy logic process was studied to calculate the sensor signals that would entail necessary features of static postures and dynamic motions. Combinations of the features were studied and the proper feature sets were chosen with compatible fuzzy rules. Then, a fuzzy inference system (FIS) can be generated to recognize the assigned movements based on the rules. We thus implemented both fuzzy and adaptive neuro-fuzzy inference systems in the model to distinguish static and dynamic movements. The proposed model can effectively reach the recognition scope of the assigned activity. Furthermore, two exercises of upper-limb flexion in physical therapy were applied for the model in which the recognition rate can stand for the passing rate of the assigned motions. Finally, a web-based interface was developed to help remotely measure movement in physical therapy for UHC.


Introduction
Modern health care services are experiencing new challenges in the rapid growth of long term illnesses and ethical demands in health care. Ubiquitous health monitoring technique offers self-management solutions for older adults and disabled patients who need regular healthcare or rehabilitation at home. Activity detection is an important issue in ubiquitous health care (UHC), particularly for daily monitoring of patients with motor handicaps. In pursuit of rehabilitation for these patients, specific motions and facilities are prescribed in routine and continuous programs during the recovery period [1][2][3]. If physiatrists can completely review the daily records of patients through UHC with ambulatory measurements, they can design more helpful therapies [4,5]. Therefore, activity recognition is the prospective solution to accomplish this task.
Appropriate techniques have been used to capture and recognize movements of people, such as lying down, sitting, standing, and walking [6]. Typically, image [7] and non-image [8] procedures have been extensively used to classify movements of the human body. Thus, patients would prefer non-image UHC devices because of privacy, convenience, and cost of equipment [9]. Requirements of UHC in relation to rehabilitation are expanded by the concept of homecare personal area networks that provide ambulatory monitoring and supporting hospital functions by using ad hoc or body area networks [10][11][12][13][14][15][16][17][18]. In the past decade, wireless sensor networks (WSNs) have been gradually deployed and applied to detect various physiological signals because of micro-electro-mechanical system (MEMS), integrated circuits (IC), and rapid advances in radio frequency (RF) [19,20]. These types of technologies have been extended to different UHC devices to measure the blood pressure of patients and monitor variations of their movements and environment at home [21,22]. Numerous studies promoted these emerging techniques in various home health care systems because of their long durability, low power, and mobile capacity for patients to ubiquitously communicate health care information and clinical data to the hospital [23][24][25][26]. For this approach to physical therapy, several activity recognition procedures were examined to improve motor measurements with accelerometers or gyroscopes for further WSN-enabled UHC applications to prevent unnecessary videotaping or photographing [27,28].
Computing algorithms such as fuzzy logic, artificial neural network (ANN), and backward propagation neural network (BPNN) were popular for recognizing and classifying features of motions in past studies. For example, rule-based fuzzy logic enables classification of regular gesture patterns [29][30][31]; the ANN with neural-fuzzy functions retains training capability to recognize irregular movements [32]; the BPNN follows the ANN with three layers of machine learning [33]. Thus, fuzzy inference system (FIS) based on Zadeh's fuzzification algorithms that map the functioned features from an input space to an output space can comprise a list of if-then rules for complex controls and decision processes [34]. In which, two well established types of FIS can be utilized: i.e., the Mamdani type which uses typical membership functions of output features for defuzzification [35] and the Sugeno type which entails weight average by constant or linear expression to compute crisp output [36]. The FIS was employed in many studies to distinguish patterns of human activities that were measured by various mobile devices with an approximate 90%-100% recognition rate dependent on features [37][38][39][40][41]. In addition, the neuro-fuzzy algorithm was suggested to adapt the training-based dataset to the training procedure for comprehensive and accurate recognition of adopted features [42][43][44][45].
This study established the activity recognition model for the self-designed wearable WSN sensor, which combines MEMS-based accelerometer and gyroscope chips to carry six motion components of acceleration and angular velocity for detecting body movement [46]. The subjects wore two WSN sensors, one on the chest and the other one on the thigh, to transmit the required signals by using a convenient measurement procedure. The WSN motes deployed in a space of a body area network could transport sensed data to the lab while users wore the WSN sensors in the other room. The measurement data were sent to the backend server of the monitoring system through a WSN gateway that was created in our previous work [47]. The motion components can be the potential feature sets in the FIS to calculate the combinative data of activity recognition. In this paper, the WSN sensor configuration is briefly described in the next section, and is followed by a presentation of the measurement methods. The FIS designs with fuzzification and defuzzification are then processed to compute the sensed data input, and to identify the output movements. The procedure is further practiced by two upper-limb flexion actions to determine a threshold of the specific activity in physical therapy for UHC measurement. Finally, the results are discussed, and concluding remarks are presented.

Measurement Methods
One of UHC's programs in physical therapy is enabling physiatrists to remotely monitor movements of the patients when they need to continuously rehabilitate their disabilities at home. The prior studies measured acceleration data to discover the activity recognition algorithms [48,49]. Thus, the gyroscope and accelerometer can return signals related to angular velocity and acceleration, respectively, and detect the motions like lie, sit, stand, walk, and run. The measured data can be converted as the components in spatial coordinates to denote the specific movements. Both of the MEMS-enabled chips are extensively embedded within a portable device to sense positions of the subjects when they are worn by the users. As transporting data through the WSN to the backend system, the fuzzy inference procedure for activity recognition that is supported by the Fuzzy Logic toolbox of MATLAB™ (by The MathWorks Inc., Natick, MA, USA) can enable the UHC application in physical therapy.

WSN Sensors and Signals
The WSN sensor was integrated within a mote that configures the embedded micro control unit (MCU), RF, and antenna, as shown in Figure 1a, to deliver signals of the wireless sensor. The accelerometer and gyroscope were installed in an inertial sensing node as shown in Figure 1b to detect six components of acceleration and angular velocity. The sensor modules are designed with low-power emissions for safety, and are compliant with TinyOS which is the open-source embedded operating system available for remote control through the typical network protocol. In the design, a packet filtering module was created at the receiver sink of the backend server to convert measured signals into physical values. Thus, the gyroscope and accelerometer can return signals related to angular velocity and acceleration, respectively, and detect the motions like lie, sit, stand, walk, and run. The measured data can be converted as the components in spatial coordinates to denote the specific movements. Both of the MEMS-enabled chips are extensively embedded within a portable device to sense positions of the subjects when they are worn by the users. As transporting data through the WSN to the backend system, the fuzzy inference procedure for activity recognition that is supported by the Fuzzy Logic toolbox of MATLAB™ (by The MathWorks Inc., Natick, MA, USA) can enable the UHC application in physical therapy.

WSN Sensors and Signals
The WSN sensor was integrated within a mote that configures the embedded micro control unit (MCU), RF, and antenna, as shown in Figure 1a, to deliver signals of the wireless sensor. The accelerometer and gyroscope were installed in an inertial sensing node as shown in Figure 1b to detect six components of acceleration and angular velocity. The sensor modules are designed with low-power emissions for safety, and are compliant with TinyOS which is the open-source embedded operating system available for remote control through the typical network protocol. In the design, a packet filtering module was created at the receiver sink of the backend server to convert measured signals into physical values. According to the design specifications, the self-developed MEMS-based wearable device allows measuring acceleration and angular velocity respectively within ±10 g and ±1000°/s. Besides, the problem of noise for low gravity was experienced and calibrated in the development of our previous work [41] to ensure the fidelity of the device in measurement. With this concern, the relative values of measured data with respect to initial data, instead of the absolute values, are suggested for calibration.
The five basic motions above cover the body movement including regular sway of the upper and lower limbs. In which, the potential motor features can be observed in movements of the chest and thigh portions for motions of the upper and lower body. We thus used two WSN sensors to measure the specific motor features of basic motions. The subject wore sensors A and B on the right chest and the left thigh, respectively, to acquire the components of acceleration and angular velocity. The variations of retrieved data can be plotted in the diagrams, as shown in Figure 2, for recognition. According to manufacture specifications, we located the local coordinate system for three sets of data packets of either accelerometer or gyroscope along 1-, 2-, and 3-axes of the device. In which, the 3-axis is oriented for gravity. We further defined the global coordinate system of x-, y-, and z-axes as vertical to the ground, lateral to the body, and forward/backward, respectively. The static posture "stand" is set as the initial status of measurement (i.e., the 1-axis of both sensors is vertical to the ground in the beginning). Let gA, gB, ωA, and ωB be the vectors of acceleration and angular velocity According to the design specifications, the self-developed MEMS-based wearable device allows measuring acceleration and angular velocity respectively within ±10 g and ±1000 • /s. Besides, the problem of noise for low gravity was experienced and calibrated in the development of our previous work [41] to ensure the fidelity of the device in measurement. With this concern, the relative values of measured data with respect to initial data, instead of the absolute values, are suggested for calibration.
The five basic motions above cover the body movement including regular sway of the upper and lower limbs. In which, the potential motor features can be observed in movements of the chest and thigh portions for motions of the upper and lower body. We thus used two WSN sensors to measure the specific motor features of basic motions. The subject wore sensors A and B on the right chest and the left thigh, respectively, to acquire the components of acceleration and angular velocity. The variations of retrieved data can be plotted in the diagrams, as shown in Figure 2, for recognition. According to manufacture specifications, we located the local coordinate system for three sets of data packets of either accelerometer or gyroscope along 1-, 2-, and 3-axes of the device. In which, the 3-axis is oriented for gravity. We further defined the global coordinate system of x-, y-, and z-axes as vertical to the ground, lateral to the body, and forward/backward, respectively. The static posture "stand" is set as the initial status of measurement (i.e., the 1-axis of both sensors is vertical to the ground in the beginning). Let g A , g B , ω A , and ω B be the vectors of acceleration and angular velocity measured by sensors A and B, respectively. Each vector consists of three components in the local coordinate; that is,  In practice, primary acceleration components are experienced in the x-and z-axes for forward-moving behaviors. Similarly, the angular velocity along the x-and y-axes is significant for the motions of body sway. Based on the specification of the sensor, the sensed data return random variables in form of probability density functions (PDF) which the output histogram follows Gaussian distributions as shown in Figure 3a. Therefore, we gathered a set of sensed data distributed during a period (e.g., 1 s), and took their mean value as the actual measured data. In practice, primary acceleration components are experienced in the xand z-axes for forward-moving behaviors. Similarly, the angular velocity along the xand y-axes is significant for the motions of body sway. Based on the specification of the sensor, the sensed data return random variables in form of probability density functions (PDF) which the output histogram follows Gaussian distributions as shown in Figure 3a. Therefore, we gathered a set of sensed data distributed during a period (e.g., 1 s), and took their mean value as the actual measured data.

Movement Features
The fuzzy computing process was utilized in the study to recognize the assigned movements. We initially suggested the native features of the motion, such as the measured accelerations and angular velocities, for the parameters to begin the fuzzy inference procedure.
1. gAR and gBR: the relative acceleration vectors for sensors A and B, respectively. The relative acceleration of motion can assist in detecting the starting motion when the body begins moving from the static position. Because of gravity, the initial acceleration of sensors in static status should be identical to 1 g. Thus, the relevant vectors for calculations were obtained by subtracting the initial acceleration from the present data, i.e., gAR = gA − gA0 and gBR = gB − gB0, where gA0 and gB0 are the initial acceleration vectors measured by sensors A and B, respectively. 2. ωAR and ωBR: the relative angular velocity vectors of sensors A and B, respectively. They can aid in recognizing body rotations. An initial value was subtracted from each angular velocity to calculate the rotating components in three directions. These were ωAR = ωA − ωA0 and ωBR = ωB − ωB0, where ωA0 and ωB0 are the vectors of initial angular velocity measured by sensors A and B, respectively. In addition, we extensively considered some features that can be derived from the features above to be the candidates for the process. 3. θA and θB: the tilt angles of sensors A (at the chest) and B (at the thigh) with respect to the initial status. The acceleration vectors at the i-th time step, for example, gAi and gBi for the sensors A and B, can be applied to conduct the tilt angle of the sensor with respect to the initial position. The tilt angles of sensor A can be computed by cos(θA) = (gAi•gA0)/(|gAi||gA0|) and vice versa for the sensor B. Let θAB be a tilt angle between two sensors, θAB = cos −1 ((gA•gB)/(|gA||gB|)) is within domain [0, π]. In which, the operator "•" denotes an inner product of two vectors, and |gA| = (gA1gA1 + gA2gA2 + gA3gA3) 1/2 . Theoretically, θA should approximate 90° when the position of sensor A is changed from the postures of sit or stand to lie; similarly, θB should approach 90° when the position of sensor B is changed from stand to sit or lie. A small angle is observed from θB between sit and lie because sensor B on the thigh cannot be perfectly horizontal to the ground. Low, medium, and high degrees of the angle features can be defined for fuzzification. 4. σgA, σgB, and σωA, σωB: the standard deviation of acceleration and angular velocity of the chest and thigh, respectively. When the movement is unstable (e.g., walk or run), the sensed data may return significant variations in acceleration. Similarly, the shoulders and limbs sway when moving, creating angular velocity. Thus, these features aid in distinguishing the motion statuses of walk and run, if the body continues in a uniform motion without significant acceleration. The mean value (μ) and standard deviation (σ) of the PDF can be counted to evaluate moving levels.

Movement Features
The fuzzy computing process was utilized in the study to recognize the assigned movements. We initially suggested the native features of the motion, such as the measured accelerations and angular velocities, for the parameters to begin the fuzzy inference procedure.

1.
g AR and g BR : the relative acceleration vectors for sensors A and B, respectively. The relative acceleration of motion can assist in detecting the starting motion when the body begins moving from the static position. Because of gravity, the initial acceleration of sensors in static status should be identical to 1 g. Thus, the relevant vectors for calculations were obtained by subtracting the initial acceleration from the present data, i.e., g AR = g A − g A0 and g BR = g B − g B0 , where g A0 and g B0 are the initial acceleration vectors measured by sensors A and B, respectively.

2.
ω AR and ω BR : the relative angular velocity vectors of sensors A and B, respectively. They can aid in recognizing body rotations. An initial value was subtracted from each angular velocity to calculate the rotating components in three directions. These were ω AR = ω A − ω A0 and ω BR = ω B − ω B0 , where ω A0 and ω B0 are the vectors of initial angular velocity measured by sensors A and B, respectively. In addition, we extensively considered some features that can be derived from the features above to be the candidates for the process.

3.
θ A and θ B : the tilt angles of sensors A (at the chest) and B (at the thigh) with respect to the initial status. The acceleration vectors at the i-th time step, for example, g Ai and g Bi for the sensors A and B, can be applied to conduct the tilt angle of the sensor with respect to the initial position. The tilt angles of sensor A can be computed by cos(θ A ) = (g Ai ·g A0 )/(|g Ai ||g A0 |) and vice versa for the sensor B. Let θ AB be a tilt angle between two sensors, In which, the operator "·" denotes an inner product of two vectors, and |g A | = (g A1 g A1 + g A2 g A2 + g A3 g A3 ) 1/2 . Theoretically, θ A should approximate 90 • when the position of sensor A is changed from the postures of sit or stand to lie; similarly, θ B should approach 90 • when the position of sensor B is changed from stand to sit or lie. A small angle is observed from θ B between sit and lie because sensor B on the thigh cannot be perfectly horizontal to the ground. Low, medium, and high degrees of the angle features can be defined for fuzzification.

4.
σ gA , σ gB , and σ ωA , σ ωB : the standard deviation of acceleration and angular velocity of the chest and thigh, respectively. When the movement is unstable (e.g., walk or run), the sensed data may return significant variations in acceleration. Similarly, the shoulders and limbs sway when moving, creating angular velocity. Thus, these features aid in distinguishing the motion statuses of walk and run, if the body continues in a uniform motion without significant acceleration. The mean value (µ) and standard deviation (σ) of the PDF can be counted to evaluate moving levels.
x i and x i is each record of the measured data vector x that contains n records.

5.
ν gAR and ν gBR : the difference rate of relative acceleration of the chest and thigh, respectively, to the initial status. Similar to extracting the standard deviation, these features given by Equation (2) return normalized differences in the accelerations at the i-th time step with respect to the initial status. Particularly, apparent variations of the features extracted from the sensor B were studied for dynamic motion of the thigh.
where, vector V i is the parameter measured by the specified sensor at the i-th time step, and V 0 is the initial value. They both have components in the three axes. 6.
γ gA , γ gB and γ ωA , γ ωB : the gradient of acceleration and angular velocity of the chest and thigh, respectively. For either sensor A or B, each gradient component of acceleration or angular velocity on the 1-, 2-, and 3-axes at the i-th time step can be given by Equation (3).
In which ∆t is the time interval between the (i − 1)-th and i-th time steps, and g i and ω i are the mean value of measured acceleration and angular velocity at the i-th time step, respectively. If the movement is severe, then the absolute value of gradient is large with respect to the others.

Fuzzy Inference System
These features are chosen for the inference rules of a fuzzy logic algorithm to reciprocally compute measured data and evaluate their feasibility. The process as shown in Figure 4a initially classifies proper features for the fuzzy sets that may include different types of the membership functions to fuzzificate the input features in the FIS. After fuzzification, if-then-based rules that control fuzzy logic between the input and output features are defined to yield activity patterns. Consequently, output features can be inferred from the movements according to the defuzzification process, and the fuzzy computing model can be generated for activity recognition. The inference procedure is described in the following steps.
(i) Select qualified input and output features required by the algorithm. Proper features are adopted by comparing the variations of the feature values and practical activities. The various inputs can be collaborated reciprocally for a similar output. For example, {θ A , θ B , ω BRx , g BRx , σ gBx } can be combined as a set of input features for SET-1 to get the output feature of activities, such as lie, sit, stand, walk, and run. Similarly, an input feature set, such as {θ A , θ B , γ ωAx , γ gBx , σ gAx } for SET-2, could yield equivalent outputs but based on different criteria, where subscript x denotes the x-axis component in the global coordinates. (ii) Create corresponding membership functions due to the input features for fuzzification that define the participative degrees of the features in the activity. It allows various distribution criteria of membership functions in the FIS. For example, θ B can present significant low-or high-angle degrees in two PDFs of stand and sit as shown in Figure 3a. In this case, Figure 3b plots the membership functions that the trapezoidal distribution was simply applied for the FIS. (iii) Induce the fuzzy rules for activity recognition. These rules are created by the fuzzy logic of "if-then" syntax to recognize the input features and conduct the output features; for example, if (θ B = "high-angle", θ A = "low-angle" and ω BRx = "low" neglecting g BRx and σ BRx ) then the output = sit. The membership function of output features for activities, such as lie, sit, stand, walk, and run, can be quantified by using the triangle distribution, as shown in Figure 3c, for the Mamdani-type FIS. (iv) Substitute the fuzzy rules with the input and output features into the defuzzification process to produce resultant patterns of recognition. One set of fuzzy rules may yield a pattern criterion, whereas the corresponding output feature can be obtained by the given input features. (iv) Substitute the fuzzy rules with the input and output features into the defuzzification process to produce resultant patterns of recognition. One set of fuzzy rules may yield a pattern criterion, whereas the corresponding output feature can be obtained by the given input features.

Adaptive Neuro-Fuzzy Inference System
The adaptive neuro-fuzzy inference system (ANFIS) was studied in the proposed model to enhance computing on the dynamic motions that performed the quite irregular variation of data with respect to static postures as shown in Figure 2. The ANFIS typically hybridizes benefits of FIS and neural network, and includes six layers that are input, fuzzification, rule antecedence, rule strength normalization, rule consequence, and inference with defuzzification [37]. In which, with the process as shown in Figure 4b, the fuzzification layer allows the clustering algorithm to allocate input variables for an initial fuzzy set, and the antecedent layer constructs the nodes that represent the membership functions. During the training cycles, the antecedent parameters (i.e., membership functions) will be modified with the fuzzy rules in the strength normalization layer iteratively until the root mean square errors (RMSEs) of the training sets are going steady. Then, the consequent layer combines them to determine the degree of the output. Thus, the rule-related layers above implicate the hidden layer with respect to the neural network. Finally, the node of inference layer computes the crisp output with defuzzification. In this study, we thus employed the ANFIS modeling of MATLAB™, which the output feature (i.e., constant weighted average) was involved in the Sugeno-type fuzzy system to enable the training process as detailed below.
(i) Define the motion index of the output feature. In this study, we defined a range of arbitrary values for the indexes of dynamic motions; e.g., let the random numbers belong to the index range [1,2] and [3,4] (e.g., 1.65 and 3.63), and represent walk and run, respectively.

Adaptive Neuro-Fuzzy Inference System
The adaptive neuro-fuzzy inference system (ANFIS) was studied in the proposed model to enhance computing on the dynamic motions that performed the quite irregular variation of data with respect to static postures as shown in Figure 2. The ANFIS typically hybridizes benefits of FIS and neural network, and includes six layers that are input, fuzzification, rule antecedence, rule strength normalization, rule consequence, and inference with defuzzification [37]. In which, with the process as shown in Figure 4b, the fuzzification layer allows the clustering algorithm to allocate input variables for an initial fuzzy set, and the antecedent layer constructs the nodes that represent the membership functions. During the training cycles, the antecedent parameters (i.e., membership functions) will be modified with the fuzzy rules in the strength normalization layer iteratively until the root mean square errors (RMSEs) of the training sets are going steady. Then, the consequent layer combines them to determine the degree of the output. Thus, the rule-related layers above implicate the hidden layer with respect to the neural network. Finally, the node of inference layer computes the crisp output with defuzzification. In this study, we thus employed the ANFIS modeling of MATLAB™, which the output feature (i.e., constant weighted average) was involved in the Sugeno-type fuzzy system to enable the training process as detailed below.
(i) Define the motion index of the output feature. In this study, we defined a range of arbitrary values for the indexes of dynamic motions; e.g., let the random numbers belong to the index range [1,2] and [3,4] (e.g., 1.65 and 3.63), and represent walk and run, respectively.
(ii) Assign membership functions for the chosen features of input. For this case, we chose three components of σ gB as input features and assigned Gaussian-type membership function to the fuzzy set. In which, if there are m features for input and n membership functions for each feature, then the ANFIS modeling requires m n constants for output features. Therefore, we simply used 3 Gaussian membership functions for each input feature and 27 weighted-average numbers for the crisp output to create the initial FIS. (iii) Load training data set. A column of the motion indexes was added to the data set of the input feature, and we can load them with the initial FIS into the ANFIS for training. In addition, the applied toolbox supports the functionality of grid partitioning for automatically generating the fuzzy set of the initial FIS according to the loaded data. (iv) Repeat the training process till steady. The ANFIS can adapt the necessary parameters of the initial FIS in the training process and return the RMSEs of each epoch. The process needs to be repeated until the RMSEs reach a steady value. Consequently, a final FIS can be obtained for estimating the output.
With the training procedure, the ANFIS produce appropriate fuzzy logic rules of the FIS that would be able to recognize the combinative activities.

Recognition Procedure and Results
We designed serialized actions that are processed by standard postures and motions for practicing the recognition procedure with FIS and ANFIS modeling, and assigned limited rules that can be extended as criteria in UHC measurement. Each subject followed the requests to sit for 10 s, stand for 10 s, run approximately 16 m in 6 s, walk about 16 m in 10 s, and then lie for 10 s (excluding the interval of several seconds between changing each action). The testers wore the WSN sensors on specified positions to observe the sample motions. The movements remained on the same plane and were conducted in a straight line. Variations of acceleration and angular velocity of activities are diagramed in the PDF histogram, and the parameters of these features can be calibrated. According to this procedure, we initially assigned seven and three testers respectively in the sample and blind-test groups to evaluate the FIS model. Then, we recruited eight testers, who are different from the previous ones but repeated the same procedure to retrieve dynamic motions of walk and run for yielding the training data set in the ANFIS model. Consequently, three other testers walked and ran with similar speed for testing. Regarding the FIS model, the sample groups modeled the FIS rules and reached 100% recognition rate. We thus applied the model in a blind test, which the testers were asked to repeat the procedure arbitrarily but were not restricted by the specific action order. The greatest difference between two tests is that irregular (or unorderly) movements would affect the rate of successful recognition in the blind test. We adopted two representatives (i.e., SET-1 and 2) from several tests to describe the proposed recognition method. Moreover, the data training process was learned in the ANFIS model for improvement.

Membership Functions and Fuzzification
The first step of fuzzification is finding the membership function. We considered θ A and θ B to recognize the static postures lie, sit, and stand and used σ gA or σ ωB for the dynamic motions of walk and run. In this test, the static posture was sit if θ A and θ B were approximate to 0 • and 90 • , respectively. If θ A did not change significantly but θ B increased to a low angle, then the posture could be stand. In contrast, if θ A changed significantly but θ B did not, then the posture was lie. Thus, a suitable range of angles can be adjusted for different postures. For example, if θ A is less than a low angle, such as 15 • , it probably represents sit and stand; if θ B is about 15 • to 30 • , it might represent lie because the subject's thigh is not parallel to the posture in sit.
Furthermore, the features σ gA or σ ωB were observed to produce impulsive amplitudes with respect to nearby time steps during a movement period; they would help judge when the motion is changed from static to dynamic and vice versa. However, this movement status was excluded because it is not important to recognize the beginning of walk or run for the scope of this study. Therefore, σ gA determines movement status, such as static postures and dynamic motions. For example, the activity is observed to be static or dynamic when σ gA is approximately 0 g, greater than 0.1 g, or between 0 and 0.1 g. In addition, σ ωB implies a swaying condition of the thigh for walk and run. For instance, a proper range of σ ωB can be discerned to see if walk and run are less and greater than 25 • /s, respectively. As considering other feature sets, θ A and θ B can be used to recognize static postures, but (ν gAR , ν gBR ) or (γ ωA , γ gB ) can be used to aid in judging dynamic motions (e.g., walk and run). Using this concept from the previous feature set, the corresponding membership functions can also be defined for further analysis.
In the FIS, the successfully-received data of each static posture or dynamic motion would be inspected to plot the PDF histogram for determining the membership functions of the features as mentioned in previous section. For these static postures, the measured features were scattered as the Gaussian distribution typically with a significant peak (e.g., Figure 3a). We then simply applied a set of trapezoidal functions including low-, median-, or high-angle degrees, in which the angle with respect to the peak of distribution is the height of the trapezoid. Considering irregular distribution of the features for dynamic motions, the minimum and maximum values of the features are typically used as the criterion boundaries of the trapezoidal function in the study. The suggested boundary cuts of membership functions with respect to the adopted features are shown in Table 1, where the suffixes x, y, or z are the components on the corresponding axes. The membership functions can be formulated as Φ(Λ) = {[f n (x)|D n (δ 0n ,δ 1n )] n } for these features; thus, where Φ(Λ) is a membership function of feature Λ, which contains m stepwise functions f n (x) in domain D n . For the domain of the n-th distribution, the lower and upper limits are given by δ 0n and δ 1n , respectively. The symbol δ implies boundary values of the distribution functions related to the features. The neighboring distribution functions in the FIS are permitted to overlap each other. For example, the upper limit δ 11 of the first distribution of Φ(θ A ) could be greater than the lower limit δ 02 of the second one when they are overlapped, and can perhaps depict a changing action. These boundary parameters lead to different strengths of the corresponding membership functions (i.e., from 0 to 1), which yield the criteria of the fuzzy set. In this study, the stepwise trapezoidal functions were adopted to present the degrees of activity features corresponding to data distribution. For example, variations in the feature θ B contribute low-angle degrees for the sit posture with respect to high-angle degrees for stand; its membership function includes two trapezoidal functions for both angles. The low-angle function has several cuts: the boundaries δ 01 = 0 and δ 11  Successively, the membership functions of output features can be generated for the FIS when the input features have been created. We thus considered triangular distributions g n (x) given by Equation (5) to assign five membership functions of the output feature for the activities lie, sit, stand, run, or walk.
where, the boundary parameter δ can be defined as (δ 0n , δ 1n ) = (n − 1, n) for g n (x). The parameters of membership functions relative to the chosen features are shown in Table 1 to generate the fuzzy logic rules for later defuzzification.

Fuzzy Logic Rules and Defuzzification
Using the MATLAB™ toolbox, the fuzzy logic rules can be computed in the defuzzification process that employs the classical vertex method [50]. Fuzzy logic for this study thus involves several combination sets of rules, which are shown in Table 2. For example, the rule for the stand posture is as follows: if θ A is low, θ B is low, and ω BRx is low; then, the output is stand. Table 2. Fuzzy logic rules with respect to both feature sets for defuzzification.

Rule 1
Rule 2 By substituting the fuzzy set into the rules, the output can be inferred at the centroid of distributions according to the defuzzication process, and the cut value of the output movement can be obtained from the FIS model. For example, in Figure 3c, the centroids of {stand, sit, lie, walk, run} are {0.5, 1, 1.5, 2, 2.5}, respectively. With the FIS model, the arbitrary arguments of input features can be inputted to estimate participation in the output features based on the fuzzy rules, and to conduct the qualified movements. For example, as shown in Figure 5, if the arguments of the feature set {θ A , θ B , γ ωAx , γ gBx , σ gAx } from the measured data are substituted by {4.76, 86, 5.11, 0.000588, 0.0114}, respectively, then the output value is 1, which is in the range of (0.5, 1.5) of the motor membership function and is recognized as a sit action.

Results from FIS Modeling
According to the assigned activity, each tester in the sample group would deliver about 50 records from measurement excluding changing actions. After generating the FIS model, the parameters of each feature set, which represents the action at a time point, can be substituted into the model to recognize an inferential posture or motion. We thus applied the FIS in the blind test to infer the movement data of the testers (i.e., about 50 records for each one) and counted the successful rates as shown in Table 3. As results, recognition rates of the static postures versus the dynamic motions were (99%:84%) and (99%:93%) respectively for SET-1 and 2, overall. In the blind test, the testers repeated the sample motions but not restricted to the same order and the identical behavior (i.e., the irregular movements with personal habits or changing poses would probably cause unsatisfactory recognition rates). Thus, the stable and regular movements can be successfully recognized according to the designed FIS. The results would present accuracy of the developed devices and feasibility of the proposed procedure in this study. However, the personal habits of the testers could be inconsistent with regularity of the dynamic motions by the sample group and affect the accuracy of recognition. That is, if the testers follow the assigned process in the rehabilitation program, their movements can be correctly caught and traced by the robotic facility. If not, we need to improve the recognition process. We rearranged the sample group for the sample test procedure, and found that the dynamic motions required remodeling the FIS for better recognition accuracy. The improvement result is discussed in next section. For the UHC Figure 5. Substitution of fuzzy parameters for activity recognition.

Results from FIS Modeling
According to the assigned activity, each tester in the sample group would deliver about 50 records from measurement excluding changing actions. After generating the FIS model, the parameters of each feature set, which represents the action at a time point, can be substituted into the model to recognize an inferential posture or motion. We thus applied the FIS in the blind test to infer the movement data of the testers (i.e., about 50 records for each one) and counted the successful rates as shown in Table 3.
As results, recognition rates of the static postures versus the dynamic motions were (99%:84%) and (99%:93%) respectively for SET-1 and 2, overall. In the blind test, the testers repeated the sample motions but not restricted to the same order and the identical behavior (i.e., the irregular movements with personal habits or changing poses would probably cause unsatisfactory recognition rates). Thus, the stable and regular movements can be successfully recognized according to the designed FIS. The results would present accuracy of the developed devices and feasibility of the proposed procedure in this study. However, the personal habits of the testers could be inconsistent with regularity of the dynamic motions by the sample group and affect the accuracy of recognition. That is, if the testers follow the assigned process in the rehabilitation program, their movements can be correctly caught and traced by the robotic facility. If not, we need to improve the recognition process. We rearranged the sample group for the sample test procedure, and found that the dynamic motions required remodeling the FIS for better recognition accuracy. The improvement result is discussed in next section. For the UHC applications, the behaviors exclusive (or unrecognized) from the assigned activity can provide useful information to monitor incorrect motions that are out of the threshold in rehabilitation.

Improvement with ANFIS Modeling
Furthermore, we employed the ANFIS modeling to improve recognition performance for the dynamic motions that were not accurately computed in the designed FIS model. In the ANFIS, a total of about 200 records were counted for walk and run, but 187 records without change-motions were extracted from eight sample testers for the training process. Following the procedure in the previous section, the initial and trained FIS, as shown in Figure 6, were verified by a blind test.
We initially selected three components of σ gB as the input features in the range of [0, 2], and assigned three Gaussian-type membership functions with identical standard deviation 0.3397 but mean at 0, 1, and 2 for each feature, as shown in Figure 6a. In addition, we separated the output range in [1,2] and [3,4] by 26 constants that distribute 13 equal intervals of 0.0769 within each range, and allocated the 27th constant at 2.5 if not in both ranges (or, unrecognizable motion). According to this design, the crisp outputs in [1,2] and [3,4] respectively determine the motions of walk and run, and that in (2, 3)  applications, the behaviors exclusive (or unrecognized) from the assigned activity can provide useful information to monitor incorrect motions that are out of the threshold in rehabilitation.

Improvement with ANFIS Modeling
Furthermore, we employed the ANFIS modeling to improve recognition performance for the dynamic motions that were not accurately computed in the designed FIS model. In the ANFIS, a total of about 200 records were counted for walk and run, but 187 records without change-motions were extracted from eight sample testers for the training process. Following the procedure in the previous section, the initial and trained FIS, as shown in Figure 6, were verified by a blind test.
We initially selected three components of σgB as the input features in the range of [0, 2], and assigned three Gaussian-type membership functions with identical standard deviation 0.3397 but mean at 0, 1, and 2 for each feature, as shown in Figure 6a. In addition, we separated the output range in [1,2] and [3,4] by 26 constants that distribute 13 equal intervals of 0.0769 within each range, and allocated the 27th constant at 2.5 if not in both ranges (or, unrecognizable motion). According to this design, the crisp outputs in [1,2] and [3,4] respectively determine the motions of walk and run, and that in (2,3) can indicate the uncertain motions. After a 40-epoch training process, we obtained the well-trained FIS as shown in Figure 6b-d that illustrated the adapted fuzzy set for inference; where, the relevant parameters are demonstrated in Table 4      ; (2) The uncertain data mean the output in the unrecognizable range in (2,3) or out or the range; (3) The testing RMSEs excluding uncertain data; (4) Recognition rate for including (excluding) uncertain data; and (5) Correct counts/total counts. Figure 7 shows the screen snapshot that inputs a set of feature values taken from the blind test. That is, the set (0.4235, 0.3412, 0.7224) and (0.9595, 1.3726, 1.3168) returned 1.61 and 3.31 that allocate in the range of walk and run, respectively. As predicting the movement, we imported the motion data of each blind-test user into the trained FIS to check the recognition rates. As a result, the blind test for three testers performed the effective recognition as shown in Table 4. In which, there was no mis-recognition case that occurred for both walk and run (i.e., the model did not recognize walk as run, and vice versa), and the rates would reach 100% if the uncertain output (because of ambiguous inputs) were ignored. Notes: (1) The Gaussian distribution function: ; (2) The uncertain data mean the output in the unrecognizable range in (2,3) or out or the range; (3) The testing RMSEs excluding uncertain data; (4) Recognition rate for including (excluding) uncertain data; and (5) Correct counts/total counts.

Discussion and Application
In this study, the laboratory members wore the self-developed WSN sensors on their chests and thighs to measure motor data for recognition. According to the assigned activity procedure, the sample-group members obeyed the serialized movements to deliver data for the FIS with the appropriate membership functions and the fuzzy logic rules. The FIS reached a 100% recognition rate for the sample group, and then was verified in the blind test that was processed by other members. The approaches with improvement are discussed below, and the proposed fuzzy computing model is expected for application in the UHC measurement.

Discussion on Fuzzy Computing Model
Many past studies for activity recognition used various algorithms to approach the anticipative outputs with the appropriate inputs. It is empirically known that the rule-based fuzzy logic is helpful to identify regular-steady models, e.g., pattern classification and decision tree analysis [51][52][53]; and the machine-learning method provides advanced algorithms, e.g., artificial neural networks and neural-fuzzy systems to trace irregular movements [54][55][56]. For instance, an earlier study considered the x component of acceleration to compare the accuracy of popular machine learning algorithms for measuring daily activities, which include sitting, standing, walking, running, climbing stairs, etc. The accuracies of collected data from the subjects would reach more than 90% if the training and testing data were in the same day; otherwise, the performance would be even less than 50% if they were measured in different days [49]. It implies that irregular movements would impact accuracy if both training and testing data were acquired from the different activity patterns. Regarding the fuzzy algorithm, the past study employed FIS to distinguish the activities for going downstairs, jumping, going upstairs, and moving forward with accuracy between 93% and 100% [40]. In addition, another study applied FIS, and compared it with some machine learning methods for tracing human activities of daily living-such as making a phone call, hand washing, cooking, and eating-by various sensor types, and reached the classification rate of about 94% [41]. According to the results of the proposed fuzzy computing models, we learned that the procedure of Figure 7. Recognition results from the trained FIS for the motions of walk and run, which are indexed within a range of [1,2] and [3,4], respectively.

Discussion and Application
In this study, the laboratory members wore the self-developed WSN sensors on their chests and thighs to measure motor data for recognition. According to the assigned activity procedure, the sample-group members obeyed the serialized movements to deliver data for the FIS with the appropriate membership functions and the fuzzy logic rules. The FIS reached a 100% recognition rate for the sample group, and then was verified in the blind test that was processed by other members. The approaches with improvement are discussed below, and the proposed fuzzy computing model is expected for application in the UHC measurement.

Discussion on Fuzzy Computing Model
Many past studies for activity recognition used various algorithms to approach the anticipative outputs with the appropriate inputs. It is empirically known that the rule-based fuzzy logic is helpful to identify regular-steady models, e.g., pattern classification and decision tree analysis [51][52][53]; and the machine-learning method provides advanced algorithms, e.g., artificial neural networks and neural-fuzzy systems to trace irregular movements [54][55][56]. For instance, an earlier study considered the x component of acceleration to compare the accuracy of popular machine learning algorithms for measuring daily activities, which include sitting, standing, walking, running, climbing stairs, etc. The accuracies of collected data from the subjects would reach more than 90% if the training and testing data were in the same day; otherwise, the performance would be even less than 50% if they were measured in different days [49]. It implies that irregular movements would impact accuracy if both training and testing data were acquired from the different activity patterns. Regarding the fuzzy algorithm, the past study employed FIS to distinguish the activities for going downstairs, jumping, going upstairs, and moving forward with accuracy between 93% and 100% [40]. In addition, another study applied FIS, and compared it with some machine learning methods for tracing human activities of daily living-such as making a phone call, hand washing, cooking, and eating-by various sensor types, and reached the classification rate of about 94% [41]. According to the results of the proposed fuzzy computing models, we learned that the procedure of generating the FIS with proper input features was useful to recognize static postures, and the process improved by the ANFIS would be efficient for evaluating dynamic motions. Combinative feature sets can be adopted for generating the appropriate fuzzy system to compute a variety of movement data. The typical type of membership function, such as triangle or trapezoid function, was used in the Mamdani-type FIS, and the Gaussian function was employed in the ANFIS. As modeling the ANFIS, besides the input features, the recognizable activity can be denoted by index numbers in the training data set, in which the range-type index is suggested for the dynamic motion. The ranges of adaptive parameters in the Sugeno-type FIS are changed after the training process, and it probably leads out-of-range or uncertain outputs for unrecognizable testing data or ambiguous inputs such as changing actions. Effective recognition rates for the assigned movements can be approached in the blind test. Thus, the proposed FIS and ANFIS models with proper features can be further applied to assist activity recognition in physical therapy for UHC.
The prior study reviewed the designs of statistical pattern recognition, and concluded that the necessary factors for successful recognition include pattern classes, sensing environment, feature extraction, training and test samples, and performance evaluation [57]. In the practical rehabilitation design, the motor behavior typically includes asymmetry and complexity to cause measurement deviation. The earlier studies suggested the multi-sensor solution to detect activity by wearing twelve accelerometers on the body [58,59]. With a limited budget for hardware costs at the developing stage, the difficulty above would impact the measurement process. Thus, the pilot study considered combinative features to learn the potential features from the components of acceleration and angular velocity, and designed the movements with restriction to filter deviations in different axes. In other words, if the motor behavior can be the combination of several simple divided actions-e.g., separating the continuous lie-sit-stand-walk-run behavior into five unique actions-then one or two sensors were feasible to measure each action in the full activity process. Recently, a wearable sensor such as a sport bracelet is viable to decrease the hardware cost, and the solutions of multi-sensor and combinative features can both be expected in the fuzzy computing model to recognize more complicated activities at the next stage.

Application in Ubiquitous Healthcare
The proposed model can be further extended to rehabilitation management for physical therapy in UHC. We applied a simple flexion exercise that was practiced in our previous study [60] with the recognition process for the UHC measurement to approve its feasibility. The test includes two upper-limb actions: (a) flex the elbow (0 • → 135 • ), and (b) raise the arm in four steps (0 • → 45 • → 90 • → 135 • → 180 • ), as shown in Figure 8. The tester wore the sensors C and D at the wrist and the upper arm respectively, and processed each action steps every five seconds for counting the exercising times. The variations of the tilt angle features are plotted on Figure 9. generating the FIS with proper input features was useful to recognize static postures, and the process improved by the ANFIS would be efficient for evaluating dynamic motions. Combinative feature sets can be adopted for generating the appropriate fuzzy system to compute a variety of movement data. The typical type of membership function, such as triangle or trapezoid function, was used in the Mamdani-type FIS, and the Gaussian function was employed in the ANFIS. As modeling the ANFIS, besides the input features, the recognizable activity can be denoted by index numbers in the training data set, in which the range-type index is suggested for the dynamic motion. The ranges of adaptive parameters in the Sugeno-type FIS are changed after the training process, and it probably leads out-of-range or uncertain outputs for unrecognizable testing data or ambiguous inputs such as changing actions. Effective recognition rates for the assigned movements can be approached in the blind test. Thus, the proposed FIS and ANFIS models with proper features can be further applied to assist activity recognition in physical therapy for UHC. The prior study reviewed the designs of statistical pattern recognition, and concluded that the necessary factors for successful recognition include pattern classes, sensing environment, feature extraction, training and test samples, and performance evaluation [57]. In the practical rehabilitation design, the motor behavior typically includes asymmetry and complexity to cause measurement deviation. The earlier studies suggested the multi-sensor solution to detect activity by wearing twelve accelerometers on the body [58,59]. With a limited budget for hardware costs at the developing stage, the difficulty above would impact the measurement process. Thus, the pilot study considered combinative features to learn the potential features from the components of acceleration and angular velocity, and designed the movements with restriction to filter deviations in different axes. In other words, if the motor behavior can be the combination of several simple divided actions-e.g., separating the continuous lie-sit-stand-walk-run behavior into five unique actions-then one or two sensors were feasible to measure each action in the full activity process. Recently, a wearable sensor such as a sport bracelet is viable to decrease the hardware cost, and the solutions of multi-sensor and combinative features can both be expected in the fuzzy computing model to recognize more complicated activities at the next stage.

Application in Ubiquitous Healthcare
The proposed model can be further extended to rehabilitation management for physical therapy in UHC. We applied a simple flexion exercise that was practiced in our previous study [60] with the recognition process for the UHC measurement to approve its feasibility. The test includes two upper-limb actions: (a) flex the elbow (0° → 135°), and (b) raise the arm in four steps (0° → 45° → 90° → 135° → 180°), as shown in Figure 8. The tester wore the sensors C and D at the wrist and the upper arm respectively, and processed each action steps every five seconds for counting the exercising times. The variations of the tilt angle features are plotted on Figure 9.    The feature set {θC, θD}, similar to the fuzzy logic of above {θA, θB}, represented the tilt angles between two motes for various action types. The angles recognized in each step were assessed by the thresholds {40°-45°, 85°-90°, 130°-135°, 175°-180°}. Table 5 presents the eligible actions with recognized angles against necessary counts of the actions. For instance, five and four steps were requested by actions (a) and (b), respectively, but only four and two motions were counted in successful passes. That is, if the movement was not recognized at the correct position, then the tester properly did not obey the therapy in a self-management program. We thus created a web-based interface by applying the criteria of physical therapy to monitor both movements. According to the prototype, we deployed WSN motes to transport the sensed data from the user who wore the self-developed WSN sensors. The gateway then sent the filtered data to the sink log of the backend server through the Internet. The model installed in the server activated the recognition process, and the records regarding the assigned movement were written to a data log. The packet was in form of "n|time|motion_1|motion_2" that denotes serial number of motion, recording time, degree of raising wrist, and lifting arm, respectively. For example, the packet "1|2016-9-25 10:30:00|40|−1" stands for the motion #1 that counted 40° for "flex elbow" but no "raise arm" (i.e., with negative value "−1"). Figure 10 presents a screenshot of the monitoring interface according to the test data in Table 5. The activity history of the assigned movements during the selected period can be reviewed by online diagrams, and the recognized motions by the FIS can be labeled by "pass" or "fail" based on the criteria. If the motion is not recognizable in the FIS, then the "fail" status will be marked because the motion features exceed the threshold.  Table 5 presents the eligible actions with recognized angles against necessary counts of the actions. For instance, five and four steps were requested by actions (a) and (b), respectively, but only four and two motions were counted in successful passes. That is, if the movement was not recognized at the correct position, then the tester properly did not obey the therapy in a self-management program. We thus created a web-based interface by applying the criteria of physical therapy to monitor both movements. According to the prototype, we deployed WSN motes to transport the sensed data from the user who wore the self-developed WSN sensors. The gateway then sent the filtered data to the sink log of the backend server through the Internet. The model installed in the server activated the recognition process, and the records regarding the assigned movement were written to a data log. The packet was in form of "n|time|motion_1|motion_2" that denotes serial number of motion, recording time, degree of raising wrist, and lifting arm, respectively. For example, the packet "1|2016-9-25 10:30:00|40|−1" stands for the motion #1 that counted 40 • for "flex elbow" but no "raise arm" (i.e., with negative value "−1"). Figure 10 presents a screenshot of the monitoring interface according to the test data in Table 5. The activity history of the assigned movements during the selected period can be reviewed by online diagrams, and the recognized motions by the FIS can be labeled by "pass" or "fail" based on the criteria. If the motion is not recognizable in the FIS, then the "fail" status will be marked because the motion features exceed the threshold.
Finally, the proposed fuzzy computing model can be approved by the simple flexion test in physical therapy, and is feasible for measurement applications in ubiquitous healthcare. For instance, the proposed model can be progressed with manual design of a personalized FIS model and process automation of activity recognition in the practical rehabilitation exercise of UHC. In which, the user can follow a personalized exercise process in the clinic that is designed by the physical therapist to provide a sample data set for training in the ANFIS model. Then, the trained FIS can be created within the web-based UHC system for real-time checking of the exercise data that are sent from a remote site at home. The mobile apps can be further joined with the system to transport the data through web services. Finally, the proposed fuzzy computing model can be approved by the simple flexion test in physical therapy, and is feasible for measurement applications in ubiquitous healthcare. For instance, the proposed model can be progressed with manual design of a personalized FIS model and process automation of activity recognition in the practical rehabilitation exercise of UHC. In which, the user can follow a personalized exercise process in the clinic that is designed by the physical therapist to provide a sample data set for training in the ANFIS model. Then, the trained FIS can be created within the web-based UHC system for real-time checking of the exercise data that are sent from a remote site at home. The mobile apps can be further joined with the system to transport the data through web services.

Conclusions
This study proposed a convenient process to measure body activities for UHC in physical therapy by using self-developed wearable WSN sensors. When the user wears the WSN sensor in movement, six components of acceleration and angular velocity can be concurrently acquired, and the movements can be recognized by the fuzzy computing model. The Mamdani-type FIS is employed in the model to calculate the sensed data for the recognition process. The input features optionally combine tilt angles, standard deviations, difference rates, and gradients for acceleration and angular velocity to determine the membership functions. Fuzzy logic rules are then defined to control the output features that index the movements including static postures and dynamic motions. Then, use of fuzzification and defuzzification can process recognition to output the indexes of movements. Two sample feature sets were designed in the FIS model for the assigned movements, and good recognition rates for static postures were reached in the blind test. Furthermore, an ANFIS model was studied to improve recognition for the dynamic motions. A Sugeno-type FIS was initially created by using features such as three components of acceleration at thigh. After the training process, the trained FIS approached the effective recognition rate, and the model would perform a feasible process for recognizing human activity. Finally, the proposed model was approved by two upper-limb exercises in physical therapy. A prototype of web-based interface was thus created to practice activity measurement for UHC. In practice, the recognition rate can represent the passing threshold of the assigned exercises. This approach contributed a fuzzy computing model with a noninvasive and wearable facility to help measure necessary rehabilitative movements of patients in physical therapy for UHC. In the future, the wearable sensor would be replaced by new devices with a wider measurement range of the modern accelerometer and gyroscope for advanced study at the next stage.

Conclusions
This study proposed a convenient process to measure body activities for UHC in physical therapy by using self-developed wearable WSN sensors. When the user wears the WSN sensor in movement, six components of acceleration and angular velocity can be concurrently acquired, and the movements can be recognized by the fuzzy computing model. The Mamdani-type FIS is employed in the model to calculate the sensed data for the recognition process. The input features optionally combine tilt angles, standard deviations, difference rates, and gradients for acceleration and angular velocity to determine the membership functions. Fuzzy logic rules are then defined to control the output features that index the movements including static postures and dynamic motions. Then, use of fuzzification and defuzzification can process recognition to output the indexes of movements. Two sample feature sets were designed in the FIS model for the assigned movements, and good recognition rates for static postures were reached in the blind test. Furthermore, an ANFIS model was studied to improve recognition for the dynamic motions. A Sugeno-type FIS was initially created by using features such as three components of acceleration at thigh. After the training process, the trained FIS approached the effective recognition rate, and the model would perform a feasible process for recognizing human activity. Finally, the proposed model was approved by two upper-limb exercises in physical therapy. A prototype of web-based interface was thus created to practice activity measurement for UHC. In practice, the recognition rate can represent the passing threshold of the assigned exercises. This approach contributed a fuzzy computing model with a noninvasive and wearable facility to help measure necessary rehabilitative movements of patients in physical therapy for UHC. In the future, the wearable sensor would be replaced by new devices with a wider measurement range of the modern accelerometer and gyroscope for advanced study at the next stage.
proposed study; H.-C. Lin is the corresponding author who conceived of the study, and contributed in its design, development, and coordination; and drafted the manuscript.