Smartphone Based Fall Detection and Logic Testing Application Using Android SDK

Smart systems aimed at detecting the fall of a person have increased significantly due to recent technological advances and availability of modular electronics. This work presents the use of embedded accelerometer and gyroscope in mobile phones to accurately detect and classify the type of fall a person is experiencing before suffering an impact. Early classification of fall type helps in optimizing the algorithm of the fall detection. User acceptance, feasibility and the limitations in the accuracy of the existing devices have also been considered in this study. High efficiency and low power approaches were emphasized with wireless capability that enhanced the system performance for variety of applications. There is a need of reducing the time for analyzing the smart algorithms designed. It is also emphasized that this application will be a good platform that can be used to test various algorithms and multiple sensors at a time with ease and obtain data analysis in a short period.


Introduction
Smartphones have become part of our day to day life which comprises of highly sophisticated sensors with high processing speeds.Since the introduction of application stores provided by technology giants like google and apple has led to the revolution of the software and application distribution to the end users.A typical smartphone consists of an accelerometer, gyroscope, global positioning system (GPS) and a camera.Availability of rich set of embedded devices without any additional hardware costs and additional hardware is attracting researchers to develop smart and high accuracy devices using the smartphones.
General falls occur from the resting posture like slipping from bed, or fall from a sitting.Fall event may also occur while running or walking, or fall from supports such as ladders, tables etc.Among these different falls, each may have different fall characteristics and different threshold parameters in order to pre detect the falling event.
First Smart phone based fall detection device was introduced in 2009 by Sposaro et al. [1] by considering the impact and the difference in position before and after the fall.Later in 2010, a new system was developed using three positions at chest, waist, thigh, considering the wearers orientation and common step mechanics during the fall events [2].This system was tested for different types of falls at various speeds.Fall detection applications were further optimized to send the fall report and location via messages and mail them to the care takers by Lopes et al. [3].In 2012 a system was developed using MLMs using a large time series feature set from the acceleration signal [4].But the system was designed with highly complex algorithms and near acceptable efficiency.Considering the impact developed later, applications may be suited for threshold based fall detection systems.
In most of the studies researchers used low complexity algorithms for the detections based on the impact thresholds of the accelerometer.Only a few researchers used multiple sensor and branching algorithms but they are proved to be less efficient, not smarter than required.One of the real issues with the current fall discovery gadgets is that they detect the fall after fall has happened.They are having restrictions as far as force, range of operation if there should arise an occurrence of gadgets having a base processor.Sometimes individuals disregard the fall detection gadgets as they are extra loads.Furthermore the available fall detection systems are expensive.Since mobile phones are of highly carrying gadgets in the present days, and according to Pew Internet Project's research 58% of Americans have a smartphone currently, utilization of smartphone in age groups higher than 65+ will increase in future.
Keen applications were consistently created now-a-days identified with the wellbeing and fitness, and safety.Developing a fall detection device using the embedded sensors in the mobile phones reduces the risk of damage due to falling events.

Overview of Fall Detection Systems
Table 1 compares the various modes of fall detection systems, showing, the classifications and disadvantages.These are useful for the system design.

Objectives and Methodologies
Fall detection and fall anticipation frameworks have the same fundamental structural engineering as shown in Figure 1.Both frameworks take after three regular periods of operation: sense, investigation, and alerts/correspondence.The fundamental contrast between the two frameworks lies in their investigation stage with contrasts in their gimmick extraction and order calculations.Fall recognition frameworks attempt to discover the event of fall occasions precisely by concentrating the peculiarities from the gained yield signal (s)/information of the sensor (s) and afterward distinguishing fall occasions from different exercises of everyday living (ADL).Then again, fall avoidance frameworks endeavor to anticipate fall occasions ahead of schedule by breaking down the yields of the sensors.Information/signal obtaining, peculiarity extraction and characterization, and correspondence for warning are the fundamental steps required for both fall recognition and anticipation frameworks.The number and kind of sensors and warning systems nonetheless, differ from framework to framework.In customary frameworks, discrete fittings segments are utilized for the usage of every unit, though in SP-based frameworks, all obliged units might as of now be in-assembled inside a condition state-of art SP.

Sensing
This is the first period of any fall recognition and avoidance framework and in this stage, proper physical amounts are sensed or measured utilizing suitable sensors.Present day cellphone accompanies implicit sensors and that is one of the basic explanations behind picking cell phines as an option of ordinary fall detection and safety systems.

Processing/Analysis
In the wake of measuring the physical amounts by utilizing sensor signals/information ought to be processed and  analyzed for decision on fall.In this stage, the noteworthy peculiarities are concentrated from the sensor's yields and preparatory choices are made by classifying and processing those concentrated gimmicks.Most SP-based arrangements, particularly answers for fall recognition, utilize a Threshold-Based Algorithm (TBA).The most basic explanation behind picking TBA's is that these calculations are less intricate and subsequently require less computational power and resources [5], which serves to lower battery power utilization [6].Edge (Threshold) based calculations may utilize more than one limit [7] and limit value (s) could be predefined (settled) or versatile.It ought to be noted that the versatile edge qualities are not figured alterably while utilizing the framework.Rather, clients present some physiological information and the framework acquires the comparing limit that is not re-figured amid the framework operation.The calculation proposed in [8] utilizes a versatile edge which changes with client gave parameters, for example, stature, weight and level of action.

Alerts/Protection Systems
In the wake of asking for a reaction from the client, the framework holds up for a predefined period (regularly ≤ 1 min).On the off chance that the client does not react inside that time, the framework will consider the occasion as a fall.Fall recognition frameworks may neglect to discover a genuine fall occasion consequently.In such cases, a few frameworks provide help (or frenzy) catches, buttons and hence permit clients to look for help physically [9].
Cell phone based frameworks produce a few sorts of notifications to look for assistance from caretakers or for cautioning the clients about an unavoidable fall, for example SMS, automated voice calls, MMS, vibration, Short Message Service (SMS), Multimedia Messaging Service (MMS), and even programmed voice calls [10].Messages and Twitter informing have additionally been portrayed [11].Warning messages may contain data on time, Global Positioning System (GPS) area (coordinates) [12], and area map [13].
This section describes the hardware and the software specification utilized for the detection.A multi branch algorithm is discussed for classification of fall type and fall detection.

System Overview
For the design of the system we have used a BOSCHBMA250 3-axis Accelerometer embedded in HTC one smartphone.Application was designed using Eclipse with Android SDK software using android programming (java environment).Since the falling speeds and fall types vary depending on the age, physical structure and falling environment.The system is designed for various sensitivities and thresholds that can be adjusted accordingly.

Algorithm Design
The algorithm is designed to detect falls based on the impact thresholds and considering the absolute thresholds.The algorithm is described in the flowchart given in Figure 2. Initially the acceleration on the mobile will be 9.8 m/sec2 in the downward direction depending on the orientation of the mobile due to the earth's gravitational force.Signal magnitude for the acceleration vector is calculated based using the phythogarus relation.The device 3D model followed in the design is given in Figure 3.
For the fall location this essential calculation just uses the module ( ) th A of the aggregate acceleration of the phone.This module can be processed as: where A x , A y and A z are the quickening readings in headings of x, y, and z-axis measured by the accelerometer that is installed in the cell phone.
A fall is specifically expected if the measured module of the increasing speed surpasses a choice threshold.Consequently, the location choice just considers abrupt crests in the quickening, ignoring the examination of the complex conduct of the increasing speed vector at whatever point a fall happens.As a result, this calculation is inclined to the recognition of false positives.
If the magnitude of acceleration reaches the threshold it saves the orientation of the person and time to a temporary varibles.The temporary variable was compared after 400 milliseconds for further confirmation of fall occurrence.
Perfalld calculation all the while considers the estimations of the modules of the aggregate increasing speed A Vaba of the device and the speeding up at unquestionably the vertical absolute acceleration (A Vaba ), which can be assessed as: Vabv sin sin cos cos where θ y and θ z are the measured pitch and move values, which focus the cell telephone's introduction.These edges are sensed by the gyroscope incorporated in the cell phone.The calculations were independently investigated, layer by layer.In this way, with a specific end goal to survey the event of a fall, the calculation considers two stages for both parameters.
Linear acceleration of the device is also verified in the detection window to resolve issues related to initial position of the person.

Results & Discussion
The main aim of the application is to enhance the testing and development capacity of fall detection devices and for analyzing various patterns for different types of falls.This application can also be used readily to detect falls.The working principle of the designed application is an enhanced one for a single sensor fall detection, freely hanging fall detection pendants/devices.The logic is developed using the vector magnitude of the 3 axis of accelerometers describes the architecture of the fall detection process.Designed application was tested using HTC one mobile.Keeping the mobile in the side pocket, back pocket and on to the arm and as a pendant to the neck tested the application.The device was tested for front fall, back fall and sudden sit and sleeping.The application has detected all the falls.One notable feature about the device is it showed a enhanced results and about 90% efficient to reduce the false detection while running, and walking when the device is freely hanging on the chest.

Experimental Data
The application is designed to have a chart to display the live data from the sensors and options to select the type of data to be displayed fall detection application was initially developed by plotting the absolute acceleration (red), Absolute vertical acceleration (blue) and the orientation (green) in order to determine multi-level algorithms to enhance the fall detection.
Fall detection line (black).Whenever the acceleration threshold is met the detection line is raised to level 1 and then it checks for the orientation and absolute vertical acceleration and linear acceleration to confirm the fall and orientation.In the above plot clearly explains our concept of confirming the fall by analyzing the orientation the fall after the thresholds are been triggered.This type of approach helps in reducing false detections due to running, walking down on steps etc.This also classifies the fall which helps the rescue team to predict the damage.
Final Application plots the magnitude of acceleration, absolute magnitude and linear acceleration and orientation is programmed internally to find the orientation: front, side, and back.

Comparison of Efficiency of Algorithm with Existing
When compared to existing highly efficient applications our algorithm uses the feedback algorithm to confirm the threshold based fall detection by monitoring the posture the body.As given in Table 2, our approach has almost reached the expectations of other devices with almost 100% of recall activity for continuous monitoring.It has a reduced 90% of false detections which enhanced detection efficiency of nearly 95%.This algorithm also classified the falls whether the fall occurred is aback fall front fall or a side fall with a specificity of 90% which need to be further analyzed.This application is developed mainly to test and design a algorithms that can be incorporated in any embedded system for fall detection.This application will reduce the data analysis time during a project to a great extent.This may be attributed to the high sensitivity of the tri-axial accelerometers within the mobile device [18].

Reduction of Algorithm Testing Time with This Application
One of the important feature of this application is to decrease the algorithm testing time.Since for the development   of wearable fall detection mechanisms the time taken for testing is done in data collection phase and data analysis phase where data needs to be processed in a computer for testing the algorithm.The designed application depicts the required data and results lively, reducing the time to test while developing efficient algorithms and modifying thresholds, moreover modern smartphones are having almost all the sensors for data analysis and application development.

Conclusion and Future Work
A fall detection application for classified fall detection is designed.Moreover this application can also be used for further analysis of fall detection algorithms lively as the graphical data are readily available and reduce the time and effort for the testing and enhancing the logics.In the above-discussed application vector magnitude of 3-axis accelerometer, absolute vector magnitude and the orientation of the sensor are taken into account.This application is mainly designed to reduce the false detection in case of freely hanging detection devices, or parts of the devices that need to be kept on moving.However smartphones are widespread for applications, these devices may be limited to usability barriers for elders in addition to the limiting positions of the carriers, waist, wrist, chest, etc., intruding errors that are position-dependent.

Figure 4
below shows the details of the pre-fall signals.The details of the fall orientations are given in Figure 5.

Figure 4 .
Figure 4. Pre-fall signals and fall detection confirmation.

Figure 5 .
Figure 5. Signals showing signals that determine the orientation of the fall and front, side and back fall events.

Table 1 .
Comparison of fall detection systems.

Table 2 .
Efficiencies of existing systems.