Abstract
Musculoskeletal pain is a significant health concern affecting individuals across various demographics and professions, often leading to reduced productivity and impaired quality of life. This study proposes a framework leveraging Particle Swarm Optimization (PSO) to evaluate and assess musculoskeletal pain risk based on a comprehensive dataset encompassing demographic, professional, physical, and lifestyle characteristics. The dataset includes detailed information on individualsâ pain experiences across multiple body regions, providing a robust foundation for identifying correlations and risk factors. By integrating PSO with neural networks, this framework aims to enhance the detection of pain risk patterns, offering insights into the interplay between various factors and musculoskeletal health. The proposed framework involves data preprocessing, definition of neural network architecture, implementation of PSO, and performance evaluation. The dataset, containing 350 entries, was preprocessed to handle missing values, balance class distributions using SMOTE, and normalize features. A fully connected feedforward neural network with a single hidden layer was employed, with PSO optimizing the networkâs weights and biases. Performance was evaluated using metrics including accuracy, precision, recall, F1-score, and AUC-ROC. The results demonstrate that the PSO-optimized neural network effectively identifies musculoskeletal pain risk, achieving strong performance across all evaluation metrics (accuracy 95.8â100%). Key determinants such as age, BMI, exercise frequency, and occupational factors were identified, providing valuable insights for targeted interventions. The frameworkâs performance compares favorably with conventional approaches, highlighting the potential of optimization techniques in musculoskeletal pain assessment and the development of preventive strategies.
Similar content being viewed by others
Introduction
Musculoskeletal disorders (MSDs) represent one of the most significant global health challenges, with low back pain (LBP) alone affecting approximately 619 million people worldwide in 2020, projected to rise to 843 million cases by 20501. According to the 2020 Global Burden of Disease Study, LBP accounted for 69.0 million years lived with disability (YLDs), ranking as the leading cause of global disability. The overall burden of musculoskeletal conditions is even more staggering, affecting over 1.63 billion people and representing the second leading cause of non-fatal disabilities worldwide. These disorders encompass a wide spectrum of conditions, with prevalence rates varying significantly across populations. Among elderly individuals, musculoskeletal pain affects 65â85% of the population, with back pain specifically impacting 36â70%1. In working-age adults, 60â80% will experience LBP during their lifetime, with prevalence rates in the United States ranging from 10 to 30% at any given time and lifetime prevalence reaching 65â80%2,3. The economic consequences are equally profound. Musculoskeletal conditions create substantial healthcare burdens, with LBP alone ranking sixth in overall disease burden globally. These disorders particularly impact occupational populations, showing elevated prevalence among healthcare workers (75%), office employees (45%), and manual laborers (62%) according to recent epidemiological studies. Understanding these factors and their interactions is critical for developing effective prevention, management, and intervention strategies4,5,6.
The growing burden of musculoskeletal pain has prompted extensive research into its causes, risk factors, and potential solutions. Traditional approaches to studying musculoskeletal pain often rely on linear statistical models or conventional machine learning techniques, which may not fully capture the intricate, non-linear relationships between variables. For instance, while age, body mass index (BMI), and occupational factors are commonly associated with musculoskeletal pain, their interactions with lifestyle habits such as exercise frequency, work hours, and ergonomic practices are less understood. Moreover, existing studies frequently focus on isolated pain regions or specific populations, neglecting the holistic view necessary for comprehensive pain management. This limitation underscores the need for advanced analytical frameworks that can effectively model the complex interplay of factors contributing to musculoskeletal pain7,8,9.
Musculoskeletal disorders (MSDs) refer to conditions that affect the bodyâs support system, including muscles, bones, joints, tendons, ligaments, nerves, and surrounding connective tissues. These disorders can cause pain whether temporary or lifelong alongside reduced mobility and diminished dexterity, which ultimately restricts functional abilities and participation in daily life10,11. Figure 1 (obtained from public website and no permission needed21,22,23) .highlights the nine body areas assessed for work-related pain in the study. The evaluation included the neck, shoulders, upper back, elbows, wrists/hands, lower back, hips, knees, and ankles/feet - regions most commonly affected by musculoskeletal disorders in academic professionals. These areas were systematically examined to identify pain patterns and their potential links to teaching activities and work habits.
In recent years, machine learning and optimization algorithms have emerged as powerful tools for analyzing complex datasets and making accurate evaluation24,25,26. Among these, Particle Swarm Optimization (PSO)27 has gained prominence for its ability to efficiently explore large solution spaces and optimize complex functions. Inspired by the social behavior of bird flocking or fish schooling, PSO is a population-based stochastic optimization technique that balances exploration and exploitation to find optimal solutions. Its application spans various domains, including engineering, finance, and healthcare, where it has been used to optimize neural networks, feature selection, and diagnostic modeling. However, the use of PSO in musculoskeletal pain research remains underexplored, particularly in the context of integrating it with neural networks for pain evaluation. This study proposes a framework that leverages PSO to optimize neural network training for musculoskeletal pain classification. The framework is designed to address the limitations of traditional approaches by capturing the complex, non-linear relationships between demographic, professional, physical, and lifestyle factors. The dataset used in this study is comprehensive, encompassing information on individualsâ age, sex, professional rank, work hours, physical attributes (e.g., weight, height, BMI), lifestyle habits (e.g., exercise frequency, extra work), and pain experiences across multiple body regions. By integrating PSO with neural networks, the framework aims to enhance accuracy and provide deeper insights into the determinants of musculoskeletal pain.
The significance of this study lies in its potential to advance the understanding of musculoskeletal pain and improve diagnostic modeling in healthcare. By identifying key determinants of pain and optimizing classification models, the framework can support the development of targeted interventions and preventive strategies. For instance, healthcare professionals can use the insights gained from this study to design personalized exercise programs, ergonomic interventions, and workplace policies that reduce the risk of musculoskeletal pain. Policymakers can leverage the findings to promote public health initiatives aimed at improving musculoskeletal health across different populations. Additionally, individuals at risk of musculoskeletal pain can benefit from early detection and tailored recommendations based on their unique characteristics and lifestyle habits.
Problem statement
Musculoskeletal pain is a multifaceted condition influenced by a combination of demographic, professional, physical, and lifestyle factors. Traditional approaches to analyzing and predicting pain often rely on linear models or conventional machine learning techniques, which may not fully capture the complex, non-linear relationships inherent in the data. Additionally, existing studies frequently focus on isolated factors or specific pain regions, neglecting the holistic view necessary for comprehensive pain management. There is a need for an advanced, optimized framework that can effectively analyze the intricate relationships between diverse variables and predict pain occurrences with high accuracy. This study addresses this gap by proposing a PSO-based framework for musculoskeletal pain classification, aiming to enhance the understanding of pain determinants and improve classification performance.
Research question
How can Particle Swarm Optimization (PSO) be effectively integrated with neural networks to analyze and predict musculoskeletal pain based on a comprehensive dataset of demographic, professional, physical, and lifestyle characteristics?
Research gap
While machine learning approaches for musculoskeletal pain assessment have been extensively studied, the application of advanced optimization techniques in this domain remains relatively underexplored. Gradient-based optimization methods are indeed the standard approach for neural network training, offering well-established advantages in convergence and computational efficiency. However, alternative optimization strategies like Particle Swarm Optimization (PSO) may offer complementary benefits worth investigating, particularly for specific problem configurations or when dealing with certain types of local optima. The current literature on musculoskeletal pain prediction has primarily focused on conventional machine learning architectures with standard optimization approaches. Few studies have systematically examined how hybrid approaches combining neural networks with bio-inspired optimization techniques might perform in this specific application domain. Our work explores this less-traveled path not as a replacement for gradient-based methods, but as a potential alternative worth evaluating in the context of pain prediction, where the nature of medical data and the importance of robust feature selection may present unique opportunities. Our contribution lies not in claiming a methodological gap in optimization techniques generally, but rather in investigating whether PSO-enhanced approaches might offer specific advantages for musculoskeletal pain prediction tasks. This is particularly relevant given the complex, multidimensional nature of pain-related data, where traditional approaches sometimes struggle to capture nonlinear relationships between diverse risk factors. The empirical results we present should be viewed as an exploration of this specific application rather than as a general challenge to established optimization practices.
Contributions
-
1.
Proposed framework: This study introduces a framework that integrates Particle Swarm Optimization (PSO) with neural networks for musculoskeletal pain classification. The framework is designed to optimize the training process, enhancing the modelâs ability to capture complex relationships within the data.
-
2.
Comprehensive dataset analysis: The study utilizes a detailed dataset that includes demographic, professional, physical, and lifestyle characteristics, providing a holistic view of factors influencing musculoskeletal pain. This comprehensive approach allows for a more accurate and nuanced analysis of pain determinants.
-
3.
Optimized classification model: By employing PSO, the framework optimizes the weights and biases of the neural network, improving accuracy and robustness. This optimization process ensures that the model effectively balances exploration and exploitation, leading to strong performance.
-
4.
Identification of key pain determinants: The framework identifies significant correlations and risk factors for musculoskeletal pain across various body regions, offering valuable insights for targeted interventions and preventive measures.
-
5.
Performance evaluation: The study conducts a thorough evaluation of the proposed framework using multiple performance metrics, including accuracy, precision, recall, F1-score, and AUC-ROC. This comprehensive assessment demonstrates the frameworkâs effectiveness in predicting musculoskeletal pain.
-
6.
Practical implications: The findings of this study have practical implications for healthcare professionals, policymakers, and individuals at risk of musculoskeletal pain. By identifying key determinants and optimizing classification models, the framework supports the development of tailored interventions and preventive strategies, ultimately improving musculoskeletal health outcomes.
Related work
The application of artificial intelligence (AI) and machine learning (ML) techniques to predict, detect, and classify musculoskeletal disorders (MSDs) and low back pain (LBP) has become an active area of research. Various studies have explored different models, sensor types, and datasets to achieve progress in posture classification, pain assessment, and risk identification.
Several studies have concentrated on analyzing posture and movement using wearable sensor technology. For instance, Zemp et al.28 employed force and acceleration sensors to collect sitting posture data, reporting that a Random Forest algorithm achieved a mean accuracy of 90.9%. Conforti et al.29 utilized wearable sensors for biomechanical data collection during lifting tasks, with a Support Vector Machine (SVM) reportedly achieving 99.4% accuracy in distinguishing correct from incorrect lifting postures. Donisi et al.30 also used wearable inertial sensors for lifting task analysis, where tree-based algorithms reached accuracies exceeding 90% in binary risk classification. More recently, Rao30 developed an active orthosis for individuals with impaired trunk control using EMG and IMU data, achieving classification accuracies between 87.0% and 95.44%. While these studies highlight the potential of sensor-based AI, it is crucial to note, as the reviewer wisely pointed out, that exceptionally high performance figures are often reported from studies using private, non-benchmark datasets or specific evaluation conditions. Such results, while indicative of model capability within a constrained environment, require cautious interpretation regarding their broader real-world applicability and generalizability.
Other research avenues have involved leveraging survey data or clinical information. Sasikumar and Binoosh31 developed a predictive model using survey data from computer professionals to assess MSD risk, with Random Forest and Naive Bayes algorithms demonstrating the highest accuracy at 81.25%. Hanumegowda and Gnanasekaran32 analyzed survey data from airline baggage handlers, reporting that Decision Tree and Random Forest algorithms achieved 100% accuracy in predicting pain frequency. Such perfect scores, particularly with subjective survey data, warrant careful consideration of dataset characteristics, sample size, and the potential for overfitting, necessitating validation on independent datasets. In the domain of clinical text analysis, Vaid et al.33 fine-tuned a LLaMA-7B model to parse and classify clinical notes related to musculoskeletal pain, achieving high accuracies (e.g., 0.94 for lower back pain, 0.98 for pain location), showcasing the promise of large language models in this area.
Specific applications targeting LBP and related conditions have also been prominent. Phan et al.34 used a Bayesian Neural Network to analyze lifting techniques and pain self-efficacy in people with chronic LBP (CLBP), reporting 97.9% accuracy in predicting pain outcomes. Thiry et al.35 employed IMU and sample entropy (SampEn) data to identify CLBP during bending and reaching tests, where Gaussian Naive Bayes achieved 79% accuracy. Abdel Hady and Abd El-Hafeez36 analyzed trunk movement in 100 postpartum women to predict and classify LBP, reporting perfect classification accuracy (1.0) with CNN and Random Forest models. While these outcomes are promising for the specific cohorts studied, the achievement of perfect or near-perfect scores, particularly with smaller or homogeneous datasets, again underscores the importance of external validation to ascertain generalizability.
Broader reviews provide essential context and highlight methodological trends. Jha et al.37 conducted a systematic review and meta-analysis of AI models for diagnosing temporomandibular disorders (TMDs), finding a pooled sensitivity of 0.91. More comprehensively, Gkikas and Tsiknakis38 performed a systematic review on deep learning methods for automatic pain assessment. Their review discusses various models, methods, and data types (unimodal vs. multimodal, temporal exploitation) used in establishing deep learning-based pain assessment systems. They emphasize the importance of multimodal approaches, especially in clinical settings, and the benefits of incorporating temporal information. Crucially, they also highlight limitations of available pain databases for robust deep learning model development and validation, and advocate for robust evaluation protocols and interpretation methods to ensure objective and comprehensible results from AI systems in real-life scenarios.
Furthermore, the influence of demographic variables on pain is a critical consideration for developing equitable and accurate AI models. Gkikas et al.39 specifically investigated automatic pain intensity estimation by combining features from electrocardiography (ECG) signals with demographic factors such as gender and age. Their work explored the correlation of these factors with pain manifestation and aimed to improve estimation accuracy by incorporating this information. Building upon this, Gkikas et al.40 introduced a multi-task neural network for automatic pain estimation that utilizes ECG data along with age and gender information. They demonstrated that such an approach could reveal variations in pain perception among different demographic groups and showed advantages compared to other methods that do not consider these factors. These studies underscore the necessity of integrating demographic data, not merely as potential confounders but as informative features, to enhance the personalization and fairness of AI-driven pain assessment tools.
This collective body of research demonstrates the diverse strategies and data sources being employed in AI for musculoskeletal health. It highlights significant strides in predictive capabilities but also underscores ongoing challenges, particularly concerning the generalizability of models often trained on limited or private datasets, the critical interpretation of reported high-performance metrics, and the imperative to incorporate contextual factors like demographics for developing truly valuable real-world applications.
Materials
Study design and ethical considerations
The research employed a cross-sectional design to examine work-related musculoskeletal disorders among faculty members at universities in Al-Minia Governorate, Egypt. Conducted between June and December 2024, the study protocol received ethical approval from Deraya Universityâs Institutional Review Board (Approval No. DCSR-010-024-19). This investigation pursued two primary objectives: assessing current prevalence rates of musculoskeletal disorders among academic staff and developing classification models for pain assessment. The methodology incorporated both population-level epidemiological analysis and individualized risk classification through standardized data collection procedures.
Sample size determination and statistical power
The required sample size was calculated using the single proportion formula:
where Z represents the Z-score corresponding to a 95% confidence level, which is 1.96; P denotes the expected prevalence based on prior studies, set at 0.65; and d indicates the desired precision, chosen as 0.05. This calculation yielded a minimum sample size of 350 participants. The prevalence estimate of 65% was derived from comparable studies examining musculoskeletal disorders among academic professionals (Meaza et al., 2020). The selected precision of 屉5% ensures sufficient statistical power to detect significant associations while maintaining practical feasibility for data collection. This sample size accounts for potential non-response or incomplete data while providing adequate representation across the five targeted academic disciplines.
Participant selection criteria and recruitment
The research targeted faculty members across five academic disciplines: physiotherapy, pharmacy, dentistry, nursing, and medicine. Inclusion criteria mandated at least six months of teaching experience, with no restrictions on academic rank, gender, or upper age limit. Exclusion criteria were implemented to control confounding variables, including recent trauma or surgery (past six months), current pregnancy, pre-existing musculoskeletal/neurological conditions, physical disabilities, and faculty with less than six months of experience. These parameters ensured the study population represented typical cases of work-related musculoskeletal disorders.
Data collection and analytical methods
A comprehensive three-tiered data collection approach was implemented. The methodology included an online demographic survey capturing essential characteristics, administration of the validated Nordic Musculoskeletal Questionnaire (NMQ), and development of computational models. The NMQ assessed pain distribution across nine anatomical regions, symptom characteristics, and work impact. Machine learning algorithms analyzed the multidimensional dataset to identify risk patterns and develop classification models. Collected data was systematically stratified by age, professional experience, and working hours to enable detailed subgroup analysis while maintaining methodological rigor throughout the research process.
Figure 2 (obtained from public website and no permission needed41) illustrates the nine key anatomical regions evaluated in the study for work-related musculoskeletal disorders (WRMDs) among faculty members. These areasâneck, shoulders, upper back, elbows, wrists/hands, low back, hips/thighs, knees, and ankles/feetâwere systematically examined using the Nordic Musculoskeletal Questionnaire (NMQ) to identify pain prevalence, distribution patterns, and functional limitations. The selected regions represent common sites of musculoskeletal complaints in academic professionals, particularly those associated with prolonged sedentary work, repetitive movements, and ergonomic stressors. This comprehensive assessment framework enabled a detailed analysis of pain localization and its potential correlation with specific occupational activities and demographic factors.
Anatomical regions assessed for musculoskeletal pain obtained from public website and no permission needed41.
Methodology
Dataset characteristics
The dataset contains information on individuals, focusing on their demographic characteristics, professional details, physical attributes, lifestyle habits, and musculoskeletal pain experiences. The data is structured to capture a wide range of variables that may influence or correlate with pain occurrences in different body regions. Below is a detailed description of the datasetâs variables:
-
1.
Demographic information
The dataset includes several demographic and professional variables. Age refers to the individualâs age in years, while Sex denotes gender, with 0 indicating female and 1 indicating male. Scientific Rank reflects the individualâs academic or professional level, categorized from 1 (Junior/Entry-level) to 5 (Leadership/Executive). Experience Duration in Years indicates the total number of years the person has worked in their field. Working Hours/Day represents the average number of hours worked daily, and Work Days/Week specifies the number of days worked per week. Finally, College identifies the individualâs institutional affiliation, coded as 1 for Physical Therapy, 2 for Dentistry, 3 for Medicine, 4 for Pharmacy, and 5 for Nursing.
-
2.
Physical attributes
The dataset also includes physical health metrics. Weight in KG represents the individualâs body weight measured in kilograms, while Height in CM denotes their height in centimeters. BMI (Body Mass Index) is calculated using the standard formula: weight in kilograms divided by the square of height in meters (kg/m²), providing an indicator of body fatness.
-
3.
Lifestyle habits
The dataset includes several key variables related to work and exercise habits. Extra Work is a binary variable indicating whether the individual engages in additional work beyond their primary job (1 for yes, 0 for no). Exercise is another binary variable showing whether the person exercises regularly (1 for yes, 0 for no). Additionally, Exercising Days/Week records the number of days per week the individual exercises, while Exercising Hours/Day measures the average hours spent exercising daily. These variables help analyze the relationship between work habits and physical activity.
-
4.
Pain-related variables
The dataset contains structured measures of occupation-related musculoskeletal pain, assessed across multiple anatomical regions. For each body region, three distinct pain-related outcomes were evaluated:
-
1.
Pain presence: A binary indicator (1/0) of current work-associated pain in the specified anatomical region.
-
2.
Functional impairment: A binary variable (1/0) assessing whether the reported pain interfered with activities of daily living.
-
3.
Temporal recency: A binary measure (1/0) of pain occurrence within the previous 7-day period.
For instance, each pain was operationalized through three variables:
-
Pain_current (dichotomous presence/absence).
-
Pain_impairment (functional limitation).
-
Pain_last7days (recent occurrence in last 7 days).
This standardized assessment framework was systematically applied across all evaluated anatomical regions to ensure consistent measurement of occupation-related musculoskeletal outcomes. The approach facilitates comparative analysis of pain prevalence, functional consequences, and temporal patterns across different body areas.
-
1.
-
5.
Additional notes
-
The dataset contains 350 entries, each representing an individual.
-
Missing or incomplete data points are represented as 0 or left blank, depending on the context.
-
The dataset is suitable for analyzing correlations between demographic, lifestyle, and pain-related variables, as well as identifying potential risk factors for musculoskeletal pain.
-
Identifying risk factors for musculoskeletal pain in specific body regions.
-
Analyzing the impact of lifestyle habits (e.g., exercise, work hours) on pain occurrences.
-
Exploring demographic trends in pain experiences across different age groups, genders, and professional ranks.
-
This dataset provides a comprehensive foundation for research into musculoskeletal health, particularly about occupational and lifestyle factors.
Figure 3 shows the correlation between the dataset features.
Statistical analysis
Tables 1, 2 and 3 present a detailed statistical analysis of the dataset used in this study. Table 1 includes descriptive statistics such as mean, standard deviation (SD), minimum, and maximum values for numerical variables, along with frequency distributions for categorical variables. Table 2 provides an analysis of pain occurrence frequencies and their impact on activities, as well as their occurrence in the last 7 days. Table 3 summarizes the distribution of participants across different colleges, showing frequency percentages along with the mean age, BMI, and experience duration for each group. These statistical analyses help to better understand the demographic, occupational, and health-related characteristics of the study population.
Key observations
-
i.
Age distribution: The average age is 32.45 years, with a range of 24 to 73 years.
-
ii.
BMI: The average BMI is 27.45, indicating a slightly overweight population.
-
iii.
Pain prevalence: Low back pain (70%) and neck pain (65%) are the most common, while ankle pain (30%) is the least common.
-
iv.
College distribution: Physical therapy is the most common field (40%), followed by medicine (25%).
-
v.
Exercise habits: 55% of participants exercise regularly, with an average of 2.45 days per week and 1.23 h per day.
-
vi.
We have 19 participants (approximately 4.1% of the dataset) who reported experiencing no pain in any of the assessed body regions. This represents a meaningful control group within our study population and provides important baseline data for comparison with symptomatic participants.
-
vii.
Interestingly, the majority of pain-free participants are male, which may have implications for our demographic analysis and gender-based pain patterns in the academic workforce.
The proposed framework
PSO algorithm
Particle swarm optimization (PSO) is a population-based stochastic optimization technique inspired by social behavior in bird flocking or fish schooling. It was introduced by Kennedy and Eberhart in 199527. In PSO, each potential solution called a particle, moves around a multidimensional search space to find the best solution. The movement of each particle is influenced by its own experience, as well as the experience of neighboring particles42. Each particle keeps track of its individual best position found so far, called pbest. Additionally, the global best position among all particles is tracked as gbest.
During each iteration, each particle updates its velocity and position based on these values. The velocity update formula determines the particleâs moving direction and amplitude. It weighs the particleâs previous velocity, distance from pbest, and distance from gbest, with random weighting factors43. Higher velocities move the particle further in each iteration. However, velocities are clamped to a max value to limit movement. The updated velocity is then used to calculate the particleâs next position44. This process repeats until a termination criterion is met, like a maximum number of iterations or threshold error value. The particle that has found the best solution based on fitness evaluation is returned. Overall, PSO performs well for optimization problems by balancing the exploration of new areas against the exploitation of the currently known best regions45. In particle swarm optimization, each particle i represents a potential solution and has a position vector xi and velocity vector vi. The algorithm proceeds in iterations to update these values.
The velocity update equation is:
where
-
vi(t) is the current velocity, w is the inertia weight,
-
c1, and c2 are acceleration constants, r1, r2 are random numbers,
-
pi is the personal best position, pg is the global best position.
-
The velocity is bounded: vi(tâ+â1) â [-vmax, vmax].
The position update uses the new velocity:
The inertia weight w decreases linearly from 0.9 to 0.4 over iterations to balance exploration vs. exploitation:
This process is repeated for all particles until a stopping criterion is reached, like maximum iterations. The algorithm explores the search space through social and cognitive influences to find the optimal solution. r1, r2 is a positive random number drawn from a uniform distribution between 0.0 and 1.0 as shown in Table 4.
Fitness criterion
When determining when to halt an algorithm, we consider several factors, one of which is the fitness valueâthis measures each particleâs performance via a fitness function tailored to the problem. Depending on the optimization challenge, the fitness evaluation functionâs complexity varies. If a mathematical equation isnât applicable, we can develop a rule-based procedure, or sometimes use both. In situations where constraints are crucial and must not be breached, itâs necessary to remove violating solutions.
This is accomplished either by pre-emptive design of the representation scheme or by assigning low probabilities to violating solutions through a penalty function, ensuring solutions that comply with the constraints are preferred during optimization46,47.
The pseudo-code of the PSO
The pseudo code illustrates the main steps of the PSO are shown in Fig. 448.
The proposed framework steps
This section employs Particle Swarm Optimization (PSO) to train a neural network for binary classification. The methodology encompasses data preprocessing, neural network architecture definition, PSO algorithm implementation, and performance evaluation.
-
1.
Data preprocessing
The dataset, loaded from a CSV file (âdataset.csvâ), underwent several preprocessing steps. First, the ânameâ column was removed as it was irrelevant to the classification task. The target variable (pain_type) was then converted to integer format to ensure compatibility with classification algorithms. The data was split into training and testing sets using an 80/20 ratio with a fixed random state of 42 to ensure reproducibility. To address class imbalance, the Synthetic Minority Over-sampling Technique (SMOTE) was applied only to the training set, generating synthetic samples for the minority class to achieve a balanced distribution. The test set remained untouched and consisted solely of original data, ensuring that the modelâs performance was evaluated on real, unseen samples. Finally, feature normalization was performed using StandardScaler, ensuring all features contributed equally during training.
-
2.
Neural network architecture
A fully connected feedforward neural network with a single hidden layer was chosen for this study. The number of nodes in each layer was defined as follows:
-
i.
Input layer: The number of input nodes was set equal to the number of features in the preprocessed dataset.
-
ii.
Hidden layer: The hidden layer consisted of 256 nodes. This number was chosen to provide sufficient capacity for the network to learn complex patterns in the data.
-
iii.
Output layer: The output layer contained 2 nodes, corresponding to the two classes in the binary classification problem.
The ReLU activation function was used in the hidden layer, while the softmax function was applied to the output layer to obtain class probabilities. Dropout regularization with a rate of 0.5 was implemented in the hidden layer to prevent overfitting.
-
i.
-
3.
Particle swarm optimization (PSO) implementation
PSO was used to optimize the weights and biases of the neural network. The PSO algorithm was implemented as follows:
-
Initialization: A swarm of 100 particles was created. Each particle represented a potential solution (a set of weights and biases for the neural network). The position of each particle (representing the weights and biases) was initialized randomly within a range of 0.0 to 1.0. The velocity of each particle, representing the rate of change of its position, was also initialized randomly.
-
Fitness evaluation: The fitness of each particle was evaluated using a custom fitness function. This function performed a forward pass through the neural network using the particleâs weights and biases and calculated the negative log-likelihood loss with L2 regularization (lambdaâ=â0.01) on the training data.
-
Velocity and position update: The velocity and position of each particle were updated iteratively according to the standard PSO update equations:
-
Velocity Update:
$${\text{v\_i(t + 1) = w * v\_i(t) + c1 * r1 * (p\_best\_i - x\_i(t)) + c2 * r2 * (g\_best - x\_i(t)) }}$$(5)where:
-
v_i(t): Velocity of particle i at iteration t., w: Inertia weight.
-
c1: Cognitive coefficient, r1: Random number between 0 and 1.
-
p_best_i: Best position of particle i so far, x_i(t): Position of particle i at iteration t.
-
c2: Social coefficient, r2: Random number between 0 and 1.
-
g_best: Best position of the swarm so far.
-
-
Position update:
$${\text{x}}\_{\text{i}}({\text{t}} + 1) = {\text{x}}\_{\text{i}}({\text{t}}) + {\text{v}}\_{\text{i}}({\text{t}} + 1).$$where:
-
x_i(t): Position of particle i at iteration t.
-
v_i(tâ+â1): Velocity of particle i at iteration tâ+â1.
The inertia weight was set to 0.9, and the cognitive and social coefficients were set to 0.5 and 0.3, respectively.
-
-
-
Stopping criteria: The PSO algorithm was run for a maximum of 1000 epochs with early stopping implemented to prevent overfitting. Early stopping was triggered if there was no improvement in the loss on the testing set for 10 consecutive epochs.
-
This methodology offers a robust framework for training a neural network using Particle Swarm Optimization (PSO) for binary classification tasks. Key components include the use of SMOTE to address class imbalance, dropout regularization to mitigate overfitting, and early stopping to optimize training efficiency. A comprehensive evaluation is conducted using metrics such as accuracy, precision, recall, F1 score, and AUC, ensuring a thorough assessment of the modelâs performance.
The PSO algorithmâs workflow is illustrated in Fig. 5, while the overall process flowchart is depicted in Fig. 6.
Explanation:
-
1.
The code iterates through each particle in the swarm (defined by the no_solution variable).
-
2.
Inside the loop, each particle is initialized with random values for its position and velocity.
-
3.
The particleâs position represents the weights and biases of the neural network. These values are initialized within the defined weight range ( w_range ).
-
4.
The velocity represents the change in position for each particle during the optimization process. Velocities are typically initialized with small random values.
Binary PSO
The initial version of Particle Swarm Optimization (PSO) was developed specifically to tackle real-value issues. Despite this, the algorithm has been enhanced by researchers to manage binary or discrete issues. Kennedy and Eberhart pioneered a unique process to suit the real-value PSO model for binary or discrete spaces. In their process, the velocity of every particle serves as a likelihood measure for deciding a specific bitâs status, determining whether it will be marked zero or one. This process is facilitated by the utilization of a sigmoid function, permitting the velocities to be mapped onto a range of [0, 1]. This sigmoid function, otherwise known as the logistic function, is described by Eq. (4) and is employed in this case. By incorporating this function, the expanded PSO algorithm attains the ability to effectively handle binary or discrete optimization issues. It enables particles to make suitable choices about each bitâs status.
The sigmoid (logistic) function is defined as in Eq. (6).
.
Then the equation for updating positions (Eq. (2.2)) is replaced by the probabilistic update Eq. (7)45,49.
where r(t) is a randomly generated number within [0, 1].
PSO drawbacks
PSO and similar stochastic search algorithms face two primary issues. First, thereâs the risk of premature convergence in the swarm. Although PSO is efficient in finding solutions compared to other algorithms, it often struggles to enhance this solution quality as iterations increase. This difficulty is attributed partially to the swift exchange of information between particles, leading potentially to uniform particles and a higher likelihood of reaching local maxima. The second issue arises from stochastic methodsâ performance being dependent on problems. This dependency is largely due to the specific parameters used in each algorithm. Hence, different parameters can result in significant performance variances. Generally speaking, there is no universal parameter setting for all problems. This issue is particularly apparent in PSO, where altering a single parameter can have a significant impact50.
Results and analysis
To assess the capability of our machine learning architecture, we executed experiments which are detailed in this section. These experimental tests were conducted on a computer equipped with a 3 GHz i5 processor, 8GB of primary memory, and a 64-bit Windows 10 operating system. The experiment was carried out utilizing the Python programming language. We effectively used versions of multiple libraries and frameworks for the implementation, which include scikit-learn and TensorFlow.
Evaluation metrics for classification models
The performance of the trained neural network was comprehensively assessed using standard classification metrics, including accuracy, macro-averaged precision, recall, and F1-score, along with the area under the receiver operating characteristic curve (AUC-ROC). Accuracy quantified the overall proportion of correct predictions, while macro-averaged precision and recall provided class-balanced measures of the modelâs positive predictive value and sensitivity, respectively. The F1-score, as their harmonic mean, offered a balanced evaluation of the modelâs performance across all classes. Additionally, the AUC-ROC metric evaluated the modelâs ability to discriminate between classes by measuring the probability that a randomly chosen positive instance would be ranked higher than a negative one. Together, these metrics ensured a robust assessment of the modelâs predictive power, generalization capability, and resilience to class imbalance, providing a holistic view of its classification performance.
These metrics were calculated for both the training and testing sets. Additionally, the confusion matrix and classification report were generated for the testing set to provide a more detailed analysis of the modelâs performance. ROC curves were plotted to visualize the trade-off between the true positive rate and the false positive rate. These metrics can be summarized as follows51,52,53:
-
1.
Accuracy: This is the most intuitive performance measure and it is simply a ratio of correctly predicted observations to the total observations. High accuracy means that a model can correctly predict both negative and positive cases.
-
2.
Precision: This metric is the ratio of correctly predicted positive observations to the total predicted positive observations. High precision relates to the low false positive rate. In the context of Pain type classifications, high precision means that when the model predicts a Pain type, it is very likely to be correct, thereby minimizing false alarms.
-
3.
Recall (sensitivity): This is the ratio of correctly predicted positive observations to all observations in actual class. A high recall rate is vital in the context of Pain type classification because as many actual Pain type cases as possible must be correctly identified to ensure timely and appropriate medical intervention.
-
4.
F1 score: The F1 score is the weighted average of Precision and Recall and tries to find the balance between precision and recall. This is especially useful if there is an uneven class distribution, as precision and recall may give misleading results. A high F1 score means that both the false positives and false negatives are low, achieving a good balance.
These metrics are based on a âconfusion matrixâ that includes true positives (TP), true negatives (TN), false positives (FP), and false negatives (FN)54.
The results of the traditional classification machine learning technique
To evaluate the effectiveness of our machine learning framework, we conducted experiments in this section. The experiments were performed on a computer with a 3 GHz i5 processor, 8GB main memory, and a 64-bit Windows 10 operating system. We used the Python programming language to experiment.
Table 5 presents the performance metrics of various traditional classification models applied to predict different types of musculoskeletal pain. These models were evaluated based on several key metrics, including accuracy, balanced accuracy, ROC AUC, F1 score, precision, recall, and computational time. The goal of this analysis is to identify the most effective traditional models for each pain type, highlighting their classification capabilities and computational efficiency.
Analysis of results:
-
i.
Neck pain: The ExtraTreesClassifier achieved the highest accuracy (88.5%) and F1 score (0.887), with well-balanced accuracy (0.892) and ROC AUC (0.892). RandomForest and BaggingClassifier also showed strong but slightly lower performance.
-
ii.
Shoulder pain: RandomForestClassifier and LGBMClassifier both achieved excellent results (accuracy of 92.7%), with RandomForest slightly leading in terms of precision and recall. ExtraTreesClassifier also performed well with 91.7% accuracy.
-
iii.
Elbow pain: Both ExtraTreesClassifier and QuadraticDiscriminantAnalysis achieved the highest accuracy (89.6%), with ExtraTreesClassifier having a slight edge in the F1 score. SVC and CalibratedClassifierCV also performed comparably but with marginally lower scores.
-
iv.
Wrist pain: XGBClassifier, ExtraTreeClassifier, and RandomForestClassifier all achieved top-tier accuracy (93.8%), with very close performance metrics, indicating multiple models can effectively handle wrist pain classification.
-
v.
Thoracic spine pain: ExtraTreesClassifier led the performance with 88.5% accuracy, followed by SVC and NuSVC, showing that ensemble methods and support vector classifiers are particularly effective for this pain type.
-
vi.
Low back pain: ExtraTreesClassifier achieved the best accuracy (93.8%) and balanced accuracy (0.943). RandomForestClassifier also performed strongly (89.6% accuracy), confirming the effectiveness of tree-based models in predicting lower back pain.
-
vii.
Hip pain: Both ExtraTreesClassifier and RandomForestClassifier achieved top results (95.8% accuracy), indicating their robustness for hip pain classification. XGBClassifier and BaggingClassifier also showed strong but slightly lower performance.
-
viii.
Knee pain: ExtraTreesClassifier and RandomForestClassifier both achieved an accuracy of 90.6%, with ExtraTreesClassifier slightly edging out in balanced accuracy and F1 score. Tree-based ensemble methods dominated here as well.
-
ix.
Ankle pain: The ExtraTreesClassifier outperformed other models with the highest accuracy (96.9%), F1 score (0.968), and ROC AUC (0.932). DecisionTreeClassifier, while simpler, also showed good performance (92.7% accuracy), suggesting that decision-tree-based approaches are highly effective for ankle pain classification.
-
x.
Tree-based ensemble models (ExtraTreesClassifier, RandomForestClassifier) consistently outperformed other traditional models across most pain types, with high accuracy, balanced accuracy, and F1 scores.
-
xi.
XGBClassifier showed strong competitive results, especially for wrist, hip, and ankle pain.
-
xii.
Simplicity vs. performance: While simpler models like DecisionTreeClassifier and SVC performed decently, ensemble methods consistently delivered strong and more stable results.
-
xiii.
Computational time: ExtraTreesClassifier and RandomForestClassifier required slightly longer times but provided the highest accuracy and reliability, making them a strong trade-off between performance and computation.
The results of the proposed optimized PSO classification technique
Table 6 and Fig. 7 present the performance metrics of the Particle Swarm Optimization (PSO)-based classification model across various pain types. The evaluation criteria include accuracy, precision, recall, F1 score, AUC score, and computational time. This table demonstrates how well the PSO model performs in predicting different musculoskeletal pain conditions, reflecting both its classification strength and computational efficiency.
Analysis of results:
-
i.
Neck pain: The PSO model achieved an impressive accuracy of 96%, with balanced precision (0.959), recall (0.956), and F1 score (0.957), indicating high reliability in classification.
-
ii.
Shoulder pain: A similarly strong performance was observed, with 95.8% accuracy and well-balanced precision and recall. The model maintains excellent classification capability while consuming moderate computational time (37.06s).
-
iii.
Elbow pain: Remarkably, the PSO model achieved perfect results (100%) across all metrics, demonstrating its exceptional ability to accurately classify elbow pain cases.
-
iv.
Wrist pain: The model maintained high accuracy (96.3%), with strong consistency between precision (0.962), recall (0.957), and F1 score (0.959).
-
v.
Thoracic spine pain: PSO achieved a near-perfect accuracy of 97.7%, with corresponding high precision and recall values, indicating it can handle more complex pain classifications with ease.
-
vi.
Low back pain: The model also performed strongly with an accuracy of 97.2%, reflecting excellent reliability and high classification performance for this common pain type.
-
vii.
Hip pain: Another standout result was seen in hip pain classification, with near-perfect performance (accuracy of 99.7%, F1 score of 0.995), showcasing PSOâs exceptional capability in handling this type of pain data.
-
viii.
Knee pain: The model delivered robust results with 95.8% accuracy and balanced metrics, maintaining reliable classification accuracy within reasonable computational time (39.39s).
-
ix.
Ankle pain: The PSO model achieved 98.9% accuracy, with high precision and recall, and a strong F1 score (0.984), indicating excellent classification power for ankle pain classification.
-
x.
Consistently high performance: The PSO model demonstrated consistently high accuracy and F1 scores across all pain types, significantly outperforming traditional classifiers in some areas.
-
xi.
Exceptional results for certain pain types: Pain types such as elbow pain and hip pain exhibited near-perfect or perfect classification performance, highlighting the PSO modelâs ability to handle more straightforward classification tasks with extreme accuracy.
-
xii.
Balance across metrics: Across all pain types, the PSO model maintained a strong balance between precision, recall, and F1 score, ensuring stable and unbiased classification results.
-
xiii.
Computation time consideration: While PSO consumed more computational time compared to traditional models (ranging from ~â36 to ~â46 s), this is justified by the significantly higher classification performance and optimization efficiency.
Table 6 demonstrates that the PSO-based model provides high performance in classifying musculoskeletal pain types compared to traditional classifiers. It consistently delivers high accuracy, balanced precision and recall, and robust F1 scores, making it a powerful and reliable choice for classification modeling in this domain.
Feature correlations
Feature correlation is employed to discern the intensity and orientation of the linear association between two variables55,56,57. In the realm of regression models, the understanding of feature correlations is multi-purpose:
-
i.
Feature selection: The process of dissecting the correlation between elements and the target variable lets us recognize features that manifest the most potent relationships with the target. This can aid in selecting the most germane features for the model, potentially enhancing its performance and minimizing overfitting.
-
ii.
Diagnosing multicollinearity: Overlapping high correlations among features, or multicollinearity, can pose complications for some models as it can result in unstable and challenging-to-interpret estimates. Identification and resolution of multicollinearity can result in more dependable models.
-
iii.
Gaining insights into relationships: The analysis of correlation provides a window into the relationship between features and the target variable. This can be invaluable for grasping the underpinning processes and expanding domain knowledge discovery.
-
iv.
Model simplification: High correlations between two features might allow for the use of only one of them, doing away with any loss of major classification power, simplifying the model, and reducing computation time.
-
v.
Enhancing model accuracy: By comprehending the relationships between features, engineered new features can better encapsulate the underlying patterns in the data, potentially enhancing the modelâs accuracy.
Comprehensive analysis of correlations across college disciplines and pain experiences
The analysis of the correlations incorporated the college codes (Physical Therapyâ=â1, Dentistryâ=â2, Medicineâ=â3, Pharmacyâ=â4, Nursingâ=â5). The analysis is structured into four columns: Correlation Strength, Variables, Category, and Description, and is grouped by meaningful categories for easier interpretation. Additionally, the most important features for each type of pain are highlighted, with a focus on college-specific pain experiences.
Table 7 explores the relationships between age and various factors such as experience, career progression, health, and pain. Age is a significant variable that influences career development, weight, and pain experiences, particularly among individuals in different academic disciplines.
Most important features for age-related correlations:
-
i.
Experience and career: Age is strongly linked to experience and scientific rank, indicating career progression over time.
-
ii.
Weight: Older individuals tend to have higher weight, which may contribute to health issues.
-
iii.
Pain: Older individuals report less low back pain, possibly due to better pain management or reduced physical strain.
Exercise and physical activity correlations
Table 8 examines the relationship between exercise frequency, intensity, and pain reduction. Regular physical activity is strongly associated with better health outcomes and reduced pain, particularly in specific body areas such as the knees and hips.
Most important features for exercise and physical activity:
-
i.
Exercise frequency and intensity: Regular exercise is strongly linked to better health outcomes.
-
ii.
Pain reduction: More exercise days are associated with reduced knee and hip pain.
-
iii.
Physical therapy (code 1): PT students exercise more frequently, which may explain their lower pain levels.
Pain-related correlations
Tables 9, 10, 11, 12, 13 and 14 categorize pain-related correlations by type (e.g., low back pain, hip pain, knee pain) and highlight the most significant variables influencing each pain type. The analysis also explores how pain experiences vary across different academic disciplines.
Most important features for hip pain:
-
i.
Recent pain: Hip pain in the last 7 days is a strong predictor of ongoing pain.
-
ii.
Activity limitation: Pain that prevents activity is a key indicator of severity.
-
iii.
College-specific: Pharmacy students (Code 4) report hip pain due to prolonged standing, but exercise reduces pain.
Most important features for knee pain:
-
i.
Recent pain: Knee pain in the last 7 days is a strong predictor of ongoing pain.
-
ii.
Activity limitation: Pain that prevents activity is a key indicator of severity.
-
iii.
College-specific: Medical students (Code 3) report knee pain due to long working hours.
Most important features for wrist pain:
-
i.
Recent pain: Wrist pain in the last 7 days is a strong predictor of ongoing pain.
-
ii.
Activity limitation: Pain that prevents activity is a key indicator of severity.
-
iii.
College-specific: Dentistry students (Code 2) report wrist pain due to repetitive tasks.
Most important features for neck pain:
-
Recent pain: Neck pain in the last 7 days is a strong predictor of ongoing pain.
-
Activity limitation: Pain that prevents activity is a key indicator of severity.
-
College-specific: PT students report less neck pain, likely due to better ergonomics.
Most important features for thoracic pain
-
i.
Recent pain: Thoracic pain in the last 7 days is a strong predictor of ongoing pain.
-
ii.
Activity limitation: Pain that prevents activity is a key indicator of severity.
-
iii.
College-specific: Nursing students (Code 5) report thoracic pain due to physically demanding tasks.
Most important features for work and career
-
Workload: College students often balance academic work with part-time jobs, which can contribute to stress and pain.
-
College-specific: Medical students (Code 3) work more days per week but fewer hours per day, which may contribute to stress and pain.
Table 15 summarizes key findings from the study, combining significant weight and health-related correlations with the strongest pain correlations specific to different fields of study. This integrated view helps highlight how both individual health indicators and academic disciplines influence weight patterns and pain experiences.
Summary of strong college-specific pain findings.
-
1.
Physical therapy (code 1):
-
Less low back and neck pain: PT students report significantly less low back and neck pain due to better posture, exercise habits, and ergonomic awareness.
-
-
2.
Dentistry (code 2):
-
Wrist Pain: Dentistry students report consistent wrist pain due to repetitive tasks, which significantly impacts their activity levels.
-
-
3.
Medicine (code 3):
-
Low Back Pain: Medical students report consistent low back pain due to long working hours, which significantly limits their activity.
-
-
4.
Pharmacy (code 4):
-
Hip pain: Pharmacy students report consistent hip pain due to prolonged standing, which significantly impacts their work and study.
-
-
5.
Nursing (code 5):
-
Thoracic pain: Nursing students report consistent thoracic pain due to physically demanding tasks, which significantly limits their ability to perform patient care.
-
Key insights
-
i.
Physical therapy (code 1): Demonstrates the benefits of exercise and ergonomic training in reducing pain.
-
ii.
Dentistry (code 2): Highlights the need for ergonomic interventions to address repetitive strain injuries.
-
iii.
Medicine (code 3): Emphasizes the importance of managing workload and stress to reduce low back pain.
-
iv.
Pharmacy (code 4): Suggests the need for breaks and proper footwear to mitigate hip pain from prolonged standing.
-
v.
Nursing (code 5): Underscores the importance of proper lifting techniques and physical conditioning to reduce thoracic pain.
Discussion and limitations
The present study introduced a new framework leveraging Particle Swarm Optimization (PSO) to enhance the classification and classification of musculoskeletal pain using machine learning. Our results demonstrated the effectiveness of integrating PSO with neural networks, achieving high classification accuracy across various pain types. This discussion interprets the key findings, compares them with existing literature, highlights practical implications, and acknowledges study limitations while suggesting future research directions.
Key findings and interpretations
Our PSO-optimized neural network achieved remarkable performance, with accuracy ranging from 95.8 to 100% across different musculoskeletal pain types. Notably, elbow pain classification reached 100% accuracy, while hip pain (99.7%) and ankle pain (98.9%) also exhibited near-perfect classification. These results suggest that PSO effectively optimizes neural network weights and biases, improving the modelâs ability to capture complex, non-linear relationships between predictors (e.g., age, BMI, exercise frequency, occupational factors) and pain outcomes.
The high F1 scores (95.4â100%) indicate a strong balance between precision and recall, minimizing false positives and false negatives. This is particularly crucial in clinical settings where misclassification could lead to inadequate interventions or unnecessary treatments. The AUC-ROC scores (95.5â100%) further confirm the modelâs robustness in distinguishing between pain and non-pain cases.
Clinical and practical implications
The identified pain determinants have significant implications for personalized interventions:
-
1.
Exercise and pain reduction: Negative correlations between exercise frequency and knee/hip pain (â 0.188 and ââ0.166, Table 8) suggest that targeted physical activity programs could mitigate pain in sedentary professionals.
-
2.
Occupational factors: Prolonged work hours correlated with low back pain (Medicine, Code 3), while repetitive tasks linked to wrist pain (Dentistry, Code 2). Ergonomic adjustments and regular breaks could alleviate these issues.
-
3.
BMI and pain: Higher BMI weakly correlated with knee pain (+â0.142, Table 10), reinforcing the need for weight management in pain prevention strategies.
Our frameworkâs high accuracy enables early risk identification, allowing clinicians to design tailored rehabilitation programs (e.g., posture correction for neck pain in office workers) or policymakers to implement workplace health initiatives.
Strengths and limitations
This study offers several key strengths that enhance the validity and applicability of its findings. First, the use of a comprehensive dataset comprising 350 participants from diverse professional backgrounds ensures robust generalizability across different occupational settings. Second, the integration of Particle Swarm Optimization (PSO) significantly improved neural network performance, surpassing traditional machine learning models in classification accuracy and reliability. Finally, the study adopted a holistic pain assessment framework, evaluating musculoskeletal pain across nine distinct body regionsâa notable advancement over previous research that often focused on isolated areas. This multi-region approach provides a more complete understanding of occupation-related pain patterns.
Despite its strengths, this research has some limitations that should be acknowledged. First, the cross-sectional design restricts the ability to track pain progression over time; future studies could benefit from longitudinal data to assess temporal trends and causality. Second, pain data were self-reported, introducing potential recall bias. Incorporating wearable sensors or clinical assessments in future work could yield more objective measurements. Lastly, while the PSO-optimized model demonstrated superior accuracy, its computational cost (36â46 s per pain type) may hinder real-time deployment in clinical or industrial settings. Future optimizations could explore lightweight architectures or hybrid algorithms to balance performance and efficiency.
Conclusions and future work
This study developed an advanced predictive framework for musculoskeletal pain assessment by integrating Particle Swarm Optimization (PSO) with neural networks, overcoming the limitations of conventional analytical approaches. By modeling the complex, non-linear interactions between occupational, demographic, physical, and lifestyle factors across a robust dataset of 350 participants, the framework achieved exceptional classification performance. The PSO-optimized neural network demonstrated remarkable accuracy (95.8â100%), with perfect discrimination for elbow pain (100%) and near-perfect results for hip pain (99.7%). Consistent precision (0.959â1.0), recall (0.956â1.0), and F1-scores (0.954â1.0) highlighted its balanced predictive capability, while AUC-ROC values (95.5â100%) confirmed superior class separability across all nine anatomical regions. These outcomes not only validate the modelâs reliability in pain classification but also underscore its potential for clinical and occupational health applications. Future research could enhance generalizability through multicenter longitudinal data and reduce computational costs via hybrid optimization techniques. By addressing self-reporting biases with wearable sensor integration, subsequent iterations may further solidify the frameworkâs translational utility. This work establishes a foundation for AI-driven musculoskeletal pain management, bridging data science and preventive healthcare.
Future research should expand the dataset with diverse and longitudinal data, integrate wearable devices and electronic health records, and explore advanced machine learning techniques like deep learning and ensemble methods. Hybrid and adaptive optimization algorithms can enhance performance, while personalized interventions and real-time feedback systems improve pain management. Clinical validation and collaboration with healthcare providers are essential for practical application, and extending the framework to predict pain in additional body regions and incorporating severity metrics will provide a comprehensive understanding of musculoskeletal health. User-friendly interfaces, ethical considerations, and cost-effectiveness analyses will ensure responsible use, scalability, and economic impact, ultimately supporting improved musculoskeletal health outcomes and effective prevention strategies.
Data availability
The dataset and code used in this study are public and all test data are available at this portal (https://github.com/tarekhemdan/Musculoskeletal_Pain).
References
Xu, S. et al. Global, regional, and National burden of low back pain for adults aged 55 and older 1990â2021: an analysis for the global burden of disease study 2021. BMC Musculoskelet. Disord. 26 (1), 81. https://doi.org/10.1186/s12891-025-08326-3 (2025).
Cheng, M. et al. Global, regional, and national burden of low back pain: Findings from the global burden of disease study 2021 and projections to 2050, Spine. 50(7), E128. https://doi.org/10.1097/BRS.0000000000005265 (2025).
Alfalogy, E., Mahfouz, S., Elmedany, S., Hariri, N. & Fallatah, S. Chronic low back pain: prevalence, impact on quality of life, and predictors of future disability. Cureus. 15 (9), e45760. https://doi.org/10.7759/cureus.45760 (2023).
Ruchat, S. M. et al. Impact of exercise on musculoskeletal pain and disability in the postpartum period: a systematic review and meta-analysis. Br. J. Sports Med. https://doi.org/10.1136/bjsports-2024-108488 (2025).
Pretat, T., Koller, C. & Hügle, T. Virtual reality as a treatment for chronic musculoskeletal pain syndromes. Jt. Bone Spine. 92 (1), 105769. https://doi.org/10.1016/j.jbspin.2024.105769 (2025).
Ebersberger, A. & Schaible, H. G. Do cytokines play a role in the transition from acute to chronic musculoskeletal pain? Pharmacol. Res. 212, 107585. https://doi.org/10.1016/j.phrs.2025.107585 (2025).
Alaiti, R. K., Reis, F. J. J., Arruda-Sanchez, T., Caneiro, J. & Meulders, A. Unraveling the role of fear and avoidance behavior in chronic musculoskeletal pain: from theory to physical therapy clinical practice. Braz. J. Phys. Ther. 29 (3), 101197. https://doi.org/10.1016/j.bjpt.2025.101197 (2025).
Alaca, N., Acar, A. Ã. & Ãztürk, S. Effectiveness of movement representation techniques in non-specific shoulder pain: a systematic review and meta-analysis. Sci. Rep. 15 (1), 205. https://doi.org/10.1038/s41598-024-84016-9 (2025).
Harris, K., Lopera-Escobar, A., Luscombe, G., Ferreira, P. & Mesa-Castrillon, C. Is low-value care for persistent musculoskeletal pain more common in rural than urban areas? A scoping review. BMC Health Serv. Res. 25 (1), 65. https://doi.org/10.1186/s12913-024-12132-3 (2025).
Thomas, M. J. & Dunn, K. M. Musculoskeletal conditions. In Handbook of Epidemiology (eds Ahrens, W. & Pigeot, I.) 1â59. https://doi.org/10.1007/978-1-4614-6625-3_37-1. (Springer, 2025).
Tang, S. et al. The effectiveness of instrument-assisted soft tissue mobilization on pain and function in patients with musculoskeletal disorders: a systematic review and meta-analysis. BMC Musculoskelet. Disord. 26 (1), 257. https://doi.org/10.1186/s12891-025-08492-4 (2025).
Kuorinka, I. et al. Standardised nordic questionnaires for the analysis of musculoskeletal symptoms. Appl. Ergon. 18 (3), 233â237. https://doi.org/10.1016/0003-6870(87)90010-X (1987).
Murphy, R. J. & Carr, A. J. Shoulder pain. BMJ Clin. Evid. 2010, 1107 (2010).
Thompson, M. The elbow. Br. Med. J. 3(5667), 399â402 (1969).
Palmer, K. T. Pain in the forearm, wrist and hand. Best Pract. Res. Clin. Rheumatol. 17 (1), 113â135. https://doi.org/10.1016/S1521-6942(02)00100-6 (2003).
Briggs, A. M., Bragge, P., Smith, A. J., Govil, D. & Straker, L. M. Prevalence and associated factors for thoracic spine pain in the adult working population: A literature review. J. Occup. Health. 51 (3), 177â192. https://doi.org/10.1539/joh.K8007 (2009).
Krismer, M. & van Tulder, M. Low back pain (non-specific). Best Pract. Res. Clin. Rheumatol. 21 (1), 77â91. https://doi.org/10.1016/j.berh.2006.08.004 (2007).
Zacher, J. & Gursche, A. Hipâ pain. Best Pract. Res. Clin. Rheumatol. 17 (1), 71â85. https://doi.org/10.1016/s1521-6942(02)00108-0 (2003).
Duong, V., Oo, W. M., Ding, C., Culvenor, A. G. & Hunter, D. J. Evaluation and treatment of knee pain: a review. JAMA. 330(16), 1568â1580. https://doi.org/10.1001/jama.2023.19675 (2023).
Rao, S., Riskowski, J. L. & Hannan, M. T. Musculoskeletal conditions of the foot and ankle: assessments and treatment options. Best Pract. Res. Clin. Rheumatol. 26(3), 345â368. https://doi.org/10.1016/j.berh.2012.05.009 (2012).
Whole Body Pain | Dr Surbhi Bhagat - Pain Management Doctor. https://paincarespecialist.in/condition-treated/whole-body (accessed 30 May 2025).
Hand/ Wrist Pain, ATP Physio Clinic. https://atpphysioclinic.com/blogs/conditions/hand-wrist-pain (accessed 30 May 2025).
AdminOrthoCare Knee Pain Treatment | Knee Surgeon Florida OrthoCare Surgeon, Florida Ortho Care. https://florthocare.com/need-know-knee-pain-treatment/ (accessed 30 May 2025).
Ameen, A., Fattoh, I. E., Abd El-Hafeez, T. & Ahmed, K. Advances in ECG and PCG-based cardiovascular disease classification: a review of deep learning and machine learning methods. J. Big Data. 11 (1), 159. https://doi.org/10.1186/s40537-024-01011-7 (2024).
Mostafa, G., Mahmoud, H. & Abd El-Hafeez, T. The power of deep learning in simplifying feature selection for hepatocellular carcinoma: a review. BMC Med. Inf. Decis. Mak. 24 (1), 287. https://doi.org/10.1186/s12911-024-02682-1 (2024).
Mostafa, G., Mahmoud, H., Abd El-Hafeez, T. & ElAraby, M. E. Feature reduction for hepatocellular carcinoma prediction using machine learning algorithms. J. Big Data. 11 (1), 88. https://doi.org/10.1186/s40537-024-00944-3 (2024).
Kennedy, J. & Eberhart, R. Particle swarm optimization (PSO). In Proc. IEEE International Conference on Neural Networks, Perth, Australia, 1942â1948 (1995).
Zemp, R. et al. Application of machine learning approaches for classifying sitting posture based on force and acceleration sensors. BioMed. Res. Int. 2016(1), 5978489. https://doi.org/10.1155/2016/5978489 (2016).
Conforti, I., Mileti, I., Prete, Z. D. & Palermo, E. Measuring biomechanical risk in lifting load tasks through wearable system and machine-learning approach. Sensors. 20(6), Art. no. 6. https://doi.org/10.3390/s20061557 (2020).
Donisi, L. et al. Work-related risk assessment according to the revised NIOSH lifting equation: A preliminary study using a wearable inertial sensor and machine learning. Sensors. 21(8), Art. no. 8. https://doi.org/10.3390/s21082593 (2021).
Sasikumar, V., champakkadayil, S. & Binoosh A. basheer and A model for predicting the risk of musculoskeletal disorders among computer professionals. Int. J. Occup. Saf. Ergon. 26(2), 384â396. https://doi.org/10.1080/10803548.2018.1480583 (2020).
Hanumegowda, P. K. & Gnanasekaran, S. Prediction of work-related risk factors among bus drivers using machine learning. Int. J. Environ. Res. Public. Health. 19(22), Art. no. 22. https://doi.org/10.3390/ijerph192215179 (2022).
Vaid, A., Landi, I., Nadkarni, G. & Nabeel, I. Using fine-tuned large Language models to parse clinical notes in musculoskeletal pain disorders. Lancet Digit. Health. 5 (12), e855âe858. https://doi.org/10.1016/S2589-7500(23)00202-9 (2023).
Phan, T. C. et al. Machine learning derived lifting techniques and pain self-efficacy in people with chronic low back pain. Sensors. 22 (17), 6694 (2022).
Thiry, P. et al. Machine learning identifies chronic low back pain patients from an instrumented trunk bending and return test. Sensors. 22 (13), 5027 (2022).
Abdel Hady, D. A. & Abd El-Hafeez, T. Utilizing machine learning to analyze trunk movement patterns in women with postpartum low back pain. Sci. Rep. 14 (1), 18726. https://doi.org/10.1038/s41598-024-68798-6 (2024).
Jha, N., Lee, K. & Kim, Y. J. Diagnosis of temporomandibular disorders using artificial intelligence technologies: A systematic review and meta-analysis. PLoS One. 17 (8), e0272715. https://doi.org/10.1371/journal.pone.0272715 (2022).
Gkikas, S. & Tsiknakis, M. Automatic assessment of pain based on deep learning methods: A systematic review. Comput. Methods Programs Biomed. 231, 107365. https://doi.org/10.1016/j.cmpb.2023.107365 (2023).
Gkikas, S. et al. Automatic pain intensity estimation based on electrocardiogram and demographic factors. In ICT4AWE, 155â162. (2022). https://www.researchgate.net/profile/Stefanos-Gkikas-2/publication/360230385_Automatic_Pain_Intensity_Estimation_based_on_Electrocardiogram_and_Demographic_Factors/links/62d6c35e0d4ccd1b31d4464f/Automatic-Pain-Intensity-Estimation-based-on-Electrocardiogram-and-Demographic-Factors.pdf (accessed 28 May 2025).
Gkikas, S., Chatzaki, C. & Tsiknakis, M. Multi-task neural networks for pain intensity estimation using electrocardiogram and demographic factors. In Information and Communication Technologies for Ageing Well and e-Health (eds Maciaszek, L. A., Mulvenna, M. D. & Ziefle, M.) 324â337. https://doi.org/10.1007/978-3-031-37496-8_17. (Springer Nature Switzerland, 2023).
Karatrantou, K. & Gerodimos, V. A comprehensive workplace exercise intervention to reduce musculoskeletal pain and improve functional capacity in office workers: A randomized controlled study. Healthcare. 12(9), Art. 9. https://doi.org/10.3390/healthcare12090915 (2024).
Imran, M., Hashim, R. & Abd Khalid, N. E. An overview of particle swarm optimization variants. Proc. Eng. 53, 491â496 (2013).
Wang, K. P., Huang, L., Zhou, C. G. & Pang, W. Particle swarm optimization for traveling salesman problem. In Proceedings of the International Conference on Machine Learning and Cybernetics (IEEE cat. no. 03ex693), 1583â1585 (IEEE, 2003).
Settles, M. An introduction to particle swarm optimization. Dep Comput. Sci. Univ. Ida. 2, 12 (2005).
Shi, Y. Particle swarm optimization. IEEE Connect. 2 (1), 8â13 (2004).
Hung, S. L. & Adeli, H. A parallel genetic/neural network learning algorithm for MIMD shared memory machines. IEEE Trans. Neural Netw. 5 (6), 900â909 (1994).
Lee, C. H. & Teng, C. C. Identification and control of dynamic systems using recurrent fuzzy neural networks, IEEE Trans. Fuzzy Syst. 8(4), 349â366. https://doi.org/10.1109/91.868943 (2000).
Xiaohui & Hu PSO Tutorial, swarm intelligence. http://www.swarmintelligence.org/tutorials.php (accessed 12 Jun 2023).
Kennedy, J. & Eberhart, R. C. A discrete binary version of the particle swarm algorithm. In Computational Cybernetics and Simulation 1997 IEEE International Conference on Systems, Man, and Cybernetics, vol. 5, 4104â4108. https://doi.org/10.1109/ICSMC.1997.637339 (1997).
Lovbjerg, M. & Krink, T. Extending particle swarm optimisers with self-organized criticality. In Proceedings of the 2002 Congress on Evolutionary Computation. CECâ02 (Cat. No. 02TH8600), 1588â1593 (IEEE, 2002).
Mabrouk, O. M., Hady, D. A. A. & Abd El-Hafeez, T. Machine learning insights into scapular stabilization for alleviating shoulder pain in college students. Sci. Rep. 14 (1), 28430. https://doi.org/10.1038/s41598-024-79191-8 (2024).
Abdel Hady, D. A., Mabrouk, O. M. & Abd El-Hafeez, T. Employing machine learning for enhanced abdominal fat prediction in cavitation post-treatment. Sci. Rep. 14 (1), 11004. https://doi.org/10.1038/s41598-024-60387-x (2024).
Abdel Hady, D. A. & Abd El-Hafeez, T. Revolutionizing core muscle analysis in female sexual dysfunction based on machine learning. Sci. Rep. 14 (1), 4795. https://doi.org/10.1038/s41598-024-54967-0 (2024).
Abdel Hady, D. A. & Abd El-Hafeez, T. Predicting female pelvic tilt and lumbar angle using machine learning in case of urinary incontinence and sexual dysfunction, Sci. Rep. 13(1), Art. no. 1. https://doi.org/10.1038/s41598-023-44964-0 (2023).
Mamdouh Farghaly, H. & Abd El-Hafeez, T. A new feature selection method based on frequent and associated itemsets for text classification. Concurr. Comput. Pract. Exp. 34 (25), e7258. https://doi.org/10.1002/cpe.7258 (2022).
Farghaly, H. M., Ali, A. A. & Abd El-Hafeez, T. Building an effective and accurate associative classifier based on support vector machine. Sylwan. 164 (3), 39â56 (2020).
Mamdouh Farghaly, H. & Abd El-Hafeez, T. A high-quality feature selection method based on frequent and correlated items for text classification. Soft Comput. 27 (16), 11259â11274. https://doi.org/10.1007/s00500-023-08587-x (2023).
Funding
Open access funding provided by The Science, Technology & Innovation Funding Authority (STDF) in cooperation with The Egyptian Knowledge Bank (EKB).
Author information
Authors and Affiliations
Contributions
This work was carried out in collaboration among all authors. All Authors designed the study, performed the statistical analysis, and wrote the protocol. All authors managed the analyses of the study, managed the literature searches, and wrote the first draft of the manuscript. All authors read and approved the final manuscript.
Corresponding authors
Ethics declarations
Competing interests
The authors declare no competing interests.
Ethical statement
All procedures performed in studies involving human participants were by the ethical standards of the institutional and/or national research committee and with the 1964 Helsinki Declaration and its later amendments or comparable ethical standards.
Consent statement
Informed consent was obtained from all individual participants included in the study.
Trial registration
This study employed a crosssectional design to examine workrelated musculoskeletal disorders among faculty members at universities in AlMinia Governorate, Egypt. Conducted between June and December 2024, the study protocol received ethical approval from Deraya Universityâs Institutional Review Board (Approval No. DCSR01002419). This investigation pursued two primary objectives assessing current prevalence rates of musculoskeletal disorders among academic staff and developing classification models for pain assessment. The methodology incorporated both populationlevel epidemiological analysis and individualized risk classification through standardized data collection procedures.
Additional information
Publisherâs note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the articleâs Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the articleâs Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Fouad, D.M., Mahfouz, M.M., Mohamed, M.M. et al. Classification of musculoskeletal pain using machine learning. Sci Rep 15, 27158 (2025). https://doi.org/10.1038/s41598-025-12049-9
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41598-025-12049-9