# FSR-Based Smart System for Detection of Wheelchair Sitting Postures Using Machine Learning Algorithms and Techniques

Authors: Mujtaba Hussain Jaffery; Muhammad Adil Ashraf; Ahmad Almogren; Hafiza Mahnoor Asim; Jehangir Arshad; Javed Khan; Ateeq Ur Rehman; Seada Hussen
Journal: Journal of Sensors
 (2022)

---

## 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 a3×3 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: K-nearest neighbors (K-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 3×3 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.


---

## Body

## 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 [8–10, 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 Table1. 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].Table 1
Sitting postures and their effects.
Posture arrangementDescriptionPressure pointsPossible health problemsIdeal postureBack and legs make an angle of 90′Balanced pressure on buttocks, arms, legs, and backNo harmForward leaningThe slope of 40′, no back supportKnee, abdomen, shoulder, upper spinal cordKnee issue, back pain, back stiffnessBackward leaningUpper back against chair backrestLumbar spine and neckSpinal dysfunction, the strain on soft tissuesRight-leaningLeaning to the right exerts more pressure on the right side of the bodyLiver, stomach and right kidney, lower spinal cordRespiratory issues, muscle imbalance, tightness of right muscles, spine curve to the rightLeft-leaningLeaning to the left exerts more pressure on the left side of the bodySpleen, left kidney, lower spinal cordRespiratory issues, muscle imbalanceIn another previous work, five supervised classification techniques, including decision tree (J48), support vector machines, multilayer perceptron, Naive Bayes, andk-nearest neighbor, are compared in accuracy, precision, recall, and F-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.Table 2
Previous work comparison.
Sr #Reference #Type of sensorsNo. of posturesClassifiers/softwareAccuracyLimitations1[23]Pressure sensor13(DT-CART), (RF), (KNN), (LR), (LDA), and (NB)98.93%Subjects for the dataset are minimal2[13]Wisat mat5Wisat algorithms in MATLAB81%Only 17 datasets are available3[8]3 pressure sensors, 1 sonar4KNN76.05%Less accuracy and classifier comparison is significantly less4[14]12 pressure sensors5Decision tree (J48), (SVM), (MLP), Naive Bayes, and (k-NN)99.47%Can record up to only 12 pressure points simultaneously5[15, 26]A32×32 pressure sensor4Support vector machine (SVM)89.6%Multiple data collected by only using 10 subjects6[10]16 sensors with 16 matrix4k-nearest neighbors (k-NN), random forest (RF), decision tree (DT) support vector machines (SVM), and LightGBM99.03%Not proposed a system through which it can correct wrong user posture


## 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, K-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].
(1)Force=Pressure∗Area.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.Figure 1
Crossconfiguration of sensors on wheelchair.


#### 2.1.2. Configuration 02

The other configuration is the3×3 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 3×3 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.Figure 2
3×3 matrix sensor configuration.The wheelchair seat consists of nine sensors embedded in a3×3 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.Figure 3
An overview of system hardware schematic.


### 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 Table3, 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.Table 3
Subjects details.
GendersNo. of subjectsNo. of samplesAge rangeMale3060019-35Female1020018-25Figure 4
This figure shows the graphical representation of dataset parameters as follows: (a) height; (b) weight; (c) BMI; (d) samples per posture.
(a)(b)(c)(d)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 (BMI≤20), healthy weight (20≤BMI≤25), overweight (25≤BMI≤30), and obese (30≤BMI). The height, weight, and BMI ranges are given in Table 4 and shown in Figure 4.Table 4
Samples details of dataset.
Total no of samplesTotal no. of posturesSamples per postureHeight range (cm)Weight range (kg)BMI range (kg/m2)80054156-19045-11016-36The 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 Figure5. 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.Figure 5
Streaming data from Arduino IDE to Excel.


### 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 K, which is suitable for data. Running the KNN algorithm again and again for different values of K helps in choosing the proper value of K, 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 k becomes less than one, predictions become less stable; by increasing the value of k, 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).
(2)Euclidean=∑i=1kxi−yi2,(3)Manhattan=∑i=1kxi−yi,(4)Minkoswski=∑i=1kxi−yiq1/q.The SVM algorithm finds a hyperplane inN-dimensional space. N 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.
(5)ly=max0,1+maxy≠twyx−wtx,HingeLossFunction:t⟶targetvariable,w⟶modelparameters,x⟶Inputvariable.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).
(6)Entropy=∑i=1C−pi∗log2pi,(7)Gini=1−∑i=1Cpi2.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).
(8)Costhθx,y=−loghθx,ify=1,−log1−hθx,ify=0,(9)P=11+e−β0+β1X1+β2X2+β3X3.⋯⋯⋯⋯+βnXn.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.IfY is the prediction and X is the feature vector:
(10)Y=Base_treeX−lr∗Tree1X−lr∗Tree2X−lr∗Tree3X.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 Figure6.Figure 6
Real-world environment and backend processing diagram.


## 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].
(1)Force=Pressure∗Area.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.Figure 1
Crossconfiguration of sensors on wheelchair.


### 2.1.2. Configuration 02

The other configuration is the3×3 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 3×3 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.Figure 2
3×3 matrix sensor configuration.The wheelchair seat consists of nine sensors embedded in a3×3 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.Figure 3
An overview of system hardware schematic.


## 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.Figure 1
Crossconfiguration of sensors on wheelchair.


## 2.1.2. Configuration 02

The other configuration is the3×3 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 3×3 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.Figure 2
3×3 matrix sensor configuration.The wheelchair seat consists of nine sensors embedded in a3×3 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.Figure 3
An overview of system hardware schematic.


## 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 Table3, 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.Table 3
Subjects details.
GendersNo. of subjectsNo. of samplesAge rangeMale3060019-35Female1020018-25Figure 4
This figure shows the graphical representation of dataset parameters as follows: (a) height; (b) weight; (c) BMI; (d) samples per posture.
(a)(b)(c)(d)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 (BMI≤20), healthy weight (20≤BMI≤25), overweight (25≤BMI≤30), and obese (30≤BMI). The height, weight, and BMI ranges are given in Table 4 and shown in Figure 4.Table 4
Samples details of dataset.
Total no of samplesTotal no. of posturesSamples per postureHeight range (cm)Weight range (kg)BMI range (kg/m2)80054156-19045-11016-36The 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 Figure5. 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.Figure 5
Streaming data from Arduino IDE to Excel.


## 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 K, which is suitable for data. Running the KNN algorithm again and again for different values of K helps in choosing the proper value of K, 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 k becomes less than one, predictions become less stable; by increasing the value of k, 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).
(2)Euclidean=∑i=1kxi−yi2,(3)Manhattan=∑i=1kxi−yi,(4)Minkoswski=∑i=1kxi−yiq1/q.The SVM algorithm finds a hyperplane inN-dimensional space. N 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.
(5)ly=max0,1+maxy≠twyx−wtx,HingeLossFunction:t⟶targetvariable,w⟶modelparameters,x⟶Inputvariable.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).
(6)Entropy=∑i=1C−pi∗log2pi,(7)Gini=1−∑i=1Cpi2.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).
(8)Costhθx,y=−loghθx,ify=1,−log1−hθx,ify=0,(9)P=11+e−β0+β1X1+β2X2+β3X3.⋯⋯⋯⋯+βnXn.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.IfY is the prediction and X is the feature vector:
(10)Y=Base_treeX−lr∗Tree1X−lr∗Tree2X−lr∗Tree3X.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 Figure6.Figure 6
Real-world environment and backend processing diagram.


## 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.3×3 Matrix

The accuracy, precision, and execution time comparison charts are shown in Figures7 and 8. In 3×3 matric configuration, KNN (K-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).Figure 7
Accuracy and precision comparison.Figure 8
Execution time comparison.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 Figure9. 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.Figure 9
Performance parameters of LightGBM.
(a)(b)(c)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 Table5.Table 5
3×3 matrix classification parameters.
AlgorithmsPrecisionAccuracyExecution timeLogistic regression80.3%79.61%0.114 sSVM85.5%85.35%0.112 sKNN89.8%90.3%0.92 sDecision tree88.6%88.26%0.163 sLightGBM95.5%95.41%1.27 s


### 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 Table6.Table 6
Crossconfiguration classification results.
AlgorithmsPrecisionAccuracyExecution timeLogistic regression80.7%80.8%0.078 sSVM87.2%83.4%0.083 sKNN87.2%86.6%0.73 sDecision tree88.6%88.26%0.052 sLightGBM90.5%89.8%0.84 s


### 3.3. Comparative Analysis and System Limitations

The comparison of these configurations is based on accuracy, precision, and execution time. The3×3 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 3×3 matrix configuration achieved higher accuracy and precision, so this configuration provides give better and more accurate results of posture detection.Table 7
Crossconfiguration classification results.
ConfigurationHighest accuracyAverage execution timeHighest precisionBetter ML algorithm3×3 matrix95.410.5158 sec95.5%LightGBMCross89.8%0.3566 sec90.5%LightGBMThe 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.


## 3.1.3×3 Matrix

The accuracy, precision, and execution time comparison charts are shown in Figures7 and 8. In 3×3 matric configuration, KNN (K-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).Figure 7
Accuracy and precision comparison.Figure 8
Execution time comparison.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 Figure9. 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.Figure 9
Performance parameters of LightGBM.
(a)(b)(c)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 Table5.Table 5
3×3 matrix classification parameters.
AlgorithmsPrecisionAccuracyExecution timeLogistic regression80.3%79.61%0.114 sSVM85.5%85.35%0.112 sKNN89.8%90.3%0.92 sDecision tree88.6%88.26%0.163 sLightGBM95.5%95.41%1.27 s


## 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 Table6.Table 6
Crossconfiguration classification results.
AlgorithmsPrecisionAccuracyExecution timeLogistic regression80.7%80.8%0.078 sSVM87.2%83.4%0.083 sKNN87.2%86.6%0.73 sDecision tree88.6%88.26%0.052 sLightGBM90.5%89.8%0.84 s


## 3.3. Comparative Analysis and System Limitations

The comparison of these configurations is based on accuracy, precision, and execution time. The3×3 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 3×3 matrix configuration achieved higher accuracy and precision, so this configuration provides give better and more accurate results of posture detection.Table 7
Crossconfiguration classification results.
ConfigurationHighest accuracyAverage execution timeHighest precisionBetter ML algorithm3×3 matrix95.410.5158 sec95.5%LightGBMCross89.8%0.3566 sec90.5%LightGBMThe 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.The3×3 matrix sensor array configuration combined with the LightGBM algorithm gave the highest accuracy of 95.41%. It is visible that using a 3×3 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.



---

*Source: 1901058-2022-05-05.xml*