Rehabilitation guidance system and method for thoracic surgery patient
By using physical switches to trigger timing-aligned band energy feature sets and twin networks to compare joint trajectory differences in the instrument state in the thoracic surgery patient rehabilitation system, combining the causal forest model and the dynamic spectrum of respiratory resistance and joint space-time synergistic index, the problem of difficulty in distinguishing active rehabilitation and compensatory actions in the existing technology is solved, and accurate evaluation of rehabilitation actions and real-time optimization of personalized training plans are achieved.
Patent Information
- Application Number
- CN202510372843.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-03-27
AI Technical Summary
The prior art is difficult to distinguish the nonlinear coupling relationship between active rehabilitation efforts in postoperative rehabilitation movements in thoracic surgery patients and compensatory actions caused by pain, resulting in multicollinearity in the behavioral feature space. Compensatory actions are misjudged as training action mode, and rehabilitation intensity recommendations that deviate from clinical guidelines.
By triggering the timing alignment of inertial sensor data flow based on physical switches, extracting the anti-interference band energy feature set, constructing a twin network to compare the joint trajectory differences in the enabled/disabled state of the device, using the causal forest model to analyze the causal relationship between sensor channels and rehabilitation effectiveness, fusing the dynamic spectrum of respiratory resistance and joint space-time synergistic index, and screening out mixed characteristics through adversarial pre-training, and finally generating evaluation indicators with both timing sensitivity and pathological interpretation.
It realizes the accurate assessment of rehabilitation movements of thoracic surgery patients, significantly enhances the clinical applicability and practical value of the system, provides real-time and accurate decision-making support, and provides a basis for the adjustment of personalized training plans.
Smart Images

Figure CN119889728A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical rehabilitation guidance, and more specifically, to a rehabilitation guidance system and method for thoracic surgery patients. Background Art
[0002] In the postoperative rehabilitation guidance system for thoracic surgery, the behavior capture system based on the inertial measurement unit (IMU) and the depth camera continuously collects high-dimensional behavior data such as the patient's three-dimensional motion trajectory, joint angle changes, and breathing patterns, which are used to quantitatively evaluate the execution quality of rehabilitation movements such as breathing training and coughing exercises. These data need to be decoupled in real time to reflect the effective motion characteristics of the actual rehabilitation progress in the real-life scenario with interference from the home environment and subjective behavioral deviations of the patient, so as to provide a decision-making basis for the adjustment of personalized training plans.
[0003] However, existing dimensionality reduction methods based on principal component analysis (PCA) and linear discriminant analysis (LDA) can compress data dimensions, but cannot distinguish the nonlinear coupling relationship between active rehabilitation efforts and compensatory movements caused by pain in motor signals. The coupling effect of this confounding variable leads to multicollinearity in the behavioral feature space, causing the supervised learning model to misjudge the time-frequency characteristics of compensatory movements as the standard execution mode of training movements, thereby generating rehabilitation intensity recommendations that deviate from clinical guidelines. The essential problem is that traditional feature engineering lacks the ability to model the causal mechanism of behavioral data generation, and it is difficult to establish a cross-modal constraint relationship between device usage records and environmental sensor data to achieve identifiable separation of confounding factors.
[0004] In order to solve the above problems, a technical solution is now provided. Summary of the invention
[0005] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a rehabilitation guidance system and method for thoracic surgery patients. First, the inertial sensor data stream is aligned based on the physical switch trigger timing, and the anti-interference frequency band energy feature set is extracted through joint analysis in the time and frequency domains, which effectively overcomes the interference of home environment noise and ensures the high-fidelity capture of motion data; further, a twin network is constructed to compare the differences in joint trajectories when the device is enabled / disabled, and the reconstruction intensity of the motion pattern by the device driving action is accurately quantified; the causal forest model is driven by the frequency of device use as an instrumental variable, the causal relationship between each sensor channel and the effectiveness of rehabilitation is analyzed, the dynamic spectrum of respiratory resistance and the spatiotemporal synergy index of joints are synchronously fused, and mixed features are screened out through adversarial pre-training; finally, the time domain feature clusters are dynamically divided based on the respiratory phase, and hierarchical fusion is implemented with frequency band energy attention to generate evaluation indicators with both timing sensitivity and pathological interpretability, so as to realize real-time closed-loop optimization of personalized training parameters, and provide real-time and accurate decision support for the adjustment of personalized training plans, thereby significantly enhancing the clinical applicability and practical value of the system to solve the problems raised in the above-mentioned background technology.
[0006] To achieve the above object, the present invention provides the following technical solutions: A method for guiding rehabilitation of thoracic surgery patients, comprising the steps of: S1. Based on the start and stop event triggering moment of the physical switch of the breathing trainer, determine the time anchor point of the device activation period in the inertial sensor data stream, extract the frequency band energy distribution of each axial accelerometer in the preset window before and after the time anchor point, and construct the frequency band energy feature set associated with the use of the device; S2. Input the frequency band energy feature set into the twin network, calculate the similarity of the motion trajectory of the same joint under the activation and inactivation states of the device through comparative learning, and generate comparative representations of compensatory actions and standard actions; S3. Using the frequency of device use as an instrumental variable, the causal forest model was used to perform counterfactual reasoning on the contrast representation to obtain the channel importance score of each sensor channel for the effectiveness of rehabilitation movements; S4. Mining key representations related to dynamic respiratory resistance information and joint motion information, inputting them into the pre-trained model, adaptively adjusting the screening threshold according to the numerical value output by the model, and screening out pure representations whose channel importance scores are higher than the adjusted threshold; S5. The pure representations are grouped in the time domain according to the phase of the respiratory waveform, and the frequency domain weighting is performed using the frequency band energy as the attention weight, and the final evaluation result is generated through hierarchical attention fusion.
[0007] In a preferred embodiment, step S1 includes the following contents: By analyzing the triggering moment of the start and stop events of the physical switch of the breathing trainer and combining it with the acceleration changes in the inertial sensor data stream, the moment of device state switching is located, and the three-axis acceleration data in the preset time windows before and after are extracted based on this. Subsequently, the acceleration data in the corresponding time window is subjected to a fast Fourier transform to convert the time domain signal into a frequency domain signal, and the frequency domain is divided into multiple sub-bands. Then, for each sub-band, the energy of each axis is calculated and normalized to obtain the relative energy distribution. Finally, the normalized energy values of each sub-band of each axis are arranged in order to construct a feature vector as a frequency band energy feature set associated with the use of the device.
[0008] In a preferred embodiment, step S2 includes the following contents: When processing the frequency band energy feature sets in the activated state and the inactivated state of the device, a twin network architecture is constructed, which includes two parameter-sharing sub-networks to process the frequency band energy feature sets in the activated state and the inactivated state respectively; Each sub-network adopts a deep convolutional neural network structure, extracts local features and enhances nonlinear expression through the convolution layer, compresses feature dimensions through the global average pooling layer, and then generates potential representation through the fully connected layer; Pair the frequency band energy feature sets of the activated state and the inactivated state into the twin network, calculate the cosine similarity of the latent representation, and generate a similarity score through an exponential decay function; Construct a contrast loss function so that the similarity of the potential representation of the same joint motion trajectory approaches the maximum value, and the similarity of different trajectories is lower than the preset threshold; After training, the latent representations of the activated and inactivated states of each joint motion trajectory are generated, the difference vector is calculated, and the weights are dynamically adjusted according to the similarity scores to generate a comparative representation to quantify the impact of device use on the joint motion trajectory.
[0009] In a preferred embodiment, step S3 includes the following contents: When processing the contrast representation, the frequency of use of the breathing trainer is first defined as an instrumental variable, which is calculated by counting the number of start and stop events of the physical switch per unit time, and the frequency of use is divided into three levels: low frequency, medium frequency and high frequency. Then, a causal forest model is constructed, with the contrast representation as the feature vector, the device usage status as the treatment variable, and the rehabilitation action effectiveness index as the outcome variable. The conditional average treatment effect is estimated by recursively partitioning the feature space. Then, counterfactual reasoning is performed to estimate the prediction results of each sample in the device activation and inactivation states, calculate the individual treatment effect, and aggregate the individual treatment effects of all samples to obtain the overall average treatment effect and the conditional distribution under different usage frequency levels. Finally, the SHAP method is used to evaluate the effectiveness of each sensor channel on the rehabilitation action, calculate the SHAP value of each dimension in the contrast representation, and average the SHAP values of all samples to obtain the channel importance score of each sensor channel.
[0010] In a preferred embodiment, step S4 includes the following contents: The dynamic respiratory resistance information includes the dynamic respiratory resistance spectrum characteristic index; the joint movement information includes the joint movement spatiotemporal coordination index.
[0011] In a preferred embodiment, S4.1, in order to characterize the spectral characteristics of the resistance change of the breathing trainer during use, first, a low-frequency energy distribution subset related to the respiratory resistance is extracted from the frequency band energy feature set; then, the corresponding low-frequency energy distribution subset is decomposed into a preset number of layers to obtain the energy spectrum of each decomposition node; then, for the decomposition nodes of each layer, the proportion of the energy of the corresponding layer nodes to the total energy is calculated, and the contribution of the high-energy nodes is amplified by the preset adjustment parameters; at the same time, the entropy weight method is used to assign weights to each layer to highlight the frequency bands that are sensitive to resistance changes; finally, the weighted contributions of all layers are added to obtain the dynamic respiratory resistance spectrum characteristic index.
[0012] In a preferred embodiment, S4.2, in order to quantify the temporal and spatial synergy of the joint motion trajectory, the spatiotemporal characteristics of the joint motion trajectory are first extracted from the contrast representation; then, the dynamic time warping method is used to calculate the trajectory matching degree of the joint motion trajectory under the activated and inactivated states of the instrument; then, for each time scale, the normalized value of the joint motion trajectory alignment cost at the corresponding scale is calculated, and multiplied by the Pearson correlation coefficient of the corresponding spatial dimension; finally, the synergy contribution of all scales is averaged to obtain the spatiotemporal synergy index of the joint motion.
[0013] In a preferred embodiment, S4.3-4, the dynamic respiratory resistance spectrum characteristic index, the spatiotemporal coordination index of joint movement and the channel importance score of each sensor channel are combined into a comprehensive feature vector, which is input into a pre-trained Transformer model, and the output result of the Transformer model is marked as the action effectiveness score; then, the basic threshold and the complement of the action effectiveness score are multiplied by the adjustment coefficient and then added; finally, according to the adjusted screening threshold, the channels with a value higher than the screening threshold are screened out from the channel importance scores of each sensor channel, and the corresponding contrast representation is extracted to generate a pure representation.
[0014] In a preferred embodiment, step S5 includes the following contents: The respiratory waveform phase is extracted from the respiratory waveform signal, and the pure representation is divided into multiple time domain groups according to the respiratory waveform phase; the pure representation of each time domain group is transformed into the frequency domain, and weighted processing is performed using the attention weight normalized by the frequency band energy feature set, and then the weighted frequency domain representation is converted back to the time domain to obtain a weighted representation; the weighted representation of each time domain group is weightedly summed by calculating the attention score to generate an intermediate representation, and the global attention mechanism is applied to the intermediate representation to generate the final evaluation result.
[0015] A thoracic surgery patient rehabilitation guidance system, comprising: a feature construction module, a trajectory similarity module, a channel contribution module, a feature screening module, and a grouping fusion module; Feature construction module: Based on the start and stop event triggering moment of the breathing trainer physical switch, the time anchor point of the device activation period is determined in the inertial sensor data stream, and the frequency band energy distribution of each axial accelerometer in the preset window before and after the time anchor point is extracted to construct the frequency band energy feature set associated with the use of the device; Trajectory similarity module: The frequency band energy feature set is input into the twin network, and the similarity of the motion trajectory of the same joint in the activated and inactivated states of the device is calculated through comparative learning, generating comparative representations of compensatory actions and standard actions; Channel contribution module: using the frequency of device use as an instrumental variable, the causal forest model is used to perform counterfactual reasoning on the comparative representation to obtain the channel importance score of each sensor channel for the effectiveness of rehabilitation movements; Feature screening module: It mines key representations related to dynamic respiratory resistance information and joint motion information, inputs them into the pre-trained model, and adaptively adjusts the screening threshold according to the numerical value output by the model to screen out pure representations whose channel importance scores are higher than the adjusted threshold; Grouping fusion module: The pure representations are grouped in the time domain according to the phase of the respiratory waveform, and frequency domain weighting is performed using the frequency band energy as the attention weight, and the final evaluation result is generated through hierarchical attention fusion.
[0016] The technical effects and advantages of the thoracic surgery patient rehabilitation guidance system and method of the present invention are as follows: First, the inertial sensor data stream is aligned based on the physical switch trigger timing, and the anti-interference frequency band energy feature set is extracted through joint analysis in the time and frequency domains, which effectively overcomes the interference of home environmental noise and ensures high-fidelity capture of motion data; further, a twin network is constructed to compare the differences in joint trajectories when the device is enabled / disabled, and accurately quantify the reconstruction intensity of the motion pattern by the device-driven action; the causal forest model is driven by the frequency of device use as an instrumental variable to analyze the causal relationship between each sensor channel and the effectiveness of rehabilitation, and the dynamic spectrum of respiratory resistance and the spatiotemporal synergy index of joints are synchronously fused, and confounding features are screened out through adversarial pre-training; finally, the time domain feature clusters are dynamically divided based on the respiratory phase, and hierarchical fusion is implemented with frequency band energy attention to generate evaluation indicators that are both timing sensitive and pathologically interpretable, so as to achieve real-time closed-loop optimization of personalized training parameters, and provide real-time and accurate decision support for the adjustment of personalized training plans, thereby significantly enhancing the clinical applicability and practical value of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 The present invention is a flowchart of a method for guiding rehabilitation of thoracic surgery patients.
[0018] Figure 2 The present invention is a schematic structural diagram of a thoracic surgery patient rehabilitation guidance system. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0020] Embodiment 1: Figure 1 The present invention provides a method for guiding rehabilitation of thoracic surgery patients, comprising: S1. Based on the start and stop event triggering moment of the physical switch of the breathing trainer, the time anchor point of the device activation period is determined in the inertial sensor data stream, and the frequency band energy distribution of each axial accelerometer in the preset window before and after the time anchor point is extracted to construct the frequency band energy feature set associated with the use of the device.
[0021] S2. Input the frequency band energy feature set into the twin network, calculate the similarity of the motion trajectory of the same joint under the activated and inactivated states of the device through comparative learning, and generate a comparative representation of the compensatory action and the standard action.
[0022] S3. Using the frequency of device use as an instrumental variable, the causal forest model was used to perform counterfactual reasoning on the comparative representation to obtain the channel importance score of each sensor channel for the effectiveness of rehabilitation movements.
[0023] S4. Mining key representations related to dynamic respiratory resistance information and joint motion information, inputting them into the pre-trained model, adaptively adjusting the screening threshold according to the numerical value output by the model, and screening out pure representations whose channel importance scores are higher than the adjusted threshold.
[0024] S5. The pure representations are grouped in the time domain according to the phase of the respiratory waveform, and the frequency domain weighting is performed using the frequency band energy as the attention weight, and the final evaluation result is generated through hierarchical attention fusion.
[0025] Through the data stream of the breathing trainer and the inertial sensor, combined with the start and stop event triggering moment of the physical switch, the use status of the device is analyzed, thereby providing a basis for evaluating the effectiveness of rehabilitation movements. In the rehabilitation training scenario, the breathing trainer is the core tool, and its use status (activated or inactivated) is controlled by the physical switch, while the inertial sensor (such as the accelerometer) captures the multi-axial motion data of the device (x, y, and z-axis acceleration) in real time. Step S1 is the starting point of the entire analysis process. The goal is to extract the frequency band energy feature set related to the activation of the device from the original inertial sensor data stream, laying a data foundation for subsequent steps (such as movement effectiveness evaluation).
[0026] Step S1 includes the following contents: S1.1, time anchor point determination: First, the switching event needs to be detected. The specific method is to calculate the acceleration change between adjacent sampling points: for each moment in the data stream, calculate the difference between the three-axis acceleration vector at that moment and the three-axis acceleration vector at the previous moment, and then find the modulus of this difference to get the magnitude of the acceleration change at that moment. Next, set an acceleration change threshold, such as a fixed value in square meters per second. When the calculated change exceeds this threshold, it is preliminarily considered that a switching action has occurred at that moment. Afterwards, the time point that meets this condition is recorded as a candidate time point. If the device provides a specific time record of the switching event, the candidate time point is calibrated using the time record to ensure that the deviation between the final determined time anchor point and the actual switching action moment is within an acceptable range, such as less than one sampling period.
[0027] S1.2, Preset time window extraction: After determining the time anchor point, a time window needs to be defined to extract data. The specific method is to set a time range with the time anchor point as the center so that the window covers equal time periods before and after the time anchor point, such as a few seconds before and after, to ensure that the total length is sufficient to include the transition phase before and after the device is activated and at least one complete breathing cycle. Subsequently, the three-axis acceleration data segment within the time window is intercepted from the acceleration data stream, including data in the three directions of the horizontal axis, vertical axis and vertical axis, to form a complete data segment for subsequent analysis.
[0028] S1.3, frequency band energy distribution extraction: Next, the three-axis acceleration data in the time window is analyzed in the frequency domain. First, the acceleration data of the horizontal axis, the vertical axis, and the vertical axis are fast Fourier transformed respectively, and the time domain signal is converted into a frequency domain signal to obtain the spectrum of each axis. Then, the frequency domain is divided into several sub-bands, such as multiple intervals from zero to one Hz, one to two Hz, two to three Hz, etc. Next, the energy of each frequency band in each axis is calculated: for each frequency band, the squares of the spectrum amplitudes of all frequency points in the frequency band are added, and then multiplied by the frequency resolution, where the frequency resolution is the ratio of the sampling rate to the number of data points, to obtain the energy value of the frequency band. In order to eliminate the influence of individual differences or sensor sensitivity, the frequency band energy of each axis is normalized. The specific method is to divide the energy value of each frequency band by the sum of the energy of all frequency bands in the axis to obtain the relative energy distribution.
[0029] S1.4, construct frequency band energy feature set: Finally, construct a feature set based on the frequency band energy distribution. The specific method is to arrange the normalized energy values of the horizontal axis, vertical axis and vertical axis in each frequency band in order to form a feature vector, for example, first arrange the energy values of each frequency band on the horizontal axis, then arrange those on the vertical axis, and finally arrange those on the vertical axis. If there are multiple time anchor points corresponding to multiple switching operations, repeat the above steps for each time anchor point to generate corresponding feature vectors respectively, and these feature vectors can be stacked and combined into a feature matrix for subsequent analysis or modeling.
[0030] Through step S1, the time anchor point corresponding to the start and stop event of the physical switch of the breathing trainer is accurately identified from the inertial sensor data stream, and the frequency band energy distribution of each axial accelerometer in the preset window before and after the time anchor point is calculated, and the frequency band energy feature set highly related to the use status of the device is successfully constructed. This feature set comprehensively describes the motion characteristics during the activation of the device, significantly improves the accuracy and reliability of rehabilitation movement analysis, and provides solid data guarantee for the objective evaluation of movement quality.
[0031] The use status of the breathing trainer directly affects the execution quality of the joint motion trajectory and its contribution to the rehabilitation effect. Step S1 has determined the time anchor point of the device activation period in the inertial sensor data stream based on the triggering moment of the start and stop event of the physical switch of the breathing trainer, and extracted the frequency band energy distribution of each axial accelerometer in the preset window before and after the time anchor point, and constructed a frequency band energy feature set associated with the use of the device. This feature set characterizes the difference in motion characteristics between the activated and inactivated states of the device, laying the foundation for subsequent analysis. Step S2 aims to use this frequency band energy feature set, through the twin network architecture and contrastive learning technology, to accurately calculate the similarity of the same joint motion trajectory in the latent space under the activated and inactivated states of the device, generate a contrastive representation of the compensatory action and the standard action, and provide reliable input for the causal reasoning of step S3.
[0032] Step S2 includes the following contents: S2.1, constructing a twin network architecture: In order to process the frequency band energy feature set of the device in the activated state and the inactivated state, a twin network architecture is designed. The architecture consists of two identical sub-networks, which share the same parameters and are used to process the feature set of the activated state and the feature set of the inactivated state respectively. Each sub-network adopts a deep convolution structure: the first layer scans the input feature set through the convolution kernel, extracts local feature information, and enhances the nonlinear expression ability of the feature through the activation function; the second layer further processes the extracted features to obtain higher-level feature information, and then compresses the spatial dimension of the feature through the global average pooling layer to retain the global information; finally, the processed features are mapped to a potential representation space through the fully connected layer to generate the potential representation of the activated state and the inactivated state respectively.
[0033] S2.2, contrastive learning mechanism: In the process of contrastive learning, the frequency band energy feature sets of the activated state and the inactivated state are paired and input into the two sub-networks of the twin network respectively to generate corresponding potential representations. Subsequently, the similarity between the two potential representations is calculated and measured by an exponential decay method based on the cosine distance. The specific steps are as follows: first, the cosine similarity of the two potential representations is calculated, that is, the similarity value is obtained by calculating the dot product of the two and then dividing it by the product of their respective module lengths; then, the obtained cosine similarity value is input into an exponential decay function for conversion so that the similarity value is limited to the range of zero to one, where the closer the value is to one, the more similar the two potential representations are.
[0034] S2.3, loss function: To optimize the training process of the twin network, a contrast loss function is constructed. The goal of this loss function is to make the similarity of the activation state potential representation and the inactivation state potential representation from the same joint motion trajectory close to 1, and at the same time make the similarity of the potential representations from different joint motion trajectories lower than the preset threshold. The specific implementation method is: for each training sample pair, calculate the similarity score of its activation state potential representation and inactivation state potential representation; according to whether the sample pair comes from the same joint motion trajectory, process the loss contribution of the positive sample pair and the negative sample pair separately; for the positive sample pair, make the similarity score close to 1 through the square term; for the negative sample pair, make the similarity score less than the preset threshold by truncating the square term; the final contrast loss function takes the average of the losses of all training sample pairs.
[0035] S2.4, generation of contrast representation: After the twin network completes training, for each joint motion trajectory, the frequency band energy feature set in its activated state and the frequency band energy feature set in the inactivated state are input into the twin network to generate corresponding latent representations respectively. Subsequently, the difference vector is obtained by calculating the difference between the latent representations corresponding to the activated state and the inactivated state, and the weight of the difference vector is dynamically adjusted according to the similarity score. The specific steps include: first, calculating the similarity score between the latent representation of the activated state and the latent representation of the inactivated state; then, subtracting the similarity score from 1 as the weight coefficient; finally, multiplying the weight coefficient by the difference vector to generate the final contrast representation. This contrast representation is used to quantify the specific impact of the use of the instrument on the execution of the joint motion trajectory. The difference vector represents the difference in the representation of the same joint motion trajectory in the latent space between the activated and inactivated states of the instrument, and quantifies the impact of the use of the instrument on the motion trajectory characteristics.
[0036] The frequency of use of the breathing trainer directly affects the effectiveness of rehabilitation movements, and the inertial sensor data stream provides a quantitative basis for the execution of movements. Step S2 generates a comparative representation of compensatory movements and standard movements through a twin network, which quantifies the potential differences in joint motion trajectories between the activated and inactivated states of the device. Step S3 aims to use the causal forest model, with the frequency of device use as an instrumental variable, to perform counterfactual reasoning on the comparative representation, obtain the channel importance score of each sensor channel for the effectiveness of rehabilitation movements, and provide accurate input for step S4 to screen key representations.
[0037] Step S3 includes the following contents: S3.1, Definition of instrumental variables: In order to identify the causal effect of the use of breathing trainers on the effectiveness of rehabilitation movements, the frequency of use of breathing trainers is defined as an instrumental variable. This frequency of use is calculated by counting the number of start and stop events of the physical switch per unit time to ensure that it is associated with the quality of action execution and is not interfered by unobserved confounding factors. In order to adapt to the classification requirements of the causal forest model and facilitate subsequent effect estimation, the frequency of use is divided into three levels: low frequency, medium frequency and high frequency, and the specific division is based on the preset number threshold.
[0038] S3.2, Construction of causal forest model: In order to deal with causal relationships in high-dimensional feature space, the causal forest model is used to estimate the conditional average treatment effect by integrating multiple causal trees. The specific construction process is: the contrast representation generated in step S2 is used as the feature vector, the device usage status (divided into two states: activated and inactivated) is used as the treatment variable, and the rehabilitation action effectiveness index is used as the result variable. The causal forest model recursively divides the feature space to estimate the impact of the treatment variables in different subspaces on the result variable, that is, under the condition of a given feature vector, the effect of device use on the effectiveness of rehabilitation actions.
[0039] S3.3, counterfactual reasoning: Use the causal forest model to perform counterfactual reasoning to estimate the difference in the effectiveness of rehabilitation movements under different usage frequencies. The specific steps are: for each sample, estimate its prediction results in the activated state and the inactivated state of the device respectively; then, calculate the individual treatment effect, that is, the difference between the prediction results of the activated state and the prediction results of the inactivated state; finally, aggregate the individual treatment effects of all samples, calculate the overall average treatment effect, and further analyze the conditional distribution under the three usage frequency levels of low frequency, medium frequency, and high frequency as the basis for the subsequent channel importance score analysis.
[0040] S3.4, acquisition of channel importance scores of sensor channels: the SHAP method is used to evaluate the importance of each dimension in the contrast representation. The specific implementation process is: each dimension of the contrast representation is regarded as an independent feature, and the contribution value of the feature to the model output is calculated by comparing the difference in processing effects when the feature is included and when the feature is not included, which is called the SHAP value; then, the SHAP values of all samples are averaged to obtain the channel importance score of each sensor channel, and it is used as the final output result.
[0041] In step S3, the frequency of device use was used as an instrumental variable, and the causal forest model was used to perform counterfactual reasoning on the comparative representations generated in step S2, successfully generating the channel importance scores of each sensor channel for the effectiveness of rehabilitation movements. This channel importance score accurately quantifies the role of different sensor channels in evaluating the effectiveness of movements, and provides a reliable basis for mining key representations related to dynamic respiratory resistance information and joint motion information in step S4, ensuring the pertinence and accuracy of the subsequent screening process.
[0042] Step S4 includes the following contents: The dynamic respiratory resistance information includes a dynamic respiratory resistance spectrum characteristic index; The joint motion information includes the spatiotemporal synergy index of joint motion.
[0043] The dynamic respiratory resistance spectrum characteristic index is used to reflect the spectrum characteristics of the resistance change of the respiratory trainer during use. By analyzing the energy distribution of respiratory resistance in the frequency domain, the stability of the respiratory rhythm and the dynamic characteristics of resistance change are quantified. The larger the value, the higher the energy concentration of respiratory resistance in a specific frequency band, reflecting the enhanced stability of the respiratory rhythm, while the smaller the value, the more dispersed or unstable the respiratory resistance change; the spatiotemporal synergy index of joint movement is used to represent the synergy of joint movement trajectory in time and space. By evaluating the alignment degree of joint movement trajectory in the activated and inactivated states of the device, the synergy and consistency of movement are quantified. The larger the value, the higher the alignment degree of joint movement trajectory in different states, the better the synergy, while the smaller the value, the greater the spatiotemporal deviation of the movement trajectory. The purpose of calculating these two indices is to comprehensively characterize the execution quality of rehabilitation movements from the two dimensions of frequency domain and spatiotemporal domain, provide high-quality feature input, so as to improve the accuracy and robustness of the pre-training model in evaluating the effectiveness of the movement. At the same time, the introduction of these two indices helps to deeply understand the influence of respiratory resistance change and joint movement synergy on rehabilitation effect, and provide data support for optimizing rehabilitation training programs. The advantage is that it can more accurately evaluate the effect of movement execution and guide training improvement.
[0044] S4.1, dynamic respiratory resistance spectrum characteristic index: In order to characterize the spectral characteristics of the resistance change of the breathing trainer during use, first extract the low-frequency energy distribution subset related to the respiratory resistance from the frequency band energy feature set, specifically focusing on the frequency band reflecting the characteristics of the breathing rhythm. Next, the low-frequency energy distribution subset is decomposed by wavelet packet decomposition to a preset number of layers to obtain the energy spectrum of each decomposition node. Then, the dynamic respiratory resistance spectrum characteristic index is calculated. The specific method is: for each layer of decomposition nodes, calculate the proportion of the node energy of this layer to the total energy, and amplify the contribution of high-energy nodes through preset adjustment parameters; at the same time, use the entropy weight method to assign weights to each layer to highlight the frequency bands that are sensitive to resistance changes; finally, add the weighted contributions of all layers to obtain the dynamic respiratory resistance spectrum characteristic index. For example, the acquisition process is as follows: Extract the frequency band energy subset related to respiratory resistance from the frequency band energy feature set in step S1, focusing on the energy distribution of the low frequency band (e.g. 0-2Hz) to reflect the respiratory rhythm characteristics. Perform wavelet packet decomposition on the frequency band energy subset to the third layer to obtain the energy spectrum of each node. Calculate the dynamic respiratory resistance spectrum feature index , using the following formula: The number of wavelet packet decomposition layers is set to 3.
[0045] : No. The weight coefficient of the layer is calculated by the entropy weight method based on the information entropy of the energy distribution of nodes in each layer, highlighting the frequency bands that are sensitive to resistance changes.
[0046] : No. The energy value of each wavelet packet node is extracted from the frequency band energy subset.
[0047] The total number of wavelet packet nodes.
[0048] : Adjustment parameter, set to 1.5, to amplify the contribution of high energy nodes.
[0049] S4.2, spatiotemporal synergy index of joint motion: In order to quantify the synergy of joint motion trajectories in time and space, the spatiotemporal characteristics of joint motion trajectories are first extracted from the comparative representation. Next, the dynamic time warping method is used to calculate the trajectory matching degree of joint motion trajectories in the activated and inactivated states of the device. Then, multi-scale analysis is introduced to evaluate synergy at different time scales and spatial dimensions. The specific calculation method is: for each time scale, calculate the normalized value of the trajectory matching degree of the joint motion trajectory at that scale, and multiply it by the Pearson correlation coefficient of the corresponding spatial dimension; finally, take the average of the synergy contributions of all scales to obtain the spatiotemporal synergy index of joint motion. For example, the acquisition process is as follows: From the comparative characterization The spatiotemporal features of the joint motion trajectory are extracted from the dynamic time warping (DTW) method to calculate the trajectory matching degree of the instrument in the activated and inactivated states. Multi-scale analysis is introduced to calculate the synergy of different time scales and spatial dimensions, using the following formula: The number of time scales is set to 3 (short, medium, and long scales).
[0050] : No. The DTW alignment cost at each time scale is based on calculate.
[0051] : No. The maximum alignment cost at each scale is used for normalization.
[0052] : No. The Pearson correlation coefficient of the spatial dimensions is calculated based on the spatial features of the contrast representation, reflecting the spatial synergy.
[0053] S4.3, the calculated dynamic respiratory resistance spectrum characteristic index, joint movement spatiotemporal coordination index and channel importance score of each sensor channel are combined to form a comprehensive feature vector as the input of the pre-training model.
[0054] S4.4, using a Transformer model pre-trained on a large-scale rehabilitation action dataset to learn a deep representation of action effectiveness. The comprehensive feature vector is input into the pre-trained model, and the output of the Transformer model is marked as the action effectiveness score. The screening threshold is dynamically adjusted according to the action effectiveness score. The specific method is: the basic threshold and the complement of the action effectiveness score (i.e., 1 minus the action effectiveness score) are multiplied by the adjustment coefficient and then added to obtain the adaptively adjusted screening threshold.
[0055] S4.5, according to the adjusted screening threshold, the channels with a value higher than the screening threshold are screened out from the channel importance scores of each sensor channel, and the contrast representations corresponding to these channels are extracted to generate pure representations.
[0056] Step S4 calculates the dynamic respiratory resistance spectrum characteristic index through wavelet packet decomposition and entropy weight method, calculates the spatiotemporal synergy index of joint movement by combining DTW and multi-scale analysis, and adaptively adjusts the screening threshold based on the comprehensive feature vector and pre-trained model. The final screened pure representation accurately reflects the sensor channel information that is highly related to the effectiveness of rehabilitation movements, providing high-quality input for the time domain grouping and frequency domain weighting in step S5, ensuring the accuracy and reliability of the evaluation results.
[0057] Step S5 is the final step of the entire process. Its goal is to group the pure representations screened in step S4 in the time domain according to the phase of the respiratory waveform, and to implement frequency domain weighting using the frequency band energy feature set extracted in step S1 as the attention weight. The final evaluation result is generated through hierarchical attention fusion to provide a comprehensive evaluation of the effectiveness of the rehabilitation movements.
[0058] Step S5 includes the following contents: S5.1, characterizes the periodic characteristics of the breathing action, first obtains the original breathing waveform signal from the pressure sensor or flow sensor of the breathing trainer, and the signal changes continuously over time. Then, the Hilbert transform is applied to the original breathing waveform signal to generate an analytical signal, which is composed of the original breathing waveform signal and its Hilbert transform result. Then, by calculating the inverse tangent of the ratio of the imaginary part to the real part of the analytical signal, the breathing waveform phase is obtained, and the value range of the breathing waveform phase is from negative π to π, reflecting the periodic changes of the inhalation and exhalation phases of the breathing action.
[0059] S5.2, capture the characteristics of different breathing stages, and divide the pure representation into multiple time domain groups according to the phase of the respiratory waveform. First, a respiratory cycle is divided into several phase segments, such as the initial inspiration, the peak inspiration, the initial exhalation and the peak exhalation, etc., each phase segment corresponds to a specific phase range. Then, for each time point in the pure representation, according to the value of its respiratory waveform phase, the corresponding pure representation is assigned to the time domain group of the corresponding phase segment.
[0060] S5.3, in order to implement frequency domain weighting for each time domain group, first perform a fast Fourier transform on the pure representation of each time domain group to obtain its frequency domain representation. Next, normalize the frequency band energy feature set to the attention weight, ensuring that the sum of all attention weights is 1. Then, multiply the frequency domain representation by the attention weight element by element to obtain the weighted frequency domain representation. Finally, convert the weighted frequency domain representation back to the time domain through an inverse fast Fourier transform to obtain the weighted representation.
[0061] S5.4, in order to fuse the weighted representations of each time domain group and generate the final evaluation result, a hierarchical attention mechanism is used. First, the attention score is calculated for each weighted representation. The specific method is: the weighted representation is linearly transformed by a learnable transformation matrix, then processed by a tanh activation function, and then multiplied by a learnable attention vector, and finally normalized by a softmax function to obtain the importance weight of each time domain group. Then, based on these importance weights, the weighted representations of all time domain groups are weighted summed to obtain an intermediate representation, which integrates the characteristics of each breathing stage. Finally, a global attention mechanism is applied to the intermediate representation. The specific method is: the intermediate representation is linearly transformed by a learnable global transformation matrix, then processed by a tanh activation function, and then multiplied by a learnable global attention vector, normalized by a softmax function, and then multiplied by the intermediate representation to obtain the final evaluation result. The final evaluation result is a scalar or vector, which represents the comprehensive evaluation value of the effectiveness of the rehabilitation action.
[0062] The calculation of the attention score involves the following steps: 1. Feature transformation: transform the input data (such as the weighted representation of a time domain group) ) through a learnable transformation matrix Perform linear transformation and introduce nonlinear activation functions (such as ), generate new feature representations.
[0063] 2. Similarity calculation: using a learnable vector ,The similarity between the feature representation and the query or context is calculated by methods such as dot product.
[0064] 3. Normalization: The calculated similarity is converted into a probability distribution form through the softmax function to obtain the attention score , ensuring that the sum of all scores is 1.
[0065] The specific formula is: ; in, Indicates Attention scores of the time domain groups.
[0066] Step S5 groups the pure representation of step S4 in the time domain by the phase of the respiratory waveform, uses the frequency band energy feature set of step S1 as the attention weight to implement frequency domain weighting, and generates the final evaluation result through the hierarchical attention fusion mechanism. This result integrates the spatiotemporal information of the respiratory cycle characteristics, the use status of the device, and the joint movement trajectory, providing an accurate and comprehensive evaluation of the effectiveness of the rehabilitation action, and supporting the optimized application of the respiratory trainer in rehabilitation training.
[0067] Embodiment 2: Figure 2 The present invention provides a thoracic surgery patient rehabilitation guidance system, comprising: Feature construction module, trajectory similarity module, channel contribution module, feature screening module, grouping fusion module; Feature construction module: Based on the start and stop event triggering moment of the breathing trainer physical switch, the time anchor point of the device activation period is determined in the inertial sensor data stream, and the frequency band energy distribution of each axial accelerometer in the preset window before and after the time anchor point is extracted to construct the frequency band energy feature set associated with the use of the device; Trajectory similarity module: The frequency band energy feature set is input into the twin network, and the similarity of the motion trajectory of the same joint in the activated and inactivated states of the device is calculated through comparative learning, generating comparative representations of compensatory actions and standard actions; Channel contribution module: using the frequency of device use as an instrumental variable, the causal forest model is used to perform counterfactual reasoning on the comparative representation to obtain the channel importance score of each sensor channel for the effectiveness of rehabilitation movements; Feature screening module: It mines key representations related to dynamic respiratory resistance information and joint motion information, inputs them into the pre-trained model, and adaptively adjusts the screening threshold according to the numerical value output by the model to screen out pure representations whose channel importance scores are higher than the adjusted threshold; Grouping fusion module: The pure representations are grouped in the time domain according to the phase of the respiratory waveform, and frequency domain weighting is performed using the frequency band energy as the attention weight, and the final evaluation result is generated through hierarchical attention fusion.
[0068] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.
[0069] It should be noted that the system of the present invention can be deployed on the device itself to realize embedded applications, and can also be run on a PC or other terminal with a user interface, thereby meeting a variety of hardware environments and usage requirements.
[0070] The above description is only by way of illustration of certain exemplary embodiments of the present invention. It is undoubted that those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the above drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present invention.
[0071] It should be noted that, in this article, if there are relational terms such as first and second, etc., they are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including a..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0072] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for guiding rehabilitation of thoracic surgery patients, characterized in that: Includes steps: S1. Based on the start and stop event triggering moment of the physical switch of the breathing trainer, determine the time anchor point of the device activation period in the inertial sensor data stream, extract the frequency band energy distribution of each axial accelerometer in the preset window before and after the time anchor point, and construct the frequency band energy feature set associated with the use of the device; S2. Input the frequency band energy feature set into the twin network, calculate the similarity of the motion trajectory of the same joint under the activation and inactivation states of the device through comparative learning, and generate comparative representations of compensatory actions and standard actions; S3. Using the frequency of device use as an instrumental variable, the causal forest model was used to perform counterfactual reasoning on the contrast representation to obtain the channel importance score of each sensor channel for the effectiveness of rehabilitation movements; S4. Mining key representations related to dynamic respiratory resistance information and joint motion information, inputting them into the pre-trained model, adaptively adjusting the screening threshold according to the numerical value output by the model, and screening out pure representations whose channel importance scores are higher than the adjusted threshold; S5. The pure representations are grouped in the time domain according to the phase of the respiratory waveform, and the frequency domain weighting is performed using the frequency band energy as the attention weight, and the final evaluation result is generated through hierarchical attention fusion.
2. A method for guiding rehabilitation of thoracic surgery patients according to claim 1, characterized in that: Step S1 includes the following contents: By analyzing the triggering moment of the start and stop events of the physical switch of the breathing trainer and combining it with the acceleration changes in the inertial sensor data stream, the moment of device state switching is located, and the three-axis acceleration data in the preset time windows before and after are extracted based on this. Subsequently, the acceleration data in the corresponding time window is subjected to a fast Fourier transform to convert the time domain signal into a frequency domain signal, and the frequency domain is divided into multiple sub-bands. Then, for each sub-band, the energy of each axis is calculated and normalized to obtain the relative energy distribution. Finally, the normalized energy values of each sub-band of each axis are arranged in order to construct a feature vector as a frequency band energy feature set associated with the use of the device.
3. A method for guiding rehabilitation of thoracic surgery patients according to claim 2, characterized in that: Step S2 includes the following contents: When processing the frequency band energy feature sets in the activated state and the inactivated state of the device, a twin network architecture is constructed, which includes two parameter-sharing sub-networks to process the frequency band energy feature sets in the activated state and the inactivated state respectively; Each sub-network adopts a deep convolutional neural network structure, extracts local features and enhances nonlinear expression through the convolution layer, compresses feature dimensions through the global average pooling layer, and then generates potential representation through the fully connected layer; Pair the frequency band energy feature sets of the activated state and the inactivated state into the twin network, calculate the cosine similarity of the latent representation, and generate a similarity score through an exponential decay function; Construct a contrast loss function so that the similarity of the potential representation of the same joint motion trajectory approaches the maximum value, and the similarity of different trajectories is lower than the preset threshold; After training is completed, the activation and inactivation state latent representations of each joint motion trajectory are generated. The difference vector is obtained by calculating the difference between the activation and inactivation state latent representations, and the weight is dynamically adjusted according to the similarity score to generate a comparative representation to quantify the impact of device use on the joint motion trajectory.
4. A method for guiding rehabilitation of thoracic surgery patients according to claim 3, characterized in that: Step S3 includes the following contents: When processing the contrast representation, the frequency of use of the breathing trainer is first defined as an instrumental variable, which is calculated by counting the number of start and stop events of the physical switch per unit time, and the frequency of use is divided into three levels: low frequency, medium frequency and high frequency. Then, a causal forest model is constructed, with the contrast representation as the feature vector, the device usage status as the treatment variable, and the rehabilitation action effectiveness index as the outcome variable. The conditional average treatment effect is estimated by recursively partitioning the feature space. Then, counterfactual reasoning is performed to estimate the prediction results of each sample in the device activation and inactivation states, calculate the individual treatment effect, and aggregate the individual treatment effects of all samples to obtain the overall average treatment effect and the conditional distribution under different usage frequency levels. Finally, the SHAP method is used to evaluate the effectiveness of each sensor channel on the rehabilitation action, calculate the SHAP value of each dimension in the contrast representation, and average the SHAP values of all samples to obtain the channel importance score of each sensor channel.
5. A method for guiding rehabilitation of thoracic surgery patients according to claim 4, characterized in that: Step S4 includes the following contents: The dynamic respiratory resistance information includes a dynamic respiratory resistance spectrum characteristic index; The joint motion information includes the spatiotemporal synergy index of joint motion.
6. A method for guiding rehabilitation of thoracic surgery patients according to claim 5, characterized in that: Step S4 also includes the following contents: S4.1, in order to characterize the spectral characteristics of the resistance change of the breathing trainer during use, firstly, the low-frequency energy distribution subset related to the breathing resistance is extracted from the frequency band energy feature set; then, the corresponding low-frequency energy distribution subset is decomposed into a preset number of layers by wavelet packet decomposition to obtain the energy spectrum of each decomposition node; then, for the decomposition nodes of each layer, the proportion of the energy of the corresponding layer nodes to the total energy is calculated, and the contribution of the high-energy nodes is amplified by the preset adjustment parameters; at the same time, the entropy weight method is used to assign weights to each layer to highlight the frequency bands that are sensitive to resistance changes; finally, the weighted contributions of all layers are added together to obtain the dynamic breathing resistance spectrum characteristic index.
7. A method for guiding rehabilitation of thoracic surgery patients according to claim 5, characterized in that: Step S4 also includes the following contents: S4.2, in order to quantify the temporal and spatial synergy of joint motion trajectories, the spatiotemporal features of joint motion trajectories are first extracted from the contrast representation; then, the dynamic time warping method is used to calculate the trajectory matching degree of joint motion trajectories under the device activation and inactivation states; then, for each time scale, the normalized value of the joint motion trajectory alignment cost at the corresponding scale is calculated and multiplied by the Pearson correlation coefficient of the corresponding spatial dimension; finally, the synergy contribution of all scales is averaged to obtain the spatiotemporal synergy index of joint motion.
8. A method for guiding rehabilitation of thoracic surgery patients according to claim 5, characterized in that: S4.3-4, the dynamic respiratory resistance spectrum feature index, the spatiotemporal coordination index of joint movement and the channel importance score of each sensor channel are combined into a comprehensive feature vector, which is input into the pre-trained Transformer model, and the output result of the Transformer model is marked as the action effectiveness score; then, the basic threshold and the complement of the action effectiveness score are multiplied by the adjustment coefficient and added together, where the complement of the action effectiveness score is 1 minus the action effectiveness score; finally, according to the adjusted screening threshold, the channels with a higher value than the screening threshold are screened out from the channel importance scores of each sensor channel, and the corresponding contrast representation is extracted to generate a pure representation.
9. A method for guiding rehabilitation of thoracic surgery patients according to claim 8, characterized in that: Step S5 includes the following contents: The respiratory waveform phase is extracted from the respiratory waveform signal, and the pure representation is divided into multiple time domain groups according to the respiratory waveform phase; the pure representation of each time domain group is transformed into the frequency domain, and weighted processing is performed using the attention weight normalized by the frequency band energy feature set, and then the weighted frequency domain representation is converted back to the time domain to obtain a weighted representation; the weighted representation of each time domain group is weightedly summed by calculating the attention score to generate an intermediate representation, and the global attention mechanism is applied to the intermediate representation to generate the final evaluation result.
10. A thoracic surgery patient rehabilitation guidance system, used to implement a thoracic surgery patient rehabilitation guidance method according to any one of claims 1 to 9, characterized in that: include: Feature construction module, trajectory similarity module, channel contribution module, feature screening module, grouping fusion module; Feature construction module: Based on the start and stop event triggering moment of the breathing trainer physical switch, the time anchor point of the device activation period is determined in the inertial sensor data stream, and the frequency band energy distribution of each axial accelerometer in the preset window before and after the time anchor point is extracted to construct the frequency band energy feature set associated with the use of the device; Trajectory similarity module: The frequency band energy feature set is input into the twin network, and the similarity of the motion trajectory of the same joint in the activated and inactivated states of the device is calculated through comparative learning, generating comparative representations of compensatory actions and standard actions; Channel contribution module: using the frequency of device use as an instrumental variable, the causal forest model is used to perform counterfactual reasoning on the comparative representation to obtain the channel importance score of each sensor channel for the effectiveness of rehabilitation movements; Feature screening module: It mines key representations related to dynamic respiratory resistance information and joint motion information, inputs them into the pre-trained model, and adaptively adjusts the screening threshold according to the numerical value output by the model to screen out pure representations whose channel importance scores are higher than the adjusted threshold; Group fusion module: The pure representations are grouped in the time domain according to the phase of the respiratory waveform, and the frequency domain weighting is implemented using the frequency band energy as the attention weight, and the final evaluation result is generated through hierarchical attention fusion.
Citation Information
Patent Citations
Portable knee joint postoperative rehabilitation training monitoring and evaluating device and method
CN117137479A
Rehabilitation bicycle training method and system based on motor imagery
CN117493801A
Wing-shaped shoulder rehabilitation training evaluation system based on simplified signal expansion
CN119257568A
Systems and Methods for Training and / or Using Representation Learning Neural Networks for Electromyographic Data
US20240412869A1
Cited By
Rehabilitation evaluation system for respiratory patient
CN120473160A
Client classification method, business processing method and system based on causal inference and interpretability
CN121456683A
Limb rehabilitation exercise data evaluation system based on wearable device
CN121725985A
Digital rehabilitation guidance system
CN122050701A
A digital rehabilitation guidance system
CN122050701B