A method for constructing a federated emotional knowledge model based on hierarchical noise injection driven by dynamic sensitivity
By employing a dynamic sensitivity-driven hierarchical noise injection method, the problem of balancing privacy protection and model accuracy in sentiment knowledge graphs is solved. This method enables refined grading of sentiment data and personalized graph construction, thereby improving the model's accuracy and privacy protection capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HEFEI UNIV OF TECH
- Filing Date
- 2025-05-23
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies struggle to balance privacy protection and the quality of knowledge representation when constructing emotional knowledge graphs. In particular, they lack sensitivity-aware modeling strategies when dealing with highly sensitive emotional entities, leading to privacy risks and poor model accuracy.
A dynamic sensitivity-driven hierarchical noise injection method is adopted. This method classifies the sensitivity of emotional entities on the local client and injects noise into the input information of the local client based on the classification results. Combined with gradient projection technology and improved optimization algorithm, parameter updates are optimized to balance privacy protection and model accuracy.
It achieves refined sensitivity grading of sentiment data, improving the model's privacy protection capabilities and accuracy, especially in the personalized graph construction of highly sensitive sentiment entities, thereby improving the model's accuracy and reducing invalid perturbations.
Smart Images

Figure CN120654789B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer sentiment analysis technology, and in particular to a method for constructing a federated sentiment knowledge model based on dynamic sensitivity-driven hierarchical noise injection. Background Technology
[0002] With the deepening application of artificial intelligence technology in the field of affective computing, affective knowledge graphs, as a technical means to effectively represent affective entities and their relationships, have demonstrated significant value in scenarios such as mental health monitoring and intelligent customer service. However, affective data is highly sensitive, and how to protect user privacy while constructing knowledge graphs has become a critical issue that urgently needs to be addressed.
[0003] In recent years, federated learning, as a privacy-preserving distributed training framework, has been widely used for collaborative model training without requiring data to be stored locally. While federated learning alleviates privacy concerns to some extent, it still faces multiple challenges, including insufficient local model learning of highly sensitive words, privacy risks during parameter upload, and sensitivity of federated aggregation to high-noise parameters. This is particularly true when dealing with emotional entities involving mental health and individual privacy, where conventional federated mechanisms struggle to balance privacy protection and knowledge representation quality. Existing technologies have the following shortcomings in modeling highly sensitive emotional entities: First, they lack sensitivity-aware modeling strategies, failing to adjust the model's learning focus based on the privacy level of the emotional entity. Second, local optimization algorithms are poorly robust to low-frequency, highly sensitive words, easily leading to ambiguous or missing semantic representations. Third, uploaded parameters do not differentiate between sensitivity levels, resulting in excessive noise injection or an inability to balance privacy protection and accuracy. Fourth, traditional federated framework aggregation strategies ignore the heterogeneity of sensitivity across different clients, affecting the overall graph quality and stability. Summary of the Invention
[0004] This invention discloses a method for constructing a federated sentiment knowledge model based on dynamic sensitivity-driven hierarchical noise injection, the specific method of which is as follows:
[0005] Download the server's sentiment knowledge classification model to the local client;
[0006] Based on the input information from the local client, obtain the local client user's emotional entity sensitivity rating;
[0007] Based on the entity sensitivity classification of local client users, noise is injected into the input information of the local client.
[0008] Using local client input information with injected noise, train a sentiment knowledge classification model for downloading local clients;
[0009] The trained local client sentiment knowledge classification model is uploaded to the server to update the server sentiment knowledge classification model.
[0010] Furthermore, the sensitivity rating of local client users' emotional entities is obtained using the following method:
[0011] To obtain the semantic relevance, social impact, and data distribution of local client input information;
[0012] The specific formula for the sensitivity value, which is based on weighted semantic relevance, social impact, and data distribution, is as follows:
[0013]
[0014] in, This is an adjustable coefficient;
[0015] The sensitivity rating of local client users' emotional entities is obtained based on the weighted results.
[0016] Furthermore, semantic relevance is calculated using the following method:
[0017] The text input by the local client is encoded using a general large model to obtain a d-dimensional semantic vector.
[0018] The formula for calculating the language similarity between local client input and a high-risk word list is as follows:
[0019]
[0020] The input is a d-dimensional semantic vector, and the output usually takes a similarity value ∈ [-1, 1], which is normalized to [0,1]. The high-risk vocabulary consists of a basic vocabulary built from standard clinical psychology terms and low-recognition network terms expanded later.
[0021] Furthermore, the data distribution is determined by the frequency of occurrence in the statistical knowledge graph, and the specific calculation formula is as follows:
[0022]
[0023] When the frequency of occurrence is less than 100, the value is increased to 2.
[0024] Furthermore, the social impact is estimated based on the PHQ-9 depression scale to weight different degrees of emotional depression.
[0025] Furthermore, for low-sensitivity entities in the aggregation results Noise injection is performed using the following method:
[0026] For low-sensitivity entities Noise is injected into the local client input information. Gaussian noise injection is used to balance privacy protection and data availability. The probability density function of the Gaussian distribution is expressed as:
[0027]
[0028] When performing dynamic noise data calculations on the data, the following conditions must be met:
[0029]
[0030]
[0031] In the formula, f(eᵢ) refers to the entity. The sensitivity indicates the maximum impact of the entity on the function's output; This refers to the privacy budget, which controls the intensity of added noise. A smaller value provides stronger privacy protection. For low-sensitivity entities, a commonly used value is typically chosen. ;
[0032] The perturbated data is represented as follows:
[0033]
[0034] Gradient projection technique is introduced to constrain the perturbed vectors within a valid semantic space. First, the semantic space is defined, and a set of orthogonal basis vectors is generated through a general large model to form a low-dimensional semantic space, ensuring that all emotional entities can be represented in this space.
[0035] The vector after noise perturbation Projecting onto the semantic space to minimize semantic distortion:
[0036]
[0037] For low-sensitivity entities To inject level 2 noise into the server, the specific formula is as follows:
[0038]
[0039] In the formula, The number of clients participating in federated learning; , .
[0040] Furthermore, for highly sensitive entities in the aggregation results The specific method for injecting noise is as follows:
[0041] Based on sensitivity values, emotional entities are divided into high-sensitivity entities and low-sensitivity entities;
[0042] For highly sensitive entities Based on the first-moment estimation of the standard Adam optimizer, a dynamic compensation coefficient based on entity sensitivity and occurrence frequency is introduced, and the gradient correction function is defined as:
[0043]
[0044] In the formula, Sensitivity to emotional entities; This indicates the frequency of the entity's occurrence in the training set; The total number of training samples; This represents the maximum sensitivity value in the current batch.
[0045] High-risk entities are amplified by up to 2 times, while low-frequency entities are compensated gradually through a logarithmic decay function.
[0046] To address the differences in gradient sparsity among entities of different frequencies, a piecewise attenuation coefficient is designed:
[0047]
[0048] In the formula, the threshold threshold , ;
[0049] The update process employs an improved second-moment estimation:
[0050]
[0051] in , which represents the current corrected gradient value; This represents the second moment estimate of the current time step, i.e., the weighted average of the squared gradients; This represents the second moment estimate of the previous time step; Indicates the segmented attenuation coefficient;
[0052] In accordance with differential privacy requirements, the final parameter update magnitude is constrained:
[0053]
[0054] In the formula, Indicates the parameter update amount; This represents the local client's privacy budget, used to control noise levels. This represents sensitivity, specifically the maximum difference between adjacent datasets for a function; Indicates the learning rate; This represents the first-order moment estimate after bias correction, used to correct the gradient direction; This represents the second-order moment estimate after bias correction, used to correct the gradient magnitude; It is a very small constant to prevent the denominator from being zero.
[0055] Among them, the first-order moment estimate after bias correction:
[0056]
[0057] Second-order moment estimation after bias correction:
[0058]
[0059] in, This represents the first-order moment attenuation coefficient, with a default value of 0.9. This represents the piecewise decay coefficient at the k-th time step;
[0060] For the current model parameters The perturbation δ is generated through gradient ascent:
[0061]
[0062] in To limit the perturbation amplitude, x is the input data, and the adversarial example is... ;
[0063] The adversarial weighted loss is:
[0064]
[0065] in, This represents adversarial loss, i.e., loss based on adversarial examples;
[0066] The ultimate training objective is:
[0067]
[0068]
[0069] in, This represents the total loss, which is the weighted sum of the standard loss and the adversarial loss. Represents a mixed weighting to counteract loss; This represents the gradient of the total loss with respect to the model parameters θ.
[0070] Furthermore, the server sentiment knowledge classification model is updated using the following method:
[0071] Define the global gradient:
[0072]
[0073] in This represents the parameter difference for the k-th update by the client. For client-side weights, including the number of samples and sensitivity parameters, Low-frequency compensation weights;
[0074] Define the client-side weight function:
[0075]
[0076] Where N is the total number of samples. This represents the number of local samples on the client side. As the amplification factor, This represents the set of sentiment entities that appear when the client updates the k-th word;
[0077] Define the low-frequency compensation function:
[0078]
[0079] A logarithmic function is used to amplify the influence of low-frequency terms and prevent overfitting, where N is the total number of samples. for Frequency of occurrence in the global context;
[0080] but It can be set to the average value of the entities involved in the client, i.e.
[0081]
[0082] Introduction To emphasize the degree of adjustment of high-sensitivity + low-frequency words, among which This is the adjustment coefficient;
[0083] Update first-order momentum
[0084]
[0085] in, Momentum decay factor
[0086] Update second-order momentum
[0087]
[0088] in, It is the second-order moment attenuation coefficient;
[0089] The first-order and second-order momentum deviation correction terms are as follows:
[0090]
[0091]
[0092] in This represents the first-order moment estimate after bias correction, used to correct the gradient direction; This represents the second-order moment estimate after bias correction, used to correct the gradient magnitude;
[0093] The final parameter update is expressed as:
[0094]
[0095] in, To prevent division by zero smoothing factor
[0096] Gradient projection technique is introduced to constrain the perturbed vectors within a valid semantic space.
[0097] A set of orthogonal basis vectors is generated by a general large model to form a low-dimensional semantic space, ensuring that all emotional entities can be represented in this space;
[0098] vector Projecting onto the semantic space to minimize semantic distortion:
[0099]
[0100] Due to the adoption of the above technical solutions, the present invention has the following beneficial effects:
[0101] 1. This invention proposes an innovative dynamic sensitivity assessment system that integrates multi-dimensional features such as semantic relevance, social influence weighting, and data sparsity to achieve refined sensitivity grading for different types of emotional data. This method effectively solves the problem that traditional uniform noise injection mechanisms cannot adapt to the differences in sensitivity of emotional data. Users do not need to rely on complex privacy risk assessment experience; they can configure optimal privacy protection strategies for different types of emotional data based on the sensitivity grading results automatically generated by the system.
[0102] 2. This invention balances privacy protection with the extraction of effective information. By introducing dynamic Gaussian noise injection and semantic space projection mechanisms, and combining sensitivity grading, parameter updates are anonymized, thus protecting the privacy of users' highly sensitive emotional data while achieving federated learning.
[0103] 3. This invention supports personalized differentiation and local optimization. The proposed "high-sensitivity path + adaptive optimizer" mechanism can adaptively select optimization strategies based on the local distribution of high-sensitivity words on the client side, improving the personalized graph construction effect and reducing invalid perturbations caused by privacy injection. Under the condition of skewed distribution of sensitive words on the client side, the proposed method improves the accuracy by 4.8% compared with the traditional FedAvg model, and the local training convergence speed is faster.
[0104] 4. The dual-path optimization mechanism and sensitivity-driven strategy of this invention can be flexibly embedded into various federated graph construction processes, such as FedAvg and FedProx frameworks, and have good versatility, portability and extensibility for multi-task modeling.
[0105] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained from the following description. Attached Figure Description
[0106] The accompanying drawings of this invention are described below.
[0107] Figure 1 This is a schematic diagram of the overall process of the present invention. Detailed Implementation
[0108] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0109] A method for constructing a federated sentiment knowledge model based on dynamic sensitivity-driven hierarchical noise injection, such as... Figure 1 As shown, the specific steps are as follows:
[0110] S1. Download the server's sentiment knowledge classification model to the local client.
[0111] S2. Based on the input information from the local client, obtain the sensitivity level of the local client user's emotional entities.
[0112] In step S2, the sensitivity of the user's emotional entities is classified.
[0113] S21. First, emotional sensitivity is quantified. The quantification indicators are mainly divided into the following three standards: semantic relevance, social impact, and data distribution. The following quantification formula is proposed to represent the weight ratio of each part:
[0114] (1)
[0115] in This is an adjustable coefficient; the default percentages are 0.5, 0.3, and 0.2.
[0116] The original text is encoded using the large Deepseek model, and the semantic similarity between sentiment tags and high-risk word lists, such as depression and self-harm, is calculated. Specifically, given two vectors, A (sentiment tag vector) and B (high-risk word vector), the cosine similarity is:
[0117] (2)
[0118] The input is a d-dimensional semantic vector obtained by Deepseek, and the output typically takes a similarity value ∈ [-1, 1], normalized to [0, 1]. The high-risk vocabulary consists of a basic vocabulary built from standard clinical psychology terminology and later expanded with less recognizable online terms. If the cosine similarity is ≥0.7, it can be judged as high-risk.
[0119] The social impact weights are assigned to different levels of harm based on psychological scales, such as a weight of 5 for severe depression and 1 for mild anxiety. The following is a knowledge graph based on the PHQ-9 depression scale to estimate the weights for different degrees of emotional depression, as shown in the table below:
[0120]
[0121] In statistical knowledge graphs, entity frequency is analyzed, with lower-frequency entities showing higher sensitivity. For example, when extracting keywords like "post-traumatic stress disorder," the sensitivity increases twofold when the frequency is less than 100 times. A function can be set to match the weights of the quantification formula.
[0122] (3)
[0123] S3. Based on the entity sensitivity classification of local client users, inject noise into the input information of the local client.
[0124] In step S3, a differential privacy-based method is used for low-sensitivity entities, injecting Gaussian noise during parameter upload and optimizing protection measures during federated aggregation. In the sentiment knowledge graph, f represents the sensitivity value of entity ei. Its value is dynamically calculated using the quantization formula in step 1. Sensitivity Δf measures the maximum difference between function f on neighboring datasets D and D′, i.e.:
[0125] (4)
[0126] The sensitivity grading can categorize emotional entities into high-sensitivity entities and low-sensitivity entities. For low-sensitivity entities... Gaussian noise injection is used to balance privacy protection and data availability. The probability density function of the Gaussian distribution is expressed as:
[0127] (5)
[0128] When performing dynamic noise data calculations on the data, the following conditions must be met:
[0129] , (6)
[0130] Where: f(eᵢ) refers to the entity The sensitivity indicates the maximum impact of the entity on the function's output; This refers to the privacy budget, which controls the intensity of added noise. A smaller value provides stronger privacy protection. For low-sensitivity entities, a commonly used value is typically chosen. While ensuring basic privacy protection, we should minimize the impact of noise on model accuracy.
[0131] The perturbated data is represented as follows:
[0132] (7)
[0133] Gradient projection is introduced to constrain the perturbed vectors within a valid semantic space, preventing noise from causing the semantic vectors of sentiment entities to deviate from a reasonable range and disrupting the knowledge graph structure. First, a semantic space is defined. A set of orthogonal basis vectors is generated using the Deepseek sentiment model to construct a low-dimensional semantic space, ensuring that all sentiment entities can be represented within this space. The noise-perturbed vectors are then... Projecting onto the semantic space to minimize semantic distortion:
[0134] (8)
[0135] On the server side of federated learning, aggregating local data from multiple clients may pose a risk of inference attacks, such as using gradient descent to infer sensitive user data. Therefore, this scheme implements secondary noise enhancement on the server side and dynamically allocates a privacy budget to further strengthen the protection of low-sensitivity entities. This is specifically designed for low-sensitivity entities in the aggregation results. The server adds extra Gaussian noise to meet more stringent requirements. -Differential Privacy:
[0136] (9)
[0137] in: The number of clients participating in federated learning; Privacy budget, extremely low value to ensure strong protection; The probability of privacy failure is negligible.
[0138] S22. For highly sensitive entities, the dataset is trained locally to enhance privacy protection and differentiated optimization. To maximize the model's learning ability for this type of information during local training, we introduce a sensitivity-driven weighted loss function:
[0139] (10)
[0140] in, Standard loss methods include cross-entropy and graph neural network loss, etc. For emotional entity sensitivity, As a loss amplification factor for highly sensitive entities, >1, This is an indicator function that takes the value 1 for high sensitivity and 0 otherwise. E represents the set of all entities in the client's local data.
[0141] During the training phase, highly sensitive words are given greater learning weights. In subsequent desensitization steps, such as noise injection which may weaken the information, their semantic representation ability is actively enhanced. For graph structure models, this loss structure can be directly constructed by nodes or edges to adapt to the graph context.
[0142] In selecting optimizers for local training, considering the adaptability and robustness of Adam optimization suitable for scenarios involving few-sample training, low-frequency entity learning, and sensitive information protection, this invention proposes an improved Adam optimization algorithm. This algorithm effectively addresses three key issues of traditional optimizers in federated learning scenarios through a triple adaptive mechanism—gradient sensitivity compensation, dynamic second-moment decay, and privacy constraint updates: 1. Insufficient gradient updates for high-risk emotional entities, such as suicidal tendencies; 2. Unstable parameter convergence for low-frequency entities (occurring less than 100 times); 3. Imbalance between privacy protection and model utility.
[0143] Based on the first-moment estimation of the standard Adam optimizer, a dynamic compensation coefficient based on entity sensitivity and occurrence frequency is introduced. The gradient correction function is defined as:
[0144] (11)
[0145] In the formula: Sensitivity to emotional entities; This indicates the frequency of the entity's occurrence in the training set; The total number of training samples; This represents the maximum sensitivity value in the current batch.
[0146] This design enables dual self-adaptation:
[0147] Sensitivity priority: for high-risk entities ( It provides a gradient amplification of up to 2 times.
[0148] Frequency compensation: for low-frequency entities ( Asymptotic compensation is provided through a logarithmic decay function.
[0149] To address the differences in gradient sparsity among entities of different frequencies, a piecewise attenuation coefficient is designed:
[0150] (12)
[0151] Where: threshold Determined based on clinical studies using the PHQ-9 scale; Minimal attenuation coefficient ensures stability of low-frequency physical foundations; Maximum attenuation coefficient, standard Adam recommended value.
[0152] The update process employs an improved second-moment estimation:
[0153] (13)
[0154] in , which represents the current corrected gradient value; This represents the second moment estimate of the current time step, i.e., the weighted average of the squared gradients; This represents the second moment estimate of the previous time step; This represents the segmented attenuation coefficient.
[0155] In accordance with differential privacy requirements, the final parameter update magnitude is constrained:
[0156] (14)
[0157] in: Indicates the parameter update amount; This represents the local privacy budget, used to control noise levels. This represents sensitivity, specifically the maximum difference between adjacent datasets for a function; Indicates the learning rate; This represents the first-order moment estimate after bias correction, used to correct the gradient direction; This represents the second-order moment estimate after bias correction, used to correct the gradient magnitude; It is a very small constant to prevent the denominator from being zero.
[0158] Among them, the first-order moment estimate after bias correction:
[0159] (15)
[0160] Second-order moment estimation after bias correction:
[0161] (16)
[0162] in: This represents the first-order moment attenuation coefficient, with a default value of 0.9. This represents the piecewise decay coefficient at the k-th time step.
[0163] Local optimization also requires adversarial perturbation training to improve the model's robustness and better resist small malicious changes in the input data.
[0164] For the current model parameters The perturbation δ is generated through gradient ascent:
[0165] (17)
[0166] in To limit the perturbation amplitude, x is the input data, and the adversarial example is...
[0167] The adversarial weighted loss is:
[0168] (18)
[0169] in: This represents adversarial loss, which is the loss based on adversarial examples.
[0170] The ultimate training objective is:
[0171] (19)
[0172] (20)
[0173] in: This represents the total loss, which is the weighted sum of the standard loss and the adversarial loss. Represents a mixed weighting to counteract loss; This represents the gradient of the total loss with respect to the model parameters θ.
[0174] S4. Train the sentiment knowledge classification model of the local client using the local client input information after injecting noise.
[0175] S5. Upload the trained local client sentiment knowledge classification model to the server and update the server sentiment knowledge classification model.
[0176] During the server data aggregation phase, considering that the application scenario of this invention is a typical Non-IID distribution, the FedAdam algorithm framework is adopted to implement the server-side aggregation process, thereby improving the overall model's performance on imbalanced data. Given that highly sensitive words often have low frequency and are easily diluted in traditional cloud update frameworks, this invention proposes an improved FedAdam aggregation framework.
[0177] Define global gradient
[0178] (twenty one)
[0179] in This represents the parameter difference for the k-th update by the client. For client-side weights, including the number of samples and sensitivity parameters, This is a low-frequency compensation weight.
[0180] Define the client-side weight function as follows:
[0181] (twenty two)
[0182] Where N is the total number of samples. This represents the number of local samples on the client side. As the amplification factor, This represents the set of sentiment entities that appear when the client updates the k-th word.
[0183] The low-frequency compensation function is defined as follows:
[0184] (twenty three)
[0185] A logarithmic function is used to amplify the influence of low-frequency terms and prevent overfitting. Similarly, N is the total number of samples. for Frequency of occurrence in the global context.
[0186] but It can be set to the average value of the entities involved in the client, i.e.
[0187] (twenty four)
[0188] Introduction To emphasize the degree of adjustment of high-sensitivity + low-frequency words, among which This is an adjustment factor, which is greater than 1 by default.
[0189] Meanwhile, referring to step two, the following parameter update process is provided.
[0190] Update first-order momentum
[0191] (25)
[0192] in Momentum decay factor
[0193] Update second-order momentum
[0194] (26)
[0195] in The second-order moment attenuation coefficient
[0196] The first-order and second-order momentum deviation correction terms are as follows:
[0197] (27)
[0198] (28)
[0199] in This represents the first-order moment estimate after bias correction, used to correct the gradient direction; This represents the second-order moment estimate after bias correction, used to correct the gradient magnitude.
[0200] The final parameter update can be represented as
[0201] (29)
[0202] in, To prevent division by zero smoothing factor.
[0203] Gradient projection is introduced to constrain the perturbed vectors within a valid semantic space. A semantic space is defined by generating a set of orthogonal basis vectors using the Deepseek sentiment model, forming a low-dimensional semantic space that ensures all sentiment entities can be represented within this space. The vectors are then... Projecting onto the semantic space to minimize semantic distortion:
[0204] (30)
[0205] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.
Claims
1. A method for constructing a federated affective knowledge model based on dynamic sensitivity-driven hierarchical noise injection, characterized in that, The specific method is as follows: Download the server's sentiment knowledge classification model to the local client; Based on the input information from the local client, obtain the local client user's emotional entity sensitivity rating; Based on the entity sensitivity classification of local client users, noise is injected into the input information of the local client. Using local client input information with injected noise, train a sentiment knowledge classification model for downloading local clients; Upload the trained local client sentiment knowledge classification model to the server and update the server sentiment knowledge classification model. The specific method for obtaining the local client user's emotional entity sensitivity rating is as follows: To obtain the semantic relevance, social impact, and data distribution of local client input information; The specific formula for the sensitivity value, which is based on weighted semantic relevance, social impact, and data distribution, is as follows: wherein is an adjustable coefficient; Based on the weighted results, obtain the local client user's emotional entity sensitivity rating; The specific method for calculating semantic relevance is as follows: The text input by the local client is encoded using a general large model to obtain a d-dimensional semantic vector. The formula for calculating the language similarity between local client input and a high-risk word list is as follows: The input is a d-dimensional semantic vector, and the output usually takes a similarity value ∈ [-1, 1], which is normalized to [0,1]. The high-risk word library consists of a basic word library built from standard clinical psychology terminology and low-recognition network terms expanded later. The data distribution is determined by the frequency of occurrence of sentiment entities in the knowledge graph, and the specific calculation formula is as follows: wherein, is the frequency of occurrence of the sentiment entity in the training set, and when the frequency of occurrence is greater than 100, the value is raised to 2; Social impact is a numerical value used to estimate the weights of different degrees of emotional depression based on the PHQ-9 depression scale.
2. The layered noise injection based on dynamic sensitivity driven association sentiment knowledge model construction method of claim 1, wherein, Low sensitivity entities in the aggregation results injecting noise, in particular as follows: For low sensitive entities Noise is injected in the local client input information, Gaussian noise injection is adopted to balance privacy protection and data availability, and the probability density function of Gaussian distribution is represented as: When performing dynamic noise data calculations on the data, the following conditions must be met: In the formula, f(eᵢ) refers to the entity. The sensitivity indicates the maximum impact of the entity on the function's output; This refers to the privacy budget, which controls the intensity of added noise. A smaller value provides stronger privacy protection. For low-sensitivity entities, a commonly used value is typically chosen. ; The perturbated data is represented as follows: Gradient projection technique is introduced to constrain the perturbed vectors within a valid semantic space. First, the semantic space is defined, and a set of orthogonal basis vectors is generated through a general large model to form a low-dimensional semantic space, ensuring that all emotional entities can be represented in this space. the vector after noise disturbance projected to semantic space to minimize semantic distortion: For low sensitivity entities The server injects secondary noise, with the following formula: In the formula, the number of clients participating in federated learning; , .
3. The layered noise injection based on dynamic sensitivity driven association sentiment knowledge model construction method of claim 1, wherein, High sensitivity entities in aggregation results The injection noise is specifically implemented as follows: Based on sensitivity values, emotional entities are divided into high-sensitivity entities and low-sensitivity entities; For high sensitivity entities On the basis of the first moment estimation of the standard Adam optimizer, a dynamic compensation coefficient based on entity sensitivity and frequency of occurrence is introduced, and the gradient correction function is defined as: In the formula, Sensitivity to emotional entities; This indicates the frequency of the entity's occurrence in the training set; The total number of training samples; This represents the maximum sensitivity value in the current batch. High-risk entities are amplified by up to 2 times, while low-frequency entities are compensated gradually through a logarithmic decay function. To address the differences in gradient sparsity among entities of different frequencies, a piecewise attenuation coefficient is designed: In the formula, threshold value , threshold value , ; The update process employs an improved second-moment estimation: wherein is the current correction gradient value; is the second moment estimate at the current time step, i.e. the weighted average of the squared gradients; is the second moment estimate at the previous time step; is the piecewise decay coefficient; In accordance with differential privacy requirements, the final parameter update magnitude is constrained: In the formula, Indicates the parameter update amount; This represents the local client's privacy budget, used to control noise levels. This represents sensitivity, specifically the maximum difference between adjacent datasets for a function; Indicates the learning rate; This represents the first-order moment estimate after bias correction, used to correct the gradient direction; This represents the second-order moment estimate after bias correction, used to correct the gradient magnitude; It is a very small constant to prevent the denominator from being zero. Among them, the first-order moment estimate after bias correction: Second-order moment estimation after bias correction: in, This represents the first-order moment attenuation coefficient, with a default value of 0.
9. This represents the piecewise decay coefficient at the k-th time step; For the current model parameters Generate adversarial perturbation δ by gradient ascent: wherein is the perturbation amplitude limit, x is the input data, and x' is the adversarial sample ; The adversarial weighted loss is: in, This represents adversarial loss, i.e., loss based on adversarial examples; The ultimate training objective is: wherein, denotes the total loss, i.e. the weighted sum of the standard loss and the adversarial loss; denotes the mixing weight for the adversarial loss; denotes the gradient of the total loss with respect to the model parameters θ.
4. The layered noise injection based on dynamic sensitivity driven association sentiment knowledge model construction method of claim 1, wherein, The server sentiment knowledge classification model is updated using the following method: Define the global gradient: in This represents the parameter difference for the k-th update by the client. For client-side weights, including the number of samples and sensitivity parameters, Low-frequency compensation weights; Define the client-side weight function: where N is the total number of samples, represents the local number of samples of the client, is the magnification factor, represents the set of sentiment entities that appear in the kth word update of the client; Define the low-frequency compensation function: The logarithmic function is used to amplify the influence of low frequency terms and prevent overfitting, N is the total number of samples, For Frequency of occurrence in the global; then may be set to the average value of the client-relevant entities, i.e. Introduction To emphasize the degree of adjustment of high-sensitivity + low-frequency words, among which This is the adjustment coefficient; Update first-order momentum wherein is a momentum decay factor Update second-order momentum wherein is the second moment decay coefficient; The correction terms for the first and second momentum deviations are as follows: wherein denotes the bias-corrected first moment estimate for correcting the gradient direction; denotes the bias-corrected second moment estimate for correcting the gradient magnitude; The final parameter update is expressed as: wherein to prevent smoothing factor except 0 Gradient projection technique is introduced to constrain the perturbed vectors within a valid semantic space. A set of orthogonal basis vectors is generated by a general large model to form a low-dimensional semantic space, ensuring that all emotional entities can be represented in this space; projecting the vectors to the semantic space to minimize semantic distortion: 。
Citation Information
Patent Citations
Federal learning model training privacy protection method and system based on hybrid strategy
CN116167084A
Incomplete multi-mode emotion recognition method based on diffusion model and federal model
CN119622449A