Introduction
The global older population is projected to double to 1.5 billion by 2050 [
1], with China facing significant aging challenges. By 2021, China had 264 million older adults, expected to comprise a quarter of its population by 2025 [
2]. Chronic pain is one of the prevalent and costly health problems in older adults that limits mobility and reduces quality of life [
3]. Studies have shown that the incidence of chronic pain among older adults is significantly higher than in the general population, about 40-80%, and this proportion rises with age [
4]. Given China’s large aging population and high chronic pain prevalence, greater attention is needed for this group.
Mild cognitive impairment (MCI) is a transition state from normal cognitive aging to dementia. It is characterized by a progressive decline in cognitive function that does not meet criteria for the diagnosis of dementia and is the best “window of intervention” for dementia prevention [
5]. Older adults are at high risk of developing MCI, and those with chronic pain are at an even higher risk of cognitive impairment, with prevalence exceeding 50% [
6]. Moreover, chronic pain and MCI often interact, increasing dementia risk [
3]. Fortunately, MCI has the potential to reverse [
5], making early detection in older adults with chronic pain critical for healthy aging. The US Preventive Services Task Force also recommends early prevention of MCI and optimizing assessment tools [
7].
Common MCI assessment tools like the Mini-Mental State Examination (MMSE), Informant Questionnaire on Cognitive Decline in the Elderly (IQCODE), Montreal Cognitive Assessment Scale (MoCA), and Self-administered Dementia Screening Questionnaire (p-AD8) are valuable, and annual cognitive health assessments are recommended for older adults [
8]. However, 29%-76% of people with cognitive impairment fail to be diagnosed promptly, making early prevention of MCI a challenge [
9]. These tools are time-consuming and their cut-off values need to be further clarified [
5]. Moreover, traditional methods, based on neuropsychological tests, often result in later-stage diagnoses [
10]. Prediction models enable earlier identification of high-risk individuals by integrating specific MCI risk factors, thus addressing the limitation of late diagnosis in traditional tools and providing a more comprehensive and targeted assessment. Therefore, developing such models for older patients with chronic pain are upstream approaches to preventing MCI.
Previous studies have explored the complex relationship between chronic pain and MCI, but few have focused on identifying MCI risk in older patients with chronic pain. Although many risk factors for MCI in older adults are worth considering [
11], this needs further validation in this specific subgroup. Moreover, it remains unclear which variables have higher predictive value. Although MCI prediction models have been developed for older patients with diabetes and chronic kidney disease, etc [
12,
13]. , no such models exist for older patients with chronic pain. Besides, most existing models rely on logistic regression methods, and their accuracy and practicality require further optimization.
Machine learning has shown its strong potential in identifying MCI risk. Unlike traditional methods, it can uncover hidden relationships between risk factors and highlighting the most predictive ones [
14]. However, the lack of clarity about the reasons behind machine learning decisions can hinder trust and usability among nurses. To address this, the Shapley Additive Explanations (SHAP) method can show how risk factor influences the model’s identification of MCI risk [
10]. Specifically, SHAP method highlights the most important variables for MCI risk and explain how a single variable, such as pain level or age, or all included variables, affect MCI risk for each individual. SHAP makes it easier for nurses to use machine learning models in clinical settings by explaining the results of MCI risk and variables analyzed by the model in a way that nurses can understand, helping them better assess MCI risk and develop personalized care plans that target specific risk factors early, thereby improving patient outcomes [
10].
Therefore, this study aims to determine MCI risk factors in older adults with chronic pain and develop explainable machine learning models to identify MCI risk. The findings will help nurses detect high-risk patients early and develop personalized care strategies to reduce MCI incidence.
Methods
Study design
This cross-sectional study collected data through face-to-face interviews with older patients with chronic pain, including general data, pain level, depression, sleep quality, and MCI. We then developed 9 machine learning models to identify MCI risk and interpreted the best model using the SHAP method. The report of this study complies with the TRIPOD statement [
15].
Participants and sample size
In this study, 612 older patients with chronic pain were recruited from the Pain Department of a tertiary general hospital in Nanchang, China, between October 2023 and July 2024 using convenience sampling. Inclusion criteria: (1) aged ≥ 60 years; (2) meet the International Association for the Study of Pain (IASP) diagnostic criteria for chronic pain, that is, pain duration ≥ 3 months, daily or almost daily pain, visual analogue scale ≥ 3 points [
16]; (3) able to communicate and understand the questionnaire. Exclusion criteria: (1) suffering from malignant tumors; (2) severe neurological, hematological, or immune diseases; (3) severe dysfunction of major organs such as heart, kidney, or liver; (4) being diagnosed with dementia.
Sample size was calculated based on the principle that event per variable (EPV) ≥ 10 [
17]. 16 variables were expected to be included in this study, considering a loss to follow-up rate of 10%-20%, so the minimum sample size for modeling was 178. Since the modeled sample size represents 70% of the total sample, the total sample size is at least 255. A total of 612 patients were finally included and met this requirement.
Ethical considerations
The study was approved by the Medical Ethics Committee of the 1st Affiliated Hospital of Nanchang University (IIT2023461) and was conducted in accordance with the Declaration of Helsinki. All participants voluntarily agreed to participate and signed an informed consent form, and their personal information was anonymized. They were also informed of their right to refuse participation in the study at any stage.
Instruments
We selected clinically important variables based on panel discussions, literature review, and expert consultation. In order to ensure the rationality of variable selection, these variables were confirmed by two experts before inclusion.
Measures of outcomes.
The outcome of this study was the occurrence of MCI, which was diagnosed according to Petersen’s Criteria and the International Working Group on MCI [
18,
19]. The diagnostic criteria included: (1) subjectively reported memory loss lasting 3 months or more; (2) Montreal Cognitive Assessment Scale (MoCA) score < 26; (3) normal or mildly impaired activities of daily living (ADL) level, that is, ADL scale score < 22; (4) not meeting the diagnostic criteria for dementia as assessed by the Mini-Mental State Examination (MMSE); and (5) no special cause that may lead to cognitive decline. Patients meeting all 5 of the above criteria were diagnosed with MCI. A senior neurologist confirmed the final diagnosis.
MoCA is widely used internationally to assess cognitive function [
19]. It has 8 cognitive domains, including executive function, visuospatial, memory, attention, language, abstract thinking, naming, and orientation. The total score ranges from 0 to 30, with higher scores indicating better cognitive function. A score ≥ 26 indicates normal cognitive function, and a score < 26 suggests MCI.
The MMSE was developed by Folstein et al. [
20] to assess dementia. It consists of 5 dimensions: orientation, memory, attention and calculation, visual construction, and language, with a total score ranging from 0 to 30. Illiterate individuals scored < 17, individuals scored < 20 for primary school culture, individuals scored < 22 for secondary school culture, and individuals scored < 23 for university culture suggesting the presence of dementia.
The ADL scale was developed by Lawton and Brody [
21] to assess the level of independence in ADL. It consists of 14 items with a total score ranging from 14 to 56. Higher scores indicate lower functional independence. A score of 14 indicates normal independence in ADL, and a score of 15–22 indicates mildly impaired independence in ADL.
Measurement of variables
We developed a general data questionnaire for the collection of demographics and disease-related characteristics. The questionnaire consists of 13 items, including: age, sex, education level, monthly household income, body mass index (BMI), employment status, marital status, living arrangement, smoking, alcohol consumption, number of pain sites, pain characteristics (for multiple pain characteristics, pain characteristics was determined based on their primary complaint, defined as the most bothersome pain characteristic that best represented themselves), and pain duration (for multiple pain sites, the longest pain duration was recorded).
Visual analogue scale (VAS) was used to assess pain level [
22]. Participants were asked to rate their average pain intensity over the past week. When using, place the graduated side of the ruler back toward the patient, having the patient mark the location on the ruler that best represents their average pain level in the past week, and then the assessor assesses the score according to the location of the mark. VAS total scores range from 0 (none) to 10 (very), with higher scores indicating more severe pain.
The 15-item geriatric depression scale (GDS-15), developed by Yesavage et al. [
23], assesses depression in older adults. The scale consists of 15 items, each scored 0 or 1, and the total score ranges from 0 to 15, with higher scores indicating more severe depression. A score of 0–4 indicates no depression, 5–8 indicates mild depression, 9–11 indicates moderate depression, and 12–15 indicates severe depression.
The Pittsburgh Sleep Quality Index (PSQI) was developed by Buysse et al. [
24] to assess sleep quality. The scale includes 19 self-rated items and 5 other-rated items, with total scores ranging from 0 to 21. Higher scores indicate poorer sleep quality.
Data collection
Prior to data collection, we set up a research team and uniformly trained the panelists. Only those passing the assessment conducted data collection. Patients were fully informed about the study and had sufficient time to decide whether to participate.
Data were collected through face-to-face interviews using standardized instructions in the hospital classroom or ward. The primary purpose of the interviews was to help participants accurately complete the questionnaire. In order to minimize the risk that face-to-face interactions might influence the responses of participants, interviewers were trained to provide neutral assistance and avoid any form of guidance or suggestion that could sway participants’ answers. Participants were encouraged to answer honestly; their questions or doubts were cleared promptly. For those unable to complete the questionnaire independently, interviewers provided explanations and completed the questionnaire on their behalf. Completed questionnaires were collected immediately.
Afterward, we conducted a rigorous questionnaire review and excluded those invalid questionnaires with logic error, and regular answers. To ensure accuracy, all data were cross-checked by two persons before entry, and 10% of the data were regularly reviewed. A total of 635 questionnaires were distributed, and 612 were valid, with an effective recovery rate of 96.4%.
Statistical analysis
Statistical analysis was performed using SPSS 25.0 and Python 3.11, with P < 0.05 was considered statistically significant. Normally distributed measurement data are expressed as mean ± standard deviation (M ± SD), non-normally distributed measurement data as median and quartile, and the enumeration data are expressed as frequency and percentage. The t-test and Mann-Whitney U test were used to compare the measurement data, and chi-square test was used to compare enumeration data.
First, we preprocessed the data. Since no missing data were identified in the study, the dataset was randomly divided into a training set (70%) and a testing set (30%). The training set was used to develop the model, while the testing set was used to evaluate and interpret the model. The Min-Max Normalization method was used to normalize data to the range of 0–1. Considering the potential linear and nonlinear relationships between MCI and variables in our cross-sectional data, we used LASSO and Support Vector Machine-Recursive Feature Elimination (SVM-RFE) for variable selection. LASSO assumes a linear relationship between MCI and variables and selects variables by reducing irrelevant coefficients to zero, while SVM-RFE ranks the importance of variables to capture nonlinear relationships. This complementary approach ensures the variables selected are both statistically robust and clinically relevant, enhancing model’s interpretability [
14]. Given the small number of MCI-positive samples in our study, SMOTETomek comprehensive sampling was used to balance the data. SMOTETomek generates synthetic samples for the minority class (MCI-positive cases) by interpolating between existing samples, achieving a 1:1 balance between MCI-positive and non-MCI cases, which improves model accuracy and reducing bias in detecting MCI [
25].
After data processing, we developed 9 machine learning models [
14]. These models included Logistic Regression (LR), Adaptive Boosting (AdaBoost), Support Vector Machine (SVM), eXtreme Gradient Boosting (XGBoost), K-Nearest Neighbors (KNN), Stacking, Gradient Boosting Decision Tree (GBDT), Random Fores (RF), and Light Gradient Boosting Machine (LightGBM). These models were selected for their diverse representation of machine learning approaches, encompassing single, ensemble, and probabilistic models. All suited for analyzing MCI risk factors in cross-sectional data. Specifically, AdaBoost identifies MCI risk by focusing more on hard-to-analyze risk factors. SVM is good at analyzing the complex relationships among MCI risk factors. KNN flexibly handles both continuous and categorical variables (e.g., age and education level) contained in our MCI dataset. LightGBM, RF, XGBoost, and GBDT excel at handling our large, multivariate MCI dataset. Stacking can comprehensively explore the linear and nonlinear relationships between MCI and variables. Hyperparameters were tuned using grid search to optimize performance. Model’s evaluation metrics included accuracy (proportion of correct predictions), precision (true positive rate among predicted positives), recall (true positive rate among actual positives), F1 values (balance of precision and recall), specificity (true negative rate), sensitivity (true positive rate), Receiver Operating Characteristic (ROC) curves, Area Under the Curve (AUC), Calibration curves, and Brier scores (probabilistic accuracy), and Decision curves analysis (DCA) [
14]. AUC differences between models were compared using DeLong’s test. To minimize random errors, all metrics were calculated using 10-fold cross validation. Finally, to enhance interpretability, the SHAP method was used to assess variable importance and analyze how variables influenced MCI risk [
10].
Discussion
This study aimed to enhance the cognitive health of older patients with chronic pain by identifying risk factors for MCI and developing explainable machine learning models for MCI risk assessment. We determined 7 variables significantly associated with MCI: pain level, age, depression, education level, pain duration, sleep quality, number of pain sites. The XGBoost model performed best, with pain level, age, and depression identified as the three most important variables. The prediction model developed in this study offers nurses with a practical tool for early and individualized MCI risk assessment, and identified risk factors can serve as the focus of targeted assessment and intervention in nursing practice.
This study showed that the incidence of MCI in older patients with chronic pain was 27.6%, higher than the global average for the older population (15.5%) but lower than the 54.4% reported by Moriya et al. in chronic pain clinics [
3,
26]. This may stem from differences in sample size and assessment methods. Nevertheless, cognitive issues in this population warrant greater attention. On the one hand, healthcare providers pay significantly insufficient attention to their cognitive impairment, with actual clinical diagnosis rates below 5% [
6]. On the other hand, both chronic pain and MCI can be mitigated by intervention [
27], emphasizing the necessity of early identification of high-risk patients for developing care strategies.
Consistent with previous findings [
11], this study confirms a positive association between age and MCI risk. The SHAP feature importance plot further identified age as the second most important variable for MCI risk. This is not surprising, as aging is closely linked to numerous risk factors. Advanced age exacerbates the interaction between chronic pain, white matter hyperintensities (WMH), and hippocampal atrophy and increases the likelihood of multiple chronic comorbidities [
28]. Aging also often leads to diminished social capabilities, further compounding MCI risk [
29]. Therefore, nurses should focus on cognitive screening and follow-up plans tailored to different age groups, while enhancing chronic disease management and psychosocial support. This study also showed that patients with lower education levels were more likely to develop MCI, consistent with previous research [
30]. This may be due to reduced synaptic density in the cerebral cortex and insufficient stimulation of brain cells, which hinder the maintenance of cognitive function [
11]. Given that more than 65% of patients in this study had an education level of primary school or below, nurses should implement health education programs, encourage patients to engage in lifelong learning, and guide family members to participate in cognitive health management efforts.
This study identified pain level as the most important variable positively associated with MCI risk, as highlighted by SHAP feature importance analysis. This novel finding can be explained by existing research [
31]. Chronic pain has been associated with alterations in the cerebral cortex and gray matter, and elevated cortisol levels, which impair hippocampal synaptic plasticity. Chronic pain, the most common symptom of patients, also triggers a cascade of adverse effects, including depression and activity limitations, often creating a vicious cycle that further deteriorates cognitive function. Notably, we observed an association between the number of pain sites and increased MCI risk, a finding supported by Zhao et al., who reported that chronic pain at multiple sites correlates with more severe cognitive impairment and hippocampal atrophy [
32]. In addition, our study found that pain duration was positively associated with MCI risk overall. Interestingly, however, unlike the linear relationship reported in previous study [
33], our SHAP dependence plot revealed an inverted “U” curve in the relationship between pain duration and MCI risk, indicating that when pain duration exceeded one year, MCI risk decreased. The “adaptation hypothesis” may offer an explanation for this phenomenon: chronic pain initially induces increased stress and neuroinflammation; however, over time, the brain compensates for sustained pain by utilizing alternative coping mechanisms, leading to psychological adaptation and cognitive resilience, which mitigates cognitive decline [
34]. Moreover, as time progresses, the pain and cognitive self-management skills acquired by patients may help reduce MCI risk. Nurses should prioritize comprehensive and regular pain assessments, including assessments of pain level, duration, and number of pain sites. In the early stages of chronic pain, nurses should prioritize cognitive screenings and address potential risk factors for MCI. As pain duration increases, the focus should shift towards maintaining functional independence, enhancing coping strategies, and promoting social engagement to mitigate the long-term cognitive effects of chronic pain.
The SHAP feature importance plot identified depression as the third most important variable associated with MCI risk. This finding aligns with previous research, which has shown that depression contributes to increased cortical amyloid-beta deposition. Moreover, depression and chronic pain often co-occur, and their synergistic effects, compounded by their adverse impact on sleep health, significantly exacerbate cognitive impairment [
35]. Our study also confirmed that sleep quality significantly impacts MCI risk, consistent with previous research [
36]. Long-term poor sleep quality may reduce acetylcholine and monoamine neurotransmitters levels in the brain, impairing memory and cognitive function [
37]. Therefore, regular depression screening and sleep quality monitoring should be integral to cognitive health care strategies. Nurses should promote cognitive behavioral therapy and relaxation techniques to manage depression. Additionally, they should encourage patients to adopt proper sleep hygiene practices, including consistent sleep schedule and minimizing screen exposure before bedtime. However, unlike the findings of Jia et al. [
26], this study failed to find a significant association between smoking, alcohol consumption, and MCI. We speculate that the cross-sectional design, which cannot assess temporal causality, along with the small sample size and the rigorous variable selection methods, may have limited our ability to detect these complex relationships. Moreover, hypertension and hyperlipidemia may have mediated their effects on MCI risk, potentially obscuring any direct associations. But given inherent health risks of smoking and alcohol consumption, promoting a healthy lifestyle remains essential.
Given the lack of prediction models for early identification of MCI in older patients with chronic pain, we developed machine learning models to address this gap. Among these, the XGBoost model performed best, with an AUC of 0.925 (95%
CI 0.863–0.995). In comparison, Jiang et al.'s traditional diabetes-based MCI prediction model reported an AUC of 0.893 [
12], while Huang et al.'s MCI logistic regression model for middle-aged and older adults achieved an AUC of 0.870 [
38]. These findings highlight the superiority of machine learning models over traditional approaches, as traditional models often struggle to capture the intricate, nonlinear relationships between MCI and risk factors. XGBoost excels at handling complex, large datasets, effectively capturing both linear and nonlinear associations to enhance MCI prediction accuracy [
10], as evidenced by the superior performance observed in our study. Although some traditional models, like Xu et al.'s (AUC 0.897) [
13], achieve comparable performance, they can only explain the MCI risk at the overall level and overlook nuanced insights and fail to account for complex interactions between variable like depression and sleep quality, thereby limiting their clinical applicability. By contrast, our SHAP-based machine learning model provides a comprehensive interpretation, offering precise and personalized guidance for clinical practice. For example, using SHAP feature importance plot, we identified pain level, age, and depression as the three most important variables influencing MCI risk in older patients with chronic pain, which had not been reported previously. These results not only highlight priority areas for future MCI research but also offer actionable insights for nursing practice. Nurses can focus MCI prevention efforts on efficient pain management, regular depression screening, and prioritizing care for older adults. SHAP summary, decision, and dependence plots further clarify the individual and combined effects of these critical variables on MCI risk. For example, by identifying patients at high risk due to severe pain or depression, nurses can prioritize these factors and initiate personalized nursing management for pain and psychology early. Moreover, SHAP waterfall plots provide detailed, patient-specific visualizations of MCI risk, enabling nurses to allocate resources more effectively and plan targeted interventions. In contrast, traditional models lack the capability to prioritize risk factors or offer individualized insights, leaving nurses without clear guidance for targeted prevention strategies. In summary, these explainable techniques optimize traditional one-size-fits-all MCI management strategies and demonstrates unique advantages in developing detailed, personalized MCI assessments [
25].
This study offers valuable insights for future research and practical applications in nursing. First, identifying MCI risk factors equips nurses with specific indicators for closely monitoring patients and developing targeted interventions. Future studies should examine whether these risk factors apply to specific chronic pain conditions such as trigeminal neuralgia and lumbar disc herniation, thus further refining nursing strategies. Second, as our model was developed using data from the Chinese population, nurses in other regions should validate and adapt the model to ensure its applicability in local settings. Third, we advocate a multidisciplinary approach to the management of MCI and chronic pain. Nurses should work with other healthcare professionals like pain specialists, neurologists, psychologists to develop a comprehensive care plan. Furthermore, this prediction model enables nurses to integrate regular MCI risk screening for older patients with chronic pain into routine assessments. Such proactive approach supports secondary prevention by facilitating early detection and intervention, as well as tertiary prevention by identifying patients at risk of worsening or recurrent MCI, allowing timely adjustments to care plans [
26,
39].
To our knowledge, this study is the first to develop machine learning models to identify MCI risk in older patients with chronic pain. The study has several key advantages: First, the integration of LASSO regression and SVM-RFE methods for variable screening ensures more rational variable selection. Most of the selected variables are modifiable, increasing the potential for targeted interventions. Second, we developed 9 representative machine learning models, enhancing the ability to identify MCI. Moreover, we used multiple evaluation metrics to ensure the comprehensive model assessment. Finally, the model is efficient, easy to use, and visualized using the SHAP method, which significantly improves its practical applicability.
Limitation
The cross-sectional design restricts our ability to infer causal relationships between variables and MCI. Longitudinal studies are needed to establish causality. The study population consisted exclusively of Chinese older adults, which may limit the cultural generalizability of the model. The comprehensiveness of cognitive health data varies across healthcare systems, and different cultural attitudes toward pain and cognitive health may affect the reliability of symptom reporting, thereby influencing the model’s performance and usability. Therefore, we recommend that future studies conduct collaborative, multicenter research across diverse populations with different cultural and ethnic backgrounds to validate the model. Given the cross-sectional design of this study, the temporal relationship between medical history and MCI risk could not be fully assessed. Furthermore, since the study primarily focused on pain-related psychosocial factors, variables such as medical history, medication history, comorbidities, and laboratory measures were excluded, which may have influenced the model’s performance. However, the use of non-invasive variables enhances the model’s applicability in community and primary care settings. Furthermore, some variables, such as depression and sleep quality, were based on self-report data, which may introduce biases and affect the reliability of the model. Finally, advanced machine learning algorithms like deep learning were not considered. Future studies should address these limitations.
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.