Smartphone Based Cervical Spine Stress Prevention

Rapidly increasing smartphone usage has resulted in an increasingly adverse impact on the health of people. Cervical Spine Stress and the risk of Thoracic Kyphosis have been accentuated due to inappropriate posture. Existing efforts to solve this problem require the use of expensive wearable devices or can only be implemented on selected smartphones. This paper has proposed a novel posture detecting mechanism which does not require any external devices and can be implemented inexpensively on all smartphones. The solution has utilized the built-in 3-dimensional accelerometer of the smartphone and provided an Android Operating System-based application as a proof of concept that determines the Cervical Spine posture and generates ALERTS when necessary. In addition, data of the posture could be displayed in form of graphs to make the user aware of his or her posture trend throughout the week. The application can be extended to different operating systems.


Introduction
There are an estimated 4.77 billion mobile phone users in the world as of 2017.
This number is expected to grow to 5.07 billion by 2019 [1].Many useful services are now implemented on smartphones and the number of such applications is continuously increasing.Consequently, smartphones have become multi-utility devices that are utilized for many functions besides the basic function of communication and are therefore being operated for prolonged periods of time.The extended and frequent usage brings with it health risks associated with physical stresses imposed on the users of these devices when incorrect body postures are adopted while operating these devices.A large number of patients exhibiting H. Gupta DOI: 10.4236/jsea.2018.112006111 Journal of Software Engineering and Applications such health problems have familiarized medical practitioners with these issues and considerable research has been conducted in analyzing and understanding the underlying causes and finding solutions.Most smartphone users, however, remain unaware of these health risks.Creating awareness and educating the extremely large and increasing number of users on these health concerns is a challenging proposition that is difficult to be effectively implemented.It is therefore necessary to find a more practical solution.
The basic health problem related to smartphone's usage relates to Cervical Spine Stress arising from the prolonged declination of the neck while viewing the screen of the smartphone.A ground-breaking study by Kenneth K. Hansraj, Chief of Spine Surgery, New York Spine Surgery and Rehabilitation Medicine revealed that while the standard weight applied on the spinal cord is normally 10 -12 lbs.when the Cervical Spine is colinear with the spinal cord it rises steeply to 60 lbs.when the user's neck is declined at 60 degrees from the body's longitudinal axis [2].The Cervical Spine connects the Spinal cord to the brain and is a crucial pathway for carrying signals between the brain and the rest of the body.These signals control almost all the bodily functions and hence any damage to this area can result in a condition termed in Text Neck and cause very serious health damage.In extreme conditions, the debility can develop into extreme curvature of the upper portion of the spinal cord, known as Kyphosis [3].Kyphosis is a severe spinal affliction that can cause hindrance in even daily activities.Various studies have shown that tilted or hunched back posture leading to less energy level and known to affect depression or happiness levels [4].Children and senior citizens are most vulnerable owing to their weaker cervical musculature.

Related Work
Several attempts have been made to solve aforementioned problem.Most solutions have required using devices that are externally attached on the body [5].
Some scholars have also used the smartphone's built-in accelerometer to gather data and monitor activity of a senior citizen to prevent falling, stumbling et cetera [6].Smartphone approaches make use of applications (known as "apps") to improve the user's posture.[11].However, the limitation lies in the number of sensors employed.Moreover, the solution lacks a proper alert system.The application may also not work reliably due to the disparity between the quality of smartphone cameras today.
This research paper presets Spined which overcomes most of the limitations.
This ability makes it extremely useful as it can run on low-end smartphones too.
Spined directly converts the raw data from the built-in triaxial accelerometer into useful values which are analyzed to monitor the users' posture.A notification is provided to the user automatically whenever the neck posture is determined to be incorrect with the notification indicating the severity of the incorrect posture.
The notification is removed automatically when the posture is corrected.

The Mechanism
After the application is installed on the smartphone and started by the user, it runs in the background, barring the exceptions mentioned in Section 3.  H. Gupta

Sensor Data
The application is based on the reading of data from a single built-in triaxial accelerometer sensor.It is the most significant sensor for obtaining information relating to the orientation and position of the smartphone.The cervical spine position for some angles is depicted through Figure 3.    that decide the posture of the cervical spine which determines the Cervical Spine stress level.The raw accelerometer data that the phone captures is in ms −2 .This value is converted mathematically into a quantified Cervical Spine Stress Level (λ).Sample measurements of the different values of the 3 axes at various angles of tilt between 0 and 85 degrees from the normal are given by Table 1.These values are with an observational error of ±2%:  As shown, the values of X-axis do not change considerably.A larger data-set of tilt angles was used to plot the graph given below for different values of Z-axis and Y-axis.The accelerometer values for which the posture severely stresses the Cervical spine are shown in Figure 4.The threshold has been set to be at 12 degrees (Datum from Kenneth K Hansraj's Study [2]).Hence all the "starred/dark" points in Figure 4 depict a bad posture and green squares depict healthy posture.Equation ( 1) has been derived by the tangent of the trigonometric angles formed by two axes of the built-in accelerometer.In Equation ( 2), the severity level of the posture is found by solving for the Arctan of Equation ( 1) and finding the percentage of severity.

The Algorithm
Let ψ be the total number of values recorded in 1500 milliseconds.The number of ψ will be variable since the built-in triaxial accelerometer in smartphones differs in precision, accuracy, and fetching data.Let the warning (Cervical Spine Stress) level be λ and the angle at which the phone is inclined be φ from Y-axis and the magnitude of the vector of the value of Z-axis be A γ and Y-axis be A β then: If λ > 90, then notification type priority is VERY SERIOUS.If λ > 65 and λ < 90, then priority is CAUTIONARY.If λ > 45 and λ < 65, then notification priority is HARMFUL.If λ > 20 and λ < 45, then notification priority is NEEDS IMPROVEMENT.
Above, Figure 5 is portrayal of a "Very Serious" Heads Up notification in Android Nougat when the posture should be immediately corrected.Red is often associated with warning and seriousness [12].The color grades shift to more soothing as the notification type decreases.When the notification type is "Needs Improvement" the color scheme of the notification is kept green.

Database
Many of the applications, for example, Smart Pose, proposed in a past research paper, warns the user only momentarily; however, datum is not collected or   reported over the day, week, or months [9].Spined stores all the data of the posture in a local SQLite Database that is created when the app is first installed.
The most important feature is that the duration of bad postures (where the cervical spine stress levels are beyond threshold values) throughout the day is stored in the SQLite database.The SQL table includes a serial number, date, and the cumulative duration of bad postures, and total recorded time in minutes throughout the day.The values can be read from the table and graphed to show progress.This database is created with a class and SQLite packages.At any time, the user can view the results, and weekly report will be shown to see whether the posture has improved or if improvement is required.This process is shown through Figure 6.
"MPAndroidChart", an open source graph plotting library, has been employed to plot the graph of the results from the database.A subsequent report is also shown.

Addressing Various Problems
There may be a lot of unanticipated bugs and glitches that occur when the user uses the app-based posture correcting mechanism.Most of these problems have not been addressed in the past studies on this subject.The most important of all these issues is undesired alerts.This study proposes a set of algorithms that try to minimize these issues.

Problem 1
Sometimes the smartphone is in use while the user is lying horizontally on his or her back with the smartphone located above the user and having its screen facing downwards.Under these conditions there is in fact very minimal Cervical Spine Stress and the application would normally produce erroneous results since the Z-axis value from accelerometer becomes negative resulting in a negative value for λ.For the problem case, the ideal raw value of Z-axis will be −9.8 ms −2 .
The application resolves this issue as follows: for any general case, let the Z-axis value of accelerometer be A γ : where SERVICE is the activity of the Application, i.e. if SERVICE pauses then no notification will be generated while this condition is true (screen faces downwards).

Problem 2
Sometimes, the user uses the phone for a very small span of time, like 1000 -2000 milliseconds.This is too short a period to create any Cervical Spine Stress and is undesirable to have notifications generated during this brief period.However, in most of the software application based prior art solutions the background service, or application does not stop even if the phone is at rest.As a result, unnecessary power is consumed.Spined avoids the unnecessary functioning and undesired power consumption by suspending its operation when the smartphone is idle and particularly when the display screen is in an OFF condition.When the screen is switched on, or is active, the application waits for 2500 milliseconds and then starts the SERVICE.This achieved by monitoring the activity state of the phone using the following library: (KeyguardManager)getSystemService (Context.KEYGUARD_SERVICE).inKeyguardRestrictedInputMode();

Result and Observation
The prototype of this system was tested on a sample of 100 people of all ages from 10 -60.Spined was installed on their Android phones.The sample users were asked to keep the application running for as long as they use their smartphones.The results of the application after the week were cumulated and graphs were generated from the data.The data from 100 sample sizes have been averaged out and plotted in Figure 7.  Analyzing the data from the SQLite Database, it is observed that for all respondents the duration of bad postures in minutes reduced; however, for some the decrease was significant, while for others it was minimal.The experiment showed results that supported Spined's primary objective.
The first observation was that the average duration of bad posture of the 100-sample people was 42.7 minutes (the outliers, who had hunched backs, were not included in the cumulative datum).The second observation was that an average of 17.67 minutes was reduced by the end of the week and a reducing pattern time with bad posture could clearly be seen.
From the detailed information of the sample set, gender did not a play a significant role in the posture data.The male to female ratio of the sample set was 59:41 and the minutes of bad posture of males were averaged out: 39.8 minutes.The average minutes of bad posture daily of women were approximately 43.2 minutes.The calculation is within an observational error of 1.5%.
In Figure 7, evidently, the decline is nearly linear.However, as mentioned, the minutes of bad posture reduced each day for some of the users was not as the above trend.Indeed, the graph showed ups and down; however, by the end of the week, they managed to get the cumulative minutes of bad posture to a significantly low duration.If 17.67 is linearly divided for 7 days, then approximately 3 -4 minutes reduced each day.
This experiment is bounded by the posture calculated only by the smartphone sensors when users view smartphone screens.Moreover, if the user stops the service, then also the data is not collected.Other daily activities where the posture is wrong or unhealthy cannot be accounted for by this datum.Spined can certainly help people to improve their posture while using phones and significantly reduce the Cervical Spine Stress level and risk of the critical problem of Thoracic Kyphosis.

Conclusions
The increase of cervical spine stress levels and poor postures is increasing at un- problem.This prototype application can be developed for various other platforms like Windows, IOS etc. Furthermore, the data from Spined can aid medical researchers in understanding the usage of smartphones and the duration of bad posture.The privacy of the user, however, will be maintained at all times.
Most of the applications that exist today require some kind of external device to be attached to the body and most of them can only run on the high-end smartphone with a built-in magnetic compass.The mechanism and algorithm mentioned in the paper solve the issue with only a single smartphone sensor which increases the user base.The limitation of the present work lies in improving the accuracy of this posture correction mechanism and alert systems.Furthermore, the phone usage constitutes only a minor part of the day; therefore, an inexpensive and comfortable 24-hour monitoring system needs to be devised that can measure posture trend at all times and alert the user to ameliorate his or her Cervical Spine posture.Our observation from the sample set has shown a considerable posture improvement due to smartphone-based correction mechanism.
The mechanism on which our proof of concept is based is, indeed, indispensable and efficient solution for the growing population of the smartphone, tablet, and phablet users.
Future work in this mechanism may include efficient integration with wearable technology that can employ not only accelerometer sensor but also data from gyroscope and magnetometer.More effective systems need to be designed and further research has to be conducted to aid the people in improving the Cervical Spine posture.
5. The application has been optimized in a way that it fetches minimal energy and stops running at extremely low battery (<5).The flowchart explaining the working of Spined is given by Figure1.The first step is to check the active state of the screen.If the screen is in an inactive state, the service terminates.As soon as the screen gets active, after 2000 milliseconds, the service automatically starts.Data from the triaxial accelerometer is constantly fetched and processed in accordance with the equation mentioned in Section 3.3.The equation returns a value of λ which is further processed through various if-else statements.The result of this computation determines the seriousness of the posture.If the value of λ is high, the notification (Alert) level will be the highest.Similarly, the notification is adapted for lower values of λ.As the notification appears, the user has to correct his or her posture to cancel the notification, else click the notification which opens the application.He or she can choose to stop the service if desired.Once the activity is recorded by the smartphone, entries of the H. Gupta duration of wrong or harmful posture in minutes are made into the local SQLite Database.The process has been thoroughly explained in Section 3.4.When required, these SQLite database values are retrieved by passing a query and the graphing library to generate various reports and plots of past performance.These plots show the time trend of posture which enhances user awareness and helps in improving posture.Finally, the application stops if the user presses the "Exit" button.The User Interface is shown in Figure 2.
Triaxial accelerometer measures the acceleration due to gravity acting on the different axes of the accelerometer.The crystal structures of the accelerometer get stressed by the acceleration forces that act on them.While the total acceleration due to gravity acting on the sensor remains constant, its components acting along the 3-axes vary with the change in the position and/or orientation of the smartphone.When the smartphone is flat (90 degrees from the normal of the ground) then the Y-axis has a acceleration due to gravity of 9.8 ms −2 .This Y-axis component reduces and Z-Axis' value increases as the angle of orientation from the normal decreases.It is unnecessary to use data from all the three axes of the accelerometer.Only data from the Y and Z axis of the phone are indispensable since horizontal movement does not contribute to adverse posture change (shown in

Spined' s
Algorithm is given by Equation (1) and Equation (2).Triaxial accelerometer readings are averaged out over 1500 milliseconds to filter out random fluctuations and noise and improve accuracy.Calculations are performed at millisecond intervals because the sensor values change rapidly.

Figure 4 .
Figure 4. Values of Y, Z axis and the angle from normal.

Table 1 .
Accelerometer readings for major angles.
DOI: 10.4236/jsea.2018.112006115 Journal of Software Engineering and Applications due to smartphone usage.Many ways have been proposed to solve this issue.This paper shows an efficient, reliable, and helpful smartphone application with SQLite Database and posture graphs that can help solve this H. Gupta DOI: 10.4236/jsea.2018.112006119 Journal of Software Engineering and Applications precedented rates