Activity Classification Feasibility Using Wearables : Considerations for Hip Fracture

Falls in the elderly are a common health issue that can involve severe injuries like hip fractures, requiring considerable medical attention, and subsequent care. Following surgery, physiotherapy is essential for strengthening muscles, mobilizing joints and fostering the return to physical activities. Ideally, physiotherapy programmes would benefit from active home-based monitoring of the elderly patients’ daily activities and exercises. This paper aims at providing a preliminary analysis addressing three key research questions. First, what are the key involved activities (at-hospital, home exercises, and activities of daily living) during the post-operative hip fracture rehabilitation process? Second, how can one monitor and identify a range of leg exercises accurately? Last, what is the most suitable sensor location that can categorize the majority of the physical activities thought to be important during the rehabilitation programme? During preliminary testing, it was noted that a standard deviation of the acceleration signal was suitable for classification of static activities like sitting, whereas classification of the ambulatory activities like walking, both the frequency content and related amplitude of the acceleration signal, plays a significant role. The research findings suggest that the ankle is an appropriate location for monitoring most of the leg movement physical activities.


Introduction
Hip fracture is a common event among the elderly population.This often leads to loss of independence with high morbidity and mortality rates [1].It is a common health issue arising from osteoporosis.It is normally combined with a fall and is anticipated to become the forefront in terms of demand for healthcare and social welfare services [2].
The effect of physical therapy following surgery has been presented previously [3,4] and shows its potential to increase strength, range of motion, and mobility.Despite continual therapy, some analysis [4,5] reveals that there is considerable variability in responses to rehabilitation, and it becomes challenging for healthcare professionals to keep a close track of the patient's daily activities/exercise and hence health progress.
It has been expressed that following hip fracture surgery, the patient should be provided with an optimal, well-coordinated, and organized rehabilitation programme [6].In order to be able to achieve such a program, we require active tracking.This will support the needs for the well-coordinated and organized rehabilitation programme.The patient can be tracked actively and in real time through wearable sensors attached on the body, remote communication, and the activity recognition approach.
Apart from the continued improvement in activities described above, rehabilitation in the outdoor environment that helps the patient go out of the home and maintain as much independence as possible covers the final stage of rehabilitation.The focus here is on gait-related activity.This includes mostly walking and knowing the distance travelled, and speed is the key aspect here.
The post-operative effects of physiotherapeutic exercises and mobility training during the hip fracture rehabilitation process for elderly patients have been discussed by a number of scholars [12][13][14][15].Limited information is available that accurately describes the physical activities undertaken at key stages during the post-operative rehabilitation, particularly those stages that occur when the patient is at home.Appreciating the number of sets of different exercises and the time spent by the patient when sitting, standing, or walking during the course of the day is of significance as it has not been addressed sufficiently by other researchers.
As a result, the development of a new active monitoring system that can monitor the different key activities like sitting, standing, climbing stairs, walking, exercycle, leg movement, and swinging the leg to the side as described above is valuable for monitoring physical activity during independent living [16].
This paper is organized as follows: The next section describes the methods used for activity sensing and data analysis.Section 3 provides the results of analysing the data collected on the selected activities.Section 4 discusses the findings, and Section 5 presents some conclusions.

Wearable Data Collection and Analysis Method
This section discusses the wearable device used for activity data collection.It also discusses the approach for activity data analysis, presentation, and recognition.The subject used for this research is a healthy young individual.Although this does not offer precise representation of a post-operative hip fracture elderly patient, it does satisfy the early stages of studying the feasibility for the approach before proceeding with trials on elderly people and then elderly patients.

Wearable Activity Sensing Device System Used
Acceleration-based sensing has been considered predominant for activity classification [17].As a result, the wearable sensor hardware used is the micro-electromechanical sensor (MEMS) triaxial accelerometer MPU6050 (InvenSense Inc., San Jose, CA, USA).It offers four different ranges of acceleration: ±2 g, ±4 g, ±8 g, ±16 g, where g is the acceleration due to gravity in m/s 2 .The acceleration range of ±2 g is considered sufficient to detect ambulation activities [18].The three layers as shown in Figure 1 below represent the wireless controller (Microduino Core+), the triaxial accelerometer, and the SD card.The stored test data are then processed off-line using MATLAB FFT software (8.6.0.267246 (R2015b), Mathworks, Natick, MA, USA.This software identifies the dominant spectrum relevant to each of the activities.is a healthy young individual.Although this does not offer precise representation of a post-operative hip fracture elderly patient, it does satisfy the early stages of studying the feasibility for the approach before proceeding with trials on elderly people and then elderly patients.

Wearable Activity Sensing Device System Used
Acceleration-based sensing has been considered predominant for activity classification [17].As a result, the wearable sensor hardware used is the micro-electromechanical sensor (MEMS) triaxial accelerometer MPU6050 (InvenSense Inc., San Jose, CA, USA).It offers four different ranges of acceleration: ±2 g, ±4 g, ±8 g, ±16 g, where g is the acceleration due to gravity in m/s 2 .The acceleration range of ±2 g is considered sufficient to detect ambulation activities [18].The three layers as shown in Figure 1 below represent the wireless controller (Microduino Core+), the triaxial accelerometer, and the SD card.The stored test data are then processed off-line using MATLAB FFT software (8.6.0.267246 (R2015b), Mathworks, Natick, MA, USA.This software identifies the dominant spectrum relevant to each of the activities.

Activity Data Collection Process
Real-time triaxial accelerometer data are collected at a sampling frequency of 128 Hz for each activity (i.e., static, ambulatory, and hip fracture activities) over a five-minute period.Five minutes is selected as the preference for the data collection due to the following reasons.
First, it will provide a sufficient number of activity samples.Second, it offers good coverage for the range of activities especially for slow movement activities like leg movement while sitting, slow walking, and swinging the leg to the side while standing.It will also help in analysing the dynamic switching from one activity to the other.
The structure of the five-minute period is divided into 10 data collection tests where each test collects data for 24 s followed by a 6-s halt.The test is subsequently repeated until the required time is completed.The 24-s epochs with 6-s rest are chosen ad-hoc.However, five other different times (1, 3, 6, 12, and 18 s) are also explored on a given case.After three activities are analysed (leg movement, slow, and fast walking at the ankle location only), the findings show that no difference was observed on reducing the data collection time to 6, 12, or 18 s for each set, as the activity recognition results are the same.In fact, for three seconds, as shown in Figure 2, it is observed that for fast walking and leg movement activities, both maximum frequency and amplitude data seem to be more consistent compared to slow walking.Moreover, on reducing to one second, data inconsistency is observed for both maximum amplitude and frequency across all activities.

Activity Data Collection Process
Real-time triaxial accelerometer data are collected at a sampling frequency of 128 Hz for each activity (i.e., static, ambulatory, and hip fracture activities) over a five-minute period.Five minutes is selected as the preference for the data collection due to the following reasons.
First, it will provide a sufficient number of activity samples.Second, it offers good coverage for the range of activities especially for slow movement activities like leg movement while sitting, slow walking, and swinging the leg to the side while standing.It will also help in analysing the dynamic switching from one activity to the other.
The structure of the five-minute period is divided into 10 data collection tests where each test collects data for 24 s followed by a 6-s halt.The test is subsequently repeated until the required time is completed.The 24-s epochs with 6-s rest are chosen ad-hoc.However, five other different times (1, 3, 6, 12, and 18 s) are also explored on a given case.After three activities are analysed (leg movement, slow, and fast walking at the ankle location only), the findings show that no difference was observed on reducing the data collection time to 6, 12, or 18 s for each set, as the activity recognition results are the same.In fact, for three seconds, as shown in Figure 2, it is observed that for fast walking and leg movement activities, both maximum frequency and amplitude data seem to be more consistent compared to slow walking.Moreover, on reducing to one second, data inconsistency is observed for both maximum amplitude and frequency across all activities.

Activity Data Processing Model
This section describes the mathematical expressions used for the: mean (m), standard deviation (σ), skewness (S), kurtosis (K), amplitude (A), and frequency peak (FP) involved in data processing algorithm techniques for activity classification.These are as follows [19]: ) (2) ( 1) FP l FS = − × (6) where N represents the number of total data samples, ci is the centre value for the ith interval of the histogram, ni = the data sample number at interval i, K is the number of intervals, α128 represents every fourth sample of the total FFT sample dataset, l = 1:(5/FS), and Frequency Scalar (FS) = (sampling frequency/N4)/128.N4 is equal to a value of four.It takes every fourth sample from the collected accelerometer data.The value of 128 represents the length of α128.
A frequency range of 20 Hz was considered sufficient to capture everyday activities [20].With respect to this point, the proposed sampling frequency is down-sampled to 32 Hz by taking every fourth sample.This is represented in Equation 5 as α128.
Some of the activities investigated are part of a daily life routine, such as sitting, standing, and walking.Categorizing each of these activities is important to associate or discriminate posture within the context of the exercises prescribed by a physiotherapist.For example, if a physiotherapist needs to monitor the leg movement of a person while sitting, categorizing the posture irrespective of the limb movement is important.
It has been acknowledged that, based on sensor orientation, it is possible to classify some static activities [19]; however, this alone is not enough to discriminate all types of activities.However, for a detailed classification of static activity behaviour, Baek et al. [19] used four parameters, skewness,

Activity Data Processing Model
This section describes the mathematical expressions used for the: mean (m), standard deviation (σ), skewness (S), kurtosis (K), amplitude (A), and frequency peak (FP) involved in data processing algorithm techniques for activity classification.These are as follows [19]: where N represents the number of total data samples, c i is the centre value for the ith interval of the histogram, n i = the data sample number at interval i, K is the number of intervals, α 128 represents every fourth sample of the total FFT sample dataset, l = 1:(5/FS), and Frequency Scalar (FS) = (sampling frequency/N 4 )/128.N 4 is equal to a value of four.It takes every fourth sample from the collected accelerometer data.The value of 128 represents the length of α 128 .
A frequency range of 20 Hz was considered sufficient to capture everyday activities [20].With respect to this point, the proposed sampling frequency is down-sampled to 32 Hz by taking every fourth sample.This is represented in Equation 5 as α 128 .
Some of the activities investigated are part of a daily life routine, such as sitting, standing, and walking.Categorizing each of these activities is important to associate or discriminate posture within the context of the exercises prescribed by a physiotherapist.For example, if a physiotherapist needs to monitor the leg movement of a person while sitting, categorizing the posture irrespective of the limb movement is important.
It has been acknowledged that, based on sensor orientation, it is possible to classify some static activities [19]; however, this alone is not enough to discriminate all types of activities.However, for a detailed classification of static activity behaviour, Baek et al. [19] used four parameters, skewness, kurtosis, mean, and standard deviation, and categorized the activity based on a single-axis sensor orientation.
This paper combines the three-axis raw accelerometer data and subsequently categorises static exercises (i.e., sitting and standing) based on these parameters.The purpose of combining the sensor axes is to make the algorithm immune to potential errors in aligning the sensors with body or anatomical axes.
In fact, for ambulatory and hip fracture-related activities categorisation, the combined three-axis raw accelerometer data are subjected exclusively to FFT.This is to identify the dominant frequency peak corresponding to the maximum amplitude.Identification of the maximum amplitude and frequency would help in comparing and classifying each activity accurately, as discussed more in the Results Section.

Considerations for the Body-Worn Sensor
The location of a sensor on the human body is significant from the perspective of human comfort, obtaining precise and accurate data, communication optimization, usability, and adaptability.It is acknowledged that sensor placement is highly dependent on the type of activity monitored and is application specific [21,22].
Sensors with single and multiple accelerometer sensors have been placed at different locations to explore the optimal sensor location for a range of activities [21][22][23][24][25]. Cleland et al. [21] investigated six different body locations to determine the optimal placement of an accelerometer sensor for recognition of basic everyday activities.Their analyses showed that sitting and standing results were poor when the sensor was on the foot.This, however, was more accurate for lying and jogging.Notably, the lower back is not considered suitable for classification, as the accelerometer tends to twist and causes irregularities in the data.Hence, Cleland et al. [21] concluded that the left hip (sensor located at the iliac crest) is the ideal location for classifying everyday activities.
Atallah et al. [24] focused on investigating the ideal sensor location for a varied group of activities involving upper and lower limbs.Results showed that wrist location provided good precision and identification rates for activities like preparing food and eating, whereas a waist-mounted sensor showed good results for lower limb activities like walking and sitting.Unlike Cleland et al. [21], Atallah et al. [24] did not investigate the effect of combining accelerometer data on classification accuracy.
Overall, there are limited evidence and information available about sensor placement in general.No one location can be viewed as perfect, and this factor is still a subject of debate that needs to be addressed [16,26].Since hip fracture exercises and physical activities focus on lower limb activities, an ankle location was considered as it has the potential to quantify most exercises and particularly gait-related activities and related features like walking, energy expenditure, and distance.
An important feature related to localization is sensor orientation.It may be directly attached to the skin by glue or tape or be placed within a strap.This becomes more complicated if developing a user-independent sensing device [27].This is because it gives the user the freedom to adjust the sensor position and its placement to fit with their clothing choice [22].Allowing such adjustments could alter signals from sensors like accelerometers quite dramatically, leading to erroneous categorisation of exercise and activities.
In our study, as part of the preliminary testing, four different sensor locations (waist, hip, thigh, and ankle) were considered, as shown in Figure 3 below.Hip, thigh, and ankle sensors were attached on the right side of the body, whereas a waist sensor was located at the centre of the body.

Results
This section represents the experimental data analysis of various activities with respect to sensor localization.The description of each of the activities is as follows.

Sitting vs. Standing
Data for two static activities, sitting and standing, are shown in Figures 4 and 5. Little difference is seen in the amplitude across the dominant frequencies observed for these activities.However, across sensor locations, there were notable differences in the dominant frequencies.Because the frequency was quite different and the amplitude was minimal, these parameters cannot be considered together for categorisation of sitting and standing.
It seems appropriate that a low amplitude (value < 1.0 m/s 2 ) can be utilized to categorise the static state of the person.

Results
This section represents the experimental data analysis of various activities with respect to sensor localization.The description of each of the activities is as follows.

Sitting vs. Standing
Data for two static activities, sitting and standing, are shown in Figures 4 and 5. Little difference is seen in the amplitude across the dominant frequencies observed for these activities.However, across sensor locations, there were notable differences in the dominant frequencies.Because the frequency was quite different and the amplitude was minimal, these parameters cannot be considered together for categorisation of sitting and standing.
It seems appropriate that a low amplitude (value < 1.0 m/s 2 ) can be utilized to categorise the static state of the person.
Figures 6 and 7 provide evidence that the standard deviation parameter is suitable for sitting and standing activity categorisation.In Figure 7, standard deviation values in Test 3 and Test 5 using the thigh sensor are high.This might be due to the medium or large shifts in forward and backward thigh movement generated by the individual while maintaining the position, as observed during data collection.As a result, the ankle location was considered more suitable for categorization where standard deviation values for sitting and standing were 0.015-0.0187and 0.020-0.0440,respectively.Figures 6 and 7 provide evidence that the standard deviation parameter is suitable for sitting and standing activity categorisation.In Figure 7, standard deviation values in Test 3 and Test 5 using the thigh sensor are high.This might be due to the medium or large shifts in forward and backward thigh movement generated by the individual while maintaining the position, as observed during data collection.As a result, the ankle location was considered more suitable for categorization where standard deviation values for sitting and standing were 0.015-0.0187and 0.020-0.0440,respectively.Figures 6 and 7 provide evidence that the standard deviation parameter is suitable for sitting and standing activity categorisation.In Figure 7, standard deviation values in Test 3 and Test 5 using the thigh sensor are high.This might be due to the medium or large shifts in forward and backward thigh movement generated by the individual while maintaining the position, as observed during data collection.As a result, the ankle location was considered more suitable for categorization where standard deviation values for sitting and standing were 0.015-0.0187and 0.020-0.0440,respectively.

Fast Walking in a Free-Living Environment versus a Corridor Environment
Figures 8 and 9 represent a comparison of fast walking in a free-living environment like a large park and a corridor environment with obstacles such as the presence of people and objects.For the free-living environment, the FFT data points for the three locations of thigh, waist, and hip reflected a frequency range of 1.5-2 Hz, but with a varying amplitude.In contrast, at the ankle location, frequency was notably lower, although at a similar amplitude to the thigh.The ankle location reflected small variations across the free-living and corridor environments.
Considering the corridor environment, data points for the ankle location lied within a frequency range of 0-1 Hz with a slight variation in amplitude.For thigh, waist, and hip location, the frequency was notably higher, between 1.5 and 2.5 Hz.
There are two key reasons for the change in frequency and amplitude observed between footfalls.First, there will be times when footfall impact is high during initial ground contact that may increase the amplitude of the acceleration.Second, at times the foot is still on the ground (magnitude ≈ 1 g having no impact), it is likely producing low frequency data.9 represent a comparison of fast walking in a free-living environment like a large park and a corridor environment with obstacles such as the presence of people and objects.For the free-living environment, the FFT data points for the three locations of thigh, waist, and hip reflected a frequency range of 1.5-2 Hz, but with a varying amplitude.In contrast, at the ankle location, frequency was notably lower, although at a similar amplitude to the thigh.The ankle location reflected small variations across the free-living and corridor environments.Considering the above comparative analysis, it was concluded that for fast walking in free-living and corridor environments, the thigh and ankle could be considered as the best locations.This is because the data points lied within a certain frequency range and had overlapping amplitude values.The ankle location could be of merit to extract foot impact data.Considering the corridor environment, data points for the ankle location lied within a frequency range of 0-1 Hz with a slight variation in amplitude.For thigh, waist, and hip location, the frequency was notably higher, between 1.5 and 2.5 Hz.
There are two key reasons for the change in frequency and amplitude observed between footfalls.First, there will be times when footfall impact is high during initial ground contact that may increase the amplitude of the acceleration.Second, at times the foot is still on the ground (magnitude ≈ 1 g having no impact), it is likely producing low frequency data.

Slow Walking in a Free-Living Environment vs. Corridor Environment
Figures 10 and 11 represent the comparison of slow walking in free-living and corridor environments.In the free-living environment, data points of the ankle and thigh locations were within the same frequency range (0-1.8Hz) with different amplitude values, whereas for the waist, the accuracy was much higher, as 90% of the data points lied within a frequency range of 1-1.5 Hz.However, for the hip, data points were randomly distributed across a wide frequency range.For the corridor environment, data points for the thigh, waist, and hip locations were also widely distributed; however, the ankle location lied within a frequency range of 0.5-1.25 Hz.Two different locations (waist and ankle) were suitable for slow-walking activity categorisation in both environments.
Recognizing both fast and slow walking is a concern, as they differ in amplitude and frequency across the walking environments unless different locations are utilized.This is problematic.First, placing the sensors at two different locations to recognize these walking activities in two different Considering the above comparative analysis, it was concluded that for fast walking in free-living and corridor environments, the thigh and ankle could be considered as the best locations.This is because the data points lied within a certain frequency range and had overlapping amplitude values.The ankle location could be of merit to extract foot impact data.

Slow Walking in a Free-Living Environment vs. Corridor Environment
Figures 10 and 11 represent the comparison of slow walking in free-living and corridor environments.In the free-living environment, data points of the ankle and thigh locations were within the same frequency range (0-1.8Hz) with different amplitude values, whereas for the waist, the accuracy was much higher, as 90% of the data points lied within a frequency range of 1-1.5 Hz.However, for the hip, data points were randomly distributed across a wide frequency range.For the corridor environment, data points for the thigh, waist, and hip locations were also widely distributed; however, the ankle location lied within a frequency range of 0.5-1.25 Hz.Two different locations (waist and ankle) were suitable for slow-walking activity categorisation in both environments.environments would be cumbersome for the user wearing the sensors.Secondly, recognizing activity based on the frequency threshold only would not be suitable, as it overlaps with both slow and fast walking.It is apparent that amplitude is one of the distinguishing parameters that can help in categorizing both slow and fast walking when the sensor is located at the ankle.From Figures 8-11, it is evident that for both environments, the amplitude for slow walking ranged from 10-28 m/s 2 , whereas for fast walking, it was notably higher, i.e., 40-60 m/s 2 .As a result, setting an amplitude threshold would be significant in classifying these two walking activities.Recognizing both fast and slow walking is a concern, as they differ in amplitude and frequency across the walking environments unless different locations are utilized.This is problematic.First, placing the sensors at two different locations to recognize these walking activities in two different environments would be cumbersome for the user wearing the sensors.Secondly, recognizing activity based on the frequency threshold only would not be suitable, as it overlaps with both slow and fast walking.

Stationary Exercise while Lying on the Back
From Figure 12, data points for hip, thigh, and ankle locations lied within a specific frequency range of 0-0.4 Hz, whereas for the waist location, it was more widely spread.However, both hip and thigh locations can be considered as a suitable location for classification, as they have a similar range of amplitude and frequencies.Considering these locations, the frequency and amplitude threshold values that could be used for classification would lied from 0-0.4 Hz and from 5-14 m/s 2 .It is apparent that amplitude is one of the distinguishing parameters that can help in categorizing both slow and fast walking when the sensor is located at the ankle.From Figures 8-11, it is evident that for both environments, the amplitude for slow walking ranged from 10-28 m/s 2 , whereas for fast walking, it was notably higher, i.e., 40-60 m/s 2 .As a result, setting an amplitude threshold would be significant in classifying these two walking activities.

Stationary Exercise while Lying on the Back
From Figure 12, data points for hip, thigh, and ankle locations lied within a specific frequency range of 0-0.4 Hz, whereas for the waist location, it was more widely spread.However, both hip and thigh locations can be considered as a suitable location for classification, as they have a similar range of amplitude and frequencies.Considering these locations, the frequency and amplitude threshold values that could be used for classification would lied from 0-0.4 Hz and from 5-14 m/s 2 .

Stationary Exercise while Lying on the Stomach
Figure 13 shows the analysis of a stationary leg exercise (flexing and extending the knee) when lying on the stomach with a sensor on four different locations.
Hip, waist and thigh location data points lies within a frequency range of 0 to 0.3 Hz with similar

Stationary Exercise while Lying on the Stomach
Figure 13 shows the analysis of a stationary leg exercise (flexing and extending the knee) when lying on the stomach with a sensor on four different locations.

Stationary Exercise while Lying on the Stomach
Figure 13 shows the analysis of a stationary leg exercise (flexing and extending the knee) when lying on the stomach with a sensor on four different locations.
Hip, waist and thigh location data points lies within a frequency range of 0 to 0.3 Hz with similar low amplitudes.As for ankle location, the data points are placed in a slightly wider frequency range but are in a distinct amplitude range.Hence, any of these locations could be utilized for categorization of exercise on the stomach.
When comparing locations for exercise on the stomach and back, the thigh would be a suitable location to consider as the amplitude value range was between 1 and 3 m/s 2 ; and did not overlap in this range.

Swinging a Leg Side to Side
Figure 14 shows the analysis of swinging a leg to the side with four different sensor locations.Data points for ankle, hip, and waist location had a varying frequency range.This negatively affects the level of accuracy for categorisation.However, the thigh location would be best as it lied within a frequency range of only 1.4-1.6Hz and the amplitude range was from 11 to 17 m/s 2 .Hip, waist and thigh location data points lies within a frequency range of 0 to 0.3 Hz with similar low amplitudes.As for ankle location, the data points are placed in a slightly wider frequency range but are in a distinct amplitude range.Hence, any of these locations could be utilized for categorization of exercise on the stomach.
When comparing locations for exercise on the stomach and back, the thigh would be a suitable location to consider as the amplitude value range was between 1 and 3 m/s 2 ; and did not overlap in this range.

Swinging a Leg Side to Side
Figure 14 shows the analysis of swinging a leg to the side with four different sensor locations.Data points for ankle, hip, and waist location had a varying frequency range.This negatively affects the level of accuracy for categorisation.However, the thigh location would be best as it lied within a frequency range of only 1.4-1.6Hz and the amplitude range was from 11 to 17 m/s 2 .

Lifting Thigh Upwards in Front of the Body
Figure 15 represents the analysis of lifting the thigh upwards in front of the body at four different sensor locations.Frequency data for thigh, hip, and waist location were widely distributed, compared to the ankle location, where data points were focused at a frequency range that lied within 0.9 and 1.1 Hz and the amplitude was between 11 and 19 m/s 2 .Hence, the ankle location was favoured for categorisation.

Lifting Thigh Upwards in Front of the Body
Figure 15 represents the analysis of lifting the thigh upwards in front of the body at four different sensor locations.Frequency data for thigh, hip, and waist location were widely distributed, compared to the ankle location, where data points were focused at a frequency range that lied within 0.9 and 1.1 Hz and the amplitude was between 11 and 19 m/s 2 .Hence, the ankle location was favoured for categorisation.During the slow walking analysis, it was observed that the amplitude values among all age groups lied within the 10-and 28-m/s 2 range.However, there were notable differences observed in the dominant frequency (young age: 0.5 Hz, mid-age: 2-2.5 Hz, senior age Person 1: 1.5-2.75Hz, and  Figures 17 and 18 represent the slow and fast walking activity comparison among different age group (one young subject in his/her mid-twenties, his/her one middle age subject in forties, and two senior age subjects in their sixties).
During the slow walking analysis, it was observed that the amplitude values among all age groups lied within the 10-and 28-m/s 2 range.However, there were notable differences observed in the dominant frequency (young age: 0.5 Hz, mid-age: 2-2.5 Hz, senior age Person 1: 1.5-2.75Hz, and senior age Person 2: 1-2.25 Hz).
For fast walking, the amplitude for the young age mostly lies between 40 and 60 m/s 2 , whereas for middle age and senior age persons, it ranged between 29 and 42 m/s 2 .However, again, notable differences were observed in the dominant frequency (young age: 0.75 Hz, mid-age: 2.25-3 Hz, senior age Person 1: 0.75-4.75Hz, and senior age Person 2: 0.75-2.25 Hz).From the above comparison analysis, it was concluded that based on the amplitude, we can categorize different age groups' slow and fast walking activity.

Discussion
The proposed activity recognition model proved to be effective at categorizing most of the exercises and activities that were practised in the process of the rehabilitation of hip fracture patients.The results of implementing the recognition model on the collected data reveal that the standard deviation plays a key role in static activities.Furthermore, the maximum amplitude of the activities acceleration signal's frequency content is associated with ambulatory activities' recognition and both maximum frequency and amplitude for hip fracture-related activities.Figure 19 provides a summary of the extent to which a particular sensor location could identify or categorize activities.Based on this figure, it is apparent that the ankle joint is the location of choice.During the slow walking analysis, it was observed that the amplitude values among all age groups lied within the 10-and 28-m/s 2 range.However, there were notable differences observed in the dominant frequency (young age: 0.5 Hz, mid-age: 2-2.5 Hz, senior age Person 1: 1.5-2.75Hz, and senior age Person 2: 1-2.25 Hz).
For fast walking, the amplitude for the young age mostly lies between 40 and 60 m/s 2 , whereas for middle age and senior age persons, it ranged between 29 and 42 m/s 2 .However, again, notable differences were observed in the dominant frequency (young age: 0.75 Hz, mid-age: 2.25-3 Hz, senior age Person 1: 0.75-4.75Hz, and senior age Person 2: 0.75-2.25 Hz).
From the above comparison analysis, it was concluded that based on the amplitude, we can categorize different age groups' slow and fast walking activity.

Discussion
The proposed activity recognition model proved to be effective at categorizing most of the exercises and activities that were practised in the process of the rehabilitation of hip fracture patients.The results of implementing the recognition model on the collected data reveal that the standard deviation plays a key role in static activities.Furthermore, the maximum amplitude of the activities acceleration signal's frequency content is associated with ambulatory activities' recognition and both maximum frequency and amplitude for hip fracture-related activities.Figure 19 provides a summary of the extent to which a particular sensor location could identify or categorize activities.Based on this figure, it is apparent that the ankle joint is the location of choice.From the above comparison analysis, it was concluded that based on the amplitude, we can categorize different age groups' slow and fast walking activity.

Discussion
The proposed activity recognition model proved to be effective at categorizing most of the exercises and activities that were practised in the process of the rehabilitation of hip fracture patients.The results of implementing the recognition model on the collected data reveal that the standard deviation plays a key role in static activities.Furthermore, the maximum amplitude of the activities acceleration signal's frequency content is associated with ambulatory activities' recognition and both maximum frequency and amplitude for hip fracture-related activities.Figure 19 provides a summary of the extent to which a particular sensor location could identify or categorize activities.Based on this figure, it is apparent that the ankle joint is the location of choice.The specific parameters, that is frequency and amplitude, across all the activities are shown graphically in Figure 20, while Table 1 provides the precise values relevant to this figure.Notably, all the activities fell under a frequency of 2 Hz and an amplitude of 60 m/s 2 .For dynamic physical activities, amplitude values of corridor fast walking overlapped with free-living fast walking.In addition, corridor slow walking overlapped with free-living slow walking.However, the frequency content values remained the same for both slow and fast walking.The amplitude values offer a good The specific parameters, that is frequency and amplitude, across all the activities are shown graphically in Figure 20, while Table 1 provides the precise values relevant to this figure.Notably, all the activities fell under a frequency of 2 Hz and an amplitude of 60 m/s 2 .For dynamic physical activities, amplitude values of corridor fast walking overlapped with free-living fast walking.In addition, corridor slow walking overlapped with free-living slow walking.However, the frequency content values remained the same for both slow and fast walking.The amplitude values offer a good indicator for recognizing walking activity irrespective of the environment.For stationary exercise while lying on the back and stationary exercise while sitting, frequency values almost overlapped, but amplitude values showed large variations, allowing for better categorization.It becomes difficult to differentiate the exercise of lying on the stomach and swinging a leg to the side when the wearable sensor is at the ankle location.This is because both the amplitude and frequency ranges almost overlapped with each other.Additionally, the amplitude and frequency for lifting the thigh upwards and swinging the leg to the side overlapped.while lying on the back and stationary exercise while sitting, frequency values almost overlapped, but amplitude values showed large variations, allowing for better categorization.It becomes difficult to differentiate the exercise of lying on the stomach and swinging a leg to the side when the wearable sensor is at the ankle location.This is because both the amplitude and frequency ranges almost overlapped with each other.Additionally, the amplitude and frequency for lifting the thigh upwards and swinging the leg to the side overlapped.In this paper, a specific duration of 24 s of active data collection and 6-s halts were used.Excessive time was allowed to accommodate covering all key frequencies generated by the various activities.Preliminary tests on the validity of this selection on the fast walk activity for example reflected that we could still detect the activity even when the data collection duration was reduced to 6 s.This means that for long-term monitoring, the selection of data collection time could be made adaptive to suit the type of activity requirement.This could allow for more rapid and better precision on dynamic recognition.Further deep study of the data content of a long-term continuous data collection will involve analysing the best transition time for a particular activity or during dynamic switching from one activity to another.Apart from the time selection, recognition parameters like the standard deviation, maximum amplitude, and frequency threshold should be tested across patients of different age groups and physical fitness.

Activity Type Amplitude Frequency
This raises the importance of artificial intelligence in facilitating learning and adaptivity.One further involvement that needs to be looked at carefully is that of the distribution of intelligence over the key functional players of the wireless sensor, Internet gateway, and remote computational These potential limitations require further indicators and possible investigation over a wide spectrum of subjects.Here, artificial intelligence and machine learning could play an important role in increasing the precision of activity identification.
In this paper, a specific duration of 24 s of active data collection and 6-s halts were used.Excessive time was allowed to accommodate covering all key frequencies generated by the various activities.Preliminary tests on the validity of this selection on the fast walk activity for example reflected that we could still detect the activity even when the data collection duration was reduced to 6 s.This means that for long-term monitoring, the selection of data collection time could be made adaptive to suit the type of activity requirement.This could allow for more rapid and better precision on dynamic recognition.Further deep study of the data content of a long-term continuous data collection will involve analysing the best transition time for a particular activity or during dynamic switching from one activity to another.Apart from the time selection, recognition parameters like the standard deviation, maximum amplitude, and frequency threshold should be tested across patients of different age groups and physical fitness.
This raises the importance of artificial intelligence in facilitating learning and adaptivity.One further involvement that needs to be looked at carefully is that of the distribution of intelligence over the key functional players of the wireless sensor, Internet gateway, and remote computational resources.This brings about the importance of cloud, fog, and edge computing with relevance to these types of exercises.
Future work would cover the data collection and analysis of elderly patients who have undergone hip fracture surgery.Upon an encouraging outcome of the implementation of the approach suggested above on elderly people, hospitalized people should be approached for testing and validating the method used.This will offer more insight into the key data and variance of the subject of focus within this area of research.

Conclusions
This paper provides an examination of key factors that are considered in the design of an active monitoring system for patients requiring rehabilitation following hip fracture operation.Key activities involved at different stages of the rehabilitation programme are discussed.Preliminary experimental results on a single subject show that the proposed activity recognition model proved to be feasible and effective at recognizing most of the proposed activities.The ankle is considered the best location for categorizing the majority of the monitored activities.The results reflect the need for learning and

Figure 2 .
Figure 2. Three-second data collection time comparison of three activities using the frequency spectrum with the maximum amplitude.

Figure 2 .
Figure 2. Three-second data collection time comparison of three activities using the frequency spectrum with the maximum amplitude.

17 Figure 12 .
Figure 12.Stationary exercise while lying on the back.

Figure 12 .
Figure 12.Stationary exercise while lying on the back.

Figure 13 .
Figure 13.Stationary exercise while lying on the stomach.

Figure 13 .
Figure 13.Stationary exercise while lying on the stomach.

17 Figure 14 . 2 Figure 14 .
Figure 14.Swinging a leg side to side.3.3.4.Lifting Thigh Upwards in Front of the Body Figure 15 represents the analysis of lifting the thigh upwards in front of the body at four different sensor locations.Frequency data for thigh, hip, and waist location were widely distributed, compared to the ankle location, where data points were focused at a frequency range that lied within 0.9 and 2

Figure 14 .
Figure 14.Swinging a leg side to side.

Figure 15 .
Figure 15.Lifting thigh upwards in front of the body.

3. 3 . 5 .
Figure 16 represents the analysis of stationary exercise while sitting (hip and knee flexion and extension) at four different sensor locations.The ankle location was favoured for categorisation as the frequency range was low (0-0.4Hz) and the amplitude was distinctive, lying between 23 and 37 m/s 2 .

Figure 15 .
Figure 15.Lifting thigh upwards in front of the body.

3. 3 . 5 . 17 Figure 16 .
Figure 16 represents the analysis of stationary exercise while sitting (hip and knee flexion and extension) four different sensor locations.The ankle location was favoured for categorisation as the frequency range was low (0-0.4Hz) and the amplitude was distinctive, lying between 23 and 37 m/s 2 .J. Sens. Actuator Netw.2018, 7, x FOR PEER REVIEW 13 of 17

Figures 17 and 18
Figures 17 and 18 represent the slow and fast walking activity comparison among different age group subjects (one young subject in his/her mid-twenties, his/her one middle age subject in forties, and two senior age subjects in their sixties).

Figure 17 .
Figure 17.Different subjects' slow walking activity comparison.Figure 17.Different subjects' slow walking activity comparison.

Figure 20 .
Figure 20.All activities' manifestation with the senor placed at the ankle location.
m/s 2 0-1.3 Hz Lifting Thigh Upwards 11-19 m/s 2 0.9-1.1 Hz Sitting (Leg Movement) 23-37 m/s 2 0-0.4 Hz These potential limitations require further indicators and possible investigation over a wide spectrum of subjects.Here, artificial intelligence and machine learning could play an important role in increasing the precision of activity identification.

Figure 20 .
Figure 20.All activities' manifestation with the senor placed at the ankle location.

Table 1 .
Activities' classification overall summary at the ankle location.

Table 1 .
Activities' classification overall summary at the ankle location.