Health risk quantification modeling system based on federated knowledge distillation

CN122471457BActive Publication Date: 2026-10-09XIANKE GROUP HOLDINGS LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610632925.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-09
Publication Date
2026-10-09
Estimated Expiration
2046-05-09

AI Technical Summary

Technical Problem

此类方法虽能实现初步量化评估,但其模型更新机制严重依赖大批量历史数据的集中标注与离线训练,迭代周期长达数周甚至数月,无法对个体体质演变、症状动态波动及调理效果反馈进行实时响应

Benefits of technology

[0058]This invention addresses the shortcomings of existing technologies by constructing a federated knowledge distillation collaborative architecture that integrates a large cloud-based model with a lightweight edge student model. Under the premise of privacy compliance and complete separation of original health data, it generates a lightweight feature reduction encoder and risk inference model adapted to individual state distributions through task-oriented knowledge distillation. Furthermore, it introduces an alignment reduction mechanism based on dynamic time window adaptation and lightweight semantic disambiguation to solve technical bottlenecks such as temporal semantic misalignment, sparsity ambiguity, and mismatch between static reduction matrices and dynamic individual distributions in multimodal heterogeneous data. Simultaneously, a confidence monitoring module performs temporal smoothing filtering and convergence determination on the inference stability of the edge model, initiating federated collaborative optimization only after the confidence level meets the standard. An online verification module performs deviation threshold verification on the distributed model, ensuring that degraded models are promptly discarded and triggering multi-teacher redistillation rollback in the cloud. This achieves three goals: real-time risk rating at the edge, unified global model standards, and dynamic adaptation of individual states. It significantly improves the accuracy of intelligent risk factor analysis and the timeliness of priority ranking, enabling the generation of personalized treatment plan instructions to be synchronized with the actual evolution of the user's physical condition. It completely overcomes the shortcomings of traditional static rating rules, such as lag, insufficient adaptability, and misallocation of intervention resources. It provides a quantitative modeling solution for smart health monitoring and precision health management that combines high privacy and security, high real-time response, and high personalization adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122471457B_ABST
    Figure CN122471457B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of knowledge distillation, and particularly relates to a health risk quantification modeling system based on federal knowledge distillation, which comprises: a collection module, which acquires multi-modal health monitoring data and self-evaluation form of edge terminal; a feature dimension reduction module, which performs risk factor alignment and tensorization representation; a confidence monitoring module, which performs local inference by using a lightweight student model pre-generated by knowledge distillation of a cloud large model, and continuously monitors the confidence until a convergence signal is triggered; a collaborative optimization module, which performs parameter aggregation on encrypted gradients under a federal learning framework, drives the cloud large model to incrementally update and distill an updated student model adapted to the current edge distribution; and an online verification module, which loads the updated model and calculates a risk rating deviation value based on local cache data, and if the deviation is less than a threshold value, the model is solidified as a real-time inference engine and personalized conditioning instructions are automatically generated, otherwise the model is discarded and cloud multi-teacher redistillation is triggered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of knowledge distillation, and in particular relates to a health risk quantification modeling system and system based on federated knowledge distillation. Background Technology

[0002] In existing technologies, health risk rating and treatment recommendation decision-making systems generally adopt a centralized architecture, uploading individual multi-dimensional health data to a cloud server. They rely on preset fixed risk assessment thresholds, rating standards configured based on human diagnostic experience, or static risk assessment templates to complete constitution classification, symptom weighting, and priority ranking. While such methods can achieve preliminary quantitative assessment, their model update mechanisms heavily depend on centralized annotation and offline training of large amounts of historical data, with iteration cycles lasting weeks or even months. This makes it impossible to respond in real-time to individual constitution evolution, dynamic fluctuations in symptoms, and feedback on treatment effects. A more significant technical bottleneck lies in the fact that, to meet privacy and security compliance requirements, users' original physiological data, behavioral logs, and symptom self-assessment records are often forcibly stored on edge terminal devices, unable to be directly shared to the cloud for model optimization. Furthermore, edge devices, limited by computing power and storage resources, cannot independently support complex deep network training, resulting in long-term stagnation of their deployed risk rating models. These models cannot continuously extract new risk patterns from the global health knowledge base, nor can they adaptively adjust parameters based on individual real-time conditions. When a user experiences a sudden change in the strength of risk factor associations, the superposition of new symptoms, or an aggravation of existing biases, the edge still uses the initially set rating boundaries and priority strategies. This results in a serious lag in the identification of high-risk states, and low-risk factors occupying the intervention queue for a long time. The weight parameters of the symptom-constitution-disease risk path are misaligned with the actual situation, ultimately leading to a significant decrease in the suitability of the conditioning plan to the current physical condition, misallocation of health intervention resources, and loss of user trust.

[0003] Therefore, the core technical problem that existing technologies urgently need to solve is: how to build a lightweight edge model update mechanism that can dynamically adapt to changes in individual status without sharing original health data, so that it can both access local monitoring data in real time for online inference and maintain co-evolution with the global risk knowledge base in the cloud, thereby breaking through the fundamental limitations of static rating rules in terms of timeliness and personalization. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention proposes a health risk quantification modeling system based on federated knowledge distillation. The system includes: a data acquisition module, which acquires multimodal health monitoring data and self-assessment data from edge terminals; a feature dimensionality reduction module, which performs risk factor alignment and tensor quantization; a confidence monitoring module, which uses a lightweight student model pre-generated through knowledge distillation from a large cloud model for local inference, continuously monitoring the confidence level until a convergence signal is triggered; a collaborative optimization module, which aggregates parameters of encrypted gradients within a federated learning framework, driving incremental updates of the large cloud model and re-distilling an updated student model adapted to the current edge distribution; and an online verification module, which loads the updated model and calculates the risk rating deviation based on locally cached data. If the deviation is less than a threshold, it is solidified into a real-time inference engine and automatically generates personalized treatment instructions; otherwise, the model is discarded, and multi-teacher re-distillation in the cloud is triggered. This invention, through a federated knowledge distillation collaborative architecture, achieves dynamic adaptive evolution of edge models without sharing original data, significantly improving the real-time performance, accuracy, and personalization of health risk ratings, making it suitable for smart health monitoring and precision health management scenarios.

[0005] To achieve the above objectives, the present invention provides the following technical solution:

[0006] A health risk quantification modeling system based on federated knowledge distillation includes:

[0007] The data acquisition module is used to acquire local multimodal health monitoring time-series data and individual self-assessment data deployed on edge terminals;

[0008] The feature dimensionality reduction module performs risk factor alignment and feature dimensionality reduction based on the local multimodal health monitoring time series data and individual self-assessment data to generate a first health state feature tensor.

[0009] The confidence monitoring module is used to input the first health status feature tensor into a lightweight student model pre-placed on the edge terminal, output an initial risk rating sequence and confidence score, continuously monitor the confidence score until the confidence score is greater than or equal to a first preset threshold, and output an edge model convergence signal.

[0010] In response to receiving the convergence signal of the edge model, the collaborative optimization module initiates a federated collaborative optimization session. The edge terminal uploads the model gradient parameters obtained from the local training in this round to the federated parameter server after homomorphic encryption. The federated parameter server aggregates the encrypted gradients from multiple edge terminals and updates the cloud-based global risk model. After completing one round of incremental learning based on the aggregated gradients, the cloud-based global risk model generates an updated lightweight student model adapted to the current state distribution of the edge terminal through knowledge distillation, and distributes the weights of the lightweight student model to the edge terminal.

[0011] The online verification module is configured to: load the updated lightweight student model using the edge terminal, perform online verification using the latest monitoring data cached locally, and calculate the risk rating deviation value.

[0012] Specifically, the lightweight student model is generated by knowledge distillation and compression from a cloud-based global risk model, and performs risk probability inference and priority scoring.

[0013] The online verification module is further configured to: if the risk rating deviation value is less than the second preset risk rating deviation threshold, then solidify the updated lightweight student model into the real-time inference engine of the edge terminal, and automatically generate personalized treatment plan instructions based on the dynamic risk priority sorting output by the model.

[0014] If the risk rating deviation value is greater than or equal to the second preset risk rating deviation threshold, the updated lightweight student model is discarded, a model mismatch flag is sent to the cloud, the cloud global risk model is triggered to re-execute the multi-teacher knowledge distillation and distribute the generated new generation student model, and the risk factor alignment and feature dimensionality reduction steps are returned to be executed.

[0015] Specifically, risk factor alignment and feature dimensionality reduction are performed, including:

[0016] Based on the multimodal health monitoring time series data, at least one risk event mutation point and its corresponding timestamp sequence are extracted to generate a first time series event stream;

[0017] Based on the individual self-assessment data, a symptom entry normalization mapping is performed by a lightweight semantic disambiguation dictionary deployed on the edge terminal to generate a first discrete symptom vector containing symptom labels, severity, and self-assessment timestamps.

[0018] The first time-series event stream and the first discrete symptom vector are input to the dynamic time window adapter. The dynamic time window adapter is centered on the self-assessment timestamp, adaptively adjusts the width of the time window according to the risk factor type, extracts the time-series statistical features within the time window, establishes the association index between the symptom label and the corresponding time-series statistical features, and outputs a time-semantic joint aligned risk factor matrix.

[0019] The risk factor matrix is ​​input into a lightweight feature dimensionality reduction encoder pre-placed on the edge terminal. The lightweight feature dimensionality reduction encoder is generated by a cloud-based global risk model through task-oriented knowledge distillation and compression. Its encoding parameters are updated collaboratively with the cloud-based large model through federated learning, and the output is a first health state feature tensor after dimensionality compression.

[0020] Specifically, the symptom entry normalization mapping is performed through a lightweight semantic disambiguation dictionary deployed on edge terminals, including:

[0021] Retrieve the original symptom text field from the individual self-assessment form data;

[0022] Perform an approximate matching based on locality-sensitive hashing on the original symptom text field, and retrieve at least one candidate standard symptom term from the lightweight semantic disambiguation dictionary;

[0023] If a candidate standard symptom term with a similarity greater than the first semantic threshold is found, the original symptom text field is normalized to the symptom code corresponding to the candidate standard symptom term.

[0024] If no candidate standard symptom terms that meet the first semantic threshold are found, a local incremental learning process is triggered. The original symptom text field is homomorphically encrypted and uploaded to the federated parameter server. The cloud-based global risk model is requested to perform remote semantic disambiguation. The updated term mapping relationship is received from the cloud, the lightweight semantic disambiguation dictionary is updated, and the original symptom text field is temporarily assigned to the unlabeled set and marked with a low confidence indicator.

[0025] Specifically, adaptively adjusting the time window width based on the type of risk factor includes:

[0026] Read the risk factor type identifier corresponding to the symptom label;

[0027] Based on the preset risk factor-time window width mapping table, determine the baseline time window width associated with the risk factor type identifier;

[0028] The signal fluctuation entropy of the multimodal health monitoring time series data within the neighborhood of the self-assessment timestamp is obtained. If the signal fluctuation entropy is greater than a preset fluctuation threshold, the width of the reference time window is compressed by a first preset ratio; if the signal fluctuation entropy is less than the preset fluctuation threshold, the width of the reference time window is expanded by a second preset ratio.

[0029] Centered on the self-assessment timestamp, time-series monitoring data within the adaptively adjusted time window width is extracted, and at least one time-series statistical feature, including mean, variance, peak value, and slope of change, is calculated and stored in association with the symptom label.

[0030] Specifically, the generation and updating methods of the lightweight feature dimensionality reduction encoder include:

[0031] After the global high-risk model in the cloud completes one round of incremental learning, the parameters of the teacher model are frozen, the intermediate layer output that is aligned with the structure of the student model is selected, and the similarity of the representation of the teacher model and the student model in this intermediate layer is calculated.

[0032] Based on the representation similarity, the top K feature dimensions that contribute the most to the downstream risk rating task in the teacher model are identified, and an attention mask is generated.

[0033] Based on the attention mask, a weighted filtering is performed on the high-dimensional risk feature vector output by the teacher model, retaining the first K feature dimensions, and a task-oriented dimensionality reduction projection matrix is ​​constructed.

[0034] The dimensionality reduction projection matrix is ​​compressed into a lightweight fully connected layer adapted to the computing power of the edge terminal through knowledge distillation, and then distributed to the edge terminal as the weight of the lightweight feature dimensionality reduction encoder.

[0035] The edge terminal loads the lightweight feature dimensionality reduction encoder, performs matrix multiplication on the risk factor matrix, and outputs the first health state feature tensor.

[0036] Specifically, the initial risk rating sequence and confidence score are output, including:

[0037] The first health state feature tensor is input into the feature extraction backbone network of the lightweight student model to generate the first hidden layer representation tensor.

[0038] The first hidden layer representation tensor is fed into the first task branch and the second task branch, respectively, where:

[0039] The first task branch is a risk probability inference head, which includes at least one fully connected layer and a Softmax activation function, outputs the probability distribution of each preset risk dimension, and generates an initial risk rating sequence based on the risk level corresponding to the maximum probability value in the probability distribution.

[0040] The second task branch is a confidence assessment head, which shares some hidden layer parameters with the first task branch and outputs the confidence score for each risk dimension. The confidence score represents the reliability of the model's prediction results for the corresponding risk level.

[0041] The confidence scores are subjected to time-series smoothing filtering to generate a filtered confidence time-series sequence.

[0042] Extract the mean of the sliding window at the current time from the confidence time series. If the mean of the sliding window is greater than or equal to the first preset threshold, it is determined that the edge model has reached the convergence state, and the edge model convergence signal is output.

[0043] If the mean of the sliding window is less than the first preset threshold, the first health state feature tensor and the corresponding model output are continuously cached until the number of cached samples reaches the preset batch size. Then, a local training task is triggered, and the cached samples are used to perform incremental fine-tuning on the lightweight student model. The confidence time series is updated, and the confidence monitoring step is repeated.

[0044] Specifically, the confidence score output by the confidence assessment header includes:

[0045] Obtain the risk probability distribution vector output by the first task branch;

[0046] Calculate the information entropy of the risk probability distribution vector, and convert the information entropy into a first confidence component through negative exponential mapping;

[0047] Obtain the feature activation values ​​of the intermediate layer of the lightweight student model, calculate the representation similarity between the lightweight student model and the cloud-based global risk model in the corresponding distillation layer, and use the normalized representation similarity as the second confidence component.

[0048] The first confidence component and the second confidence component are weighted and fused to generate the confidence score.

[0049] Specifically, performing time-series smoothing filtering on the confidence score includes:

[0050] Initialize a circular buffer of length N to store the confidence scores of the first N inference outputs;

[0051] After each inference is completed, the current confidence score is written to the circular buffer, and the arithmetic mean of all confidence scores in the buffer is calculated as the mean of the sliding window.

[0052] If the circular buffer is not full, the historical global mean is used for filling compensation, and the compensated sliding window mean is output.

[0053] Specifically, triggering a local training task and performing incremental fine-tuning of the lightweight student model using cached samples includes:

[0054] Read the first health status feature tensor and its corresponding initial risk rating sequence from the cache to form a local training sample pair;

[0055] The parameters of the feature extraction backbone network in the lightweight student model, excluding the classification head, are fixed, and several rounds of stochastic gradient descent updates are performed only on the terminal fully connected layers of the first and second task branches.

[0056] After fine-tuning, some cached samples are cleared, and risk inference is re-performed on the latest collected feature tensors based on the updated lightweight student model to generate an updated confidence time series.

[0057] Compared with the prior art, the beneficial effects of the present invention are:

[0058] This invention addresses the shortcomings of existing technologies by constructing a federated knowledge distillation collaborative architecture that integrates a large cloud-based model with a lightweight edge student model. Under the premise of privacy compliance and complete separation of original health data, it generates a lightweight feature reduction encoder and risk inference model adapted to individual state distributions through task-oriented knowledge distillation. Furthermore, it introduces an alignment reduction mechanism based on dynamic time window adaptation and lightweight semantic disambiguation to solve technical bottlenecks such as temporal semantic misalignment, sparsity ambiguity, and mismatch between static reduction matrices and dynamic individual distributions in multimodal heterogeneous data. Simultaneously, a confidence monitoring module performs temporal smoothing filtering and convergence determination on the inference stability of the edge model, initiating federated collaborative optimization only after the confidence level meets the standard. An online verification module performs deviation threshold verification on the distributed model, ensuring that degraded models are promptly discarded and triggering multi-teacher redistillation rollback in the cloud. This achieves three goals: real-time risk rating at the edge, unified global model standards, and dynamic adaptation of individual states. It significantly improves the accuracy of intelligent risk factor analysis and the timeliness of priority ranking, enabling the generation of personalized treatment plan instructions to be synchronized with the actual evolution of the user's physical condition. It completely overcomes the shortcomings of traditional static rating rules, such as lag, insufficient adaptability, and misallocation of intervention resources. It provides a quantitative modeling solution for smart health monitoring and precision health management that combines high privacy and security, high real-time response, and high personalization adaptability. Attached Figure Description

[0059] Figure 1 This is a module diagram of a health risk quantification modeling system based on federated knowledge distillation, as described in Embodiment 1 of the present invention.

[0060] Figure 2 This is a flowchart illustrating the risk factor alignment and feature dimensionality reduction process performed in Embodiment 1 of the present invention.

[0061] Figure 3 This is a flowchart illustrating the symptom entry normalization mapping process performed by a lightweight semantic disambiguation dictionary deployed on an edge terminal in Embodiment 1 of the present invention. Detailed Implementation

[0062] Example 1

[0063] Please see Figure 1 The present invention provides an embodiment of a health risk quantification modeling system based on federated knowledge distillation, comprising the following steps:

[0064] The data acquisition module is used to acquire local multimodal health monitoring time-series data and individual self-assessment data deployed on edge terminals;

[0065] The feature dimensionality reduction module performs risk factor alignment and feature dimensionality reduction based on the local multimodal health monitoring time series data and individual self-assessment data to generate a first health state feature tensor.

[0066] The confidence monitoring module is used to input the first health status feature tensor into a lightweight student model pre-placed on the edge terminal, output an initial risk rating sequence and confidence score, continuously monitor the confidence score until the confidence score is greater than or equal to a first preset threshold, and output an edge model convergence signal. In the system of this embodiment, in the health risk quantification modeling scenario of this application, the setting of the first preset threshold needs to take into account the dynamic differences of individual states of edge terminals and the triggering reliability of federated collaborative optimization, and adopts a reproducible adaptive statistical method, specifically as follows: The system selects the historical confidence time series sequence of the edge terminal in the past 72 hours or the past 100 inference caches, calculates the long-term distribution of the sliding window mean of the sequence, wherein the sliding window length is consistent with the sliding window of confidence monitoring, denoted as N, and sets the first preset threshold to 1.2 to 1.5 times the historical mean, preferably 1.3 times; if the calculation result of the historical mean plus two standard deviations is higher than the above value, the larger value of the two is taken to ensure that the convergence signal is triggered only when the model prediction stability is significantly higher than its own average level. Meanwhile, to avoid threshold mismatch during cold starts or when data distribution fluctuates drastically, the system introduces a dynamic adjustment mechanism: if the terminal fails to reach the initial threshold within 50 consecutive inferences, these 50 consecutive inferences are counted as one round, and the terminal automatically lowers the threshold by 0.02 per round, with the minimum threshold not lower than 0.70. This value is set based on the clinical error tolerance accuracy of health risk rating. While the threshold is lowered, the terminal simultaneously reports a low convergence flag to the cloud, enabling the cloud to specifically enhance the distribution adaptation weight of the terminal during subsequent distillation.

[0067] In response to receiving the convergence signal of the edge model, the collaborative optimization module initiates a federated collaborative optimization session. The edge terminal uploads the model gradient parameters obtained from the local training in this round to the federated parameter server after homomorphic encryption. The federated parameter server aggregates the encrypted gradients from multiple edge terminals and updates the cloud-based global risk model. After completing one round of incremental learning based on the aggregated gradients, the cloud-based global risk model generates an updated lightweight student model adapted to the current state distribution of the edge terminal through knowledge distillation, and distributes the weights of the lightweight student model to the edge terminal.

[0068] The online verification module is configured to: load the updated lightweight student model using the edge terminal, perform online verification using the latest monitoring data cached locally, and calculate the risk rating deviation value;

[0069] If the risk rating deviation value is less than the second preset risk rating deviation threshold, the updated lightweight student model is solidified as the real-time inference engine of the edge terminal, and personalized treatment plan instructions are automatically generated based on the dynamic risk priority ranking output by the model. In the system of this embodiment, in the health risk quantification modeling scenario of this application, the second preset risk rating deviation threshold is used to determine whether the updated lightweight student model issued by the cloud is suitable for the actual state distribution of the current edge terminal. Its setting needs to reflect strict constraints on the tolerance of model performance degradation, and adopt a combination of historical deviation statistics and clinical risk tolerance. The reproduction method is as follows: The system uses the average rating deviation of the previous version of the fixed model on the local 50 most recent validation samples as the benchmark. These 50 validation samples have all been manually or expert-reviewed. The second preset threshold is set to 1.2 to 1.5 times the benchmark value, with 1.3 times being preferred. At the same time, the minimum detectable difference of clinical risk tolerance is superimposed. If the risk level is divided into 1 to 5 levels, where level 1 is the lowest level and level 5 is the highest level, then a single-dimensional deviation of no more than 0.5 levels is considered acceptable. That is, the second preset threshold should not be lower than 0.5 levels. This 0.5 level is normalized to 0.1 levels. To prevent misjudgments due to insufficient or skewed validation samples, the system introduces an adaptive mechanism: when the number of historical validation samples on the terminal is less than 30, 30 is the preset minimum value, and the threshold temporarily adopts the globally conservative default value of 0.15 issued by the cloud. This value is set based on the minimum acceptable deviation of validation of large-scale public health datasets; once the number of locally accumulated validation samples reaches 30 or more, it immediately switches to an adaptive threshold based on historical deviation, thereby achieving a balance between the security of model updates and the efficiency of personalized adaptation to the terminal.

[0070] If the risk rating deviation value is greater than or equal to the second preset risk rating deviation threshold, the updated lightweight student model is discarded, a model mismatch flag is sent to the cloud, triggering the cloud-based global risk model to re-execute multi-teacher knowledge distillation and distribute the generated new generation student model, and then returning to execute the risk factor alignment and feature dimensionality reduction steps. It should be further noted that the lightweight student model in this embodiment is generated by knowledge distillation compression from the cloud-based global risk model, performing risk probability inference and priority scoring. Furthermore, the implementation steps for triggering the cloud-based global risk model to re-execute multi-teacher knowledge distillation specifically include:

[0071] 3.1 The cloud-based global risk model calls multiple heterogeneous teacher models pre-stored in the cloud model library. These heterogeneous teacher models include a global risk rating master model based on the Transformer architecture, a risk factor correlation analysis model based on graph attention networks, a physiological signal risk trend prediction model based on temporal convolutional networks, and a symptom-risk mapping expert model based on a clinical rule base. Simultaneously, the model reads the mismatch risk dimension identifier from the model mismatch identifier and filters out teacher models whose historical validation accuracy under the mismatch risk dimension is higher than a preset accuracy threshold. The preset accuracy threshold is 85%, which is set based on the minimum acceptable accuracy of clinical risk rating. After filtering, an effective set of teacher models for this round of distillation is formed.

[0072] It should be further explained that the construction and training steps of the heterogeneous teacher model described in this embodiment specifically include: the global risk rating main model based on the Transformer architecture adopts a BERT-based lightweight improved Transformer encoder, setting 6 Transformer encoding blocks, each encoding block containing a multi-head self-attention sub-layer and a feedforward neural network sub-layer, the number of multi-head attention heads is set to 8, the hidden layer dimension is set to 512, and the intermediate layer dimension of the feedforward neural network is set to 2048. At the model input end, a word embedding layer and a position embedding layer are set to encode the input multimodal health feature sequence. At the output end, a classification head consisting of 2 fully connected layers and a Softmax activation function is set to output balanced constitution, qi deficiency constitution, yang deficiency constitution, yin deficiency constitution, and phlegm dampness constitution. Nine pre-defined risk dimensions and probability distributions of risk levels 1 to 5 were established for the model, including constitution, damp-heat constitution, blood stasis constitution, qi stagnation constitution, and special constitution. The model was trained using an ethically approved desensitized full-dimensional health checkup dataset, the MIMIC-IV public dataset, and the CHNS China Health and Nutrition Survey dataset. These datasets contain multimodal physiological time-series data, symptom self-assessment records, and gold standard annotations of risk levels corresponding to clinical diagnoses, with a total sample size of no less than 500,000 records. The datasets were divided into training, validation, and test sets in an 8:1:1 ratio. After standardization, normalization, missing value imputation, and outlier removal, the multimodal health features were converted into fixed-length 128-bit sequence tensors. One-hot encoding was performed on the gold standard risk levels. The training configuration used the AdamW optimizer with an initial learning rate of 2e^(-1 / 2). -5 Weight decay coefficient 1e -4The batch size is 64, the maximum training epochs are 30, the loss function is multi-class cross-entropy loss function with a label smoothing coefficient of 0.1 added to alleviate overfitting. The training process is as follows: freeze the embedding layer parameters for 3 warm-up training epochs, then unlock all parameters to perform full training. After each training epoch, the model classification accuracy is calculated on the validation set. If the accuracy improvement on the validation set is less than 0.1% for 5 consecutive epochs, early stop is triggered to terminate the training. After training, the overall classification accuracy of the model is verified on the test set to be no less than 90%, and the single risk dimension classification accuracy is no less than 85%. The model weights are then stored in the cloud model library. The risk factor association analysis model based on graph attention network is set with 2 graph attention layers, each with 4 attention heads and 128 output dimensions. The model input is a risk factor heterogeneous graph, and the nodes of the heterogeneous graph are physiological indicator factors, symptom factors, constitution factors, and disease risk factors. The model uses predefined health risk factors, with edges representing clinical associations between these factors. Node features represent the statistical and temporal fluctuation characteristics of the corresponding risk factors. The output is configured with an association weight prediction head to output the association strength weights between any two risk factors and the contribution scores of each risk factor to the target risk dimension. The model is trained using a risk factor association knowledge base constructed based on clinical guidelines for Traditional Chinese Medicine constitution and modern medical disease diagnosis and treatment guidelines, combined with a risk factor co-occurrence relationship dataset from desensitized clinical medical records. This results in a heterogeneous graph dataset containing over 1200 risk factor nodes and over 150,000 association edges, divided into training and validation subgraphs in a 7:3 ratio. Z-score standardization is applied to node features, and normalization is performed on association edge weights to construct a graph adjacency matrix and a node feature matrix. The training configuration uses the Adam optimizer with an initial learning rate of 1e. -3The batch size is 32, the maximum training epochs are 50, the loss function adopts the mean squared error loss function for the association strength prediction task and adds a graph structure regularization term to constrain the sparsity of node embedding. After each training epoch, the mean absolute error of association strength prediction is calculated in the validation subgraph. If the mean absolute error of the validation set decreases by less than 0.005 for 6 consecutive epochs, early stopping is triggered. After training, the accuracy of the model in predicting high-risk factor association pairs is no less than 88%. The model weights are then stored in the cloud model library. The physiological signal risk trend prediction model based on temporal convolutional networks adopts a causal temporal convolutional network architecture, with 4 layers of dilated causal convolutional blocks. Each convolutional block contains 2 one-dimensional causal convolutional layers, a batch normalization layer, a ReLU activation function layer and a Dropout layer. The kernel size is set to 3, and the dilation coefficient increases layer by layer in [1,2,4,8] to ensure that the model's receptive field covers no less than 72 hours of physiological temporal data. The input consists of multimodal physiological time-series data, with a sequence length of 1440 bytes corresponding to 24 hours of time-series data sampled at a 1-minute sampling frequency. The output is a trend prediction head that outputs the probability distribution of risk level changes in the target risk dimension within two time windows: 24 hours and 72 hours. The model is trained using a continuous physiological time-series desensitized dataset collected by wearable devices and an ICU multi-parameter monitoring dataset. The dataset contains physiological signal sampling data from more than 7 consecutive days and corresponding clinical risk event annotations within the time windows, with a total sample size of no less than 200,000 time-series sequences. These sequences are divided into training, validation, and test sets in an 8:1:1 ratio. The physiological time-series data is resampled to a uniform 1-minute sampling frequency, and after removing high-frequency noise through a sliding window mean filter, it is normalized to the [0,1] interval using min-max normalization. One-hot encoding is performed on the gold standard for future risk trends. The training configuration uses the AdamW optimizer with an initial learning rate of 5e. -4 Weight decay coefficient 1e -5The batch size is 128, with a maximum training epoch of 40 epochs. The loss function used is the multi-class cross-entropy loss function. After each training epoch, the trend prediction accuracy is calculated on the validation set. If the accuracy improvement on the validation set is less than 0.15% for five consecutive epochs, early termination is triggered. After training, the model's risk trend prediction accuracy is verified on the test set to be no less than 86% after 72 hours. The model weights are then stored in a cloud-based model library. The symptom-risk mapping expert model based on a clinical rule base adopts a hybrid architecture of a rule engine and a lightweight logistic regression classifier. The core is a pre-built clinical rule base, constructed according to the "Classification and Determination of Traditional Chinese Medicine Constitution," the "National Basic Public Health Service Specifications" health risk assessment specifications, and clinical common disease diagnosis and treatment guidelines. It includes three main categories: symptom term-risk dimension mapping rules, symptom severity-risk level assignment rules, and multi-symptom superposition risk correction rules, with a total of no less than 2000 rule entries. The model input receives normalized standard symptom terms and severity vectors, and the output outputs the risk level mapping results corresponding to the risk dimension and the corresponding rule settings. The model training and rule optimization utilize a symptom-risk matching dataset with at least 100,000 samples, reviewed and annotated by experts with associate chief physician or higher titles. The dataset is divided into training and validation sets in a 7:3 ratio. First, basic rule entries are entered based on clinical guidelines and physical condition assessment standards, with initial weights and confidence scores assigned to each rule. Then, a logistic regression classifier is used to perform secondary calibration on the risk level results output by the rules. The optimization configuration employs gradient descent with a maximum of 100 iterations. The loss function used is the binary cross-entropy loss function for single-risk dimension risk level binary classification tasks. The optimization process involves iteratively optimizing the weights of rule entries based on the training set data, removing invalid rules with a misclassification rate higher than 20%, and adding new rules with high recall. After each round of optimization, the symptom-risk mapping accuracy is calculated on the validation set. If the accuracy improvement is less than 0.2% for three consecutive rounds, the optimization is terminated. After optimization, the overall symptom-risk mapping accuracy of the validation model is no less than 92%. The optimized rule base and logistic regression classifier weights are then stored in a cloud-based model library.

[0073] 3.2 Extract the risk factor distribution features of the edge terminal from the model mismatch identifier and corresponding historical state data, including the proportion of risk dimensions, symptom label distribution, and temporal fluctuation features of physiological signals; perform hierarchical resampling from the desensitized public health dataset and the edge terminal state distribution memory according to the risk factor distribution features, wherein the public health dataset provides general health feature samples without individual privacy risks, and the edge terminal state distribution memory provides anonymized aggregated feature samples with the same distribution, and the two types of samples are mixed according to a preset ratio to construct a multi-source distillation dataset containing temporal physiological features, symptom semantic features, and risk label triplet; divide the multi-source distillation dataset into a distillation training set and a distillation validation set according to a preset ratio, and complete data normalization and dimension alignment preprocessing;

[0074] 3.3 Parallel Inference and Soft Label Generation using Multi-Teacher Models: The parameters of all teacher models in the effective teacher model set are frozen. A distillation temperature coefficient matching the output distribution characteristics is configured for each teacher model, where the distillation temperature coefficient for the Transformer main model is 3, and the distillation temperature coefficients for the other models are 2. Each teacher model performs parallel inference on the distillation training set, outputting a soft label representing the probability distribution of each sample corresponding to a preset risk dimension. Confidence filtering is performed on the soft labels output by each teacher model, removing invalid outputs with a single sample confidence level lower than a preset soft label confidence threshold of 0.8. It should be further noted that the application of the distillation temperature coefficient in soft label generation in this embodiment is specifically as follows: the effective teacher model set is frozen. After obtaining the trainable parameters of all teacher models, each teacher model performs forward inference on the distillation training set samples and outputs the original logits vector corresponding to the preset risk dimension. For the original logits vector output by each teacher model, each element value is divided by the distillation temperature coefficient corresponding to that teacher model, and then the probability mapping is performed through the Softmax activation function to generate the probability distribution soft label of the corresponding sample. The distillation temperature coefficient of the Transformer main model is 3, and the distillation temperature coefficient of the other models is 2. The soft label after temperature coefficient scaling can smooth the probability distribution and retain the inter-category association knowledge learned by the teacher model. After the soft label is generated, each teacher model synchronously outputs the original logits vector and probability distribution result of the corresponding soft label. It should be further explained that the confidence calculation and filtering rules for the soft labels output by the teacher model in this embodiment are as follows: For the probability distribution soft label output by a single teacher model for a single sample, the difference between the maximum probability value and the second largest probability value of the probability distribution vector is calculated. This difference is then normalized to the [0,1] interval by min-max and used as the confidence score of the soft label of the teacher model for that sample. For each sample, the confidence scores of the soft labels of all teacher models in the effective teacher model set are traversed. The soft label outputs of teacher models with confidence scores lower than 0.8 on that sample are removed. If the confidence scores of a teacher model on soft labels are lower than the confidence threshold for more than 10 consecutive samples, then that teacher model is removed from the effective teacher model set in this round of distillation. After filtering, the soft label outputs of the remaining effective teacher models are used as the effective input for subsequent weighted fusion. If there are no effective teacher model outputs after filtering a single sample, then that sample is removed from the distillation training set.

[0075] 3.4 For each sample, obtain the historical validation F1 score of each teacher model in the effective teacher model set under the mismatch risk dimension, and generate the basic weights of each teacher model after normalization of the F1 scores; for the soft label component corresponding to the mismatch risk dimension, add weight gain to the teacher model with higher historical accuracy under this dimension to generate the dynamic fusion weights of each teacher model; based on the dynamic fusion weights, perform weighted summation on the soft labels output by each teacher model, and then perform probability normalization on the summation result to generate the fusion soft label corresponding to each sample, which serves as the supervision signal for this round of distillation;

[0076] It should be further explained that the historical validation F1 score of the teacher model under the mismatch risk dimension described in this embodiment is calculated, updated, and applied in the following way: The F1 score is an evaluation index for binary classification tasks under a single risk dimension, used to quantify the teacher model's ability to distinguish between medium and high risk levels under that risk dimension. The calculation dimension corresponds one-to-one with the mismatch risk dimension. Each preset risk dimension of each teacher model is independently calculated and stored with an F1 score ranging from [0,1]. The higher the value, the higher the prediction accuracy of the corresponding dimension. During the calculation, for the target risk dimension, the F1 score is first calculated from the cloud and the training dataset. At least 10,000 samples were extracted from a completely physically isolated, desensitized health validation dataset reviewed and annotated by experts with associate chief physician or higher titles. A binary classification labeling system was constructed, with a gold standard risk level ≥3 as positive samples and a label value of 1, and a gold standard risk level <3 as negative samples and a label value of 0. The validation set samples were then input into the target teacher model, and predicted labels were generated according to the same binary classification rules. A confusion matrix was constructed based on the gold standard labels and predicted labels, and four basic statistics were obtained: true positives (TP), false positives (FP), true negatives (TN), and false negatives (FN). Subsequently, the formula Precision = TP was applied. Precision is calculated using the formula / (TP+FP) (Precision is 0 when TP+FP=0). Recall is calculated using the formula Recall=TP / (TP+FN) (Recall is 0 when TP+FN=0). Finally, the F1 score of the corresponding teacher model under the target risk dimension is calculated using the core formula F1=2×(Precision×Recall) / (Precision+Recall) (F1 is 0 when Precision+Recall=0). The updating and storage of the F1 score follows these rules: Teacher Model During training and solidification, the initial F1 score is calculated by traversing all preset risk dimensions and stored in the model metadata data table in the cloud model library. Every 30 days, the cloud updates the F1 score of the entire model across all dimensions based on newly added expert-annotated validation samples within the period. When the teacher model completes incremental optimization or the number of new validation samples for a single risk dimension exceeds 5,000, a targeted update of the F1 score for the corresponding dimension of the model is immediately triggered. All F1 scores are stored in a structured format with a unique model identifier, risk dimension code, F1 score value, calculation timestamp, and validation sample size, and can be retrieved in real time during the distillation process.In the dynamic weighted fusion stage of multi-teacher knowledge distillation, for the identified mismatch risk dimensions, the latest F1 score of the corresponding dimension of the effective teacher model set is retrieved from the cloud metadata database. All original F1 scores are subjected to min-max normalization processing. The scores are mapped to the interval [0,1] according to the formula F1_norm_i=(F1_i-F1_min) / (F1_max-F1_min), where F1_i is the original F1 score of the i-th teacher model, and F1_max and F1_min are the maximum and minimum original F1 scores in the effective teacher model set, respectively. The normalized F1_norm_i is the basic value for calculating the dynamic fusion weight of the teacher model. It should be further explained that the calculation of teacher model weight gain and the dynamic fusion weight generation rule in this embodiment are as follows: For the identified mismatch risk dimension, the median of the historical validation F1 score in the effective teacher model set under that dimension is used as the baseline. For teacher models with F1 scores higher than the baseline, the weight gain is calculated according to the proportion of their F1 scores exceeding the baseline. The gain calculation formula is Gain_i=(F1_i-F1_med) / F1_med, where F1_i is the F1 score of the i-th teacher model, F1_med is the median of the baseline, and the upper limit of the weight gain is set to 0.5 and the lower limit is set to 0. The normalized F1 score is added to the corresponding weight gain to generate the dynamic fusion weight of the teacher model under the mismatch risk dimension. For non-mismatch risk dimensions, the normalized F1 score is directly used as the fusion weight. The fusion weights of all dimensions are normalized to ensure that the sum of the fusion weights of each teacher model in a single sample is 1. It should be further explained that the weighted summation and probability normalization processing of the fused soft labels in this embodiment is as follows: For each preset risk dimension of each sample, using the dynamic fusion weights of each teacher model under that dimension as coefficients, the element-wise weighted summation of the soft label probability distribution vector of each teacher model under that dimension is performed to generate the weighted summation vector of that dimension; for each dimension's weighted summation vector, the Softmax function is used to perform dimension-wise probability normalization processing, mapping each element in the vector to the [0,1] interval and ensuring that the sum of all elements in a single dimension is 1, generating the fused soft label component of that dimension; the fused soft label components of all preset risk dimensions are concatenated in a preset order to generate the complete fused soft label of the sample, which serves as the main supervision signal for this round of distillation training of the student model.

[0077] 3.5. Using a lightweight network structure that is fully adapted to the computing power, input and output dimensions of the edge terminal as the student model skeleton, load the student model weights stably operated in the previous version of the edge terminal as the initial value of warm start; taking the fused soft labels as the main supervision signal and the hard labels of the distillation validation set as the auxiliary supervision signal, a joint distillation loss function is constructed. The joint distillation loss function includes the KL divergence loss between the soft labels and the output of the student model, the cross-entropy loss between the hard labels and the output of the student model, and the mean square error loss between the intermediate layer features of the teacher model and the student model, with weight proportions of 0.6, 0.3 and 0.1 respectively; multiple rounds of distillation training are performed on the cloud graphics processing unit cluster until the loss of the distillation validation set converges to the preset convergence threshold or reaches the maximum number of iteration rounds, wherein the preset convergence threshold is 0.05 and the maximum number of iteration rounds is 25; after the training is completed, accuracy verification is performed on the generated new-generation lightweight student model. If the verification accuracy of the model under the mismatch risk dimension reaches the preset qualification threshold, the model is determined to be qualified, and the generation of the new-generation lightweight student model is completed, and the preset qualification threshold is 88%; if the accuracy fails to reach the standard, the teacher model set is re-adjusted, models with high accuracy in mismatched dimensions are supplemented, the distillation temperature coefficient is adjusted with an adjustment range of ±0.5, and the loss weights are adjusted, wherein the adjustment range of the KL divergence loss weight is ±0.1, and then the distillation training process is repeated; it should be further noted that in this embodiment, the specific calculation logic of the joint distillation loss function is as follows: the student model outputs a prediction logits vector whose dimensions are aligned with those of the teacher model through forward inference. First, the student model prediction logits vector is scaled by the same distillation temperature coefficient used for fused soft label generation, and after activation by Softmax, the probability distribution of the student model is generated, and the KL divergence between this distribution and the fused soft labels is calculated to obtain the soft label loss term L_soft; second, the original prediction logits vector of the student model is activated by Softmax to generate a hard prediction distribution, and the multi-classification cross-entropy loss between this distribution and the gold standard hard labels of samples is calculated to obtain the hard label loss term L_hard; meanwhile, the intermediate coding layers with aligned structures of the teacher model and the student model are selected, the feature tensors output by the two layers are extracted respectively, after global average pooling dimensionality reduction is performed on the feature tensors to the same dimension, the mean square error between the two is calculated to obtain the feature alignment loss term L_feat; finally, weighted summation is performed on the three loss items according to the weight proportions 0.6, 0.3 and 0.1 to obtain the joint distillation loss function L_total=0.6×L_soft+0.3×L_hard+0.1×L_feat, and this loss function serves as the optimization objective for back propagation in distillation training.

[0078] The cloud-based global risk model packages the weight file, model version number, adapted risk factor distribution characteristics, and distillation meta-information of the qualified new generation lightweight student model, performs digital signature and encryption processing using the certificate public key of the corresponding edge terminal, and distributes it to the edge terminal through the encrypted channel of the federated parameter server.

[0079] After receiving the encrypted data packet, the edge terminal verifies the integrity and legality of the digital signature. If the verification is successful, it decrypts the weight file of the new generation lightweight student model and verifies the model's input and output dimensions, structural compatibility, and matching with the local feature processing flow. If all verifications are successful, the edge terminal returns to execute the risk factor alignment and feature dimensionality reduction steps and restarts the complete health risk quantification inference process based on the new generation lightweight student model. If the verification fails, the edge terminal sends the model mismatch flag to the cloud again and re-triggers the multi-teacher knowledge distillation process.

[0080] For example, an edge terminal user with Qi deficiency continuously wears a smart bracelet to collect time-series data on heart rate, blood oxygen, and sleep stages, and fills out a self-assessment scale containing symptom entries daily. After the system's data acquisition module obtains the above multimodal data, the feature dimensionality reduction module performs risk factor alignment and feature dimensionality reduction to generate a 64-dimensional first health state feature tensor. The confidence monitoring module inputs this tensor into a lightweight student model pre-installed on the edge terminal. The model outputs a Qi deficiency risk level of medium and a confidence score of 0.81. The system continuously monitors the confidence score. When the sliding window average of 10 consecutive inferences reaches 0.83, exceeding the first preset threshold of 0.80, the edge model convergence signal is output. In response to receiving the convergence signal of the edge model, the collaborative optimization module initiates a federated collaborative optimization session: The edge terminal performs differentiated training on the currently deployed lightweight student model based on 500 locally cached sample pairs, freezes the backbone network parameters for feature extraction, and only updates the terminal fully connected layers of the first and second task branches to generate a sparse gradient tensor. This sparse gradient tensor is then homomorphically encrypted using CKKS and uploaded to the federated parameter server along with the sample count and the terminal's anonymity identifier. The federated parameter server aggregates the encrypted gradients uploaded from the five edge terminals, performs a weighted average based on the sample count in the ciphertext domain, decrypts the gradient to obtain the plaintext aggregated gradient, and inputs it into the Adam optimizer of the cloud-based global risk model to perform an incremental parameter update. The updated cloud-based global risk model, used as the teacher model, undergoes two-stage knowledge distillation—global common distillation and distribution adaptation distillation—to generate an updated lightweight student model adapted to the recent rising distribution of the sputum-dampness risk ratio of the terminal. The weight file of this updated lightweight student model is then encrypted with a digital signature and distributed to the edge terminal. The online verification module loads the updated lightweight student model and calculates the risk rating deviation value using 20 locally cached verification samples reviewed by family doctors. The result is 0.12, which is less than the second preset risk rating deviation threshold of 0.15, indicating successful model adaptation. The updated lightweight student model is then solidified into the real-time inference engine of the edge terminal. This real-time inference engine outputs a dynamic risk priority ranking: high-level Qi deficiency, medium-level phlegm-dampness, and low-level Yang deficiency. Based on this dynamic risk priority ranking, the system automatically generates personalized conditioning instructions, including suggestions such as Astragalus and Codonopsis tea, daily Eight-Section Brocade exercises, and controlling the intake of sweets in the diet. If the risk rating deviation value is greater than or equal to the second preset risk rating deviation threshold of 0.15, the edge terminal discards the updated lightweight student model, sends a model mismatch flag to the cloud, triggers the cloud-based global risk model to re-execute multi-teacher knowledge distillation, and distributes the generated new generation lightweight student model to the edge terminal. The system then returns to perform risk factor alignment and feature dimensionality reduction steps, restarting the health risk quantification inference process.

[0081] Further explanation is needed; please refer to [link / reference]. Figure 2This embodiment performs risk factor alignment and feature dimensionality reduction, including:

[0082] Based on the multimodal health monitoring time series data, at least one risk event mutation point and its corresponding timestamp sequence are extracted to generate a first time series event stream;

[0083] Based on the individual self-assessment data, a symptom entry normalization mapping is performed by a lightweight semantic disambiguation dictionary deployed on the edge terminal to generate a first discrete symptom vector containing symptom labels, severity, and self-assessment timestamps.

[0084] The first time-series event stream and the first discrete symptom vector are input to the dynamic time window adapter. The dynamic time window adapter is centered on the self-assessment timestamp, adaptively adjusts the width of the time window according to the risk factor type, extracts the time-series statistical features within the time window, establishes the association index between the symptom label and the corresponding time-series statistical features, and outputs a time-semantic joint aligned risk factor matrix.

[0085] The risk factor matrix is ​​input into a lightweight feature dimensionality reduction encoder pre-placed on the edge terminal. The lightweight feature dimensionality reduction encoder is generated by a cloud-based global risk model through task-oriented knowledge distillation and compression. Its encoding parameters are updated collaboratively with the cloud-based large model through federated learning, and the output is a first health state feature tensor after dimensionality compression.

[0086] Further explanation is needed; please refer to [link / reference]. Figure 3 This embodiment performs symptom entry normalization mapping using a lightweight semantic disambiguation dictionary deployed on edge terminals, including:

[0087] Retrieve the original symptom text field from the individual self-assessment form data;

[0088] Perform an approximate matching based on locality-sensitive hashing on the original symptom text field, and retrieve at least one candidate standard symptom term from the lightweight semantic disambiguation dictionary;

[0089] If a candidate standard symptom term with a similarity greater than the first semantic threshold is found, the original symptom text field is normalized to the symptom code corresponding to the candidate standard symptom term.

[0090] If no candidate standard symptom entries satisfying the first semantic threshold are found, a local incremental learning process is triggered. The original symptom text field is homomorphically encrypted and uploaded to the federated parameter server. The cloud-based global risk model is requested to perform remote semantic disambiguation, and the updated term mapping relationship is received from the cloud. The lightweight semantic disambiguation dictionary is updated, and the original symptom text field is temporarily assigned to the unlabeled set and marked with a low-confidence identifier. For example, when a user fills out a self-assessment form, they input the original symptom text "always waking up at night, restless sleep." The lightweight semantic disambiguation dictionary on the edge terminal already contains standard entries such as insomnia, early awakening, and excessive dreaming. Through local sensitive hashing calculation, the similarity between "always waking up at night" and "early awakening" is 0.92, and the similarity between "restless sleep" and "excessive dreaming" is also low. Therefore, "always waking up at night" is normalized to the symptom code S02-early awakening, while the similarity between "restless sleep" and "excessive dreaming" is assumed to be below the first semantic threshold, triggering remote semantic disambiguation. The edge terminal uploads the "sleep disturbance" data after homomorphic encryption. The cloud-based global high-risk model analyzes the data and returns the standard term "sleep disturbance" with a confidence score of 0.96. The edge terminal updates its local dictionary, adds the mapping "sleep disturbance" to "sleep disturbance", and generates the first discrete symptom vector: [symptom tag: early awakening, severity: moderate, self-assessment timestamp: 2026-02-13 22:35:00] and [symptom tag: sleep disturbance, severity: moderate, self-assessment timestamp: 2026-02-13 22:35:00].

[0091] It should be further explained that, in this embodiment, the dynamic time window adapter adaptively adjusts the time window width based on the risk factor type, centered on the self-assessment timestamp, including:

[0092] Read the risk factor type identifier corresponding to the symptom label;

[0093] Determine the reference time window width associated with the risk factor type identifier according to the preset risk factor-time window width mapping table. It should be further noted that the risk factor-time window width mapping table in this embodiment comprises: the mapping table is a static data structure pre-stored in the edge terminal, which stores the association relationship between at least one risk factor type identifier and the corresponding reference time window width, wherein the risk factor type identifier is divided in advance according to the physiological system attribution of the symptom, and the reference time window width is set according to the empirical value of the dynamic change cycle of each risk factor in health monitoring; the dynamic time window adapter reads the reference time window width corresponding to the risk factor type identifier associated with the current symptom label from the mapping table, which is used as the initial value for subsequent adaptive compression or expansion based on signal fluctuation entropy. For example, the mapping table records that the risk factor type sleep corresponds to a reference time window width of 60 minutes, the risk factor type cardiovascular corresponds to a reference time window width of 30 minutes, and the risk factor type digestion corresponds to a reference time window width of 120 minutes, so that the dynamic time window adapter can extract clinically significant time-series monitoring data windows for symptoms of different physiological systems.

[0094] Obtain the signal fluctuation entropy of the multimodal health monitoring time-series data within the neighborhood of the self-assessment timestamp, and set the preset fluctuation threshold to 0.6, which is set based on statistics of the conventional fluctuation range of multimodal health signals; if the signal fluctuation entropy is greater than 0.6, compress the reference time window width according to a first preset ratio, which is 0.7 times; if the signal fluctuation entropy is less than 0.6, expand the reference time window width according to a second preset ratio, which is 1.3 times; the time window width after compression or expansion shall not be less than 10 minutes and not more than 300 minutes, so as to avoid feature loss caused by an excessively narrow window and redundancy caused by an excessively wide window; wherein the specific calculation method for the compression ratio and the expansion ratio comprises:

[0095] According to the difference ΔH=H-H_th between the signal fluctuation entropy H and the preset fluctuation threshold H_th, calculate the compression factor γ_compress=1 / (1+β·|ΔH|), where β is the compression sensitivity coefficient (e.g., β=0.2); and calculate the expansion factor γ_expand=1+β·|ΔH| at the same time;

[0096] Multiply the reference time window width W_base by the corresponding compression or expansion factor to obtain the adaptive time window width W_adapt, that is:

[0097] If H>H_th, then W_adapt=W_base·γ_compress;

[0098] If H<H_th, then W_adapt=W_base·γ_expand;

[0099] If H = H_th, then W_adapt = W_base is maintained. Here, signal fluctuation entropy H is used to quantify the complexity and irregularity of multimodal health monitoring time-series data within the self-assessment timestamp neighborhood; a larger value indicates more severe signal fluctuations and faster information changes. The preset fluctuation threshold H_th is an empirical constant pre-placed at the edge terminal, used to determine whether the current signal fluctuation level has reached the critical point requiring adjustment of the time window width. The difference ΔH is the difference between the signal fluctuation entropy and the preset fluctuation threshold; its absolute value |ΔH| represents the deviation of the current signal fluctuation relative to the critical point. The compression sensitivity coefficient β is a positive real constant used to control the correlation strength between the time window width compression rate and |ΔH|; a larger value indicates that the compression degree is more sensitive to changes in the deviation amplitude. The compression factor γ_com... `press` is a dimensionless scaling factor calculated based on |ΔH| and β, with a value less than or equal to 1 and inversely proportional to |ΔH|, used to compress the base time window width; `expand` is a dimensionless scaling factor calculated based on |ΔH| and β, with a value greater than or equal to 1 and directly proportional to |ΔH|, used to expand the base time window width; `base` is the initial time window length associated with the current risk factor type in the risk factor-time window width mapping table, representing the typical monitoring duration of the risk factor under normal fluctuation conditions; `adaptive` is the actual time window length used to extract time series monitoring data after adjustment by the compression or expansion factor. For example, the baseline time window width for sleep risk factors is 60 minutes, the signal fluctuation entropy H=0.72, the preset fluctuation threshold H_th=0.6, β=0.2, then ΔH=0.12, the compression factor γ_compress=1 / (1+0.2×0.12)≈0.976, and the adaptive time window width W_adapt=60×0.976≈58.6 minutes, which is rounded to 59 minutes.

[0100] Centered on the self-assessment timestamp, time-series monitoring data within the adaptively adjusted time window width is extracted, and at least one time-series statistical feature, including mean, variance, peak value, and slope of change, is calculated and stored in association with the symptom label. For example, the risk factor type associated with the symptom label "early awakening" is sleep, and the baseline time window width for sleep in the mapping table is 60 minutes. The self-assessment timestamp is 2026-02-13 05:30:00. Heart rate data within its neighborhood [-30 minutes, +30 minutes] is extracted, and the signal fluctuation entropy is calculated to be 0.72. The preset fluctuation threshold is 0.6. Since 0.72 > 0.6, the time window needs to be compressed, with a compression ratio of 0.7, thus the adaptive time window width is adjusted to 42 minutes. Heart rate data within the [-21 minutes, +21 minutes] range is extracted from the self-assessment timestamp, and the mean is calculated to be 72.3 bpm, variance 15.6, peak value 88 bpm, and slope of change 0.23. This data is then stored in association with the early awakening symptom label.

[0101] It should be further explained that, in this embodiment, obtaining the signal fluctuation entropy of the multimodal health monitoring time series data within the self-assessment timestamp neighborhood includes:

[0102] A 30-minute time series segment centered on the self-assessed timestamp is extracted, with 30 minutes serving as the preset neighborhood base window width. The time series segment undergoes phase space reconstruction, and the distance between each subsequence and the remaining subsequences is calculated. The number of subsequences with a distance less than a preset similarity tolerance is counted, generating an approximate entropy value. This approximate entropy value is normalized and mapped to the interval between 0 and 1, outputting the signal fluctuation entropy. Specifically, the embedding dimension and similarity tolerance of the approximate entropy algorithm are adaptively determined based on signal characteristics. This includes: acquiring a time series segment, the length of which is denoted as L, with candidate values ​​for the embedding dimension m ranging from 2 to one-third of L (rounded down); traversing the candidate m, with the similarity tolerance r set to 0.2 times the standard deviation of the time series segment, calculating the approximate entropy value ApEn(m,r) corresponding to each m; selecting the m with the largest rate of change of the approximate entropy value as the optimal embedding dimension; the candidate interval for the similarity tolerance r is from 0.1 times the standard deviation to 0.25 times the standard deviation, with the r having the smallest self-similarity deviation selected as the optimal similarity tolerance to ensure accurate calculation of the signal fluctuation entropy.

[0103] It should be further explained that the approximate entropy algorithm used in this embodiment to calculate the signal fluctuation entropy has its embedding dimension and similarity tolerance adaptively determined according to the signal characteristics, specifically including:

[0104] Obtain a time series segment extracted from the self-assessment timestamp neighborhood of the multimodal health monitoring time series data, and denote the length of the time series segment as L;

[0105] Define a candidate value range for the embedding dimension m, where the lower limit of the candidate value range is 2 and the upper limit is L divided by 3 and rounded down.

[0106] Iterate through each candidate embedding dimension m within the range of candidate values, and calculate the approximate entropy value ApEn(m,r) under the preset similarity tolerance r, where the similarity tolerance r is a preset multiple of the standard deviation of the time series segment;

[0107] For each candidate embedding dimension m, calculate the absolute value of the difference between its approximate entropy value and the approximate entropy value of the previous embedding dimension m-1, and use it as the rate of change corresponding to that embedding dimension.

[0108] Select the embedding dimension that maximizes the rate of change from all candidate embedding dimensions as the optimal embedding dimension;

[0109] A candidate interval for a similarity tolerance r is set, wherein the lower limit of the candidate interval is 0.1 times the standard deviation of the time series segment, and the upper limit is 0.25 times the standard deviation of the time series segment;

[0110] For each candidate similarity tolerance r within the candidate interval, calculate the approximate entropy value ApEn(m,r) and the approximate entropy value ApEn(m,2r) under the optimal embedding dimension, and calculate the absolute value of the difference between the two as the self-similarity deviation corresponding to the similarity tolerance.

[0111] Select the similarity tolerance that minimizes the self-similarity deviation from all candidate similarity tolerances as the optimal similarity tolerance.

[0112] Using the optimal embedding dimension and the optimal similarity tolerance, the approximate entropy value of the time series segment is calculated, and the approximate entropy value is output as the signal fluctuation entropy after normalization mapping.

[0113] It should be further explained that the generation and updating method of the lightweight feature dimensionality reduction encoder in this embodiment includes:

[0114] After the global high-risk model in the cloud completes one round of incremental learning, the parameters of the teacher model are frozen, the intermediate layer output that is aligned with the structure of the student model is selected, and the similarity of the representation of the teacher model and the student model in this intermediate layer is calculated.

[0115] Based on the representation similarity, the top K feature dimensions that contribute the most to the downstream risk rating task in the teacher model are identified, and an attention mask is generated.

[0116] Based on the attention mask, a weighted filtering is performed on the high-dimensional risk feature vector output by the teacher model, retaining the first K feature dimensions, and a task-oriented dimensionality reduction projection matrix is ​​constructed.

[0117] The dimensionality reduction projection matrix is ​​compressed into a lightweight fully connected layer adapted to the computing power of the edge terminal through knowledge distillation, and then distributed to the edge terminal as the weight of the lightweight feature dimensionality reduction encoder.

[0118] The edge terminal loads the lightweight feature dimensionality reduction encoder, performs matrix multiplication on the risk factor matrix, and outputs the first health state feature tensor. For example, the cloud-based global risk model is a Transformer structure with an intermediate layer output dimension of 768. The lightweight student model feature extraction backbone output dimension is 128. The cosine similarity between the output of the 12th layer of the teacher model and the output of the 6th layer of the student model is calculated to be 0.83. Based on gradient contribution ranking, the top K=64 feature dimensions that contribute the most to the risk rating task are selected to generate a binary attention mask. The non-mask positions in the 768-dimensional features of the teacher model are set to zero, retaining 64 dimensions to construct a 64×768 dimensionality reduction projection matrix, which is then compressed through knowledge distillation into 64×128 fully connected layer weights that can run on the edge terminal. After loading these weights, the edge terminal performs matrix multiplication on the input risk factor matrix (e.g., dimension 128×256) and outputs a 64-dimensional first health state feature tensor.

[0119] It should be further explained that, in this embodiment, the dimensionality-reduced projection matrix is ​​compressed into a lightweight fully connected layer adapted to the computing power of edge terminals through knowledge distillation, including:

[0120] The reduced projection matrix Φ (dimension K×D, where K is the feature-preserving dimension and D is the intermediate layer dimension of the teacher model) is used as the teacher projection layer;

[0121] Construct a student projection layer, which is a fully connected structure, with input dimension D_s (the backbone output dimension of student model feature extraction), output dimension K, and weight matrix W_s randomly initialized;

[0122] The mean squared error distillation loss is calculated using the low-dimensional features output by the teacher's projection layer as the target and the low-dimensional features output by the student's projection layer as the prediction.

[0123] Perform several rounds of distillation training on a cloud server, updating only the student projection layer weights while freezing other parameters;

[0124] The weights W_s of the student projection layer after training convergence are sent to the edge terminal as the weights of the lightweight feature dimensionality reduction encoder.

[0125] For example, the teacher model has a middle layer dimension of 768, retains a feature dimension of K=64, and has a dimensionality reduction projection matrix Φ of 64×768. The student model's feature extraction backbone output dimension is 128, and the student projection layer weights W_s are constructed as 64×128, randomly initialized with a Gaussian distribution. The MSE loss is calculated using Φ×teacher features (768 dimensions) as soft labels and W_s×s student features (128 dimensions) as predictions. The learning rate is 1e-4, batch size is 64, and the iterations are 20 rounds. After convergence, the W_s weights are frozen and distributed to the edge terminal. After loading, the edge terminal performs multiplication on the input risk factor matrix (128 dimensions) and outputs a 64-dimensional first health state feature tensor.

[0126] It should be further explained that, in this embodiment, the attention mask generated for the top K feature dimensions that contribute the most to the downstream risk rating task in the teacher model includes:

[0127] A forward propagation is performed in the global risk model in the cloud to obtain the gradient information of the output features of the intermediate layer. The gradient information is obtained by differentiating the loss function of the downstream risk rating task.

[0128] Calculate the product of the gradient information and the feature activation value to generate the contribution score for each feature dimension;

[0129] The contribution scores of all feature dimensions are sorted in descending order, and the top K dimensions are selected as the retained feature set.

[0130] Generate a binary mask vector with the same length as the original feature dimension, set 1 at the corresponding position of the retained feature set, and set 0 at the other positions, and output the attention mask.

[0131] For example, the intermediate layer of the teacher model outputs a feature dimension of 768, and the downstream risk rating task is a 5-class classification (balanced constitution, qi deficiency constitution, yang deficiency constitution, yin deficiency constitution, and phlegm-dampness constitution). The gradient of each feature dimension with respect to the cross-entropy loss function is obtained through backpropagation, with a gradient shape of [1, 768]. The feature activation values ​​are [1, 768]. The contribution score is calculated as gradient × activation value, resulting in a contribution array of [1, 768]. After sorting, the first K = 64 dimensions are selected, with indices [23, 57, 89, ...]. A binary mask vector of length 768 is generated, with the corresponding index position set to 1 and the rest set to 0.

[0132] It should be further explained that this embodiment outputs the initial risk rating sequence and confidence score, including:

[0133] The first health state feature tensor is input into the feature extraction backbone network of the lightweight student model to generate the first hidden layer representation tensor.

[0134] The first hidden layer representation tensor is fed into the first task branch and the second task branch, respectively, where:

[0135] The first task branch is a risk probability inference head, which includes at least one fully connected layer and a Softmax activation function, outputs the probability distribution of each preset risk dimension, and generates an initial risk rating sequence based on the risk level corresponding to the maximum probability value in the probability distribution.

[0136] The second task branch is a confidence assessment head, which shares some hidden layer parameters with the first task branch and outputs the confidence score for each risk dimension. The confidence score represents the reliability of the model's prediction results for the corresponding risk level.

[0137] The confidence scores are subjected to time-series smoothing filtering to generate a filtered confidence time-series sequence.

[0138] Extract the mean of the sliding window at the current time from the confidence time series. If the mean of the sliding window is greater than or equal to the first preset threshold, it is determined that the edge model has reached the convergence state, and the edge model convergence signal is output.

[0139] If the mean of the sliding window is less than the first preset threshold, the first health state feature tensor and the corresponding model output are continuously cached until the number of cached samples reaches the preset batch size. Then, a local training task is triggered, using the cached samples to perform incremental fine-tuning on the lightweight student model and updating the confidence time series. The confidence monitoring step is repeated. For example, the first health state feature tensor is a 64-dimensional vector, input to the lightweight student model feature extraction backbone (2 convolutional layers + 1 fully connected layer), and outputs a 128-dimensional hidden layer representation tensor. The first task branch is a fully connected layer (128→5) with Softmax, outputting a probability distribution [0.1, 0.7, 0.1, 0.05, 0.05], with the maximum probability of 0.7 corresponding to Qi deficiency, generating an initial risk rating sequence [Constitution: Qi deficiency, Risk level: Medium]. The second task branch is a fully connected layer (128→1) with Sigmoid, outputting a confidence score of 0.85. The confidence scores for 10 consecutive inferences are [0.82, 0.83, 0.85, 0.84, 0.86, 0.85, 0.87, 0.86, 0.88, 0.85], the sliding window mean is 0.851, the first preset threshold is 0.85, the mean is ≥ the threshold, and the edge model convergence signal is output.

[0140] It should be further noted that, in addition to the number of cached samples reaching the preset batch size, this embodiment also introduces a maximum waiting time threshold to prevent updates from failing to be triggered for a long time due to data sparsity. Specifically, this includes the following steps:

[0141] Presetting a minimum number of triggering samples threshold N_min and a maximum waiting time threshold T_wait, wherein the minimum number of triggering samples threshold N_min is the minimum number of cached samples required to trigger local training, and the maximum waiting time threshold T_wait is the maximum allowable waiting duration from caching of the first sample to triggering of training;

[0142] Continuously monitoring the number of accumulated samples N_cache in the local cache, and recording the caching time T_first of the first sample;

[0143] Acquiring the current time T_current in real time, and calculating the elapsed duration Δt since the first sample was cached, wherein Δt=T_current-T_first;

[0144] Judging whether the number of accumulated samples N_cache is greater than or equal to the minimum number of triggering samples threshold N_min;

[0145] If N_cache≥N_min, triggering a local training task immediately;

[0146] If N_cache<N_min, further judging whether the elapsed duration Δt is greater than or equal to the maximum waiting time threshold T_wait;

[0147] If Δt≥T_wait, forcibly triggering a local training task, performing fine-tuning with all currently cached samples, and reducing the loss weight of a confidence branch in a joint loss function, wherein the joint loss function is formed by weighted summation of cross-entropy loss of a first task branch and mean square error loss of a second task confidence branch, and the reduced confidence branch loss coefficient λ_conf' is smaller than a preset original confidence branch loss coefficient λ_conf, so as to alleviate the overfitting risk under small samples;

[0148] If Δt<T_wait, continuing to accumulate samples and not triggering training temporarily;

[0149] After the local training task is completed, the cached samples used this time are cleared, and the caching time of the first sample T_first is reset to the current time T_current. In the local training triggering mechanism of this embodiment, N_min is a preset minimum triggering sample number threshold, which represents the minimum number of cached samples required to trigger local training, and is used to ensure that the model update has sufficient statistical significance; T_wait is a maximum waiting time threshold, which represents the maximum allowable waiting time starting from the caching of the first sample, and is used to prevent the model from being unable to update for a long time due to sparse data collection; N_cache is the current number of cached samples, which is a real-time monitored cumulative sample indicator; T_first is the caching time of the first sample, which serves as the starting point of timing; T_current is the current time, which is used to calculate the waiting duration; Δt is the duration that has elapsed since the first sample was cached, which is obtained from the difference between T_current and T_first; λ_conf is a preset original confidence branch loss coefficient, which is used to balance the weight of cross-entropy loss and confidence mean square error loss during normal training; λ_conf' is the reduced confidence branch loss coefficient during forced training, and its value is smaller than λ_conf, which is used to reduce the contribution of the confidence branch in small sample scenarios, thereby mitigating the risk of overfitting. Through the dual threshold judgment of N_min and T_wait, the system can update immediately when there are sufficient samples, force update when samples are sparse but the waiting time exceeds the threshold, and dynamically adjust the loss weight to adapt to different data scales.

[0150] For example, the preset minimum triggering sample number threshold N_min=200, and the maximum waiting time threshold T_wait=24 hours. Due to irregular wearing by the user, an edge terminal only accumulates 120 samples within 12 hours. At this time, N_cache=120<N_min and Δt=12 hours<T_wait, so training is not triggered; when waiting continues until the 23rd hour, the number of samples N_cache is still 168, but Δt=23 hours≥T_wait, so forced training is triggered, and the weight of the confidence branch in the joint loss function is reduced from the original λ_conf=0.3 to λ_conf'=0.15 to avoid overfitting.

[0151] It should be further noted that in this embodiment, temporal smoothing filtering is performed on the confidence scores, and generating the filtered confidence time series includes:

[0152] Maintain an independent circular buffer for each preset risk dimension respectively, and store the confidence scores output by the latest N times of inference for this dimension;

[0153] After each inference is completed, write the confidence scores of each risk dimension in the current inference into the circular buffer of the respective dimension in parallel;

[0154] Calculate the arithmetic mean of the confidence scores in the buffer of each risk dimension to generate the sliding window confidence score for each dimension;

[0155] A weighted average is applied to the sliding window confidence scores for each dimension, outputting the global sliding window mean at the current moment. The weights of the weighted average are related to the prior probability or historical frequency of each risk dimension. For example, there are 5 risk dimensions (balanced constitution, qi deficiency constitution, yang deficiency constitution, yin deficiency constitution, and phlegm-dampness constitution), N=10. The 11th inference outputs the confidence scores for each dimension [0.85, 0.82, 0.79, 0.81, 0.80]. The circular buffers for each dimension are now full, and their means are calculated as [0.84, 0.81, 0.80, 0.82, 0.79]. The weights for the historical occurrence frequency of each dimension are [0.1, 0.3, 0.2, 0.2, 0.2]. The weighted average of the global sliding window mean is 0.84×0.1+0.81×0.3+0.80×0.2+0.82×0.2+0.79×0.2=0.808, and the output is 0.808.

[0156] It should be further noted that, in this embodiment, during the first system startup or the first inference after a model version update, the circular buffer is initialized to a preset baseline confidence value. The method for setting the baseline confidence value includes:

[0157] The average confidence score of the validation version that is closest to the current student model architecture on the public validation set is obtained from the historical distillation records of the global risk model in the cloud and used as the global benchmark value.

[0158] If no historical records are available for reference, then take an empirical value of 0.5 as the initial baseline;

[0159] After the initial inference, the baseline value in the buffer is gradually replaced with the actual confidence level. The mean of the sliding window output from the first N inferences is calculated based on the actual number of elements filled, i.e.:

[0160] Sliding window mean = (sum of current filled confidence scores + number of remaining unfilled positions × baseline value) / buffer length.

[0161] For example, the buffer length M=10, and the initial baseline value is set to 0.5. The confidence level of the first inference is 0.82, and the number of elements filled after writing is 1, so the sliding window mean is (0.82+9×0.5) / 10=0.532; the confidence level of the second inference is 0.83, so the mean is (0.82+0.83+8×0.5) / 10=0.565; until the 10th time it is filled, the mean is (0.82+0.83+...+0.85) / 10=0.84, and the baseline value is no longer used thereafter.

[0162] It should be further noted that, in this embodiment, the hidden layer parameters shared by the first task branch and the second task branch include:

[0163] After the feature extraction backbone network, a shared fully connected layer is set to map the first hidden layer representation tensor to the shared hidden layer space to generate a shared feature tensor.

[0164] The shared feature tensor is fed into the independent terminal fully connected layers of the first task branch and the second task branch, respectively.

[0165] The weight parameters of the shared fully connected layer simultaneously receive gradients from both the first and second task branches during model training, achieving multi-task joint optimization. For example, the first hidden layer representation tensor [1, 128] is input to the shared fully connected layer with weights [64, 128] and an output [1, 64] sharing the feature tensor. The first task branch's independent fully connected layer has weights [5, 64] and an output [1, 5] which is processed by Softmax to obtain the risk probability distribution. The second task branch's independent fully connected layer has weights [1, 64] and an output [1, 1] which is processed by Sigmoid to obtain the confidence score. During training, the shared fully connected layer simultaneously receives gradients from both the cross-entropy loss and the confidence mean squared error loss; the gradients are weighted and summed before updating the parameters.

[0166] It should be further explained that, in this embodiment, the first health state feature tensor is input into the feature extraction backbone network of the lightweight student model to generate the first hidden layer representation tensor, including:

[0167] The feature extraction backbone network is a depthwise separable convolutional structure, which includes a depthwise convolutional layer, a pointwise convolutional layer, a batch normalization layer and a ReLU activation function layer connected in sequence.

[0168] The first health state feature tensor is reshaped into a two-dimensional feature map and input into a deep convolutional layer. Spatial convolution is performed independently on each input channel to generate channel-separated intermediate feature maps.

[0169] The intermediate feature maps separated by the channels are input into a pointwise convolutional layer, and cross-channel feature fusion is performed through a 1×1 convolutional kernel to generate a channel-compressed fused feature map.

[0170] The fused feature map is input into the batch normalization layer, and mean and variance normalization is performed on each feature dimension to output a normalized feature map.

[0171] The normalized feature map is input into the ReLU activation function layer, positive response values ​​are retained and negative response values ​​are suppressed, and the activation feature map is output.

[0172] The activated feature map is flattened into a one-dimensional feature vector, linearly mapped to a preset hidden layer dimension through a fully connected layer, and the first hidden layer representation tensor is output.

[0173] For example, the first health state feature tensor is a vector of [1, 64], which is reshaped into a two-dimensional feature map of [1, 1, 8, 8]. A depthwise convolutional layer with a 3×3 kernel, 1 input channel and 1 output channel (depth multiplier = 1), generates a channel-separated intermediate feature map of [1, 1, 8, 8]. A pointwise convolutional layer with a 1×1 kernel, 1 input channel and 16 output channels, generates a fused feature map of [1, 16, 8, 8]. A batch normalization layer calculates the mean and variance of the 16 channels, outputting a normalized [1, 16, 8, 8]. After ReLU activation, it is flattened into a vector of [1, 1024]. A fully connected layer with weights of [128, 1024] is linearly mapped, outputting a first hidden layer representation tensor of [1, 128].

[0174] In this embodiment, the shared hidden layer parameters refer to a shared fully connected layer set after the feature extraction backbone network and before the first task branch (risk probability inference head) and the second task branch (confidence assessment head) in the lightweight student model. Taking the specific values ​​in the embodiment as an example, the first hidden layer representation tensor output by the feature extraction backbone network has a dimension of 128. This shared fully connected layer maps it to a 64-dimensional shared hidden layer space. The generated shared feature tensor is simultaneously fed into the terminal fully connected layer of the first task branch (128→5 dimensions, outputting risk probability distribution) and the terminal fully connected layer of the second task branch (128→1 dimension, outputting confidence score). During model training and incremental fine-tuning, the parameters of this shared fully connected layer simultaneously receive gradients returned from the two task branches (e.g., cross-entropy loss and confidence mean squared error loss weighted at 0.7:0.3 and then returned), realizing multi-task joint optimization. However, during local incremental fine-tuning, to reduce computational overhead and prevent overfitting, the parameters of this shared layer are usually frozen, and only the terminal fully connected layers of the two task branches are updated. Its design aims to enable the confidence assessment branch to reuse the general feature representations related to risk rating learned by the risk inference branch, thereby improving the accuracy and generalization ability of confidence score assessment. At the same time, it effectively controls the total number of parameters of the lightweight model of the edge terminal through parameter sharing (for example, in this embodiment, the shared layer only introduces about 8192 additional parameters, which is significantly lower than the number of parameters required for two independent branches to connect to the backbone network respectively).

[0175] It should be further noted that the confidence score output by the confidence assessment head in this embodiment includes:

[0176] Obtain the risk probability distribution vector output by the first task branch;

[0177] Calculate the information entropy of the risk probability distribution vector, and convert the information entropy into a first confidence component through negative exponential mapping;

[0178] Obtain the feature activation values ​​of the intermediate layer of the lightweight student model, calculate the representation similarity between the lightweight student model and the cloud-based global risk model in the corresponding distillation layer, and use the normalized representation similarity as the second confidence component.

[0179] The first confidence component and the second confidence component are weighted and fused to generate the confidence score.

[0180] It should be further explained that, in this embodiment, the normalized similarity is used as the second confidence component, including:

[0181] Extract the intermediate layer feature tensor from the lightweight student model that is aligned with the distillation layer structure of the cloud-based global risk high model, and denote it as the first student activation tensor;

[0182] Extract the feature tensor of the corresponding distillation layer from the global risk model in the cloud, and denote it as the first teacher activation tensor;

[0183] Perform global average pooling on the first student activation tensor and the first teacher activation tensor respectively to reduce the dimension to a one-dimensional feature vector;

[0184] Calculate the cosine similarity cos_sim between two one-dimensional feature vectors, with a value range of [-1, 1].

[0185] The cosine similarity is mapped to the interval [0, 1] by normalizing the function norm(x)=(x+1) / 2, and the second confidence component is output.

[0186] For example, the student model's fourth layer outputs an activation tensor of [1, 64, 7, 7], and the teacher model's eighth layer outputs an activation tensor of [1, 64, 7, 7]. After global average pooling, they yield vectors of [1, 64]. The cosine similarity is calculated to be 0.78, which, after normalization, gives (0.78+1) / 2=0.89, resulting in a second confidence component of 0.89.

[0187] It should be further explained that, in this embodiment, the information entropy used to calculate the risk probability distribution vector, and the conversion of the information entropy into a first confidence component via negative exponential mapping, includes:

[0188] Obtain the risk probability distribution vector P = [p1, p2, ..., p] output by the first task branch. c ], where c is the total number of preset risk dimensions, and satisfies ∑p i =1;

[0189] Calculate information entropy H= The entropy range is [0, log2]. c ];

[0190] Information entropy is mapped via a negative exponential function Convert to the first confidence component, where α is the preset entropy sensitivity coefficient, α>0;

[0191] When the probability distribution is highly concentrated (H approaches 0), the first confidence component approaches 1; when the probability distribution is uniformly dispersed (H approaches log2), the first confidence component approaches 1. c When the first confidence component approaches e, {-αlog 2 c} .

[0192] For example, the risk probability distribution vector is [0.05, 0.68, 0.10, 0.03, 0.04, 0.02, 0.03, 0.02, 0.03], c=9. The information entropy H=-(0.05·log20.05+0.68·log20.68+0.10·log20.10+0.03·log20.03+0.04·log20.04)

[0193] +0.02·log20.02+0.03·log20.03+0.02·log20.02+0.03·log20.03)=1.53×log2 9 ≈3.17, the entropy value is at a moderate level; assuming α=0.5, the negative exponential mapping e {-0.5×1.53} =e {-0.765} =0.465, output the first confidence component 0.465. The normalized similarity representation is then used as the second confidence component.

[0194] It should be further explained that the time-series smoothing filtering performed on the confidence score in this embodiment includes:

[0195] Initialize a circular buffer of length M to store the confidence scores of the first N inference outputs;

[0196] After each inference is completed, the current confidence score is written to the circular buffer, and the arithmetic mean of all confidence scores in the buffer is calculated as the mean of the sliding window.

[0197] If the circular buffer is not full, the historical global mean is used for filling compensation, and the compensated sliding window mean is output.

[0198] It should be further explained that this embodiment further includes initializing a circular buffer of length M to store the confidence scores of the first N inference outputs and calculating the sliding window mean:

[0199] During the first system startup or the first inference after a model version update, the entire circular buffer is initialized to a preset baseline confidence value.

[0200] After each inference, the position pointed to by the tail pointer of the circular buffer is overwritten with the current confidence score, and the tail pointer is incremented by one position. If the tail pointer exceeds the length of the buffer, it is reset to zero.

[0201] Calculate the arithmetic mean of all elements in the circular buffer, and use it as the mean of the sliding window;

[0202] If the circular buffer is not full, the denominator of the arithmetic mean is the number of currently filled elements, and the numerator is the sum of the values ​​of the currently filled elements. The compensated sliding window mean is then output.

[0203] For example, upon initial system startup, the circular buffer has a length of 10, all initialized to 0.5. The tail pointer is initially 0. During the first inference, with a confidence level of 0.82, a write operation is performed at position 0, the tail pointer becomes 1, and the buffer is [0.82, 0.5, 0.5, ...], containing 1 element with a mean of 0.82. During the second inference, with a confidence level of 0.83, a write operation is performed at position 1, the tail pointer becomes 2, and the buffer is [0.82, 0.83, 0.5, ...], with a mean of (0.82 + 0.83) / 2 = 0.825. This continues until the buffer is filled for the 10th time, at which point the tail pointer is reset to zero, and subsequent writes overwrite the oldest data.

[0204] It should be further explained that, in this embodiment, triggering a local training task and performing incremental fine-tuning of the lightweight student model using cached samples includes:

[0205] Read the first health status feature tensor and its corresponding initial risk rating sequence from the cache to form a local training sample pair;

[0206] The parameters of the feature extraction backbone network in the lightweight student model, excluding the classification head, are fixed, and several rounds of stochastic gradient descent updates are performed only on the terminal fully connected layers of the first and second task branches.

[0207] After fine-tuning, some cached samples are cleared, and risk inference is re-performed on the newly acquired feature tensors based on the updated lightweight student model, generating an updated confidence time series. For example, 200 sample pairs have accumulated in the cache, with a preset batch size of 200. The backbone parameters for feature extraction are fixed, and only the fully connected layers of the first task branch (128→5) and the second task branch (128→1) are updated. The learning rate is set to 1e-5, the Adam optimizer to batch size 32, and 5 iterations are performed. In each iteration, a weighted sum of cross-entropy loss and confidence mean squared error loss (weights 0.7:0.3) is calculated. After fine-tuning, a precision gain of +2.3% is calculated on the retained 50 validation samples, and the new model is accepted. Used cached samples are cleared, and the 20 most recent samples are retained for the next round. Inference is performed on the newly acquired feature tensors, increasing the mean confidence from 0.85 to 0.89, generating an updated confidence time series.

[0208] It should be further explained that this embodiment extracts at least one risk event mutation point and its corresponding timestamp sequence to generate the first time-series event stream, including:

[0209] Obtain the continuous numerical sequence of each single-mode signal channel in the multimodal health monitoring time series data;

[0210] Perform sliding window variance analysis on the continuous numerical sequence, calculate the variance of the values ​​within each sliding window, and mark the center time of the window where the variance exceeds a preset mutation threshold as a candidate mutation point;

[0211] Temporal density clustering is performed on the candidate mutation points to remove isolated noise points, and candidate mutation points with a density exceeding a preset clustering threshold within a continuous time interval are merged into a single risk event mutation point. In the health risk quantification modeling scenario of this embodiment, the setting of the preset mutation threshold and the preset clustering threshold must take into account both the clinical sensitivity of physiological signal fluctuations and the robustness of noise removal. The preset mutation threshold is usually determined using an adaptive statistical method: based on the variance distribution of multimodal health monitoring time series data in a stable state period (such as the nighttime rest period), the threshold is set to 3 to 5 times the variance of this benchmark, or the benchmark mean plus 3 times the standard deviation, to ensure that only when the signal fluctuation intensity significantly exceeds the individual's daily fluctuation range is it marked as a candidate mutation point, thereby avoiding false triggering caused by slight physiological fluctuations (such as the normal changes in heart rate with respiratory rhythm); at the same time, the system can dynamically adjust the multiplier coefficient according to the type of risk factor (such as the heart rate mutation threshold being more lenient than blood oxygen saturation). The preset clustering threshold is based on clinical prior settings for time neighborhood and the persistence of physiological events: the clustering window is set to the neighborhood radius of the risk event mutation point on the time axis (e.g., 15-30 seconds), and the minimum number of neighborhood points is set to 2-3. Only when the number of candidate mutation points clustered in the time neighborhood reaches this threshold are they merged into a single risk event mutation point, thereby eliminating isolated candidate points caused by sensor transient noise or single-point anomalies. This clustering threshold can also be adaptively adjusted according to the type of risk factor. For example, a smaller neighborhood radius and a higher density requirement can be set for high-frequency sampling signals such as heart rate, while the clustering conditions can be relaxed for slowly changing signals such as blood oxygen, ensuring that the clinically significant continuous process of risk events is effectively captured, while avoiding the misjudgment of transient interference as risk mutation.

[0212] For each risk event mutation point, its corresponding signal channel identifier, mutation direction, and mutation magnitude are associated, generating a first time-series event stream containing timestamps, risk factor types, and mutation feature vectors. For example, assuming the continuous numerical sequence of heart rate channels collected by the edge terminal is [72, 75, 78, 82, 90, 108, 115, 112, 105, 95, 85], the sliding window length is 3, and the sliding step size is 1. The variance of each window is calculated: the variance of window [78, 82, 90] is 24.9, the variance of window [82, 90, 108] is 124.1, and the variance of window [90, 108, 115] is 110.3. With a preset mutation threshold of 80, the center times of the marked windows, t=5 (corresponding to value 108) and t=6 (corresponding to value 115), are considered candidate mutation points. Temporal density clustering is performed on candidate mutation points. The temporal neighborhood radius ε is set to 2 sampling intervals and the minimum number of neighborhood points MinPts is set to 2. Then, t=5 and t=6 are clustered into one class and merged into one risk event mutation point, generating a time series event entry: {timestamp: 2026-02-1308:23:15, risk factor type: heart rate, mutation direction: rising, mutation amplitude: 28 bpm}, and included in the first time series event stream.

[0213] It should be further explained that this embodiment receives the updated term mapping relationship from the cloud, and updates the lightweight semantic disambiguation dictionary including:

[0214] After concatenating the original symptom text field with the context identifier, an encrypted text vector is generated using a homomorphic encryption algorithm and uploaded to the federated parameter server.

[0215] The federated parameter server forwards the encrypted text vector to the semantic disambiguation interface of the cloud-based global risk model. The cloud-based global risk model performs similarity retrieval or zero-shot semantic parsing in the encrypted domain and outputs the corresponding standard symptom term codes and confidence scores.

[0216] The cloud transmits the standard symptom term codes and confidence scores back to the edge terminal after homomorphic encryption;

[0217] The edge terminal decrypts and obtains the standard symptom term code and confidence score. If the confidence score is greater than the second semantic threshold, the mapping relationship between the original symptom text field and the standard symptom term code is incrementally written into the lightweight semantic disambiguation dictionary. In the health risk quantification modeling scenario of this application, the second semantic threshold is used to determine whether the standard symptom term mapping relationship returned by the remote semantic disambiguation of the cloud-based global risk model is reliable. Its setting needs to strike a balance between automatic update efficiency and clinical semantic accuracy. This threshold is usually determined based on the historical confidence distribution of the cloud-based semantic disambiguation interface on the labeled validation set: First, the confidence scores of the cloud-based global risk model for the validated standard symptom terms are statistically analyzed. The 10th percentile or mean minus 1.5 times the standard deviation of the confidence scores of all correctly mapped samples is taken as the initial threshold (e.g., 0.85~0.90) to ensure that the local lightweight semantic disambiguation dictionary is automatically updated only when the remote parsing result reaches a high level of reliability. At the same time, the system can make differentiated settings according to the clinical risk level of the symptom items—for symptom items associated with high-risk events (such as "chest pain", "breathing" etc.), the threshold is adjusted accordingly. For entries with "difficulty in breathing," a stricter threshold (e.g., 0.95) is used, requiring near-certain parsing results for automatic database entry. For low-risk or common symptom entries, the threshold can be appropriately relaxed (e.g., 0.80) to improve dictionary coverage and reduce the frequency of manual intervention. In addition, the threshold can be dynamically adjusted based on historical feedback from edge terminals. If a terminal frequently triggers low-confidence remote parsing but the mapping is accurate after manual review, the system gradually lowers the second semantic threshold for that terminal, and vice versa, forming an adaptive mechanism. Ultimately, this achieves a gradual update of the lightweight semantic disambiguation dictionary while ensuring the accuracy of symptom normalization.

[0218] If the confidence score is less than or equal to the second semantic threshold, the original symptom text field is stored in the queue for manual review, and the low-confidence identifier in the temporary annotation set is retained. For example, the edge terminal uploads the encrypted text vector x7f2a9e... The cloud-based global risk model calculates the cosine similarity between this vector and the encrypted representation of each term in the standard symptom database in the encrypted domain. It finds that the highest similarity is 0.91 (after decryption) with the term "palpitation," and the second semantic threshold is 0.90. Therefore, it returns the standard term code S07-palpitation with a confidence score of 0.91. After decryption, the edge terminal maps "heart palpitation" to "palpitation" and incrementally writes it into the local dictionary. Another text field, "lack of energy," returns a confidence score of only 0.65 after remote parsing, which is lower than the second semantic threshold. The edge terminal stores it in the queue for manual review and temporarily marks it as low-confidence pending confirmation.

[0219] It should be further explained that the initiation of the federated collaborative optimization session in this embodiment includes:

[0220] Step S1: In response to receiving the edge model convergence signal, the edge terminal reads all the first health status feature tensors accumulated since the last round of federated aggregation and their corresponding initial risk rating sequences from the local cache queue to form the local training dataset for this round.

[0221] Using the parameters of the currently deployed lightweight student model network as initial weights, perform a preset number of stochastic gradient descent iterations on the local training dataset;

[0222] During the forward propagation process, the cross-entropy loss of the first task branch and the confidence mean square error loss of the second task branch are calculated separately, and a joint loss function is constructed by weighted summation.

[0223] During backpropagation, by setting requires_grad=False for all parameters of the feature extraction backbone network, we force only the trainable parameters of the fully connected layers at the end of the first and second task branches to be updated, while the backbone network parameters remain frozen.

[0224] After completing the iteration, extract the weight gradient matrix and bias gradient vector of the fully connected layer in the first task branch, and the weight gradient matrix and bias gradient vector of the fully connected layer in the second task branch to form a sparse gradient tensor set to be uploaded.

[0225] At the same time, the number of samples and the slope of the loss value convergence curve in this round of local training are recorded as auxiliary metadata.

[0226] For example, 680 valid sample pairs are accumulated in the edge terminal cache queue, and the current student model is version v4.2. The local iteration rounds are set to E=3, batch size=64, and joint loss weights λ_cls=0.7 and λ_conf=0.3. The backbone network parameters (2 convolutional layers + 1 shared fully connected layer) are frozen, and only the fully connected layer of the first task branch (128→9) and the fully connected layer of the second task branch (128→1) are updated. After 3 iterations, the weight gradient shape [9, 128] and bias gradient [9] of the first task branch and the weight gradient [1, 128] and bias gradient [1] of the second task branch are calculated. The number of samples is 680, the training loss decreases from 0.43 to 0.37, and the recorded slope is -0.02.

[0227] Step S2: The edge terminal performs numerical pruning on the sparse gradient tensor set, restricting each gradient value to the interval [-δ, δ] to prevent gradient explosion from affecting encryption accuracy;

[0228] The clipped gradient floating-point number is converted into a fixed-point representation and scaled to a preset integer encoding space;

[0229] The edge terminal hardware security module calls the CKKS homomorphic encryption context and uses the public key distributed by the federated parameter server to perform encryption operations on each gradient encoding polynomial to generate a ciphertext gradient tensor.

[0230] The encrypted gradient tensor, along with the terminal anonymous identifier (a one-time pseudonym dynamically generated for each round of the federated session), the number of local samples, and auxiliary metadata, is encapsulated into a ProtocolBuffer message and uploaded to the federated parameter server via a bidirectional TLS encrypted channel. For example, with a pruning threshold δ=1.0, a gradient value of 0.0023 will remain 0.0023 after pruning. Fixed-point scaling factor 2. 16 0.0023 × 65536 ≈ 151, encoded as polynomial coefficients. CKKS parameters: polynomial modulus M = 8192, scaling factor 2. 40 The security level is 128-bit. The size of a single encrypted gradient ciphertext is 16KB, and the total size of all gradient ciphertexts is approximately (9×128+9+1×128+1)×16KB≈200KB. The one-time pseudonym is sess_8f3a2b, the number of samples is 680, the loss slope is -0.02, and the data is uploaded in a package.

[0231] It should be further noted that in this embodiment, the edge terminal performs numerical pruning on the sparse gradient tensor. The pruning threshold is not a fixed value, but is dynamically and adaptively determined based on historical gradient statistics. The meanings of the symbols involved are as follows:

[0232] The L2 norm of the gradient tensor refers to the Euclidean norm of the gradient tensor after it is flattened into a one-dimensional vector, which is used to characterize the overall size of the gradient in this round of local training.

[0233] The local gradient history buffer is used to store the L2 norm of the gradient tensors obtained from the most recent K local training iterations, where K is a preset buffer length, for example, K=10.

[0234] The moving average μ_grad refers to the arithmetic mean of the K gradient norms stored in the historical buffer, which reflects the typical level of the recent gradient scale.

[0235] The standard deviation σ_grad refers to the standard deviation of the samples calculated from the K gradient norms stored in the historical buffer, reflecting the degree of fluctuation in the recent gradient size.

[0236] The clipping threshold δ is a value dynamically determined based on the moving average and standard deviation. The specific calculation formula is δ=μ_grad+3·σ_grad. This threshold is used to define the boundary between normal gradients and abnormal gradients, ensuring that the vast majority of historical gradients fall within this threshold range.

[0237] When the gradient norm of this round exceeds δ, the compression coefficient is calculated. The compression coefficient is equal to δ divided by its gradient norm, and each element of the gradient tensor is multiplied by the compression coefficient so that the compressed gradient norm does not exceed δ.

[0238] On the first run, since the historical buffer is empty, the moving average and standard deviation cannot be calculated. Therefore, the empirical value δ=1.0 is taken as the initial pruning threshold.

[0239] For example, the L2 norms of the gradients in the previous 10 rounds were 0.35, 0.42, 0.38, 0.51, 0.46, 0.39, 0.44, 0.47, 0.53, and 0.49, respectively. The moving average μ_grad = 0.444, and the standard deviation σ_grad = 0.057. Therefore, the dynamic pruning threshold δ = 0.444 + 3 × 0.057 = 0.615. The gradient norm in this round is 0.67, which is greater than δ. The compression factor is approximately 0.615 / 0.67 ≈ 0.918. Pruning is achieved by multiplying each element of the gradient tensor of this round by 0.918 and then outputting the result.

[0240] Step S3: The federated parameter server maintains the session context of this round of federated aggregation, receives encrypted gradient messages uploaded by at least two edge terminals, and verifies the integrity and timeliness of the messages.

[0241] For the weight gradient ciphertext and bias gradient ciphertext of the same model layer, perform homomorphic addition operations separately, and the aggregation formula is:

[0242] G_agg_enc=(Σn_i G_i_enc) / Σn_i;

[0243] Where n_i is the number of terminal samples, G_i_enc is the encryption gradient tensor, and scalar multiplication and division are performed in the ciphertext domain through homomorphic scalar operations.

[0244] After all terminals have uploaded, the federated parameter server uses its own private key to perform batch decryption of the aggregated encrypted gradient and restore the plaintext aggregated gradient.

[0245] Optional momentum smoothing or gradient clipping is performed on the decrypted aggregated gradient to prevent anomalous gradients in a single round from compromising the stability of the cloud model. For example, five terminals participate in the aggregation in this round, with sample sizes of [680, 520, 410, 330, 290]. The server performs a weighted average on the ciphertext of the first task branch weight gradient for each terminal: first, each ciphertext is multiplied by its corresponding sample size, summed, and then divided by the total sample size of 2230. Homomorphic scalar multiplication is achieved by multiplying the ciphertext by the integer-encoded sample size, and division is performed by multiplying by the modular inverse of the total sample size. The decrypted aggregated gradient has a shape of [9, 128] and a value range of [-0.003, 0.005]. A momentum smoothing factor μ=0.9 is added, and the gradient is weighted and averaged with the previous round's aggregated gradient before output.

[0246] Step S4: Input the decrypted and smoothed aggregated gradient into the Adam optimizer of the global high-risk model in the cloud and perform a single-step parameter update;

[0247] After the update is completed, the change in the accuracy of the model on the fixed validation set before and after the update is calculated. If the accuracy drops beyond the preset tolerance threshold, the update is rolled back and an alarm is issued. In the health risk quantification modeling scenario of this application, the preset tolerance threshold is used to determine whether the model performance has deteriorated unacceptably after the cloud-based global risk model aggregates the encrypted gradients of multiple edge terminals and performs an incremental update. Its setting needs to achieve a balance between model evolution stability and federated learning convergence efficiency. This threshold is typically determined based on the historical accuracy fluctuations of the global risk model in the cloud on a fixed public validation set. Using the standard deviation of accuracy changes before and after successful updates in the most recent rounds (e.g., 10 rounds) as a benchmark, the tolerance threshold is set to 1.5 to 2 times this standard deviation, or the absolute value of the historical accuracy fluctuation mean plus twice the standard deviation. This ensures that a rollback is triggered only when the accuracy drop in the current update significantly exceeds the normal statistical fluctuation range. Simultaneously, this threshold needs to be constrained by the clinical tolerance requirements of health risk ratings—if the validation set accuracy is lower than the clinically acceptable minimum accuracy baseline (e.g., 85%), a forced rollback and an alarm are issued, regardless of the magnitude of the drop. Furthermore, the system introduces an adaptive mechanism: when multiple consecutive updates trigger rollbacks, the tolerance threshold is dynamically relaxed (e.g., relaxed by 0.5 percentage points per round, with an upper limit of 3 percentage points) to avoid frequent rollbacks blocking the federated optimization process due to drastic fluctuations in the distribution of edge terminal users. The threshold is then gradually tightened after stabilization.

[0248] If the update is successful, the aggregated gradient statistics (L2 norm of the gradient, number of participating terminals, sample distribution entropy) will be written to the cloud model version log.

[0249] Based on the risk factor distribution characteristics extracted from the metadata of participating terminals, the edge terminal state distribution memory maintained in the cloud is updated for subsequent personalized distillation. For example, the large cloud model is a BERT-based structure, with an Adam optimizer learning rate of 1e-5 and eps=1e... -8 After updating all parameters using aggregated gradients, the accuracy on the 50,000 publicly available physical examination validation set increased from 89.2% to 89.3%, a rise of 0.1%, and is therefore accepted for update. The L2 norm of this round of aggregated gradients is recorded as 0.37, with 5 participating terminals and a sample distribution entropy of 1.28. Meta-information uploaded by edge terminals shows an increase in the frequency of sputum-wet constitution annotations, prompting an update to the distribution weights of the corresponding terminal group in the memory.

[0250] Step S5: Freeze the updated global risk model in the cloud as the teacher model;

[0251] Instantiate a lightweight student model shell from the template library that is consistent with the current architecture of the target edge terminal, and load the weights issued last time as a warm start;

[0252] Phase 1: Global public distillation. A large-scale desensitized public health dataset (containing no sensitive individual information) was used as the transport set. The teacher model generated soft labels (temperature T=3), and the student model used KL divergence as the loss function. 20 rounds of distillation training were performed on a cloud GPU cluster with a learning rate of 1e. -4 This enables the student model to approximate the generalization ability of the teacher model.

[0253] The second stage is distribution adaptation distillation. Based on the edge terminal state distribution memory updated in step S4, the data is resampled from the public dataset to construct an adaptation set that is similar to the risk factor distribution of the target terminal group. The distillation continues for 5 rounds, and the learning rate decays to 5e-5.

[0254] After distillation, the updated student model weights are obtained.

[0255] For example, the teacher model is a 12-layer Transformer, and the student model is a lightweight MobileNetV3-like network (0.5M parameters). The public dataset uses 100,000 insensitive statistical features from MIMIC-III. In the first stage, the distillation temperature is T=3, using KL divergence loss and the Adam optimizer. After 20 rounds, the student model achieves 91% of the teacher model's accuracy on the public test set. In the second stage, based on the distribution of the target terminal groups in the memory bank (28% phlegm-dampness constitution and 35% qi deficiency constitution), the public data is resampled according to this distribution to form a 5000-piece fitting set. Distillation is then performed for another 5 rounds, resulting in a 4.2% improvement in the student model's accuracy on the fitting set.

[0256] Step S6: The cloud retrieves the historical metadata (mean confidence level, deviation value sequence, and time series drift of risk factors) of the edge terminal from the memory bank based on the anonymous identifier uploaded by the edge terminal.

[0257] Starting with the updated student model obtained from distillation in step S5, and using the synthetic gradients from the terminal's own historical cache or a small amount of local data to approximate the distribution, several rounds of hyperlocal fine-tuning are performed, updating only the classification head parameters. The specific implementation steps are as follows:

[0258] Step A: The cloud retrieves the historical metadata corresponding to the anonymous identifier of the target terminal from the edge terminal state distribution memory. The historical metadata includes the confidence mean sequence, risk rating deviation sequence, proportion change trend of each risk dimension within the most recent T time windows of the terminal, and the number of local training samples and feature distribution statistics accumulated since the last round of federated aggregation. At the same time, if the edge terminal is allowed to upload local data approximate distribution (such as differential privacy version of feature mean and covariance matrix) in this federated collaborative optimization session, the cloud will also obtain the approximate distribution; otherwise, the risk factor distribution features in the historical metadata will be used as a substitute.

[0259] Step B: Based on the approximate distribution of the historical metadata and local data, the cloud performs a data resampling strategy. This involves selecting samples from the desensitized public health database that have the highest similarity to the risk factor distribution characteristics of the target terminal, forming a candidate sample set. The candidate sample set is then oversampled or undersampled according to a preset sampling ratio to align the sample distribution with the proportion of the local risk dimension of the target terminal. If the target terminal provides feature statistics under differential privacy protection, a generative model is used to synthesize pseudo-samples that match the statistics, expanding the fine-tuning dataset. The completed dataset is then divided into a fine-tuning training set and a fine-tuning validation set according to a preset ratio.

[0260] Step C: Starting with the updated student model obtained from S5 distillation, load its complete weights as the initial values ​​for fine-tuning; identify the parameter groupings in the student model, and set the requires_grad attribute of all parameters (including the feature extraction backbone network and shared fully connected layers) except for the classification head (i.e., the terminal fully connected layer of the first task branch and the second task branch) to False to freeze the parameters; set the requires_grad attribute of the classification head parameters to True as the only trainable parameter in this round of fine-tuning;

[0261] Step D: Configure the optimizer and hyperparameters. Use the Adam or SGD optimizer and set the learning rate to be lower than that of the basic distillation stage (e.g., 1e-5 to 5e-5). The batch size is dynamically adjusted according to the size of the fine-tuning dataset. Construct a joint loss function, which includes a weighted sum of the cross-entropy loss of the first task branch and the confidence mean square error loss of the second task branch. The loss weight of the confidence branch is dynamically adjusted according to the reliability of the confidence labels of the samples in the fine-tuning dataset. Iteratively perform forward propagation and backpropagation on the fine-tuning training set. Only update the classification head parameters during each backpropagation, and the frozen parts do not participate in gradient updates. After each iteration, calculate the accuracy and loss value on the fine-tuning validation set. If the validation loss does not decrease for E consecutive rounds or the validation accuracy reaches the preset fine-tuning qualification threshold, terminate the training early to prevent overfitting.

[0262] Step E: During fine-tuning training, a regularization term for the classifier head parameters is added to the joint loss function. The regularization term is an L2 distance constraint between the classifier head weights and the classifier head weights in the updated student model. By constraining the magnitude of parameter changes, the excessive correction of the knowledge obtained by distillation during fine-tuning is limited, thereby mitigating the risk of overfitting in small sample scenarios. The regularization coefficient λ_reg is adaptively adjusted according to the size of the fine-tuning dataset; the smaller the dataset size, the larger the value of λ_reg.

[0263] Step F: After fine-tuning the training, merge the updated classification head parameters with the other frozen parameters in the basic updated student model to generate a complete next-generation lightweight student model as a candidate model. Calculate the accuracy gain of the candidate model relative to the basic updated student model on the fine-tuning validation set. If the accuracy gain is positive and overfitting is not triggered, the candidate model is accepted. Calculate the weight difference between the candidate model and the basic updated student model, extracting only the weight changes of the classification head parameters to generate a binary incremental patch package. Simultaneously, record the fine-tuning metadata (including the fine-tuning rounds, final loss value, validation accuracy, and regularization coefficient) for subsequent retrospective analysis.

[0264] Step G: If the accuracy of the fine-tuned validation set decreases by more than the preset backoff threshold compared to the basic updated student model, or if the loss function oscillates and does not converge during the fine-tuning process, the fine-tuning process is terminated, the candidate model is discarded, the basic updated student model is directly used as the target model, and the record of this fine-tuning failure is written to the cloud log, triggering the decay adjustment of the confidence of the historical metadata of the terminal, and reducing the priority of subsequent hyperlocal fine-tuning for the terminal.

[0265] After fine-tuning, the model is compared with the basic version of the student model using differential compression to generate a binary incremental patch package;

[0266] The incremental patch package is digitally signed using the edge terminal's certificate public key and distributed to the corresponding edge terminal via a two-way TLS encrypted channel. For example, the edge terminal sess_8f3a2b has a 30-day average confidence score of 0.81, a bias of 0.12, and the proportion of the phlegm-dampness constitution risk factor has increased from 20% to 35%. The cloud reads this metadata from its memory, starts from the base student model, and performs three rounds of fine-tuning using 200 synthetic data points sampled from public data at a 35% phlegm-dampness constitution proportion, with a learning rate of 1e-5, updating only the final classification layer. After fine-tuning, the model's F1-score improves by b% on a simulated local distribution test set. The generated incremental patch package contains only the classification layer weight differences, is 3.2KB in size, is signed using the terminal certificate, and distributed encrypted.

[0267] Step S7: The edge terminal receives the incremental patch package, verifies the integrity of the digital signature, merges it with the currently running lightweight student model base version, and generates a complete updated model.

[0268] Write the updated model to the temporary storage area, perform model format checks and inference tests (using reserved verification samples), and if they pass, atomically replace the production model file and record the new version number;

[0269] If the verification fails or the inference test deviation value exceeds the second preset risk rating deviation threshold, the temporary model will be automatically discarded, rolled back to the previous stable version, and the reason for the update failure will be reported to the cloud.

[0270] After a successful update, the edge terminal clears the cached samples used in this round of federated learning (retaining the 20 most recent samples for the next round of verification) and enters the online verification module process. For example, the edge terminal receives a 3.2KB incremental packet, verifies the RSA-SHA256 signature, and merges it with the current model to generate a complete model. It performs an inference test using 50 locally reserved heart rate-self-assessment association samples that were not used in training; the risk rating deviation is 0.11 (second threshold 0.15), passing verification. The model file is then atomically replaced, upgrading the version number from v4.2 to v4.3, clearing the 680 cached samples used in training, and retaining the 20 most recent samples. The update is then reported as successful to the cloud.

[0271] It should be further noted that this embodiment performs online verification using the latest monitoring data cached locally, and the calculation of the risk rating deviation value includes:

[0272] At least one verification sample is read from the local cache. The verification sample includes a first health status feature tensor and a corresponding reference risk rating sequence. The reference risk rating sequence is generated by a preset high-confidence annotation source through symptom entry normalization mapping. For example, the local cache stores 20 health risk records recently reviewed and confirmed by a family doctor. Each record includes a first health status feature tensor at the corresponding time and a sequence of constitution risk levels annotated by experts (such as the level values ​​of Qi deficiency constitution, Yang deficiency constitution, phlegm-dampness constitution, etc.).

[0273] The first health status feature tensor is input into the updated lightweight student model after loading, and forward propagation is performed to output the risk rating sequence to be verified and the confidence scores corresponding to each preset risk dimension. For example, after the edge terminal loads the updated student model, it performs inference on the above 20 feature tensors one by one to generate the risk rating sequence to be verified, and outputs the probability distribution of each physical fitness dimension and the corresponding confidence score for each sample.

[0274] Calculate the absolute difference between the risk rating sequence to be verified and the reference risk rating sequence in each preset risk dimension, and generate the original deviation component for each dimension. For example, for the Qi deficiency constitution dimension, the reference rating level is 3 and the rating level to be verified is 2, so the original deviation component is 1; for the Yang deficiency constitution dimension, the reference level is 2 and the rating level to be verified is 2, so the deviation component is 0.

[0275] The original deviation components of each dimension are weighted by confidence level, and the confidence scores are used as weighting coefficients to generate weighted deviation components for each dimension. For example, the confidence score for the Qi deficiency dimension is 0.85, and the weighted deviation component is 1 × 0.85 = 0.85; the confidence score for the Yang deficiency dimension is 0.78, and the weighted deviation component is 0 × 0.78 = 0.

[0276] An aggregation operation is performed on the weighted deviation components of each dimension to generate a single deviation metric. For example, the arithmetic mean of the weighted deviation components of all risk dimensions is calculated, or a weighted mean is calculated based on the prior risk weights of each dimension to obtain the single deviation metric.

[0277] The single deviation measure is mapped to a uniform dimension interval using a preset normalization function, and the risk rating deviation value is output. For example, the single deviation measure is linearly scaled to the interval [0, 1], where 0 represents complete consistency and 1 represents complete deviation, and the output risk rating deviation value is 0.23.

[0278] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments under the guidance of the present invention without departing from the spirit and scope of the claims. All of these variations are within the protection scope of the present invention.

Claims

1. A health risk quantification modeling system based on federated knowledge distillation, characterized in that, include: The data acquisition module is used to acquire local multimodal health monitoring time-series data and individual self-assessment data deployed on edge terminals; The feature dimensionality reduction module performs risk factor alignment and feature dimensionality reduction based on the local multimodal health monitoring time series data and individual self-assessment data to generate a first health state feature tensor. The alignment of execution risk factors includes: Based on the multimodal health monitoring time series data, at least one risk event mutation point and its corresponding timestamp sequence are extracted to generate a first time series event stream; Based on the individual self-assessment data, a symptom entry normalization mapping is performed by a lightweight semantic disambiguation dictionary deployed on the edge terminal to generate a first discrete symptom vector containing symptom labels, severity, and self-assessment timestamps. The first time-series event stream and the first discrete symptom vector are input to the dynamic time window adapter. The dynamic time window adapter is centered on the self-assessment timestamp, adaptively adjusts the width of the time window according to the risk factor type, extracts the time-series statistical features within the time window, establishes the association index between the symptom label and the corresponding time-series statistical features, and outputs a time-semantic joint aligned risk factor matrix. The adaptive adjustment of the time window width based on risk factor type includes: Read the risk factor type identifier corresponding to the symptom label; Based on the preset risk factor-time window width mapping table, determine the baseline time window width associated with the risk factor type identifier; The signal fluctuation entropy of the multimodal health monitoring time series data within the neighborhood of the self-assessment timestamp is obtained. If the signal fluctuation entropy is greater than a preset fluctuation threshold, the width of the reference time window is compressed by a first preset ratio; if the signal fluctuation entropy is less than the preset fluctuation threshold, the width of the reference time window is expanded by a second preset ratio. The confidence monitoring module is used to input the first health status feature tensor into a lightweight student model pre-placed on the edge terminal, output an initial risk rating sequence and confidence score, continuously monitor the confidence score until the confidence score is greater than or equal to a first preset threshold, and output an edge model convergence signal. In response to receiving the convergence signal of the edge model, the collaborative optimization module initiates a federated collaborative optimization session. The edge terminal uploads the model gradient parameters obtained from the local training in this round to the federated parameter server after homomorphic encryption. The federated parameter server aggregates the encrypted gradients from multiple edge terminals and updates the cloud-based global risk model. After completing one round of incremental learning based on the aggregated gradients, the cloud-based global risk model generates an updated lightweight student model adapted to the current state distribution of the edge terminal through knowledge distillation, and distributes the weights of the lightweight student model to the edge terminal. The online verification module is configured to: load the updated lightweight student model using the edge terminal, perform online verification using the latest monitoring data cached locally, and calculate the risk rating deviation value.

2. The health risk quantification modeling system based on federated knowledge distillation as described in claim 1, characterized in that, The lightweight student model is generated by knowledge distillation and compression from a cloud-based global risk model, and performs risk probability inference and priority scoring. The online verification module is further configured to: if the risk rating deviation value is less than the second preset risk rating deviation threshold, then solidify the updated lightweight student model into the real-time inference engine of the edge terminal, and automatically generate personalized treatment plan instructions based on the dynamic risk priority sorting output by the model. If the risk rating deviation value is greater than or equal to the second preset risk rating deviation threshold, the updated lightweight student model is discarded, a model mismatch flag is sent to the cloud, the cloud global risk model is triggered to re-execute the multi-teacher knowledge distillation and distribute the generated new generation student model, and the risk factor alignment and feature dimensionality reduction steps are returned to be executed.

3. The health risk quantification modeling system based on federated knowledge distillation as described in claim 2, characterized in that, The aforementioned risk factor feature dimensionality reduction includes: The risk factor matrix is ​​input into a lightweight feature dimensionality reduction encoder pre-placed on the edge terminal. The lightweight feature dimensionality reduction encoder is generated by a cloud-based global risk model through task-oriented knowledge distillation and compression. Its encoding parameters are updated collaboratively with the cloud-based large model through federated learning, and the output is a first health state feature tensor after dimensionality compression.

4. The health risk quantification modeling system based on federated knowledge distillation as described in claim 3, characterized in that, The Symptom entry normalization mapping is performed using a lightweight semantic disambiguation dictionary deployed on edge devices, including: Retrieve the original symptom text field from the individual self-assessment form data; Perform an approximate matching based on locality-sensitive hashing on the original symptom text field, and retrieve at least one candidate standard symptom term from the lightweight semantic disambiguation dictionary; If a candidate standard symptom term with a similarity greater than the first semantic threshold is found, the original symptom text field is normalized to the symptom code corresponding to the candidate standard symptom term. If no candidate standard symptom terms that meet the first semantic threshold are found, a local incremental learning process is triggered. The original symptom text field is homomorphically encrypted and uploaded to the federated parameter server. The cloud-based global risk model is requested to perform remote semantic disambiguation. The updated term mapping relationship is received from the cloud, the lightweight semantic disambiguation dictionary is updated, and the original symptom text field is temporarily assigned to the unlabeled set and marked with a low confidence indicator.

5. The health risk quantification modeling system based on federated knowledge distillation as described in claim 4, characterized in that, The adaptive adjustment of the time window width based on risk factor type also includes: Centered on the self-assessment timestamp, time-series monitoring data within the adaptively adjusted time window width is extracted, and at least one time-series statistical feature, including mean, variance, peak value, and slope of change, is calculated and stored in association with the symptom label.

6. The health risk quantification modeling system based on federated knowledge distillation as described in claim 5, characterized in that, The The generation and updating methods of lightweight feature dimensionality reduction encoders include: After the global high-risk model in the cloud completes one round of incremental learning, the parameters of the teacher model are frozen, the intermediate layer output that is aligned with the structure of the student model is selected, and the similarity of the representation of the teacher model and the student model in this intermediate layer is calculated. Based on the representation similarity, the top K feature dimensions that contribute the most to the downstream risk rating task in the teacher model are identified, and an attention mask is generated. Based on the attention mask, a weighted filtering is performed on the high-dimensional risk feature vector output by the teacher model, retaining the first K feature dimensions, and a task-oriented dimensionality reduction projection matrix is ​​constructed. The dimensionality reduction projection matrix is ​​compressed into a lightweight fully connected layer adapted to the computing power of the edge terminal through knowledge distillation, and then distributed to the edge terminal as the weight of the lightweight feature dimensionality reduction encoder. The edge terminal loads the lightweight feature dimensionality reduction encoder, performs matrix multiplication on the risk factor matrix, and outputs the first health state feature tensor.

7. The health risk quantification modeling system based on federated knowledge distillation as described in claim 6, characterized in that, The output initial risk rating sequence and confidence score include: The first health state feature tensor is input into the feature extraction backbone network of the lightweight student model to generate the first hidden layer representation tensor. The first hidden layer representation tensor is fed into the first task branch and the second task branch, respectively, where: The first task branch is a risk probability inference head, which includes at least one fully connected layer and a Softmax activation function, outputs the probability distribution of each preset risk dimension, and generates an initial risk rating sequence based on the risk level corresponding to the maximum probability value in the probability distribution. The second task branch is a confidence assessment head, which shares some hidden layer parameters with the first task branch and outputs the confidence score for each risk dimension. The confidence score represents the reliability of the model's prediction results for the corresponding risk level. The confidence scores are subjected to time-series smoothing filtering to generate a filtered confidence time-series sequence. Extract the mean of the sliding window at the current time from the confidence time series. If the mean of the sliding window is greater than or equal to the first preset threshold, it is determined that the edge model has reached the convergence state, and the edge model convergence signal is output. If the mean of the sliding window is less than the first preset threshold, the first health state feature tensor and the corresponding model output are continuously cached until the number of cached samples reaches the preset batch size. Then, a local training task is triggered, and the cached samples are used to perform incremental fine-tuning on the lightweight student model. The confidence time series is updated, and the confidence monitoring step is repeated.

8. The health risk quantification modeling system based on federated knowledge distillation as described in claim 7, characterized in that, The confidence score output by the confidence assessment head includes: Obtain the risk probability distribution vector output by the first task branch; Calculate the information entropy of the risk probability distribution vector, and convert the information entropy into a first confidence component through negative exponential mapping; Obtain the feature activation values ​​of the intermediate layer of the lightweight student model, calculate the representation similarity between the lightweight student model and the cloud-based global risk model in the corresponding distillation layer, and use the normalized representation similarity as the second confidence component. The first confidence component and the second confidence component are weighted and fused to generate the confidence score.

9. The health risk quantification modeling system based on federated knowledge distillation as described in claim 8, characterized in that, The step of performing time-series smoothing filtering on the confidence score includes: Initialize a circular buffer of length N to store the confidence scores of the first N inference outputs; After each inference is completed, the current confidence score is written to the circular buffer, and the arithmetic mean of all confidence scores in the buffer is calculated as the mean of the sliding window. If the circular buffer is not full, the historical global mean is used for filling compensation, and the compensated sliding window mean is output.

10. The health risk quantification modeling system based on federated knowledge distillation as described in claim 9, characterized in that, The step of triggering the local training task and performing incremental fine-tuning of the lightweight student model using cached samples includes: Read the first health status feature tensor and its corresponding initial risk rating sequence from the cache to form a local training sample pair; The parameters of the feature extraction backbone network in the lightweight student model, excluding the classification head, are fixed, and several rounds of stochastic gradient descent updates are performed only on the terminal fully connected layers of the first and second task branches. After fine-tuning, the preset number of cached samples are cleared, and risk inference is re-performed on the latest collected feature tensors based on the updated lightweight student model to generate an updated confidence time series.

Citation Information

Patent Citations

  • Risk signal screening and monitoring method and system for mobile terminal

    CN121924485A

  • Ai-based cybersecurity system and method thereof

    US20260067314A1