Abstract

This paper presents an intelligent system containing FSR-based posture detection using machine learning algorithms. This paper is aimed at detecting the sitting posture of a wheelchair user. Individuals using wheelchairs are at increased risk of pressure ulcers when they hold an incorrect position for too long because the blood supply desists at some points of their skin due to increased pressure. The main objective of this research is to find a better configuration combined with the best machine learning algorithm for the detection of posture to prevent pressure ulcers. In the proposed monitoring system, two configurations consisting of a matrix configuration (9 sensors) and a crossconfiguration (5 sensors) of FSR sensors are embedded on a wheelchair seat to get pressure data generated and collected in a real-time processing unit and then compared. The posture recognition is performed for five sitting positions: ideal, backward-leaning, forward-leaning, right-leaning, and left-leaning based on five machine learning algorithms: -nearest neighbors (-NN), logistic regression (LR), decision tree (DT), support vector machines (SVM), and LightGBM. The research study provides a system to detect a real-time pressure sitting posture on a processing unit (laptop) wirelessly using the ESP32 module. Consequently, a posture classification accuracy of up to 95.41% is accomplished using a matrix configuration. The proposed system helps prevent pressure ulcers and is valuable in risk assessment related to pressure ulcers. This system describes the relationship between accuracy, different sensor configurations, and performance of the multiple machine learning algorithms.

1. Introduction and Literature Review

A sedentary lifestyle affects a person’s health mentally and welcomes many physical health problems. According to WHO-World Health Organization, 60 to 85% of people live a sedentary lifestyle [1] which may cause many unwanted health problems and diseases, including pressure ulcers. Pressure ulcers or bedsores are diseases that can cause damage to the skin and underlying tissues due to the exertion of prolonged pressure on a specific point in the body. Persons with pressure ulcers have a 4.5-times more significant risk of dying than those with the same risk factors without pressure ulcers [2]. Individuals who use a wheelchair may face many difficulties other than immobility, which counts pressure ulcers. According to an estimation, 1% of the world’s population uses a wheelchair which covers around 65 million of the population [3], and approximately 60,000 people face death because of pressure ulcers annually [2].

Much research has been done to reduce the risk of getting pressure ulcers, and the most appropriate way to avoid getting pressure ulcers is to reduce the exertion of pressure on the body. People with a sedentary lifestyle can improve their lives by increasing their physical activity rate, but a wheelchair user has to sit every time on a chair due to immobility. The high-probability sites for a wheelchair user to get pressure ulcers are where most of their body weight lies and the points of their skin that frequently get rubbed by wheelchair seats such as hips, back, and heels [4]. If the sitting patterns are wrong, there are increased risks of getting pressure ulcers sooner than expected. 30%-85% of people with spinal cord injuries get pressure ulcers in their first month of injury [5]. Sites having increased risk of development of pressure ulcers are over the sacrum due to prolonged sitting in a wrong posture, such as if the patient sits slumped down the seat without using backrest support, the angle of backrest increases, and this arrangement exerts shear forces over the sacrum causing pressure ulcers [6].

Incorrect posture can disturb the natural distribution of the human body weight resulting in higher pressure on the buttocks; the increased pressure decreases the blood flow and malnourished the area from oxygen and nutrients, and if this goes unhealed, it begins to break down of the skin resulting in the development of a pressure ulcer. Similarly, incorrect posture can increase pressure on the spine and other joints, making them more prone to pressure ulcers. An ideal sitting posture maintains four natural bends of the spine: the concaved cervical spine bend, the forthcoming thoracic spine bend, the lower concaved lumbar spine bend, and the lower outward sacral bend. The back is straight or slightly forward, and the legs 5°-8° apart. The back and the legs should make an angle of 90° with feet and heels touching the floor to preserve ideal sitting posture [7]. An angle between legs and spine of 90° is considered optimal for daily life [8]. Sitting in a correct posture distributes body weight primarily to the buttocks; nevertheless, it can be reduced 12.4% by chair armrests, 4.4% by the backrest, and 18.4% by supporting feet properly [7]. In conclusion, a balanced sitting posture can reduce the risk of getting a pressure ulcer or cause a delay in that. The best way to adopt an ideal sitting posture is to eliminate an incorrect posture by analyzing daily sitting patterns and rectifying them. Numerous other research has been done to examine the sitting habits of a wheelchair user using different methods and techniques [810, 27].

This paper presents a system developed to analyze and monitor the posture of a wheelchair user to prevent pressure ulcers and indicate to the patient or caretaker if the patient holds an incorrect posture for too long. The five sitting patterns are included: one is an ideal posture, and the other four are incorrect postures subsumed backward-leaning, forward-leaning, left-leaning, and right-leaning. The description of these postures and the impairment caused by these are given in Table 1. Many previous studies are centered on sitting posture detection with the purpose of the reduction of risks of getting pressure ulcers. J. Ahmad proposed a system of a Life Chair for posture detection, using a pressure sensing technique, a cellphone API, and machine learning (ML). Accuracy of 98.93% is achieved by the life chair system in recognition of 13 different postures using a supervised learning algorithm [11]. Analogously, a chair with six flexible force sensors and Nod red application for the whole process solution from QNAP stored in the Mongo dB database is developed [12]. A different approach to detecting sitting posture is the WiSAT sensor mat placed on a wheelchair seat. Posture detection is carried out by predicting weight shifts and in-seat movements in the mat [13].

In another previous work, five supervised classification techniques, including decision tree (J48), support vector machines, multilayer perceptron, Naive Bayes, and -nearest neighbor, are compared in accuracy, precision, recall, and -measure [14]. Nevertheless, only a support vector machine (SVM) is used in some studies, including a polynomial kernel to categorize four different sitting postures, with a classification precision of 89.6% [15]. The accuracy achieved in some studies is up to 99.03%, in which five different classifiers have been used, and their accuracy and computational time are computed using the embedded device and GPU [10]. Focusing on the sitting poses of travelers in airplanes is also considered, a study has been done with 24 subjects tested, and 489 sitting positions are obtained, and the pressure data among subjects and seats have been collected, while eight different sitting postures are classified in this work. By using a support vector machine (SVM), a classification rate of 89.26% is obtained in the aircraft study [16]. Artificial neural networks could also achieve the highest accuracy of 97.07% [17, 18]. Research on gait detection with various techniques has also been done in [19]. A concise comparison of existing works has been presented in Table 2.

2. Materials and Methods

This paper includes a system to detect the posture of wheelchair users and other sitting environments using an FSR-force sensitive resistor [20]. It covers comparison of two configurations with five different machine learning algorithms, including logistic regression (LR), LightGBM, -nearest neighbor (KNN), support vector machine (SVM), and decision tree (DT), to find out which configuration combination with which algorithm is better to detect the posture of the user with higher efficiency. This paper contains the following contributions for the detection of posture. (a)Designing the embedded system(b)Dataset generation and compilation(c)Processing machine learning algorithms

2.1. Designing the Embedded System

This study uses FSR (force-sensitive resistor) sensors that exhibit varying resistance to the force applied to it to design an embedded system. Arranging the FSR sensors on a wheelchair seat, such as when a person sits on it, the FSR sensors give variation in output value according to the force exerting on it. The force exerted on FSR sensors equals the pressure times area (1). Output voltage varies according to the variation in the force exerting on this sensor [21].

Two configurations are compared in this study to determine which configuration of sensors is better to detect the posture with higher accuracy. The standard and usual sitting patterns and the pressure distribution at different postures are observed, which vary depending on height, weight, and body mass.

2.1.1. Configuration 01

In this configuration, five sensors are placed in the cross (X) position, given the body mass and pressure distribution of sitting patterns [22]. This configuration is designed to detect posture detection using fewer sensors. The sensor arrangement of crossconfiguration is shown in Figure 1. The total cost of this configuration is approximately $18.

2.1.2. Configuration 02

The other configuration is the matrix sensor configuration which covers an almost complete chair area. This configuration attracts most researchers, and research has already been done on this configuration [10], but in our study, we compared this configuration to another configuration by applying five different machine learning algorithms to gain higher accuracy. The matrix arrangement of sensors is shown in Figure 2. The total cost of this system is $15. Thus, this configuration costs less than configuration 01.

The wheelchair seat consists of nine sensors embedded in a matrix arrangement named configuration 01 and six sensors in a cross arrangement named configuration 02. The samples are collected of all subjects on both configurations, and an ESP 32 module is used for communication between wheelchair seat sensors and operating system—windows. The sensor data is sent to Arduino IDE serial communication and converted to CSV dataset format. A laptop used for data collection has the following specifications: Intel core i5, 6th generation, G3 2.40 Ghz processor, and 8 Gb RAM. The hardware system overview diagram is given in Figure 3.

2.2. Dataset Generation and Compilation

In this study, people of both genders contributed, having different heights and weights. Thirty males and ten females participated in the generation of the dataset, 600 male and 200 female samples of five different postures are recorded as given in Table 3, and a graphical representation of the dataset is given in Figure 4. The subject’s weight, height, and BMI range is 156 cm-190 cm, 45 kg-110 kg, and 16 kg/m2-36 kg/m2, respectively.

The samples are recorded in five different postures: ideal position, forward-leaning, backward leaning, left-leaning, and right-leaning. This research is made keeping in view the average height and weight and optimal range of BMI, So, four types of people are included in this research according to their height and weight: underweight (), healthy weight (), overweight (), and obese (). The height, weight, and BMI ranges are given in Table 4 and shown in Figure 4.

The sensor’s data is sent to Arduino IDE serial monitor using the ESP32 module, and simultaneously, the data is recorded into Excel through Arduino IDE to Excel data streaming technique as shown in Figure 5. Figure 5 shows the dataset of a male subject with 20 samples, four samples per posture of configuration 02. The position column represents the sitting patterns including ideal posture, forward-leaning, backward leaning, left-leaning, and right-leaning as 0, 1, 2, 3, and 4, respectively, and the G, H, W columns present gender, height, and weight, respectively. Gender is represented by 0 and 1 as male and female.

2.3. Machine Learning Algorithms

This paper compares five different algorithms after generating the dataset, including KNN, SVM, LightGBM, logistic regression, and decision tree. The KNN algorithm calculates the nearest things or objects to it and predicts values [23]. The straight-line distance is the Euclidean distance, a famous method for calculating the distance between two points in the dataset—selecting the , which is suitable for data. Running the KNN algorithm again and again for different values of helps in choosing the proper value of , which is very necessary to reduce the number of errors. For achieving higher accuracy in the KNN algorithm, the preprocessing technique is used in this study which is essential to maintain the algorithm’s ability to make predictions accurately. As the value of becomes less than one, predictions become less stable; by increasing the value of , predictions become more stable due to majority voting/averaging and start making more accurate predictions. Distance functions used to calculate the distance from the nearest neighbor are Euclidean calculated as in (2), Manhattan given in (3), and Minkowski given in (4).

The SVM algorithm finds a hyperplane in -dimensional space. shows total features distinctly to classify the data points [24]. The margin between the data points is maximized by using SVM. The hyperplane and the loss function helps in maximizing the margin, which is called hinge loss.

The decision tree algorithm is the most straightforward and efficient supervised learning algorithm. In the decision tree, algorithm data points are split continuously according to some parameters, and the algorithm tries to solve the problem [25]. Other names of decision trees are classification and regression trees. Decision trees follow a top-down approach. The tree leaves represent the outcomes of the decision tree. Decision trees are called Divide, and Conquer means recursive partitioning. The function of Entropy is an information theory metric that measures the impurity or uncertainty using a group of observations built using a heuristic given in (6). In the meantime, when selected randomly, Gini calculates the probability of a specified feature classified incorrectly as in (7).

The statistical analysis method that predicts a binary outcome in the form of 0 and 1 is called logistic regression, based on the prior observations of a given dataset. After analyzing the relationship between existing independent variables, a logistic regression model predicts a dependent data variable [19] and the cost function of logistic regression modeled as in (8). The probability of a record belonging to the positive class given features is predicted by the logistic regression given in (9).

LightGBM is used to extend the gradient boosting of an algorithm, focusing on boosting examples with more significant gradients [25]. Predictive performance can be improved by speeding up the training process, which is accomplished through automatic feature selection. The LightGBM algorithm uses two novel techniques called Gradient-Based One-Side Sampling (GOSS) and Exclusive Feature Bundling (EFB); these techniques make the algorithm run faster while maintaining a high level of accuracy.

If is the prediction and is the feature vector:

In this study, five algorithms are applied to the dataset of two configurations and compared based on their accuracy, precision, and execution time—these all algorithms combined structure the backend process of the posture detection system. The dataset is trained using the machine learning algorithms, and then, different predictions are made to detect the posture. Predictions are tested by comparing them with test values. The overall system diagram of a real-world environment consisting of FSR sensors and the backend posture detection process is given in Figure 6.

3. Results and Discussion

For the performance evaluation, the classification algorithms’ results (including logistic regression, SVM, KNN, decision tree, and LightGBM) are determined on the basics of precision, accuracy, and execution time. The classifiers are trained using the training data consisting of five different sitting postures: ideal, forward-leaning, backward-leaning, left-leaning, and right-leaning.

3.1. Matrix

The accuracy, precision, and execution time comparison charts are shown in Figures 7 and 8. In matric configuration, KNN (-nearest neighbor) algorithm prediction precision is 89.8%, accuracy 90.3%, and execution time is about 0.92 s. KNN is better than SVM, logistic regression, and decision tree in this configuration. However, it takes more execution time as compared to other classification algorithms. For this reason, KNN is also known as a slow learner because of its slow learning rate. The decision tree algorithm generates precision of 88.6% and accuracy of 88.26% with an execution time of 0.163 s. For this configuration, the highest accuracy is achieved by LightGBM (95.41%) but with a higher execution time (1.27 sec).

LightGBM generates the highest accuracy and precision compared to other classifiers with a high-performance gradient boosting framework based on decision tree algorithms. This study concluded that LightGBM gives the highest accuracy and detects the posture with higher accuracy and precision rate but with maximum execution time. The performance parameters are shown in Figure 9. Figure 9(a) shows that LightGBM is achieving 95.41% accuracy with 600 training examples, and for the generation of 600 training examples to achieve this accuracy, it consumed 1.27 seconds with better scalability.

The classification algorithm of logistic regression gave precision of 80.3% and accuracy of 79.61%, achieved with the execution time of 0.114 s. Logistic regression used for binary classification did not produce such good results in the posture detection classification task, a multiclass classification. SVM (support vector machine) algorithm is used to predict posture, and the precision recorded is 85.5%; the accuracy of 85.35% is achieved with the execution time of 0.112 s. SVM works better where there is a definite distinction between two classifications, so in this scenario, the accuracy of SVM is higher than logistic regression. The precision, accuracy, and execution time of logistic regression, SVM, KNN, decision tree, and LightGBM are given in Table 5.

3.2. Crossconfiguration

Logistic regression is applied, and a precision of 80.7% is achieved with an accuracy of 80.8% and execution time of 0.078 s. SVM (support vector machine) algorithm is used to predict posture 87.2% precision, and accuracy is about 83.4% with the execution time of 0.083 s. KNN algorithm gave precision of about 87.2%, accuracy 86.6%, and execution time is about 0.73 s. The decision tree algorithm generates a precision of 88.6% and an accuracy of 88.26% with an execution time of 0.052 s. LightGBM accuracy is about 89.8%, and precision is 90.5%, and its execution time is 0.84 s. The crossconfiguration classification results consisting of accuracy, precision, and execution time are given in Table 6.

3.3. Comparative Analysis and System Limitations

The comparison of these configurations is based on accuracy, precision, and execution time. The matrix configuration gave better results for posture detection with the highest accuracy of 95.41% when processed in the LightGBM algorithm. The comparison of both configurations with machine learning algorithms is given in Table 7. The matrix configuration achieved higher accuracy and precision, so this configuration provides give better and more accurate results of posture detection.

The number of subjects who participated in the generation of the dataset for this study is limited. Thus, the number of subjects can be increased to have an extensive dataset as the number of predictions increases with the increase in the dataset. Moreover, more configurations can be designed to compare and find the best sensor distribution arrangement according to body mass and weight distribution. More machine learning algorithms can be applied to find the highest accuracy and precision with the lowest execution time. The deep learning algorithms can also be helpful in the better prediction of posture detection.

4. Conclusions

This research presents an intelligent system for detecting sitting postures of wheelchair users using FSR sensors and machine learning algorithms. The designed system will help to prevent the development of pressure ulcers. Wheelchair users are often troubled with pressure ulcers caused by cutting blood supply to a particular skin area due to prolonged increased pressure. The proposed system is designed into three sections, including (i) two types of sensor distribution arrangement, (ii)gathering of dataset of five sitting positions including ideal, forward-leaning, backward-leaning, right-leaning, and left-leaning, and (iii) applying five different machine learning algorithms consisting of KNN, SVM, LightGBM, decision tree, and logistic regression and compared algorithms with sensor configuration based on accuracy, precision, and execution time.

The matrix sensor array configuration combined with the LightGBM algorithm gave the highest accuracy of 95.41%. It is visible that using a matrix configuration gives more accurate results than crossconfiguration. Hence, this configuration is better for the detection of sitting patterns. The proposed system is helpful for the prevention of pressure ulcers in wheelchair users and can be used for the users without mobility issues for analyzing their sitting patterns for the long-term prevention of pressure ulcers. This system describes the relationship between accuracy, different sensor configurations, and performance of the multiple machine learning algorithms.

Data Availability

No data were used to support this study.

Disclosure

Mujtaba Hussain Jaffery and Jehangir Arshad are co-first authors.

Conflicts of Interest

The authors declare no conflict of interest.

Authors’ Contributions

Mujtaba Hussain Jaffery, Muhammad Adil Ashraf, Ahmad Almogren, Hafiza Mahnoor Asim, and Jehangir Arshad contributed to actualization, validation, methodology, formal analysis, investigation, software, and initial draft. Mujtaba Hussain Jaffery, Javed Khan, Ateeq Ur Rehman, and Seada Hussen contributed to actualization, validation, methodology, formal analysis, investigation, and initial draft. All authors read and approved the final version.

Acknowledgments

This work was supported by the King Saud University, Riyadh, Saudi Arabia, through Researchers Supporting Project number RSP-2022/184.