A multimodal prediction method and system for chronic pain comorbid mood disorders

CN122967978APending Publication Date: 2026-10-23FIRST HOSPITAL OF SHANXI MEDICAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611224296.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-13
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0012]为解决现有慢性疼痛共病情感障碍预测方法中固定流水线适应性差、缺失模态处理能力不足、多任务适配能力弱、算法模块不可动态组合、预测解释不闭环以及新增模型扩展困难的技术问题,本发明提出了一种基于粗到细技能匹配与多智能体闭环协同的慢性疼痛共病情感障碍多模态预测方法及系统

Benefits of technology

[0046]第一,本发明将慢性疼痛共病情感障碍预测中常用的数据质控、特征构建、特征筛选、降维、融合、预测、校准、解释和建议生成算法统一封装为预测技能,并通过技能元数据描述其输入、输出、适用条件和历史性能,提高了算法模块的可组合性和可扩展性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122967978A_ABST
    Figure CN122967978A_ABST
Patent Text Reader

Abstract

The present application belongs to the field of medical artificial intelligence and multi-modal clinical prediction, and specifically relates to a chronic pain comorbid emotional disorder multi-modal prediction method and system based on coarse-to-fine skill matching and multi-agent closed-loop cooperation. To solve the technical problems of poor adaptability of the existing fixed pipeline, insufficient processing capacity of missing modal, weak multi-task adaptation ability, algorithm module cannot be dynamically combined, prediction explanation is not closed-loop, and new model expansion is difficult in the chronic pain comorbid emotional disorder prediction method. The present application comprises: acquiring multi-modal data of patients, constructing a prediction skill library, constructing a multi-agent closed-loop cooperation network, analyzing clinical prediction requirements, filtering prediction skills from coarse to fine, generating a candidate skill chain, executing the candidate skill chain, ranking and fusing candidate outputs, feedback repairing low confidence or conflict outputs, and generating risk prediction results and auxiliary suggestions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of medical artificial intelligence, chronic pain management, emotional disorder risk prediction, multimodal data fusion, multi-agent systems, and clinical decision support technology, specifically to a multimodal prediction method and system for emotional disorders associated with chronic pain. Background Technology

[0002] Chronic pain is a disease state characterized by its long duration, complex pathological mechanisms, and highly heterogeneous clinical manifestations. Unlike acute pain, chronic pain is often not merely a direct reflection of tissue damage or peripheral nerve stimulation, but is associated with multiple factors, including central sensitization, autonomic nervous system regulation, mood regulation, sleep rhythm, cognitive appraisal, social function, and long-term disease burden. Patients with chronic pain often experience emotional or psychological problems such as depression, anxiety, sleep disturbances, pain catastrophizing, reduced activity, decreased social participation, and reduced quality of life. These comorbidities not only affect patients' subjective pain experience but may also influence treatment adherence, drug response, recovery speed, and long-term prognosis.

[0003] In clinical practice, the identification of comorbid affective disorders in chronic pain typically relies on pain scores, depression and anxiety scales, sleep scales, and physician interviews. While this approach is clinically interpretable, it suffers from limitations such as high subjectivity, limited information dimensions, and difficulty in capturing dynamic changes in a timely manner. With the development of wearable devices, physiological signal acquisition, medical imaging, electronic medical records, and mobile health data, the state of patients with chronic pain can be characterized through multiple modalities. For example, pain assessment scales can reflect pain intensity and pain interference, mood scales can reflect the degree of depression and anxiety, sleep data can reflect sleep quality and rhythm changes, physiological signals such as heart rate variability can reflect the state of autonomic nervous system regulation, behavioral activity data can reflect the degree of functional limitation, and medical imaging features can reflect brain functional or structural changes related to pain and emotion regulation.

[0004] In recent years, machine learning and deep learning methods have been applied to chronic pain assessment, depression risk prediction, anxiety risk prediction, sleep disorder identification, and personalized treatment response prediction. Common methods include high-dimensional feature reduction based on principal component analysis, sparse feature screening based on LASSO regression, risk prediction based on random forest or gradient boosting models, multimodal fusion based on neural networks, and feature contribution interpretation based on methods such as SHAP. These methods provide a foundation for intelligent prediction of comorbid affective disorders in chronic pain.

[0005] However, existing predictive technologies for comorbid affective disorders in chronic pain still have the following prominent drawbacks. First, existing predictive models typically employ a fixed pipeline, meaning that the order of data cleaning, feature construction, feature selection, multimodal fusion, and risk prediction is predetermined. This approach can achieve certain results when the distribution of training and test set data is stable, but in real-world clinical scenarios, patient data modalities are often inconsistent. Some patients only have pain and mood scales, some have sleep and wearable data, and some have heart rate variability or brain imaging data. A fixed pipeline makes it difficult to dynamically adjust the algorithm path based on available modalities, resulting in insufficient applicability of the model in scenarios with missing modalities.

[0006] Second, predicting comorbid affective disorders in chronic pain has a distinctly multi-task nature. Physicians may want to predict the risk of depression, anxiety, sleep disorders, pain catastrophizing, comprehensive affective disorders, or follow-up priorities. The data modalities, feature construction methods, and model interpretation focuses differ for each predictive objective. For example, anxiety risk prediction may rely more on autonomic nerve signals, sleep quality, and anxiety scales, while pain catastrophizing risk prediction may rely more on pain cognition, pain interference, and behavioral avoidance. Using a single, fixed pipeline to process all tasks can easily lead to task misfitting.

[0007] Third, algorithms such as principal component analysis, LASSO regression, multimodal fusion, risk prediction, and interpretive analysis are already relatively mature, and using these algorithms alone is unlikely to lead to stable technological innovation. The truly valuable challenge lies in how to encapsulate these algorithms into skills that are registerable, callable, replaceable, composable, and evaluable, and dynamically select appropriate skill combinations based on clinical tasks, patient phenotypes, available modalities, and historical performance. In existing technologies, algorithms are typically embedded within the system as code modules or model files, lacking a unified skill metadata description and an automatic combination mechanism based on the semantic relationships between skill inputs and outputs.

[0008] Fourth, existing multi-agent medical systems are mostly used for clinical question answering, diagnostic reasoning, medical text analysis, or multi-role discussions. While these systems can simulate collaborative reasoning among multiple experts, they typically lack an executable algorithm skill library for specific multimodal medical prediction tasks, and they haven't formed a complete closed loop from task parsing, modality filtering, phenotypic filtering, target filtering, skill chain execution, result fusion, to feedback and correction. Simply having multiple agents analyze data separately and summarize conclusions still makes it difficult to guarantee the stability, scalability, and reproducibility of the prediction process.

[0009] Fifth, the predictive results for comorbid affective disorders in chronic pain need to be highly interpretable and traceable. Physicians not only need to know whether a patient is at low, medium, or high risk, but also which modalities, features, and algorithmic paths contribute to that risk. For example, the system should be able to explain that high-risk outcomes primarily stem from elevated pain interference scores, decreased sleep quality, reduced heart rate variability, decreased activity levels, or abnormal brain imaging features. Traditional end-to-end black-box models struggle to retain intermediate states from each algorithmic step and cannot automatically switch to alternative algorithmic paths when prediction confidence is low or when conclusions from different modalities conflict.

[0010] Sixth, the existing model has insufficient scalability. With the emergence of new chronic pain data modalities, new prediction models, and new interpretation algorithms, established systems often require retraining or redesigning processes to incorporate new models. If new models lack range control, it may also affect the stability of existing tasks. Therefore, an incremental skill set expansion mechanism is needed to allow new algorithmic skills to be gradually incorporated into the system without compromising existing predictive capabilities.

[0011] In summary, existing technologies have not yet provided a method or system for multimodal prediction tasks of chronic pain comorbidity affective disorders that can encapsulate multiple algorithms into predictive skills and perform clinical task parsing, coarse-to-fine skill matching, execution of multiple candidate skill chains, ranking-aware fusion, feedback repair, and incremental expansion evaluation through multi-agent systems. Summary of the Invention

[0012] To address the technical problems of existing methods for predicting chronic pain comorbidity affective disorders, such as poor adaptability of fixed pipelines, insufficient capacity to handle missing modalities, weak multi-task adaptability, inability to dynamically combine algorithm modules, lack of closed-loop prediction interpretation, and difficulty in expanding new models, this invention proposes a multimodal prediction method and system for chronic pain comorbidity affective disorders based on coarse-to-fine skill matching and multi-agent closed-loop collaboration.

[0013] To achieve the above objectives, the present invention employs the following technical solution:

[0014] This invention provides a multimodal prediction method for comorbid affective disorders in chronic pain, comprising the following steps:

[0015] Step S1: Obtain multimodal data of patients with chronic pain and standardize the multimodal data; the multimodal data includes at least two of the following: patient basic information, pain assessment scale, emotion assessment scale, sleep assessment data, physiological signal data, behavioral activity data, medical imaging data, laboratory test data, and electronic medical record text data.

[0016] Step S2: Construct a prediction skill library for predicting comorbid affective disorders of chronic pain. The prediction skill library includes multiple algorithm skills. Each algorithm skill is configured with a skill identifier, skill type, input modality constraints, output semantic type, clinical task label, patient phenotype label, applicable conditions, historical performance indicators, failure mode, and calling interface.

[0017] The predictive skill library in this invention is used to manage multiple executable algorithmic skills. Each algorithmic skill is described in a unified metadata format, which includes at least a skill identifier, skill type, input modality constraints, output semantic type, clinical task label, patient phenotype label, applicable conditions, historical performance indicators, failure modes, and invocation interface. This structure clearly defines what inputs each skill can process, what outputs it can generate, what tasks it is suitable for, and under what conditions it is not advisable to invoke it.

[0018] The prediction skill library in this invention supports incremental expansion. When a new algorithm skill is added, the skill metadata of the new algorithm skill is written into the prediction skill library, and the impact of the new algorithm skill on the original skill chain matching results and prediction results is evaluated on the existing benchmark task set. When the impact exceeds a preset threshold, the activation scope of the new algorithm skill is restricted.

[0019] The incremental expansion mechanism of the skill library in this invention supports the addition of new algorithmic skills. When a new electronic medical record text encoding skill, brain image feature processing skill, deep fusion model, or new interpretation algorithm is added, only the corresponding skill metadata and calling interface need to be registered, and it can be invoked in the appropriate task through a coarse-to-fine matching mechanism. To avoid the addition of skills disrupting the stability of the original tasks, the impact of the new skills on the original matching and prediction results is evaluated on an existing set of benchmark tasks, and the scope of activation of the new skills is limited according to the degree of impact.

[0020] Step S3: Construct a multi-agent closed-loop collaborative network, which includes a clinical task parsing agent, a modality filtering agent, a phenotypic filtering agent, a target filtering agent, a skill selection agent, a skill chain execution agent, an outcome evaluation agent, a feedback repair agent, and an auxiliary suggestion generation agent.

[0021] The multi-agent closed-loop collaborative network in this invention is not a simple parallel expert discussion structure, but a hierarchical agent system oriented towards algorithmic skill scheduling. The clinical task parsing agent is responsible for parsing the doctor's input or research task into structured task information; the modality filtering agent is responsible for filtering executable skills based on available patient data modalities; the phenotypic filtering agent is responsible for filtering suitable skills based on chronic pain type and patient clinical background; the goal filtering agent is responsible for filtering task-related skills based on predicted goals; the skill selection agent is responsible for combining candidate skills and generating candidate skill chains; the skill chain execution agent is responsible for executing candidate skill chains; the result evaluation agent is responsible for sorting and fusing multiple candidate results; the feedback repair agent is responsible for readjusting the skill chain when results are unstable; and the auxiliary suggestion generation agent is responsible for generating individualized auxiliary intervention suggestions for doctors' reference.

[0022] Step S4: The clinical task parsing agent parses the input clinical prediction requirements into structured task information, which includes the target population, pain phenotype, available modalities, prediction target, prediction time window, output requirements, and interpretation requirements.

[0023] Step S5: Based on the structured task information, the modality filtering agent, phenotypic filtering agent, and target filtering agent sequentially perform coarse-to-fine filtering on the algorithm skills in the prediction skill base to obtain a candidate skill set.

[0024] Step S6: The skill selection agent generates at least one candidate skill chain based on the candidate skill set. Each candidate skill chain includes at least three of the following: data quality control skills, feature construction skills, feature selection skills or dimensionality reduction skills, multimodal fusion skills, risk prediction skills, and interpretation and analysis skills.

[0025] Step S7: The skill chain execution agent executes the candidate skill chains to obtain the risk prediction results, prediction confidence, modal contribution, and patient-level explanatory factors corresponding to each candidate skill chain.

[0026] Step S8: The result evaluation agent sorts the outputs of multiple candidate skill chains based on input modality matching degree, modality quality score, historical performance index, prediction confidence, calibration error, interpretation consistency and computational cost, and performs ranking-aware fusion based on the sorting results to generate the final risk prediction result.

[0027] Step S9: When the confidence level of the final risk prediction result is lower than the preset confidence threshold, or the output difference of multiple candidate skill chains is greater than the preset difference threshold, the feedback repair agent triggers the selection of alternative skill chains, adjustment of modality weights, compensation for missing modalities, prediction calibration or fusion strategy switching, and regenerates the risk prediction result.

[0028] Step S10: Based on the final risk prediction results and patient-level explanatory factors, the auxiliary suggestion generator outputs the risk level of chronic pain comorbidity affective disorder, key influencing factors, and individualized auxiliary intervention suggestions for doctors' reference.

[0029] The coarse-to-fine skill matching mechanism in this invention reduces the risk of algorithm selection errors in complex tasks. This mechanism filters skills layer by layer based on available modalities, pain phenotypes, prediction targets, skill input-output semantics, historical performance, and computational constraints, ensuring that each agent only processes relatively well-defined sub-tasks. Compared to directly selecting the final model from all skills at once, coarse-to-fine matching reduces semantic interference and improves the stability of skill chain matching.

[0030] The multi-candidate skill chain execution mechanism in this invention is used to avoid random biases from a single model path. For the same patient and the same prediction target, the system can generate multiple candidate skill chains. For example, a scale-dominated skill chain can focus on pain and emotion scales; a physiological behavior-dominated skill chain can focus on heart rate variability, sleep, and activity data; and a multimodal fusion skill chain can integrate scale, physiological, behavioral, and imaging features. Different skill chains output risk results from different information perspectives, and the result evaluation agent then sorts and fuses them.

[0031] The ranking-aware fusion mechanism in this invention replaces simple averaging or fixed weighting. A comprehensive score is calculated for each skill chain based on input modality matching degree, modality quality score, historical performance indicators, prediction confidence, calibration error, interpretation consistency, and computational cost, and fusion weights are allocated according to this comprehensive score. Higher-ranked skill chains have a larger weight in the final prediction, while lower-ranked skill chains serve as auxiliary references. If the prediction directions of high-ranking skill chains are consistent, the final confidence is increased; if the prediction directions of high-ranking skill chains are opposite, feedback correction is triggered.

[0032] The feedback repair mechanism in this invention is used to form a prediction closed loop. When insufficient prediction confidence, modal conflict, excessive differences in skill chain output, excessive contribution from low-quality modalities, unstable interpretation results, or skill execution failure are detected, the feedback repair agent can re-invoke modal filtering, skill selection, missing modality compensation, prediction calibration, or alternative fusion skills to generate a repaired prediction result. Through this mechanism, the prediction result is not output all at once, but rather a closed loop of "prediction-evaluation-repair-repregnancy" is executed when necessary.

[0033] This invention also provides a multimodal prediction system for chronic pain comorbidity affective disorder, used to implement the method, comprising:

[0034] A multimodal data acquisition module is used to acquire multimodal data from patients with chronic pain.

[0035] The prediction skill library module is used to store multiple algorithmic skills and their skill metadata;

[0036] The clinical task parsing module is used to parse clinical prediction needs into structured task information;

[0037] The coarse-to-fine skill matching module is used to filter candidate skills step by step according to available modalities, pain phenotypes, prediction targets, skill semantics, and historical performance.

[0038] The skill chain generation and execution module is used to generate and execute at least one candidate skill chain.

[0039] The ranking-aware fusion module is used to sort and fuse the outputs of multiple candidate skill chains;

[0040] The feedback repair module is used to trigger alternative skill chain selection, modality weight adjustment, missing modality compensation, prediction calibration, or fusion strategy switching when prediction confidence is insufficient or modality conflicts occur.

[0041] The explanation and auxiliary suggestion module is used to output the risk level, key influencing factors, and individualized auxiliary intervention suggestions for doctors' reference;

[0042] The collaborative state caching module is used to record the task parsing results, candidate skill sets, candidate skill chains, skill execution results, prediction confidence, modal contribution, feedback and repair records, and final output results of each agent.

[0043] Furthermore, the prediction skill library module includes a skill registration unit, a skill metadata management unit, a skill performance update unit, and a skill activation scope control unit; the skill metadata management unit is used to maintain the input modal constraints, output semantic types, clinical task labels, patient phenotype labels, applicable conditions, historical performance indicators, failure modes, and calling interfaces of the algorithm skills.

[0044] The present invention also provides a readable storage medium storing a computer program that, when executed by a processor, implements the method described herein.

[0045] Compared with the prior art, the present invention has the following advantages:

[0046] First, this invention encapsulates commonly used data quality control, feature construction, feature selection, dimensionality reduction, fusion, prediction, calibration, interpretation, and suggestion generation algorithms in the prediction of chronic pain comorbidity affective disorders into a unified prediction skill. It also describes the input, output, applicable conditions, and historical performance through skill metadata, thereby improving the composability and scalability of the algorithm modules.

[0047] Second, this invention constructs a coarse-to-fine skill matching mechanism through clinical task parsing, modality filtering, phenotypic filtering, target filtering, and skill semantic filtering, enabling the system to dynamically generate skill chains based on the data modalities, pain phenotypes, and predicted targets of different patients, thus solving the technical problem that traditional fixed pipelines are difficult to adapt to clinical heterogeneity.

[0048] Third, this invention enables the system to integrate the results of multiple prediction paths through a multi-candidate skill chain execution and ranking-aware fusion mechanism, and to allocate fusion weights based on modal quality, prediction confidence, calibration error and interpretation consistency, thereby improving prediction stability and robustness.

[0049] Fourth, this invention improves the reliability of the system in complex clinical scenarios by triggering alternative skill chain selection, modality weight adjustment, missing modality compensation, and fusion strategy switching when the feedback repair agent triggers low confidence, modality conflict, or skill execution failure.

[0050] Fifth, this invention supports the addition of new modalities, new models, and new interpretation algorithms through an incremental expansion mechanism of the skill library. It can expand the predictive capability without completely reconstructing the system, and control the impact of new skills on the original tasks through extended stability evaluation. Attached Figure Description

[0051] Figure 1 This is a schematic diagram of the overall process of the multimodal prediction method for chronic pain comorbid affective disorders of the present invention;

[0052] Figure 2 This is a schematic diagram of the multi-agent closed-loop cooperative network structure of the present invention;

[0053] Figure 3 This is a schematic diagram of the predicted skill base and skill metadata structure of the present invention;

[0054] Figure 4 This is a schematic diagram of the coarse-to-fine skill matching process of the present invention;

[0055] Figure 5 This is a schematic diagram of the multi-candidate skill chain generation and execution process of the present invention;

[0056] Figure 6 This is a schematic diagram of the ranking perception fusion process of the present invention;

[0057] Figure 7 This is a schematic diagram of the feedback repair and re-prediction process of the present invention;

[0058] Figure 8 This is a schematic diagram of the incremental expansion and stability evaluation process of the skill library in this invention;

[0059] Figure 9 This is a schematic diagram of the module structure of the system of the present invention. Detailed Implementation

[0060] To further illustrate the technical solution of the present invention, the present invention will be further described below through embodiments.

[0061] In the description of this invention, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. The term "intelligent agent" refers to a software functional unit capable of completing a specific sub-task based on input information, preset rules, model inference results, or algorithm execution results, and can be implemented by a large language model, rule engine, machine learning model, programmatic scheduler, or a combination thereof. The term "skill" refers to an algorithmic functional unit with clearly defined inputs, outputs, applicable conditions, and calling interfaces, and is not limited to a single model; it can also include data processing flows, feature extraction flows, model inference flows, or interpretation and analysis flows.

[0062] like Figures 1 to 8 As shown, this invention provides a multimodal prediction method for chronic pain comorbidity affective disorders based on coarse-to-fine skill matching and multi-agent closed-loop collaboration, comprising the following steps:

[0063] Step S1: Obtain multimodal data of patients with chronic pain and standardize the multimodal data; the multimodal data includes at least two of the following: patient basic information, pain assessment scale, emotion assessment scale, sleep assessment data, physiological signal data, behavioral activity data, medical imaging data, laboratory test data, and electronic medical record text data.

[0064] Among them, chronic pain patients include at least one of the following: chronic low back pain patients, neuropathic pain patients, fibromyalgia patients, chronic postoperative pain patients, bone and joint pain patients, chronic headache patients, and mixed chronic pain patients; pain assessment scales include at least one of the following: pain intensity score, pain duration, number of pain sites, pain interference score, pain catastrophizing score, and pain self-efficacy score; emotion assessment scales include at least one of the following: depression scale, anxiety scale, stress perception scale, anhedonia scale, and emotion regulation scale.

[0065] Step S2: Construct a prediction skill library for predicting comorbid affective disorders of chronic pain. The prediction skill library includes multiple algorithm skills. Each algorithm skill is configured with a skill identifier, skill type, input modality constraints, output semantic type, clinical task label, patient phenotype label, applicable conditions, historical performance indicators, failure mode and calling interface.

[0066] The algorithmic skills include at least two of the following: data quality control skills, principal component analysis skills, LASSO feature selection skills, heart rate variability feature construction skills, brain image feature processing skills, sleep rhythm feature construction skills, behavioral activity feature construction skills, electronic medical record text encoding skills, multimodal early fusion skills, multimodal mid-term fusion skills, multimodal late-term fusion skills, missing modality compensation skills, risk prediction skills, prediction calibration skills, feature contribution interpretation skills, modality contribution interpretation skills, counterfactual interpretation skills, and auxiliary suggestion generation skills.

[0067] Applicable conditions include at least one of the following: data modality type, sample size range, feature dimension range, missing rate range, modality quality threshold, pain phenotype, prediction target, prediction time window, computational resource constraints, and output interpretation requirements;

[0068] Historical performance metrics include at least one of AUC, F1 score, sensitivity, specificity, calibration error, net gain of decision curve, external validation performance, and runtime.

[0069] Step S3: Construct a multi-agent closed-loop collaborative network, which includes a clinical task parsing agent, a modality filtering agent, a phenotypic filtering agent, a target filtering agent, a skill selection agent, a skill chain execution agent, an outcome evaluation agent, a feedback repair agent, and an auxiliary suggestion generation agent.

[0070] Step S4: The clinical task parsing agent parses the input clinical prediction needs into structured task information, which includes target population, pain phenotype, available modalities, prediction target, prediction time window, output requirements, and interpretation requirements.

[0071] Step S5: Based on the structured task information, the modality filtering agent, phenotypic filtering agent, and target filtering agent sequentially perform coarse-to-fine filtering on the algorithm skills in the prediction skill base to obtain a candidate skill set.

[0072] The coarse-to-fine filtering process consists of: a first layer of filtering based on the patient's available modalities; a second layer of filtering based on the chronic pain phenotype; a third layer of filtering based on the prediction target; a fourth layer of filtering based on the semantic matching relationship between skill input and output; and a fifth layer of filtering based on historical performance indicators, calibration errors, interpretation requirements, and computational resource constraints.

[0073] Step S6: The skill selection agent generates at least one candidate skill chain based on the candidate skill set. Each candidate skill chain includes at least three of the following: data quality control skills, feature construction skills, feature selection skills or dimensionality reduction skills, multimodal fusion skills, risk prediction skills, and interpretation and analysis skills.

[0074] The candidate skill chains include at least one scale-dominated skill chain, at least one physiological behavior-dominated skill chain, and at least one multimodal fusion skill chain. The scale-dominated skill chain is used to process pain assessment scales and emotion assessment scales, the physiological behavior-dominated skill chain is used to process physiological signal data, sleep assessment data, and behavioral activity data, and the multimodal fusion skill chain is used to fuse features from at least two modalities and output a comprehensive risk prediction result.

[0075] Step S7: The skill chain execution agent executes the candidate skill chains to obtain the risk prediction results, prediction confidence, modal contribution, and patient-level explanatory factors corresponding to each candidate skill chain.

[0076] Step S8: The result evaluation agent sorts the outputs of multiple candidate skill chains based on input modality matching degree, modality quality score, historical performance index, prediction confidence, calibration error, interpretation consistency and computational cost, and performs ranking-aware fusion based on the sorting results to generate the final risk prediction result.

[0077] The ranking-aware fusion process includes the following steps:

[0078] Calculate a comprehensive score for each candidate skill chain; rank the candidate skill chains according to the comprehensive score; assign fusion weights related to the ranking to the ranked candidate skill chains; and perform weighted fusion of the risk probabilities output by each candidate skill chain according to the fusion weights. The comprehensive score is calculated by weighting the input modality matching degree, modality quality score, historical performance index, prediction confidence, calibration error, interpretation consistency, and computational cost.

[0079] For the above ranking perception fusion, the comprehensive score for each candidate skill chain is calculated using the following formula:

[0080] ;

[0081] in, For the first The first of the candidate skill chains The scoring factors are derived from input modality fit, modality quality score, historical performance indicators, prediction confidence, calibration error, interpretation consistency, and computational cost. Assign corresponding weights; allocate ranking-aware fusion weights according to the following formula:

[0082] ;

[0083] in, As a temperature coefficient, skill chains with higher overall scores receive greater fusion weights; the final risk prediction is obtained by weighted fusion of the risk probabilities output by each candidate skill chain.

[0084] ;

[0085] in, For the first The probability of risk output from each candidate skill chain This is the final risk prediction result.

[0086] Step S9: When the confidence level of the final risk prediction result is lower than the preset confidence threshold, or the output difference of multiple candidate skill chains is greater than the preset difference threshold, the feedback repair agent triggers the selection of alternative skill chains, adjustment of modality weights, compensation for missing modalities, prediction calibration or fusion strategy switching, and regenerates the risk prediction result.

[0087] When the feedback repair agent detects a modal conflict, it calculates the sub-prediction risk direction corresponding to each modality and reduces the weight of abnormal modalities based on the modality quality score, or switches the current fusion strategy from early fusion to late fusion; when it detects that a missing modality affects the prediction confidence, it calls the missing modality compensation skill or outputs a low confidence prompt; when it detects that the prediction result calibration is insufficient, it calls the prediction calibration skill to recalculate the risk probability.

[0088] Step S10: Based on the final risk prediction results and patient-level explanatory factors, the auxiliary suggestion generator outputs the risk level of chronic pain comorbidity affective disorder, key influencing factors, and individualized auxiliary intervention suggestions for doctors' reference.

[0089] Example 2

[0090] I. Closed-loop prediction in complete multimodal data scenarios:

[0091] In this embodiment, the system receives multimodal data from a patient with chronic low back pain. Basic patient information includes age, gender, body mass index, disease duration, pain location, medication use, and previous treatment. Pain assessment scales include pain intensity score, pain interference score, pain catastrophizing score, and pain self-efficacy score. Mood assessment scales include depression and anxiety scores. Sleep data includes subjective sleep quality, sleep duration, number of nighttime awakenings, and sleep rhythm indicators. Physiological signal data includes heart rate, heart rate variability, skin conductance, and respiratory rate. Behavioral activity data includes average daily steps, activity intensity, sedentary time, and daytime activity rhythm. Medical imaging data includes brain structural imaging features, brain functional connectivity features, or radiomics features of pain-related brain regions.

[0092] The clinical task parsing agent receives a prediction request from a doctor: "Assess the risk of comorbid depression and anxiety in this patient with chronic low back pain over the next three months, and provide the main influencing factors." The agent parses this request into structured task information, including: the target population is patients with chronic low back pain; the prediction targets are the risk of depression and anxiety; the prediction time window is the next three months; available modalities include scales, sleep, physiological, behavioral, and imaging data; the output requirements are risk level, risk probability, key influencing factors, and supplementary suggestions for the doctor's reference; and the interpretation requirement is patient-level interpretation.

[0093] The modality filtering agent reads structured task information and patient data availability, and filters algorithmic skills capable of handling the current modality combination. Since scales, sleep, physiological, behavioral, and imaging modalities are all available in this embodiment, the system retains scale quality control skills, HRV feature construction skills, sleep rhythm feature construction skills, behavioral activity feature construction skills, brain imaging feature processing skills, PCA dimensionality reduction skills, LASSO feature screening skills, mid-term multimodal fusion skills, late-term multimodal fusion skills, risk prediction skills, and interpretation and analysis skills.

[0094] The phenotypic filtering agent further filters candidate skills based on the patient's pain phenotype, which is chronic low back pain. Skills applicable only to fibromyalgia or neuropathic pain are prioritized or removed from the candidate set; skills with good historical performance in the chronic low back pain cohort are prioritized. The target filtering agent retains skills suitable for predicting the risk of depression, anxiety, and combined affective disorders, based on the predicted risk of depression and anxiety.

[0095] The skill selection agent generates three candidate skill chains based on the candidate skill set. The first is a scale-driven skill chain, including scale quality control, LASSO feature selection, logistic regression risk prediction, and feature contribution interpretation. The second is a physiological and behavioral-driven skill chain, including HRV feature construction, sleep rhythm feature construction, behavioral activity feature construction, late-stage fusion, gradient boosting risk prediction, and modality contribution interpretation. The third is a multimodal fusion skill chain, including image feature PCA dimensionality reduction, scale feature stitching, physiological and behavioral feature fusion, mid-stage fusion, random forest risk prediction, and SHAP interpretation.

[0096] The skill chain execution agent executes three candidate skill chains sequentially. The scale-driven skill chain outputs the probability of depression risk, the probability of anxiety risk, the main scale contribution factors, and the prediction confidence. The physiological behavior-driven skill chain outputs the risk probability, modality contribution, and confidence based on HRV, sleep, and activity data. The multimodal fusion skill chain outputs the overall risk probability, fusion modality weights, key features, and interpretation results. All outputs are written to a collaborative state cache for use by the outcome evaluation agent and the feedback repair agent.

[0097] The evaluation agent comprehensively scores the three candidate skill chains. Scoring factors include input modality matching, current modality quality score, historical AUC of the skill chain, calibration error, prediction confidence, interpretation consistency, and computational cost. In this embodiment, the comprehensive scores of the scale-dominated skill chain, the physiological behavior-dominated skill chain, and the multimodal fusion skill chain are 0.84, 0.87, and 0.91, respectively; the output risk probabilities are 0.76, 0.82, and 0.88, respectively; and the prediction confidences are 0.82, 0.86, and 0.90, respectively. The candidate skill chain retention threshold is set to 0.75, the prediction confidence threshold is set to 0.65, and the candidate skill chain output difference threshold is set to 0.20. Since the comprehensive scores and prediction confidences of the three candidate skill chains are all higher than their respective thresholds, and the maximum difference in risk probabilities is 0.12, which does not exceed the candidate skill chain output difference threshold, all three candidate skill chains are retained and participate in ranking-aware fusion. If all three skill chains indicate a high-risk patient, and the key influencing factors all point to increased pain interference, decreased sleep quality, increased anxiety scores, and decreased heart rate variability, then the system increases the final prediction confidence and uses ranking-aware fusion to obtain the final risk probability. In this embodiment, the three candidate skill chains are ranked according to their comprehensive scores, and at a temperature coefficient of 0.1, fusion weights of 0.229, 0.309, and 0.462 are assigned to the scale-dominated skill chain, the physiological behavior-dominated skill chain, and the multimodal fusion skill chain, respectively. The final risk probability after ranking-aware fusion is:

[0098]

[0099] If the output of a certain skill chain deviates significantly from other skill chains, the result evaluation agent reduces the weight of that skill chain. For example, when the difference between the risk probability output of a candidate skill chain and the risk probabilities output of other candidate skill chains exceeds 0.20, the result evaluation agent reduces the fusion weight of that candidate skill chain; when the difference simultaneously causes the final prediction confidence to be lower than 0.65, the feedback repair agent is triggered. In this embodiment, the above triggering conditions are not met, therefore the final risk probability of 0.834 and the patient-level explanatory factor are sent to the auxiliary suggestion generation agent.

[0100] The auxiliary suggestion generation agent generates auxiliary suggestions based on the final risk result and patient-level explanatory factors. In this embodiment, the final risk probability obtained from the ranking-aware fusion is 0.834, corresponding to a high risk level. For this embodiment, the system can output: This patient has a high risk of comorbid affective disorder in chronic pain, with the main influencing factors including elevated pain interference score, decreased sleep quality, decreased heart rate variability, and reduced activity. It is recommended that the doctor conduct further psychological assessments and focus on sleep management, pain catastrophic intervention, and pain functional recovery training. The above suggestions are only for doctors' reference and do not replace doctors' diagnostic and treatment decisions.

[0101] II. Adaptive prediction in scenarios with missing image modalities:

[0102] In this embodiment, the patient has pain assessment scales, emotion assessment scales, sleep data, and behavioral activity data, but lacks brain imaging data and physiological signal data. Traditional fixed models that rely on imaging or physiological signals may fail to function or require simple imputation of missing values, leading to unstable prediction results. This invention achieves adaptive prediction through a coarse-to-fine skill matching mechanism.

[0103] The clinical task parsing agent parses the predicted needs into a comprehensive affective disorder risk prediction task. The modality filtering agent first identifies missing modalities and automatically filters skills that require brain imaging or HRV input, retaining only scale-related, sleep-related, and behavioral activity-related skills. The phenotype filtering agent selects appropriate skills based on the patient's pain type, while the target filtering agent retains relevant risk prediction skills based on the comprehensive affective disorder risk prediction task.

[0104] The skill selection agent generates two candidate skill chains. The first is a scale-driven skill chain, including scale quality control, LASSO feature selection, logistic regression risk prediction, and feature contribution interpretation. The second is a sleep behavior-driven skill chain, including sleep rhythm feature construction, behavioral activity feature construction, post-fusion, gradient boosting risk prediction, and modality contribution interpretation. Due to the lack of brain imaging and physiological signals, the skill selection agent does not generate skill chains dependent on these modalities and writes the missing modal states into the co-state cache.

[0105] The skill chain execution agent executes the two skill chains mentioned above. In this embodiment, the risk probability of the scale-dominated skill chain output is 0.56, and the prediction confidence is 0.71; the risk probability of the sleep behavior-dominated skill chain output is 0.62, and the prediction confidence is 0.69. The result evaluation agent assigns fusion weights of 0.47 and 0.53 to the two candidate skill chains based on their combined scores, resulting in the final risk probabilities:

[0106]

[0107] If both skill chains output medium risk and the prediction confidence is at a moderate level, the system outputs a medium-risk result and indicates in the explanation that the risk prediction did not use brain imaging and physiological signal data, and the prediction confidence is affected by the range of available modalities. In this embodiment, the final risk probability of 0.592 falls within the preset medium-risk range of 0.40 to 0.70, therefore the system outputs a medium-risk result. If the doctor requires higher confidence, the system suggests supplementing with heart rate variability or continuous sleep monitoring data. In this way, the present invention can still provide interpretable predictions in scenarios with missing modalities, instead of directly rejecting predictions or using opaque imputation strategies.

[0108] III. Feedback Repair in Modal Conflict Scenarios:

[0109] In this embodiment, the patient's mood scale showed a low risk of depression and anxiety, but sleep data, behavioral activity data, and physiological signals indicated a higher risk. Using a simple fusion model might yield an intermediate risk probability, but it wouldn't explain the source of conflict between the different modalities. This invention addresses this type of situation through a feedback-based repair agent.

[0110] In the initial prediction phase, the system generates a scale-dominated skill chain, a physiological behavior-dominated skill chain, and a multimodal fusion skill chain. The scale-dominated skill chain outputs low risk, the physiological behavior-dominated skill chain outputs high risk, and the multimodal fusion skill chain outputs medium-to-high risk. In this embodiment, the risk probabilities output by the three candidate skill chains are 0.31, 0.82, and 0.68, respectively, and the prediction confidence of the initial fusion result is 0.58. The maximum difference in risk probabilities among the three candidate skill chains is 0.51. The result evaluation agent detects that the difference in output between the different skill chains (0.51) exceeds the preset difference threshold of 0.20, and the prediction confidence (0.58) is lower than the preset confidence threshold of 0.65. Therefore, the feedback repair trigger condition is met, and the feedback repair agent is triggered.

[0111] The feedback repair agent first invokes the modal conflict analysis skill to check the collection time, quality scores, and task relevance of the scale data and physiological behavior data. In this embodiment, the emotion scale was completed 14 days earlier than the collection time of sleep data, behavioral activity data, and physiological signal data; the scale modality quality score was 0.86, and the physiological behavior modality quality score was 0.92. If the scale completion time is found to be earlier than the physiological behavior data collection time, the system marks the time window inconsistency as a source of conflict; if a modality quality score is found to be low, the system reduces the weight of that modality; if the quality of all modalities is high, the system retains the conflict state and generates a conflict explanation.

[0112] Subsequently, the feedback repair agent switches the current fusion strategy from early fusion to late fusion, allowing different modal sub-prediction results to be generated separately first, and then fused by weighting according to modality quality and task relevance. Based on data acquisition time and modality quality scores, the system adjusts the fusion weights of the scale-dominated skill chain, the physiological behavior-dominated skill chain, and the multimodal fusion skill chain to 0.10, 0.55, and 0.35, respectively. The risk probability after re-fusion is:

[0113]

[0114] The confidence level of the re-predicted data was 0.76, higher than the preset confidence threshold of 0.65. The system output a medium-to-high risk, explaining that recent decreased sleep quality, reduced activity levels, and abnormal physiological regulation indicate an increased current risk, while the scale results may reflect an earlier time window or subjective underestimation. The system recommends that physicians further review the patient's recent mood and sleep changes in conjunction with clinical interviews.

[0115] IV. Alternative skill chain selection in low-confidence scenarios:

[0116] In this embodiment, the patient has only a small amount of scale data and some missed answers, resulting in a low-confidence output from the initial scale-dominant skill chain generated by the system. Data quality control skill calculation yields a scale completeness of 0.62, lower than the preset scale completeness threshold of 0.75; the initial scale-dominant skill chain outputs a risk probability of 0.52 and a prediction confidence of 0.48. The result evaluation agent detects insufficient input quality in this skill chain, with a prediction confidence of 0.48 lower than the preset confidence threshold of 0.65, and a risk probability of 0.52 close to the middle of the medium-risk judgment interval, while the output probability is close to the risk classification threshold. Therefore, the system marks this result as a low-confidence result, triggering feedback for correction.

[0117] The feedback repair agent first invokes the data quality control skill to reassess the scale completeness and then invokes the missing item handling skill to generate usable scale features. Subsequently, the skill selection agent chooses the calibrated logistic regression skill chain, which is more suitable for small samples and low-dimensional inputs, instead of invoking a high-dimensional fusion model. After missing item handling, the scale completeness improves to 0.81. The risk probability output by the calibrated logistic regression skill chain is 0.57, and the prediction confidence is 0.61. If the confidence is still below the threshold after re-prediction, the system outputs a low-confidence warning and suggests supplementing sleep, behavioral activity, or physiological signal data before conducting a comprehensive assessment. In this embodiment, the confidence of 0.61 after re-prediction is still below the preset confidence threshold of 0.65, therefore the system retains the risk probability of 0.57 and outputs a low-confidence warning. This embodiment illustrates that the present invention can proactively reduce the strength of conclusions based on data quality limitations, avoiding the output of overly certain risk judgments.

[0118] V. Scenarios for Incremental Expansion of the Skill Library:

[0119] In this embodiment, the research team added an electronic medical record text encoding skill. This skill is used to extract pain descriptions, emotional vocabulary, sleep complaints, medication responses, functional limitations, and negative cognitive expressions from medical records, and output text risk features. When registering a new skill, the system writes its skill identifier, skill type, input modality constraints, output semantic type, clinical task label, patient phenotype label, applicable conditions, historical performance indicators, failure mode, and API call.

[0120] After incremental expansion of the skill library, the system evaluates the impact of new skills on existing tasks on the existing baseline task set. In this embodiment, the threshold for the maximum change in the predicted probability of existing tasks caused by new skills is set to 0.05, and the threshold for electronic medical record text quality score is set to 0.80. Evaluation shows that the maximum change in the predicted probability of existing tasks without text data is 0.018, lower than the preset change threshold of 0.05. If the skill chain matching results of existing tasks without text data do not change significantly, and the skill coverage and prediction performance of tasks containing electronic medical record text improve, the system allows the skill to be enabled when electronic medical record text is available and the text quality score is higher than the threshold. Since the skill chain coverage of tasks containing electronic medical record text increased from 72% to 86%, and the historical AUC increased from 0.79 to 0.83, the skill is allowed to be enabled when the electronic medical record text quality score is not lower than 0.80. If the new skill causes instability in the output of some tasks, the skill activation scope control unit restricts its invocation to specific pain phenotypes, specific prediction targets, or specific text quality conditions. For example, when a new skill causes a maximum change in the prediction probability of an existing task exceeding 0.05, the skill activation range control unit restricts the skill to be invoked only when electronic medical record text is available, the text quality score is not lower than 0.80, and the prediction target is the risk prediction of depression, anxiety, or combined affective disorders. Through the above mechanism, this invention can incorporate new models without compromising the stability of the original system.

[0121] Example 3

[0122] like Figure 9 As shown in the figure, this embodiment presents a multimodal prediction system for chronic pain comorbidity affective disorders based on coarse-to-fine skill matching and multi-agent closed-loop collaboration, comprising:

[0123] The multimodal data acquisition module is used to receive and standardize multimodal data from patients with chronic pain. This module can acquire data from hospital information systems, scale systems, wearable devices, physiological signal acquisition devices, medical imaging systems, and electronic medical record systems, and perform field mapping, time alignment, missing data identification, and unit standardization.

[0124] The prediction skill library module stores multiple algorithmic skills and their corresponding metadata. It includes a skill registration unit, a skill metadata management unit, a skill performance update unit, and a skill activation scope control unit. The skill registration unit adds, deletes, or updates skills; the skill metadata management unit maintains the semantics of skill input and output and their applicable conditions; the skill performance update unit updates historical performance based on verification results; and the skill activation scope control unit limits the scope of skill invocation based on extended stability evaluation results.

[0125] The clinical task parsing module is used to parse clinical prediction needs into structured task information. This module can be implemented based on rule templates, natural language processing models, large language models, or combinations thereof, and is used to extract the target population, pain phenotype, available modalities, prediction objectives, prediction time windows, output requirements, and interpretation requirements.

[0126] The coarse-to-fine skill matching module filters candidate skills hierarchically based on available modalities, pain phenotypes, prediction targets, skill semantics, and historical performance. This module breaks down the complex skill selection problem into multiple hierarchical filtering steps, reducing the risk of the agent selecting the wrong skill chain.

[0127] The skill chain generation and execution module generates and executes at least one candidate skill chain. Each candidate skill chain consists of multiple algorithmic skills, and the output semantics of the previous skill must satisfy the input constraints of the subsequent skill. After the skill chain is executed, the module outputs the risk prediction result, confidence level, modal contribution, key features, and abnormal states.

[0128] The ranking-aware fusion module is used to sort and fuse the outputs of multiple candidate skill chains. This module calculates a comprehensive score based on modality matching degree, modality quality score, historical performance indicators, prediction confidence, calibration error, interpretation consistency, and computational cost, and assigns fusion weights accordingly.

[0129] The feedback repair module is used to trigger alternative skill chain selection, modality weight adjustment, missing modality compensation, prediction calibration, or fusion strategy switching when prediction confidence is insufficient, modality conflicts occur, or skill execution fails. The feedback repair module enables the system to have closed-loop adaptive capabilities.

[0130] The collaborative state caching module records the task parsing results, candidate skill sets, candidate skill chains, skill execution results, prediction confidence, modal contribution, feedback and repair records, and final output results for each agent. This module supports subsequent skill selection, result interpretation, and runtime traceability.

[0131] The Explanation and Assistance Advisory module is used to output risk levels, key influencing factors, and individualized assistance intervention suggestions for physicians based on the final risk prediction results and patient-level explanatory factors.

[0132] This embodiment also provides a readable storage medium on which a computer program is stored, which, when executed by a processor, implements the method described in Embodiment 1.

[0133] The foregoing has shown and described the main features and advantages of the present invention. It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, it is intended that all variations falling within the meaning and scope of equivalents of the claims be included within the present invention.

[0134] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. A multimodal prediction method for comorbid affective disorders in chronic pain, characterized in that, Includes the following steps: Step S1: Obtain multimodal data of patients with chronic pain and standardize the multimodal data; the multimodal data includes at least two of the following: patient basic information, pain assessment scale, emotion assessment scale, sleep assessment data, physiological signal data, behavioral activity data, medical imaging data, laboratory test data, and electronic medical record text data. Step S2: Construct a prediction skill library for predicting comorbid affective disorders of chronic pain. The prediction skill library includes multiple algorithm skills. Each algorithm skill is configured with a skill identifier, skill type, input modality constraints, output semantic type, clinical task label, patient phenotype label, applicable conditions, historical performance indicators, failure mode and calling interface. Step S3: Construct a multi-agent closed-loop collaborative network, which includes a clinical task parsing agent, a modality filtering agent, a phenotypic filtering agent, a target filtering agent, a skill selection agent, a skill chain execution agent, an outcome evaluation agent, a feedback repair agent, and an auxiliary suggestion generation agent. Step S4: The clinical task parsing agent parses the input clinical prediction needs into structured task information, which includes target population, pain phenotype, available modalities, prediction target, prediction time window, output requirements, and interpretation requirements. Step S5: Based on the structured task information, the modality filtering agent, phenotypic filtering agent, and target filtering agent sequentially perform coarse-to-fine filtering on the algorithm skills in the prediction skill base to obtain a candidate skill set. Step S6: The skill selection agent generates at least one candidate skill chain based on the candidate skill set. Each candidate skill chain includes at least three of the following: data quality control skills, feature construction skills, feature selection skills or dimensionality reduction skills, multimodal fusion skills, risk prediction skills, and interpretation and analysis skills. Step S7: The skill chain execution agent executes the candidate skill chains to obtain the risk prediction results, prediction confidence, modal contribution, and patient-level explanatory factors corresponding to each candidate skill chain. Step S8: The result evaluation agent sorts the outputs of multiple candidate skill chains based on input modality matching degree, modality quality score, historical performance index, prediction confidence, calibration error, interpretation consistency and computational cost, and performs ranking-aware fusion based on the sorting results to generate the final risk prediction result. Step S9: When the confidence level of the final risk prediction result is lower than the preset confidence threshold, or the output difference of multiple candidate skill chains is greater than the preset difference threshold, the feedback repair agent triggers the selection of alternative skill chains, adjustment of modality weights, compensation for missing modalities, prediction calibration or fusion strategy switching, and regenerates the risk prediction result. Step S10: Based on the final risk prediction results and patient-level explanatory factors, the auxiliary suggestion generator outputs the risk level of chronic pain comorbidity affective disorder, key influencing factors, and individualized auxiliary intervention suggestions for doctors' reference.

2. The multimodal prediction method for comorbid affective disorders of chronic pain according to claim 1, characterized in that, In step S1, the chronic pain patients include at least one of the following: chronic low back pain patients, neuropathic pain patients, fibromyalgia patients, chronic postoperative pain patients, bone and joint pain patients, chronic headache patients, and mixed chronic pain patients; the pain assessment scale includes at least one of the following: pain intensity score, pain duration, number of pain sites, pain interference score, pain catastrophizing score, and pain self-efficacy score; the emotion assessment scale includes at least one of the following: depression scale, anxiety scale, stress perception scale, anhedonia scale, and emotion regulation scale.

3. The multimodal prediction method for comorbid affective disorders of chronic pain according to claim 1, characterized in that, In step S2, the algorithm skills include at least two of the following: data quality control skills, principal component analysis skills, LASSO feature screening skills, heart rate variability feature construction skills, brain image feature processing skills, sleep rhythm feature construction skills, behavioral activity feature construction skills, electronic medical record text encoding skills, multimodal early fusion skills, multimodal mid-term fusion skills, multimodal late-term fusion skills, missing modality compensation skills, risk prediction skills, prediction calibration skills, feature contribution interpretation skills, modality contribution interpretation skills, counterfactual interpretation skills, and auxiliary suggestion generation skills. The applicable conditions include at least one of the following: data modality type, sample size range, feature dimension range, missing rate range, modality quality threshold, pain phenotype, prediction target, prediction time window, computational resource constraints, and output interpretation requirements. The historical performance metrics include at least one of AUC, F1 score, sensitivity, specificity, calibration error, net gain of decision curve, external validation performance, and runtime.

4. The multimodal prediction method for comorbid affective disorders of chronic pain according to claim 1, characterized in that, In step S5, the coarse-to-fine filtering is as follows: a first layer of filtering is performed based on the patient's available modalities; a second layer of filtering is performed based on the chronic pain phenotype; a third layer of filtering is performed based on the prediction target; a fourth layer of filtering is performed based on the semantic matching relationship between skill input and output; and a fifth layer of filtering is performed based on historical performance indicators, calibration errors, interpretation requirements, and computational resource constraints.

5. A multimodal prediction method for comorbid affective disorders of chronic pain according to claim 1, characterized in that, In step S6, the candidate skill chain includes at least one scale-dominated skill chain, at least one physiological behavior-dominated skill chain, and at least one multimodal fusion skill chain; the scale-dominated skill chain is used to process pain assessment scales and emotion assessment scales, the physiological behavior-dominated skill chain is used to process physiological signal data, sleep assessment data, and behavioral activity data, and the multimodal fusion skill chain is used to fuse at least two modal features and output a comprehensive risk prediction result.

6. The multimodal prediction method for comorbid affective disorders of chronic pain according to claim 1, characterized in that, In step S8, the ranking-aware fusion Includes the following processes: A comprehensive score is calculated for each candidate skill chain; the candidate skill chains are ranked according to the comprehensive score; fusion weights related to the ranking are assigned to the ranked candidate skill chains; and the risk probabilities output by each candidate skill chain are weighted and fused according to the fusion weights; wherein, the comprehensive score is obtained by weighting the input modality matching degree, modality quality score, historical performance index, prediction confidence, calibration error, interpretation consistency and computational cost.

7. The multimodal prediction method for comorbid affective disorders of chronic pain according to claim 1, characterized in that, In step S9, when the feedback repair agent detects a modal conflict, it calculates the sub-predicted risk direction corresponding to each modality and reduces the weight of abnormal modalities based on the modal quality score, or switches the current fusion strategy from early fusion to late fusion; when it detects that a missing modality affects the prediction confidence, it calls the missing modality compensation skill or outputs a low confidence prompt; when it detects that the prediction result calibration is insufficient, it calls the prediction calibration skill to recalculate the risk probability.

8. A multimodal prediction system for comorbid affective disorders of chronic pain, characterized in that, To implement the method according to any one of claims 1 to 7, comprising: A multimodal data acquisition module is used to acquire multimodal data from patients with chronic pain. The prediction skill library module is used to store multiple algorithmic skills and their skill metadata; The clinical task parsing module is used to parse clinical prediction needs into structured task information; The coarse-to-fine skill matching module is used to filter candidate skills step by step according to available modalities, pain phenotypes, prediction targets, skill semantics, and historical performance. The skill chain generation and execution module is used to generate and execute at least one candidate skill chain. The ranking-aware fusion module is used to sort and fuse the outputs of multiple candidate skill chains; The feedback repair module is used to trigger alternative skill chain selection, modality weight adjustment, missing modality compensation, prediction calibration, or fusion strategy switching when prediction confidence is insufficient or modality conflicts occur. The explanation and auxiliary suggestion module is used to output the risk level, key influencing factors, and individualized auxiliary intervention suggestions for doctors' reference; The collaborative state caching module is used to record the task parsing results, candidate skill sets, candidate skill chains, skill execution results, prediction confidence, modal contribution, feedback and repair records, and final output results of each agent.

9. A multimodal prediction system for chronic pain comorbidity affective disorder according to claim 8, characterized in that, The predictive skill base module includes a skill registration unit, a skill metadata management unit, a skill performance update unit, and a skill activation scope control unit; The skill metadata management unit is used to maintain the input modal constraints, output semantic types, clinical task labels, patient phenotype labels, applicable conditions, historical performance indicators, failure modes, and calling interfaces of the algorithm skills.

10. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.