Kalman Filter Based Elderly Fall Detection with a Triaxial Accelerometer

The consequences of a fall on an elderly person can be diminished if the accident is attended 1 by medical personnel within the first hour. Independent elderly people use to stay alone for long 2 periods of time, being in more risk if they suffer a fall. The literature offers several approaches for 3 detecting falls with embedded devices or smartphones using a triaxial accelerometer. Most of these 4 approaches were not tested with the objective population, or are not feasible to be implemented in 5 real-life conditions. In this work we propose a Kalman-filter-based fall detection methodology that 6 includes a periodicity detector to reduce the false positive rate. Moreover, this methodology requires 7 a sampling rate of only 25 Hz, it does not require large computations or memory, and it is robust 8 among devices. We tested our approach with the SisFall dataset. Then, we validated it with a new 9 round of simulated activities with young adults and an elderly person achieving 99.4 % of accuracy. 10 Finally, we gave the devices to three elderly persons during two days for full-day validations. They 11 continued with their normal life and the devices behaved as expected. 12


Introduction
At least one third of elderly people suffers a fall per year, and the probability of falling increases with age and previous falls [1][2][3][4].The consequences of a fall can be diminished if the person is attended by medical services within an hour from the accident [5][6][7].This timing is feasible with institutionalized elderly people, but healthy independent elderly people use to stay alone for long periods of time increasing their risk of aggravating the injuries in case of an accident.Nowadays, authors focus on developing automatic fall detection systems that generate an alarm in case of an event, but they still present high error rates in real-life conditions (see [7][8][9][10] for reviews on the field).In this paper, we tackle this issue with a novel fall detection methodology tested in real-life situations with the objective population, using a simple to implement triaxial-accelerometer-based embedded device.
Detecting falls with a triaxial accelerometer is commonly divided in three stages: pre-processing, feature extraction, and classification.The preprocessing can be as simple as a low-pass filter [11], but it mainly depends on the selected feature extraction.In this sense, there is a wide amount of features available in the literature, such as acceleration peaks, variance, angles, etc. (see [9,Table 4] for a complete list).These features transform the acceleration signal in order to better discriminate between falls and activities of daily living (ADL).Regarding classification, threshold based detection is still the most opted choice over machine learning alternatives, mainly because the latter ones are impractical for real-time implementation.Habib et al. [10] show various examples of SVM approaches consuming the battery in few hours; and Igual et al. [12] concluded that these approaches are highly dependent on the acquisition device used.
A common problem with approaches proposed in the literature is that most of them were tested with young adults under controlled conditions [9,  that the accuracy of these approaches is significantly diminished when tested on institutionalized [13] and independent [11] elderly people.The main reason for authors not testing with the objective population is the lack of appropriate public datasets, and the difficulty of acquiring real falls with elderly people [9,11,13].In order to tackle these issues, we recently released the SisFall dataset [11], a fall and movement dataset acquired with a triaxial accelerometer mounted on an embedded device attached to the waist (see [14] for implementation details).
In [11], we demonstrated that most failures in fall detection are focused on a few activities.Most of these activities coincide in periodic waveforms (from walk and jog) and high peak acceleration ADL (e.g., jump).There are previous approaches in the literature for detecting jog and walk with accelerometers.Cola et al. [15] detected gait deviation as a fall-risk feature.[16] used the peaks of the acceleration signal measured with a smartphone to detect steps, and subsequently the kind of activity based on the period between steps.Wundersitz et al. [17] did it with an embedded device.Other authors used more elaborated metrics but all peak based.Clements et al. [18] computed principal components of the Fast Fourier Transform (FFT), to cite an example.In contrast, we previously developed a more stable gait detector based on wavelet or auto-correlation indistinctly [19].However, it was too computationally intensive for real-life implementation in an embedded device.
In this work, we present a Kalman-filter-based fall detection algorithm that additionally detects gait as a feature to avoid false positives.The fall detection feature is a novel non-linear metric based on two widely used features: the sum vector magnitude and the standard deviation magnitude.The Kalman filter is a well-known optimal estimator [20] widely used in several research fields.The Kalman filter is Markovian (avoiding large memory storage), and linear (simple computations for lower energy consumption).Here, we use it as an input to the non-linear feature by determining the orientation of the subject: jogging activities may lead to high accelerations, but the absence of inclination implies that the subject is not falling.We additionally use the Kalman filter to smooth gait patterns (as sinusoidal-shape waveforms) in order to feed our gait detector.
The Kalman filter has been previously used to identify movements of interest with accelerometers.
Bagalà et al. [21] used it to determine the lie-to-sit-to-stand-to-walk states, which are commonly used to measure the risk of falling in elderly people (with the Berg Balance Scale -BBS-for example [22]).There, the authors used an Extended Kalman filter to determine the orientation of the device.
Otebolaku et al. [23] proposed a novel user context recognition using a smartphone.In their work, the Kalman filter was used to obtain the orientation of the device based on its multiple sensors (not only the accelerometer).But the authors did not specify how they did it.Finally, Novak et al. [24] used a multiple sensors system to determine gait initiation and termination.In their work, the Kalman filter was used again to obtain the orientation of the device.
The aforementioned works coincide in their objective with the Kalman filter (identifying locomotion activities), but they differ on the way it was implemented, and none of them was interested in detecting falls.In Yuan et al. [25], the authors used the Kalman filter to obtain the device angle for detecting falls, but using three different sensors (including gyroscope, which demands too much energy for long-term use [7]).All previously mentioned works demonstrate that the orientation of the device computed with a Kalman filter is a strong feature, and that it is useful to detect periodic activities such as walking or jogging.However, none of them combined these capabilities as we propose in this work.
This paper continues as follows: In Sections 2 and 3 we present the dataset used and explain the proposed approach.In Section 4 we present the overall results with controlled activities and falls (in simulation and implemented on an embedded device); we perform an individual activity analysis; and we show an on-line validation, where three elderly voluntaries carried an embedded device during at least two days each.Finally, we present our conclusions in Section 5.

Materials
We recently published a dataset with falls and ADL acquired with accelerometer (SisFall: Sistemic research group fall and movement dataset [11]).Here we use this dataset to train and test the proposed approach.It was generated with 38 participants divided in elderly people and young adults.Twenty three young adults performed five repetitions of 19 ADL and 15 fall types, while 14 participants over 62 years old performed 15 ADL.One additional participant of 60 years old performed both ADL and falls.The dataset was acquired with a self-developed embedded device attached to the waist [14].
The embedded device was based on a Kinets MKL25Z128VLK4 microcontroller with an ADXL345 accelerometer.The accelerometer was configured for ±16 G, 13 bits of ADC, and a sampling rate of 200 Hz.
A second device was developed for validating our methodology (Figure 1).This device consisted of the same microcontroller and sensor used for SisFall, but it included a GPRS transmitter (to send short text messages -SMS) that was activated if a fall was detected.As we did with the first device, it was fixed with a homemade belt (see the supplementary videos of [11]) to guarantee that it does not move relative to the subject.It does not require to be completely vertical neither an additional calibration once the subject wears it.Two additional validation tests were performed with this device: • Individual activities: Six young adults (subjects SA03, SA04, SA05, SA06, SA09, SA21) and one elderly person (subject SE06) performed again three trials of all activities in SisFall (except D17, getting in and out of a car, due to logistic issues).

•
On-line tests: We gave the device to three elderly participants that were not part of SisFall dataset.
They used the device permanently for at least two days, except during sleep and shower (as the device is not water-proof yet).We used three devices to guarantee the integrity of the system.
Table 1 shows their gender, age, height and weight.

Preprocessing and periodicity detector
The same 4-th order IIR low-pass Butterworth filter with a cut-off frequency of 5 Hz used in [11] was used in this work.This filter was selected because: (i) It can be implemented in simple embedded devices; (ii) It does not require large computations in software; and (iii) Increasing the order or the cut-off frequency did not improve the accuracy, i.e., it does not require higher sampling frequencies.
The filtered data is then bias removed with a simple differentiation of consecutive samples, as it is needed to compute the static feature (J 1 ).SisFall dataset was initially acquired at 200 Hz; however, the proposed methodology only requires 25 Hz to feed the filter.Then, all results presented here correspond to the proper downsampled signals.
The second feature (J 2 ) is computed over the bias level, which is obtained with a Kalman filter.A Kalman filter [20] is an optimal quadratic estimator able to recover hidden states of a state-space model.
It was used here with two purposes: to recover the bias-level variation, and to find the periodicity of the signal.Let us define the filtered acceleration data as a[k] = [a x , a y , a z ] T ∈ 3×1 for time instant k, where a x , a y , and a z are single samples of raw acceleration (in practice it comes in bits, as acquired by the ADC of the device).These data feed the following autonomous state-space model: where the first three states of x ∈ 4×1 are used for classification, and the fourth state x 4 removes peaks from periodic signals (see Figure 3, example with activity F05: jog, trip, and fall).As this Kalman filter is exclusively used for smoothing (and not for feature extraction or classification), the state transition A ∈ 4×4 and output C ∈ 4×4 matrices are identity matrices.Finally, the output is defined , where the first three terms are the low-pass filtered acceleration data in the three axis, and the fourth output is the acceleration on vertical axis minus its current bias b a y , updated together with the feature.x 4 provides a zero-bias sinusoidal-shape waveform when the acceleration comes from periodic activities (walk, jog, going-up stairs, etc.).The period of this signal can be detected counting zero-crossings (changes of sing) and dividing by two over a given time window.
This state-space model is affected by Gaussian measurement noise = N (0, R), and Gaussian state uncertainty η = N (0, Q).The objective of the Kalman filter is to minimize the variance of the states P ∈ 4×4 , considering them as random variables with a Gaussian distribution: x = N (x, P).
The Kalman filter consists of five equations divided in two stages.The prediction stage of the Kalman filter predicts the current value of the states and their variance solely based on their previous values: where The states can be initialized with zero values, and P[0] = Q, i.e., selecting uninformative priors.
However, for faster convergence x 2 [0] and b a y [0] can be initialized with −1 G (approx.-258 in bytes for the device configuration used here), which is the initial condition of the accelerometer in our device.
Q and R can be computed with a simple heuristic process: For the first three states, initialize Q and R with identity matrices and reduce their standard deviation in scales of 10 until the accuracy stops increasing.For the fourth state, reduce Q and R until x 4 shows a sinusoidal shape in periodic activities (walk and jog).The final values used in this work were: In practice, all computations in both the computer (Matlab, Mathworks) and the embedded device were performed in bits and not in gravities to reduce the computational burden.
Figure 3 (Bottom panel) shows how state x 4 tends to a zero-bias sinusoidal shape when the person walks or jogs.This allows implementing a simple zero-crossing periodicity detector.Note how the periodicity is lost when the person trips and fall.The periodicity detector analyzes three seconds after a possible fall event.If during this 3 s window the periodicity is kept stable, we may expect that it was not a fall.The size of the window is selected as the minimum to guarantee that the person is slowly walking.

Feature extraction and classification
The feature extraction consists of a non-linear feature composed of two widely used ones, the sum vector magnitude and the standard deviation magnitude.The static sum vector magnitude is computed as the root-mean-square (RMS) of the static acceleration with previous bias removal: Preprints (www.preprints.org)| NOT PEER-REVIEWED | Posted: 14 November 2017 doi:10.20944/preprints201711.0087.v1 where the bias is rejected with differentiation.
The standard deviation magnitude is computed at each time step k over a 1 s sliding window of the first three states of the Kalman filter: , where N = 25 is the size of the window (for a frequency sample of 25 Hz).This second feature is computed as follows: where std(•) is the standard deviation operator.The size of the window is selected as the one that includes the three stages of the fall: the pre-fall, the hit, and the time just after it [26].Testing with windows between 0.25 and 2 s did not improve the accuracy, as expected [11].
The same sliding window can be used to determine the current bias on the y axis: (Second panel) Feature J 1 detects the fall as a large difference between its peak and jogging peaks.(Third panel) Feature J 2 has a similar shape but with a larger percentual difference.Both J 1 and J 2 are computed in bits for reducing computations on the embedded device.(Bottom panel) J 3 is formed by J 1 and J 2 , increasing their coincidences and diminishing their differences.
Finally, the classification stage is performed over an indirect feature: With Ji [k] ∈ N×1 a sliding window with the last N values of the corresponding feature.This window is necessary as the Kalman filter takes some time to achieve the maximum, i.e., not always both metrics present a maximum at the same time.The objective of this product of features is to amplify the values of those activities where both features agree, and to minimize those where both features disagree (see Figure 4, bottom panel).The square of J 2 gives it priority over J 1 , as it is more accurate [11].
The classification consists of a single threshold over J 3 [k]  Accuracy (ACC), Sensitivity (SEN) and specificity (SPE) were used as performance metrics.SEN and SPE were calculated as specified in [27]: where TP are falls correctly classified, FN are falls that the algorithm did not detect, TN are ADL correctly classified, and FP indicates false falls.The accuracy was calculated using Eq. ( 12): This balanced computation of the accuracy is selected due to the large difference between the number of ADL and fall files.

Fall detection
We initially tested the performance of the proposed algorithm without detecting periodic activities.
Table 2 shows the validation results with SisFall dataset over a 10-fold cross-validation (451 files each).All subjects and activities available in the dataset were included in the cross validation.The low detection accuracy obtained with J 1 (around 86 %) would raise questions about its usefulness.
However, note how J 3 is significantly higher than J 2 (99.3 % vs. 96.5 %), i.e., even J 1 is not a good metric, combined with J 2 it improves the individual accuracy values.Figure 5 shows an activity-by-activity analysis for the three metrics.The horizontal red line is the threshold for the best accuracy value, and the vertical red line divides ADL and falls.By comparing J 1 (Figure 5(a)) and J 2 (Figure 5(b)), we observe that J 1 largely fails in periodic ADL (D03, D04, D06, D18, and D19) while J 2 does not, and J 2 goes closer to the threshold in activities where J 1 does not (D16 for example).This separation was the basis to create J 3 , it combines their results with a product but giving priority to J 2 (computed with square), given that it is more accurate.The small box in Figure 5(c) shows how all activities are more separated from the threshold; and importantly, less fall files crossed the threshold (false negatives).This initial result significantly improves those obtained with previous approaches tested in [11] (none of them achieved more than 96 %).

Fall detection with periodicity detector
We then performed the same analysis but including the periodicity detector.The main purpose of this detector is to take J 1 to zero if a periodic activity is observed after a possible fall (false positive) -Same result is obtained if J 2 is selected.Table 3 shows the validation results after a 10-fold cross-validation.Compared to the previous analysis, J 1 has 8 % of improvement (94.32 %).Although one would expect a similar improvement in J 3 , this is not the case (although it is higher, with 99.4 % of accuracy) given that on SisFall dataset, walk and jog only have one file per subject.Nevertheless, the periodicity detector was active in 606 files (13.5 % of the dataset).Every dataset has a limited number of repetitions per activity.SisFall for example contains only one 1 minute repetition of walk per subject.However, it is expected that a walk will last more than one minute, i.e., the possibility of failure is higher with activities that the subject performs regularly (such as walking).Additionally, Figure 6 shows how the possibility of errors in other activities is lower given their larger distance from the threshold.Figure 6 shows the same individual activity analysis of Figure 5 but with the periodicity detector in J 1 .Figure 6 shows how activities D01 to D04 were turned to zero, as the detector confirmed that the subject was walking or jogging.In this case, J 3 shows overall more distance from the threshold than the previous test (the threshold is updated accordingly).This indicates that even the cross-validation did not show a significant improvement on accuracy, the inclusion of the periodicity detector increased the robustness of the algorithm.Importantly, none fall was turned to zero in Figure 6, indicating that the periodicity detector was turned off in all periodic activities that finished in a fall. .Individual activity analysis of the proposed algorithm including the periodicity detector.The horizontal red line corresponds to the optimal threshold value, and the vertical red line separates ADL and falls.J 3 was turned to zero in all periodic ADL, this allowed it to increase the distance between most ADL and Falls.

On-line validation
In order to verify the off-line results presented in Table 3, we repeated the activities of SisFall with six young adults and an elderly person with the algorithm implemented on the device (see Section 2).
During the tests, we verified on-line if the alarm was turned on (with an indicator incorporated to the device).Additionally, all raw data and the device computations were recorded in text files.We obtained no significant differences between the device and the computer.The proposed approach was implemented on the embedded device with the same parameters and sample frequency defined above (25 Hz).The threshold for J 3 was set at 40,000.The six volunteers performed 18 types of ADL and 15 types of fall in the same way that SisFall dataset was acquired (around 100 total trials per subject).
The participants presented a total of 4 false positives and 1 false negative.Subject SE06 (the elderly person) did not show errors.All false positives were in D13 and D14 (bed related ones).Following problem (which is not reflected in the following test) demonstrated that when a person moves on the bed, it is usual to separate the hip from the mattress and let it fall in the new position.The pad used for this experiment is harder than a mattress increasing the false positive probability.The overall results coincided with the statistics expected from Table 3.

Full-day (pilot) tests
We invited three elderly participants that were not part of SisFall acquisition (in order to avoid biases) to carry the device for full days (see Section 2).We asked them to behave normally while carrying the device during at least two days, and we checked the integrity of the devices every couple of hours.They used the device permanently except during night sleep and shower.The files were cut in segments to avoid computational overloads (one hour of recording implied a text file of around 10 MB).
This is a summary of the activities that they performed and the overall behavior of the system: • SM01: She assisted to a Tae-Bo for adults class (INDER Medellín, Colombia), and stayed at home cooking, cleaning and resting.She did not present false positives.
• SM02: She stayed most of the time cooking at home, cleaning and sit on the dinning room.She usually supports her belly against the kitchen or the table, it caused some false positives (4) of the system.She went out of her home two times, unfortunately both times the device got hits and lost the SD card, loosing all data.This is worrying as after an interview we concluded that she strongly hit the device in both cases presumably against furniture.We presume that her low height together with the shape of her belly (rounded) incremented the risk of direct hits to the device.
• SM03: He did some trips to a business in the downtown and to the church.The rest of the time he stayed at home in bed or in the dinning room.He did not have false positives in any activity.His trip to the downtown included stairs, two train trips and two bus trips.This trip is presented in Figure 7, note that despite the wide amount of activities, the levels of feature J 3 were not close to the threshold (40,000).

Figure 1 .
Figure 1.Validation device.With similar characteristics of the device used in[11], this one included a GPRS module able to send text messages in case of alarm.

Figure 3 .
Figure 3. Kalman filtering.(Toppanel) Reference filtered acceleration data (Activity F05 of SisFall: jog, trip, and fall) in gravities [G].(Second panel) First three states of the Kalman filter.The filter estimates the bias-level variations of the signal.(Third panel) The forth state of the Kalman filter recovers a quasi sinusoidal signal during the first 6 s.Its objective is to dynamically remove bias to allow posterior zero crossing detection.(Bottom panel) Periodicity detector.The first 6 s the subject is jogging with a period of 10 time samples (half zero crossings); when the subject suffers a fall it stops detecting periodicity too.

Figure 4 Figure 4 .
Figure 4. Feature extraction.(Top panel) Reference raw data (The subject is running, trips and falls).(Secondpanel) Feature J 1 detects the fall as a large difference between its peak and jogging peaks.(Third panel) Feature J 2 has a similar shape but with a larger percentual difference.Both J 1 and J 2 are computed in bits for reducing computations on the embedded device.(Bottom panel) J 3 is formed by J 1 and J 2 , increasing their coincidences and diminishing their differences.
computed at each time step k.The value of the threshold is defined after a training process.The robustness of the threshold was analyzed with a cross-validation set-up.This analysis was performed guaranteeing the same proportion of falls and ADL in all groups (4510 files randomly divided in 10 groups).A 10-fold cross-validation was Preprints (www.preprints.org)| NOT PEER-REVIEWED | Posted: 14 November 2017 doi:10.20944/preprints201711.0087.v1performed, each fold had 4059 files for training and 451 for validation.Each group was used in one round as validation data.

J 3 Figure 5 .
Figure 5. Individual activity analysis of the proposed algorithm tested with SisFall.The horizontal red line corresponds to the optimal threshold value, and the vertical one separates ADL and falls.(a) J 1 has large errors on periodic activities, while (b) J 2 fails in those that change the body angle.(c) They provide to J 3 a better discriminant capability (the small box at the left shows a vertical zoom).

Figure 6
Figure 6.Individual activity analysis of the proposed algorithm including the periodicity detector.The horizontal red line corresponds to the optimal threshold value, and the vertical red line separates ADL and falls.J 3 was turned to zero in all periodic ADL, this allowed it to increase the distance between most ADL and Falls.

Figure 6 ,
Figure 6, it is clear that these activities are commonly close to the threshold.A deeper analysis of this

Figure 7 .
Figure 7. Trip to the downtown of subject SM03.(Top panel) Raw acceleration data, 2 hours and 45 minutes of recording.(Second panel) First three states of the Kalman filter.(Third panel) feature J 3 .It was always below the threshold (set at 40,000).Data recorded and processed with the embedded device of Figure 1.

Table 1 .
Gender, age, height and weight of the on-line test participants.
All activities performed by the participants were approved by the Bio-ethics Committee of the Medicine Faculty, Universidad de Antioquia UDEA (Medellín, Colombia).Additionally, all participants were evaluated by a sports specialized physician.Preprints (www.preprints.org)| NOT PEER-REVIEWED | Posted:

14 November 2017 doi:10.20944/preprints201711.0087.v1 3. Methods Figure
2 shows a schematic of the proposed approach.It includes bias variations of the signal together with acceleration peaks.This increases the robustness of the feature extraction and allows simpler classifiers.The proposed methodology consists of four stages: Preprocessing, feature extraction, classification, and periodic activity detection.For each time sample k, the raw acceleration data a[k]is initially low-pass filtered.Then, it splits into bias removal and Kalman filtering, which feed both features J 1 and J 2 respectively (see Eqs. (8) and (9) below).A threshold-based classification is performed over a non-linear indirect feature.If the resultant value crosses the threshold, the periodicity of the signal (extracted from the Kalman filter and a zero-crossing algorithm) is analyzed in order to determine if it is a false fall alert, or if indeed the alarm should be turned on.This methodology is explained in the following section.
Figure 2. Proposed methodology.It is based on a non-linear feature that allows detecting falls with a simple threshold based detector.Then, false positives are discarded if a periodic activity is detected after the fall.

Table 2 .
Test on SisFall dataset without periodicity detector.

Table 3 .
Test on SisFall dataset with periodicity detector.