System for the analysis of human balance based on accelerometers and support vector machines

Introduction: Disturbances in balance control lead to movement impairment and severe discomfort, dizziness, and vertigo. They can also lead to serious accidents, due to the loss of balance in critical conditions. It is important to monitor the level of balance in order to determine the risk of a fall and to evaluate progress during treatment. Some solutions exist, such as those based on cameras and force platforms, but they are generally restricted to indoor environments. We propose and evaluate a system, based on accelerometers and support vector machines (SVMs), that indicates the user’s postural balance variation by monitoring signals related to balance, and which can be used in indoor and outdoor environments. Methodology: The proposed system consists of a second-skin shirt, six accelerometers, a 328 ATMEGA microcontroller, and a local storage module. For the training phase, we used the accelerometer signals acquired from a single subject under monitored conditions of balance and intentional imbalance, and used the scores provided by a validated commercial solution (the SWAY ® software) for establishing the reference target values. Based on these These results suggest that the system can be used to detect variations in balance and, therefore, to indicate the risk of a fall even in outdoor environments.


Introduction
Postural stability refers to the ability to keep the human body in balance and is a fundamental condition for most human activities, especially locomotion. Poor balance usually affects performance in motor activities of daily living and is also one of the major factors in the risk of a fall [1,2,3]. Although stable control of posture and balance is automatic for people under normal conditions, it is a challenge for persons with vestibular deficiency, children with cerebral palsy, the elderly, and others who lack stability due to pathologies, deformities or injuries [4,5,6].
Trauma resulting from falls, especially in elderly people who live most of their daily life out of contact with the rest of society, are the most significant causes of fractures, injuries and deaths [5]. Falls can cost approximately 10 billion dollars annually worldwide [7,6]. Elderly residents in long-term care homes fall for a variety of reasons and are more likely to suffer injuries due to falls than those living in the community [8]. The main factors that contribute to falls are a decrease in body weight and osteoporosis [8]. The higher mortality among the elderly results from complications of injuries resulting from falls, including head trauma, pulmonary embolism, pneumonia and hip fractures [9,10].
There are also risks associated not only with falls, but also with other factors related to the loss of stability in people with a balance problem, e.g., persons with a neurological disorder, physical deformity or arthritis [11,6]. Such risks involve a reduction in the quality of life due to an excessively cautious gait, instability, excessive fear of falling, and abnormal postural responses [3,6]. These risks result in secondary characteristics, such as depressive symptoms, increased anxiety, mild extrapyramidal symptoms, and mild cognitive decline [12,11].
Balance problems can affect humans of various ages, with several pathological conditions, in different ways. In order to generate an improvement in the living conditions of these people, there has been much research in this area [13,14,15]. In view of the importance of monitoring balance signals, the development of devices for the detection and prevention of all types of falls has become a much discussed topic [16,17,6].
For the detection and prevention of falls, some biomedical engineering systems have been developed: (i) robotic prostheses that use electromyographic signals to better synchronize joint movement, such as real-time biofeedback [18]; (ii) interactive systems (virtual robots) that present periodic auditory stimuli and determine a synchronism with the patient's uncoordinated steps [19]; (iii) gait monitoring through pressure sensors built into the shoes [20,21]. Among these processes, there is also the possibility of remote monitoring systems with Wi-Fi and Bluetooth connections [22].
However, many of these rehabilitation and monitoring systems are limited to closed environments, laboratories, or clinics [1,15], with restricted mobility due to excessive wiring. Others are also limited in this way because they depend on static platforms, or because they require the help of cameras, as in the case of home monitoring systems (residential installations) [10]. There are also other dynamic but costly monitoring solutions, such as the Vicon system, used in robotic tracking, virtual reality and ergonomic studies [23,1]. A different approach using accelerometers and/or gyroscopes has also been developed [3,24,17,25,26,27,5], where changes in the acceleration and rotacional velocity are continually analyzed to determine whether the individual's body is falling or not. If an individual falls, the device can employ GPS and a wireless transmitter to determine the location and issue an alert in order to get assistance. But these projects only indicate if there was a fall and do not detect if the patient lost their balance [16].
Another solution available is the force platform. Considered the gold standard, it is a device on the floor that has force sensors. The device allows monitoring the distribution of the person's reaction forces on the platform. This gives an idea of the postural balance and allows the user to shift their weight, without taking their feet off the platform, while monitoring its center of pressure.
Although it is the gold standard, the platform has limitations, such as: the user has to move to the place where the platform is, as it is fixed; it does not monitor throughout the day; it cannot monitor walks; it is unable to detect changes in balance throughout the day, thus making it infeasible to be use, for example, to study a person's balance over the course of the day and what possible situations are leading to a loss of balance.
There are also mobile approaches to try to monitor balance, such as the SWAY application, which allows determining levels of balance, but it requires the person to place a cellular device in the sternum bone and perform specific tests. It also does not allow continual monitoring.
In view of these limitations, the present paper proposes a system that allows continually measuring signals related to the balance. The system is installed on a shirt where accelerometer type sensors are installed, since the accelerometer-based approach makes it easier to quantify postural impairments compared to the conventional protocol with force plates, which are more expensive and not portable [27]. Accelerometers are particularly promising as they can be easily used in clinics [3], and a person can wear the system's shirt during their daily activities, thus providing the signals related to the user's balance over the course of the day. From these signals, a classification of levels of balance is implemented. That is, there will be direct information from the sensors as well as the balance levels that are generated, and this continually generates information about postural balance throughout the course of the day. The system has been validated by comparing the data obtained with the results from a force platform, and also with the SWAY application. It has proved to be possible to monitor the balance levels through the use of the proposed system.

Methods
We present the development and evaluation of a system for acquiring signals related to human postural balance and for automatically classifying these signals into different levels of balance over time.
The system includes a second-skin shirt equipped with accelerometers, multiplexers, a real time clock (RTC) module, and an SD card recorder. An Arduino microcontrolled board controls each module, processing and storing the acquired signals. Figure 1 shows a diagram of the complete system. First note that the system acquires the data from the accelerometers and, through classifiers, is able to define levels of balance (including states of imbalance). For training and validating the classifier, we used the SWAY software, already validated in the literature, which returns scores corresponding to the levels of balance. A dummy and a John Doe doll were also used to simulate sudden falls and recovery of balance, for the evaluation of disturbed static balance.
Also note in Fig. 1 that the classification of signals into balance levels is based on support vector machines (SVMs), which must be trained before use. For training, we used a supervised strategy, in which several example signals corresponding to known class labels are presented to the classifier, as illustrated in Fig. 1(b). This allows us to determine the support vectors based on a numerical optimization procedure, and by using the support vectors we can later apply the system to new, unlabeled signals in order to determine the corresponding balance levels. This classification of unkown signals represents the system in its normal operation mode (as opposed to the training stage), as shown in Fig. 1(c).

Implementation of the prototype Hardware
The prototype was simulated by the Proteus ® software in its ISIS environment. In the next step, tests were done on a protoboard of the already simulated circuit. In the initial tests, we verified the acquisitions of the accelerometers that were connected to the multiplexers, as well as their Arduino programming code. Connections were made to the six accelerometers with three 4051 multiplexers, one for each axis of displacement. All six X -axes were connected to the inputs of one multiplexer. The same logic was implemented for the Y -and Z -axes. The outputs of the multiplexers were connected to the analog pins of one Arduino Uno. Once the data digitalized by the microcontroller was verified, the SD card module and the clock and calendar module were included in the following steps and their schedules attached to the initial programming code.
The prototype made with the simulated circuit was tested and implemented on the back of a second-skin type shirt. The shirt fits and molds to the user's body without limiting its movement. It also keeps the sensors in the same place during the experiments. The use of this shirt makes it more practical and ergonomic than other alternatives, such as elastics or velcros, which tend to cause discomfort to the user.
The six plates, containing the ADXL335 accelerometer, were arranged according to Figure 2: the center pocket corresponds to the location of the acquisition circuit (SD, RTC and Arduino Uno modules), and a small pocket holds the battery. The accelerometers were distributed near the border between the cervical and thoracic spine, on top of each scapula, near the border between the thoracic and lumbar spine and at each junction of the lower posterior iliac spine. These points were selected because they are the places where there are greater perceptions by the accelerometers of the variation of inclinations of the body.

Software
The code implemented in the Arduino Uno controls the acquisition and variation of the accelerometers and the recording on the SD card. In the main code there was implemented an operating mode that writes to the SD card.
Real time acquisition In this step the acquisition and validation of the acquired signals were made using the software developed in MatLab. The code was implemented to read the serial port (USB), plotting in real time. This way, it is possible to clearly perceive the changes in angle read by the accelerometer. For the transmission of the X and Y signals from the accelerometers, it was empirically realized that there was no delay in the reading when the sensors underwent sudden movements. Using this data, a classifier was trained to predict the static and dynamic body balance.
Classifier training algorithm for static case In order to obtain data with which to start the training process, a routine was developed for data acquisition. The routine consists of setting up the prototype shirt to acquire the training data and using the SWAY application to get the scores used as reference. For the SWAY procedure, the user first presses the mobile device against the sternum bone and, when a sound signal is received, is asked to move in a predetermined direction as far as can be reached, while also trying to stay balanced. After the second signal is received, the user returns to the initial position.
Using this routine, 30 acquisitions were performed for each of the 5 different modes: front, back, left, right and stopped. All data aquired from the prototype shirt along with the corresponding scores from the application were stored for later processing.
In order to process all the data acquired, a program was developed in MatLab. The first step was to analyse the data, which was done by plotting 18 graphs corresponding to the three axes of the six accelerometers for all 150 routines. Then, the data was segmented in order to separate the portion of the signal that corresponds to the moment of greatest instability (for the inclined cases: front, back, left and right) or greatest stability (for the erect case). This process discards the moments in which the SD card is inserted and removed from the module (where there can be observed a great trembling of the signal), as well as the moments of displacement from the initial position to the position of instability and of displacement from the position of instability to the initial position. In this way, it can be observed that the signal is no longer in a larger band and is concentrated in a narrower band, corresponding better to the moments of instability or stability, depending on the routine performed.
The study group, after attempting to determine how many seconds were needed to tell whether or not a person was balanced, determined that approximately two seconds would be sufficient to do this. Thus, it was determined that the classifier shoud also have two seconds to predict the balancing state, that is, the classification is performed in a signal of two seconds of duration, separated by applying a window to the full signal. The group also determined that the displacements between consecutive windows would be one second, thus avoiding the loss of any part of the information. Also a window of the Hamming type was selected, since, besides presenting good spectral behavior, it avoids the appearance of spurious peaks.
We also added to the information vectors the frequencies of the signal variation and the RMS values corresponding to each defined window. Now the classifier can verify if there is a large frequency variation or if some sensor value is higher than the others and thus infer whether the user is unbalanced or not.
After this stage, we started the training phase of the classifier and performance evaluation of the trained system. For training we presented windows of the signals with known balance levels (from the SWAY outputs), and this information was used to adjust the parameters of the SVM. In particular, the parameters called the receiver operation characteristics (ROC) [28,29] were determined. To evaluate the performance, the hit and error rates were calculated after training.
It should be noted that the performance may vary according to the selected training examples. Thus, a common procedure in the study of classifiers is to randomly vary the training set and to evaluate the performance for each tested combination [30]. During this evaluation, the trained system is applied both to the signals used for training and to the signals reserved exclusively for validation. In this research, 60% and 80% were used for training. The performance of each combination, in terms of the histograms of the error rates, was then recorded and the best performance, which reflects the best hit rates achieved in all training, is also highlighted. The dependence of the performance on the training examples is due to the fact that some sample sets may better reflect the variability of the input signals and thus allow for better generalization. Therefore, the evaluation of different combinations of examples may show the average performance and its variability, so care has been taken to increase the number of combinations of examples until the average performance converged.
Four experiments were performed to observe the behavior of the system in relation to the levels of balance (including states of imbalance), with 1000 operations each: randomly chosen percentages of 80/20 were used for the training and validation of the SVM with a RBF type kernel. The difference in the experiments were the number of levels of balance and levels considered unbalanced. Thus, we set: Experiment 1 has two levels of balance and one which is unbalanced; Experiment 2 has three levels of balance of which one is unbalanced; Experiment 3 has five levels of balance of which one is a state of imbalance; Experiment 4 has seven levels of balance of which two are unbalanced. The program, in the end, returns histograms containing the error percentages found in each experiment for the training case and for the test case.

Validation experiments Disturbed static case experiments
Procedures were performed with an inert mannikin (sudden drop) and with a John Doe doll (attempt to recover one's balance). The procedures follow a simple routine (Table 1), where every five seconds, the dummy is pushed, held and returned to its initial position (in the case of the mannikin), or there is a wait for it to return to its initial state of rest (in the case of John Doe), then pushing it back again. Thirty repetitions were executed for each of the four main directions (front, back, left and right) with the two dolls. At this point, using the same principle as in the previous software, the classifier can identify when the user is in the process of recovering balance or is falling.
We conducted another set of training and validation sessions for this new experiment. In this case, we acquired 30 signals for each of the directions (front, back, right, left), meaning that we pushed both the mannikin and the doll in these directions and collected the signals until fall (in the case of the mannikin) or recovery of balance (in the case of the John Doe doll). Note that the time in a fall is much smaller than in a recovery of balance. This is a problem for the SVM since it expects always the same number of inputs. To adress this problem, a few different strategies were tested: (i) we padded the smaller length signals with zeros (right zero-padding); (ii) we extended the smaller lenght signals with the latest sensor data (final sample extension); (iii) we considered as inputs the smallest interval only (thus removing the time intervals exceeding the fastest fall); (iv) we considered as inputs a fraction of the lowest interval. In terms of accuracy, specificity, sensitivity, and precision, strategies (ii) and (iii) provided the best results, suggesting that it is possible to decide between a fall and a recovery of balance by looking only at the beginning of the response to the perturbation (strategy iii, as if the way the body responds in the beginning is the determining condition), or by extending the last samples (strategy ii, as if the final samples only reaffirm the equilibrium condition). On the other hand, completing with zeros seems to represent a different range value that damages the classifier's performance, whereas using even smaller time segments, when compared to (iii), only reduces the amount of useful information provided to the classifier.
We performed 1000 training/validation sessions, using in each case 80% of the available data for training and the remaining data for validation. Therefore, the validation always considered data that was not used during the training stage. In each training/validation session, we used the RBF kernel, and two types of inputs: (i) the matrix of signals collected by our sensors installed on the John Doe doll, representing the condition of perturbation followed by balance recovery; (ii) the matrix of signals collected by our sensors installed on the mannikin, representing the condition of perturbation followed by fall. In both cases, the perturbation corresponds to the doll or mannikin being pushed, each time in one of four possible directions (front, back, right, left).

Comparison with the AMTI force platform
The procedures of the next experimental phase had the objective of evaluating if it is possible to use the accelerometer signals from the proposed system to evaluate the COP, as they would be provided by a force platform. For this purpose, signals from the proposed system and the AMTI force platform were collected simultaneously while the volunteer performed a sequence of predetermined movements. The routine of this procedure was as follows: the user climbs on the platform at the same time as the prototype shirt system starts to record, and, every seven seconds, the user changes their position in the following order: stopped, front, right, left, back (Table 2). The research group chose to change the position every seven seconds since it was estimated there should be two seconds for the position to change and approximately five seconds stopped in each position. The user always tries to maintain the maximum stability in each position, without losing balance. The total acquisition time under this condition was 196 seconds. Since the participant maintained each position for seven seconds at a time, this allowed us to collect five complete cycles of measurements (for a total of 175 seconds, considering all five positions), plus an additional cycle in the sustained position, an additional cycle in the front position, and an additional cycle in the right position.
In this experiment, since the data were written in the following sequence: stopped, front, right, left and back, it was also necessary to segment the data as in the previous experiments, both for the accelerometers and for the AMTI platform data.
To make the comparison, only the stable regions of the data (segmented parts) were used. But because there was no synchronization between the AMTI platform and the prototype shirt, it was not possible to know exactly which samples of the accelerometer signal correspond to which samples of the platform signal. Therefore, the signal was segmented to separate the corresponding regions where the user is more stable. Subsequently, the accelerometer signals and the platform signals were averaged.
In order to match the accelerometer and platform signals, polynomial and ensemble interpolations were made in the accelerometer's data, for all the acquisition sessions. At this stage, tests were made varying the percentage of data used for training from 55% to 95%, using steps of 5%, the remaining being used only for validation.
Another approach evaluated was the definition of different classes associated with the regions of stable pressure exerted by the participant on the platform. Thus, one class was assigned for vertical positioning, and one each for forward, right, left and back. For each of these five classes, the centroids of the COPs evaluated by the platform were calculated at each step of each acquisition session. Then, the classifier was trained to associate the measured accelerometer signals with the evaluated centroids. Again, different proportions for training data were tested and the remaining ones were used for validation.
The purpose is to evaluate the performance of the system when mapping accelerometer signals to signals of COP. To this end, we calculated the errors between the centroids defined by the classifier and the COP provided by the platform. The observed errors were subjected to a statistical test to determine, with a level of confidence, the error band associated with the estimation of COP using the proposed system.

Method of analysis
Statistical tests were performed for the static case, the perturbed static case, and the AMTI force platform experiments. Having in hand the acuracies, precisions, sensitivities and specificities of the experiments of the static case and the disturbed static case, we analyzed the question of the normality of the distribution of each parameter, using the Shapiro-Wilk and Kolmogorov-Smirnov tests for large samples and Lilliefors for small samples. We consider that a p value less than 5% indicates that the distribution of the parameter is not normal and a p value greater than 20% indicates that the distribution is normal. If the three tests have discrepant values, nonparametric tests must be used to determine the reliability of each parameter. If the distribution of the parameter is normal, Student's t-test was used, but if the distribution is not normal, the Wilcoxon test was used. The same reasoning was employed for the force platform tests, where the parameter analyzed was the difference between the data provided by the shirt and that provided by the platform.

Results and discussion
Static case After training the system, which uses the information obtained from the prototype shirt and SWAY application scores, the program returned the results of the best trained systems for each of the conditions of the experiments presented. The data is in Table 3, indicating the percentage of error in each experiment for training and validation.
According to the data contained in the table, it can be seen that the more balance levels are used for the training, the greater the probability of error and the lower the accuracy, precision, sensitivity and specificity. This is due to the fact that there is not enough data for the parameters in question. Thus, if there were more data available for training, it could possibly return better trained systems with better reliability parameters.
There is the case where the error percentage of Test 3 was greater than that of Test 4 and, therefore, the sensitivity and precision of Test 3 were also smaller than Test 4. This is due to the fact that the randomly chosen samples for the best Test 4 were samples with more information for the training than the randomly chosen samples for the best Test 3.
Through the obtained results, it can be seen that in Experiment 1 the greatest amount of errors for training was around 3.6%; in Experiment 2, around 5.9%; in Experiment 3, around 8.7%; and in Experiment 4, around 8.8%. Now, noting the number of errors for validation, the majority in Experiment 1 was around 5%; in Experiment 2, around 7.7%; in Experiment 3, around 12.5%; and in Experiment 4, around 11.8%. As expected, the error percentage for the validation of the trained systems is slightly higher than the error percentage for the training. However, a signal type not represented in the training set might appear in the validation set, causing errors.
The results emphasize that the more balance levels are considered for training, the greater the chance of error for both training and validation. An observation to be made is that the error percentage for validation in Experiment 4 was lower than in Experiment 3. Although more levels of balance were used in Experiment 4, there was also one more level of imbalance than in Experiment 3. It is likely that the use of one more level of imbalance would have improved the performance of the trained system when compared to Experiment 3, which had fewer levels. In order to verify this statement, new experiments with five and seven levels of balance were made, considering one and two of them to be unbalanced.
After the test, the error percentage for the validation of the trained systems continued a little greater than the error percentage for training. It was expected that, after increasing the number of balance levels, the error percentage would increase as well and, when analyzing the case where only the number of balance levels from five to seven was increased, it is noticed that the number of error occurrences is higher and the percentage of error was slightly lower for the training, which still confirms that increasing the number of balance levels increases the error. Under this condition, five levels were still used, but there was the difference that one more level was considered unbalanced (three balanced and two unbalanced). It can be seen that although the number of error occurrences was slightly lower, the error percentage for the training increased by about 1%, which also increased the overall error.
Comparing the cases where the seven levels were maintained, but there was the difference that one more level was considered unbalanced (five balanced and two unbalanced), we note that the number of error occurrences decreased and the percentage of error for training remained approximately the same. In the case where the number of balance levels was changed from five to seven, but maintaing two of them as unbalanced, the number of error occurrences decreased and the error percentage as well.
According to the obtained results, it can be concluded that increasing the number of levels of balance, or increasing the number of levels considered as unbalanced, increases the general error. However, for the data provided for the system, using two unbalanced levels out of seven levels in all, a better trained system was generated than the system of five levels, of which on was unbalanced. Hence, it can be stated that the data provided for the system considering seven levels, including one level of imbalance, generates a better trained system than considering five levels with one of them unbalanced.
The three normality tests indicated that none of the parameters followed a normal distribution, and so to determine the confidence interval, the Wilcoxon test was used. Table 4 shows the lower bounds for the evaluated performance metrics, for each experiment and considering a 95% confidence interval.
As already confirmed, the more levels, the worse the results, due to the lack of information to better train the classifier. Also, as previously reported, Experiment 4 had better results than Experiment 3, which indicates that although the case of seven levels with two of them considered unbalanced, the system, with this information, proved to be more well-trained than the case of five levels with one of them considered unbalanced.

Disturbed static case
The program returned, as results of the best trained systems, the data of Table 5 and the results containing the percentages of errors and their respective error occurrences for the training and validation for Test 1 (matrix completed with the last observed values) and for Test 2 (matrix with the duration times equal to the time of the signal that stabilizes the fastest). Among the 1000 operations, the program managed to train two systems in both tests with 100% accuracy, precision, sensitivity and specificity. These systems showed a high degree of reliability.
In Test 1, when using the matrix completed with the last observed values, the system basically evaluates the end of the signal, so it only compares the difference in the user's positions and whether or not the user is vertical. Also, the most challenging issue would be to detect the moment before the user's fall [31]. As can be observed, the training was perfect, because in the 1000 operations the error was 0%. In the validation tests, it can be seen that most of the operations presented very low percentages of error, less than 2%, which indicates a reliable system with a low error.
In Test 2, using the matrix with duration equal to the time of the signal that stabilizes the fastest, the system evaluates what would be closer to reality, that is, it evaluates whether the person is in the process of losing their balance or falling, before getting to the floor. There are very low error percentages for training, less than 1% for all 1000 operations, and most of the validation operations had a percentage error of less than 4%, which also gives a reliable and low error system, but not as good as the system that was trained perfectly with a trivial operation, as was the case with Test 1.
In order to shorten the duration of the signal, so that the system identifies as soon as possible a lack of balance or a fall, a study was made to know how many characteristics should be adopted in order to have a low error percentage. It was concluded that with five columns of information the program already manages to train systems with a very low error percentage, and the use of more information does not add much value to improve this percentage. Thus, less information is used because there is a redundancy in the signals from different accelerometers, due to the rigidity of the doll. But this information could be important in more complex processes, such as the human torso. In addition, redundancy could be useful because of a potential loss of signals from some plates.
The parameters of this case, for the three normality tests, also did not approach a normal distribution. To analyze the confidence interval, the Wilcoxon test was also used, generating the following results: For Test 1 (use of extended matrix), with 95.8% confidence that the accuracies are equal to or above 97%, and with 95.8% confidence that the sensitivities are equal to or above 95%. Precision and specificity gave 100% confidence for all 1000 operations, so it was not necessary to perform a statistical analysis for these parameters.
For Test 2 (use of segmented matrix), with 95.7% confidence the accuracies are equal to or above 95%, and with 97.4% confidence the precisions are equal to or above 95%, 95.5% confidence the sensitivities are equal to or above 95% and 95.5% confidence the specificities are equal to or above 95%.
Comparison with the AMTI platform Comparing the proposed system and the force platform within each group, both in polynomial interpolation and ensemble, a very small error was noticed. But, when joining more than one group of information, the errors increased, indicating the classifier was overfitting. From this information, the issue arose that, with each climb onto the force platform, the COP moved, in addition to the direction in which the experiments were carried out.
Therefore, within each group, the interpolations gave coherent results, due to the overfitting, but when joining the groups, the information was not consistent. A possible suggestion for future work would be to acquire more data for training and, later, do a finer interpolation.
In the latter approach, after separating the force platform data, from the stable pressure regions, into classes, the centroid for each of these classes was calculated with information from all groups of acquisitions. Then, the classifier was trained with different proportions of data (90% for training and 10% for validation) and the predicted output was compared to the centroids provided by the platform.
The data of the accelerometers of each class was very close to the centroids of the respective class provided by the platform, both in training and validation, which suggests that the system allows calculating an approximate value of the positions of the COP from the data of the accelerometers (Figure 4). For a more detailed analysis, the error between the centroids of the COPs measured by the proposed system and the positions of the COPs given by the platform was also calculated.
When observing the training, it can be seen that the classifier was able to identify all the classes for all the samples used for training. During validation, most classes were also identified correctly. There were a few cases where the classifier was not able to identify which class pertained to some samples. Therefore, for these cases, a maximum error is attributed, which is the largest distance between the centroids and the origin. The idea is: if the system does not identify a class, the zero point is conventionalized as the exit centroid; thus the largest distance that can be contained is the greatest distance between the centroids and the origin of the coordinate system. A thousand sessions of training and validation were done. In each session, the errors between the centroids estimated by the proposed system and the force platform were calculated. Based on the errors of each session, a statistical analysis was performed to evaluate the confidence in rejecting the null hypothesis that the mean error between the proposed system estimate and the force platform is greater than 0.9 cm. Finally, the mean is calculated for the p values obtained in the 1000 sessions. Table 6 shows the p values obtained when the error was evaluated for inputs used in training and for validation inputs.
The results suggest that the system can estimate the COPs with an average error of less than 0.9 cm, using only accelerometer signals. Note that this estimate is based on classes corresponding to regions in the two-dimensional space defined by the COPs. The subdivision of these regions using more classes may potentially increase the accuracy with which the COP is estimated. However, this would probably require more examples of training, so that there would be enough points in each class. A proposal for future work is, for example, to repeat this experiment with ten times more points and subdivide the classes into smaller regions.

Conclusion
In this research, we evaluated a system for estimating both the level of balance and the class of pressure center, based on accelerometers positioned on the participant's torso, using a second-skin type shirt. In evaluating the system's performance, we compared the estimated levels of balance with those provided by a commercially available mobile solution, and with the pressure center class acquired from a static force platform.
The experimental results show that the proposed system achieves an average accuracy between 96.6% and 98.9% when evaluating the balance level into two to seven classes (of which one or two are states of imbalance, depending on the case), and an error significantly lower than 0.9 cm when evaluating the center of pressure (p = 0.0042). These results suggest that the chosen characteristics extracted from the accelerometer signals provide the needed information for both the classification of the degree of balance and the center of pressure. They also suggest that this approach is viable for an outdoor evaluation of balance, as the equipment does not rely on heavy static devices and the processing is performed locally. In comparison with the mobile solution used as a reference, our solution does not require participants to hold a device in a special position, thus altering their normal behavior, and can be used while performing other activities.
Since the classified data is available as the output of a microcontroller that can be easily connected to other devices, we would like, as a future work, to evaluate the use of the proposed equipment as a monitor for balance loss during daily activities, by connecting it to a speaker for generating an alarm and to a communication device to alert relatives in the case of a fall. Another possible investigation would involve the evaluation of the level of balance during physical exercises, specially if one combines the device with an electromyography system, in order to correlate the level of balance with physiological parameters such as muscle fatigue.
List of abbreviations COP -Center of pressure ROC -Receiver Operation Characteristics RTC -Real time clock SVM -Support Vector Machines Figure 1 Schematic describing the complete balance system. Note that there are two operation stages: the training stage, when we use kwnon data associated to different balance levels to tune the system, and the operation stage, when the system is used under real conditions to properly classify the current balance level.
[width=80mm]shirt Figure 2 Disposition of the balance sensors over the developed shirt.
[width=120mm]Hardware Figure 3 Block diagram describing the whole system for balance and pressure center measurement based on accelerometers.
[width=120mm]trainamti Figure 4 Pressure centers estimated in the training phase by the platform (blue markers) and centroids generated by the proposed system (red crosses). Tables   Table 1 Sketch Table 6 Reliability results for training and validation of the COP estimates using the proposed system, with reference to the force platform.
Test p value for null hypothesis Distance (cm) Training 0.0030 0.9 Validation 0.0042 0.9