Federal emotion knowledge graph construction method based on layered noise injection driven by dynamic sensitivity

Through the dynamic sensitivity-driven hierarchical noise injection method, the balance problem between privacy protection and knowledge expression in the emotional knowledge graph is solved, the refined sensitivity grading of emotional data and personalized graph construction are realized, and the accuracy and training efficiency of the model are improved.

CN120654789AActive Publication Date: 2025-09-16HEFEI UNIV OF TECH
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510675739.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-09-16
Estimated Expiration
2045-05-23

AI Technical Summary

Technical Problem

Existing technologies have difficulty balancing privacy protection and knowledge expression quality when constructing emotional knowledge graphs. In particular, when dealing with emotional entities related to mental health and individual privacy, there is a lack of sensitivity-aware modeling strategies, resulting in insufficient model learning and a high risk of privacy leakage during parameter upload. In addition, traditional federated mechanisms are unable to balance noise injection and accuracy.

Method used

A dynamic sensitivity-driven hierarchical noise injection method is adopted to evaluate the sensitivity of emotional entities through semantic relevance, social influence and data distribution. Combined with gradient projection and differential privacy technology, the noise injection intensity is dynamically adjusted and the gradient update strategy is optimized to achieve personalized graph construction.

Benefits of technology

It achieves refined sensitivity grading of emotional data, balances privacy protection and information extraction, improves model accuracy and accelerates training convergence, adapts to the sensitivity differences of different emotional data, and enhances the stability and privacy protection capabilities of the graph.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654789A_ABST
    Figure CN120654789A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer sentiment analysis, in particular to a federal sentiment knowledge graph construction method based on layered noise injection driven by dynamic sensitivity. Comprising the following steps: downloading a model to a local client; obtaining a user emotion entity sensitivity grade of the local client; noise is injected into the input information of the local client; training and downloading an emotional knowledge classification model of the local client; and updating the server emotion knowledge classification model. According to the method, through fusion of multi-dimensional features such as semantic relevance, social influence weight and data sparsity, refined sensitivity grading of different emotion data is realized. According to the method, the problem that a traditional unified noise injection mechanism cannot adapt to sentiment data sensitivity difference is effectively solved, and a user can configure an optimal privacy protection strategy for different types of sentiment data according to a sensitivity grading result automatically generated by a system without depending on complex privacy risk assessment experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer sentiment analysis technology, and in particular to a method for constructing a federated sentiment knowledge graph based on dynamic sensitivity-driven hierarchical noise injection. Background Art

[0002] With the deepening application of artificial intelligence in the field of affective computing, emotional knowledge graphs, as a technical means of effectively representing emotional entities and their relationships, have demonstrated significant value in scenarios such as mental health monitoring and intelligent customer service. However, emotional data is highly sensitive, and protecting user privacy while building knowledge graphs has become a key issue that 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 leaving local data. While federated learning has alleviated 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 noisy parameters. Conventional federated mechanisms are particularly difficult to balance privacy protection with knowledge representation quality when dealing with emotional entities related to mental health and individual privacy. Existing technologies for modeling highly sensitive emotional entities have the following shortcomings: First, there is a lack of sensitivity-aware modeling strategies, making it impossible 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 resulting in ambiguous or missing semantic representations. Third, uploaded parameters do not distinguish between sensitivity levels, leading to excessive noise injection or a difficult balance between privacy protection and accuracy. Fourth, traditional federated framework aggregation strategies ignore the heterogeneity of sensitivity across clients, impacting overall graph quality and stability. Summary of the Invention

[0004] The present invention discloses a method for constructing a federated sentiment knowledge graph based on hierarchical noise injection driven by dynamic sensitivity. The specific method is as follows:

[0005] Download the server's emotional knowledge classification model to the local client;

[0006] Obtain the local client user's emotional entity sensitivity rating based on the local client input information;

[0007] Inject noise into the local client input information based on the entity sensitivity level of the local client user situation;

[0008] Using the local client input information after injecting noise, the sentiment knowledge classification model downloaded from the local client is trained;

[0009] The trained local client emotion knowledge classification model is uploaded to the server to update the server emotion knowledge classification model.

[0010] Furthermore, the local client user's emotional entity sensitivity rating is obtained as follows:

[0011] Obtain the semantic relevance, social influence, and data distribution of local client input information;

[0012] The sensitivity value is calculated by weighting semantic relevance, social influence, and data distribution as follows:

[0013] S(e i )=α·SemSim(e i )+β·SocialW(e i )+γ·Sparsity(e i )

[0014] Among them, α+β+γ=1 is the adjustable coefficient;

[0015] Obtain the local client user's emotional entity sensitivity rating based on the weighted results.

[0016] Furthermore, the semantic relevance is calculated as follows:

[0017] The local client input information text is encoded through the universal large model to obtain a d-dimensional semantic vector;

[0018] Calculate the language similarity between the local client input information and the high-risk vocabulary. The specific formula is:

[0019]

[0020] Among them, the input is a d-dimensional semantic vector, the output usually takes a similarity value ∈ [-1, 1], normalized to [0, 1], and the high-risk vocabulary is composed of a basic vocabulary built on standard clinical psychology terminology and low-recognition network terms expanded later.

[0021] Furthermore, the data distribution is determined by the frequency of occurrence in the statistical knowledge graph. The specific calculation formula is as follows:

[0022]

[0023] When the frequency is less than 100, the value is increased to 2.

[0024] Furthermore, social influence is used to estimate the weights of different degrees of emotional depression based on the PHQ-9 depression scale.

[0025] Furthermore, for the low-sensitivity entity e in the aggregation result L , inject noise, the specific method is as follows:

[0026] For low sensitivity entities S(ei )<θ, 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 calculating dynamic noise data, the following conditions are met:

[0029] Noise i ~N(0,σ 2 )

[0030]

[0031] Where, f(e i ) refers to entity e i The sensitivity of , which indicates the maximum impact of the entity on the function output; ∈ G Refers to the privacy budget, which is used to control the intensity of adding noise. The smaller the value, the stronger the privacy protection. For low-sensitivity entities, the common value is usually ∈ G =1.0;

[0032] The perturbed data is expressed as:

[0033]

[0034] Gradient projection technology is introduced to constrain the perturbed vectors to a valid semantic space. First, the semantic space is defined. A set of orthogonal basis vectors are generated through a universal large model to form a low-dimensional semantic space, ensuring that all emotional entities can be represented in this space.

[0035] The noise-perturbed vector Project to semantic space to minimize semantic distortion:

[0036]

[0037] For low sensitivity entities e L , inject secondary noise into the server, the specific formula is as follows:

[0038]

[0039] Where K is the number of clients participating in federated learning; ∈ S =0.05,δ=10 -5 .

[0040] Furthermore, for highly sensitive entities e in the aggregation results i , the specific method of injecting noise is as follows:

[0041] According to the sensitivity value, the emotional entities are divided into high-sensitivity entities and low-sensitivity entities;

[0042] For highly sensitive entities i , based on the first-order 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, S(e i ) is the sensitivity of emotional entity; F(e i ) represents the frequency of occurrence of the entity in the training set; N is the total number of training samples; max(S) is the maximum sensitivity value in the current batch;

[0045] Provide up to 2 times gradient amplification for high-risk entities and provide progressive compensation for low-frequency entities through a logarithmic attenuation function;

[0046] According to the difference in gradient sparsity of entities with different frequencies, a segmented attenuation coefficient is designed:

[0047]

[0048] Where, the threshold F thres =100, threshold F thres =100,

[0049] The updating process uses the improved second-order moment estimation:

[0050]

[0051] in Represents the current corrected gradient value; v t Represents the second-order moment estimate of the current time step, that is, the weighted average of the squared gradient; v t-1 represents the second-order moment estimate of the previous time step; β 2,t (e i ) represents the segment attenuation coefficient;

[0052] Combined with the requirements of differential privacy, the final parameter update range is constrained:

[0053]

[0054] Where Δθ t Represents the parameter update amount; ∈ local represents the local client privacy budget, which is used to control the noise intensity; Δf represents the sensitivity, that is, the maximum difference of the function on adjacent data sets; α t represents the learning rate; Represents the first-order moment estimate after bias correction, which is used to correct the gradient direction; Represents the second-order moment estimate after bias correction, which is used to correct the gradient amplitude; δ is a very small constant to prevent the denominator from being zero

[0055] Among them, the bias-corrected first-order moment estimate is:

[0056]

[0057] Bias-corrected second moment estimate:

[0058]

[0059] in, Indicates the first-order moment attenuation coefficient, the default is 0.9; β 2,k (e i ) represents the piecewise attenuation coefficient of the kth time step;

[0060] For the current model parameter θ, generate adversarial perturbation δ through gradient ascent:

[0061]

[0062] Where ∈ is the perturbation amplitude limit, x is the input data, and the adversarial sample is x adv =x+δ * ;

[0063] The adversarial weighted loss is:

[0064]

[0065] Among them, L adv represents the adversarial loss, that is, the loss based on adversarial samples;

[0066] The final training goal is:

[0067] L total =(1-α)·L+α·L adv ,α∈[0,1]

[0068]

[0069] Among them, L total represents the total loss, which is the weighted sum of the standard loss and the adversarial loss; α represents the mixed weight of the adversarial loss; g t represents the gradient of the total loss with respect to the model parameters θ.

[0070] Furthermore, the server sentiment knowledge classification model is updated. The specific method is as follows:

[0071] Define the global gradient:

[0072]

[0073] in represents the parameter difference of the client's kth update, α k is the client weight, including the number of samples and sensitivity parameters, ω k is the low frequency compensation weight;

[0074] Define the client weight function:

[0075]

[0076] Where N is the total number of samples, n k represents the number of local samples of the client, λ s is the amplification factor, E k Represents the set of sentiment entities that appear in the k-th word update on the client;

[0077] Define the low-frequency compensation function:

[0078]

[0079] The logarithmic function is used to amplify the influence of low-frequency terms and prevent overfitting. N is the total number of samples, f(e i ) is e i Frequency of occurrence in the global context;

[0080] Then ω k It can be set to the average value of the entities involved in the client, that is,

[0081]

[0082] Introducing S(e i ) γ To emphasize the degree of regulation of high-sensitivity + low-frequency words, where γ is the regulation coefficient;

[0083] Update first-order momentum

[0084] m (t) =β1·m (t-1) +(1-β1)·g (t)

[0085] Where β1 is the momentum decay factor

[0086] Update second-order momentum

[0087] v t =β2·v t-1 +(1-β2)·(g (t) ) 2

[0088] Among them, β2 is the second-order moment attenuation coefficient;

[0089] The first-order momentum and second-order momentum deviation correction terms are as follows

[0090]

[0091] in Represents the first-order moment estimate after bias correction, which is used to correct the gradient direction; represents the bias-corrected second-order moment estimate, which is used to correct the gradient amplitude;

[0092] The final parameter update is expressed as:

[0093]

[0094] Where ∈ is a smoothing factor to prevent division by zero

[0095] The gradient projection technology is introduced to constrain the perturbed vector to a legal semantic space.

[0096] Generate a set of orthogonal basis vectors through a universal large model to form a low-dimensional semantic space, ensuring that all emotional entities can be represented in this space;

[0097] The vector Projecting into semantic space to minimize semantic distortion:

[0098]

[0099] Due to the adoption of the above technical solution, the present invention has the following beneficial effects:

[0100] 1. This paper proposes an innovative dynamic sensitivity assessment system that integrates multi-dimensional features such as semantic relevance, social influence weight, and data sparsity to achieve refined sensitivity grading for different types of sentimental data. This method effectively addresses the inability of traditional unified noise injection mechanisms to adapt to the varying sensitivity of sentimental data. Users can configure optimal privacy protection strategies for different types of sentimental data based on the system's automatically generated sensitivity grading results, without relying on complex privacy risk assessment techniques.

[0101] 2. This invention balances privacy protection and the extraction of effective information. By introducing dynamic Gaussian noise injection and semantic space projection mechanisms, and combining sensitivity grading, it desensitizes parameter updates, thereby protecting the privacy of users' highly sensitive emotional data while achieving federated learning.

[0102] 3. This invention supports personalized differentiation and local optimization. The proposed "high-sensitivity path + adaptive optimizer" mechanism adaptively selects optimization strategies based on the client's local distribution of highly sensitive words, improving personalized graph construction and reducing invalid perturbations caused by privacy injection. Under conditions of skewed client-side sensitive word distribution, the proposed method achieves a 4.8% improvement in accuracy over the traditional FedAvg model, and achieves faster local training convergence.

[0103] 4. The dual-path optimization mechanism and sensitivity-driven strategy of the present invention can be flexibly embedded in a variety of federated graph construction processes, such as FedAvg, FedProx and other frameworks, and has good versatility, portability and scalability for multi-task modeling.

[0104] Other advantages, objects, and features of the present invention will be described in part in the following description and, in part, will be apparent to those skilled in the art upon examination of the following description or may be learned from practice of the present invention. The objects and other advantages of the present invention may be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0105] The accompanying drawings of the present invention are described below.

[0106] Figure 1 It is a schematic diagram of the overall process of the present invention. DETAILED DESCRIPTION

[0107] The present invention will be further described below with reference to the accompanying drawings and examples.

[0108] A method for constructing federated sentiment knowledge graph based on hierarchical noise injection driven by dynamic sensitivity, such as Figure 1 The specific steps are as follows:

[0109] S1. Download the server emotion knowledge classification model to the local client.

[0110] S2. Obtain the local client user's emotion entity sensitivity rating based on the local client input information.

[0111] In step S2, the user's emotion entity is graded in terms of sensitivity.

[0112] S21. First, we quantify emotional sensitivity. The quantitative indicators are mainly divided into the following three criteria: semantic relevance, social influence, and data distribution. The following quantitative formula is proposed to express the weight of each component:

[0113] S(e i )=α·SemSim(e i )+β·SocialW(e i)+γ·Sparsity(e i ) (1)

[0114] Among them, α+β+γ=1 is an adjustable coefficient, and the default proportions are 0.5, 0.3, and 0.2.

[0115] The original text is encoded using the Deepseek model, and the semantic similarity between the sentiment label and the high-risk vocabulary, such as depression and self-harm, is calculated. Given two vectors A, the sentiment label vector, and B, the high-risk word vector, the cosine similarity is:

[0116]

[0117] The input is a d-dimensional semantic vector obtained from Deepseek. The output is typically a similarity value ∈ [-1, 1], normalized to [0, 1]. The high-risk vocabulary consists of a basic vocabulary based on standard clinical psychology terminology and later-expanded internet terms with lower recognition. If the cosine similarity is ≥ 0.7, the case is considered high-risk.

[0118] The social impact weights are combined with psychological scales to assign different levels of harm to different emotional states, such as severe depression with a weight of 5 and mild anxiety with a weight of 1. The following is a knowledge map of weight estimates for different degrees of emotional depression based on the PHQ-9 depression scale, as shown in the table below:

[0119]

[0120] The frequency of entities in the knowledge graph is counted. Low-frequency entities are more sensitive. For example, when extracting keywords such as post-traumatic stress disorder, the sensitivity is doubled when the frequency is less than 100. You can set the function to match the weight of the quantification formula:

[0121]

[0122] S3. Inject noise into the local client input information based on the entity sensitivity classification of the local client user situation.

[0123] In step S3, for low-sensitivity entities, a differential privacy-based approach is used to inject Gaussian noise when uploading parameters and optimize the protection measures during federation aggregation. In the sentiment knowledge graph, f represents the sensitivity value S(e i ), whose value is dynamically calculated by the quantization formula in step 1. The sensitivity Δf measures the maximum difference of the function f on adjacent data sets D and D′, that is:

[0124]

[0125] Sensitivity grading can be performed to divide emotional entities into high-sensitivity entities and low-sensitivity entities. i )<θ, Gaussian noise injection is used to balance privacy protection and data availability. The probability density function of Gaussian distribution is expressed as:

[0126]

[0127] When calculating dynamic noise data, the following conditions are met:

[0128]

[0129] Where: f(e i ) refers to entity e i The sensitivity of , which indicates the maximum impact of the entity on the function output; ∈ G Refers to the privacy budget, which is used to control the intensity of adding noise. The smaller the value, the stronger the privacy protection. For low-sensitivity entities, the common value is usually ∈ G =1.0, while ensuring basic privacy protection, minimize the impact of noise on model accuracy.

[0130] The perturbed data is expressed as:

[0131]

[0132] Gradient projection technology is introduced to constrain the perturbed vector within the legal semantic space, avoiding the semantic vector of the emotional entity deviating from the reasonable range due to the addition of noise, which will destroy the structure of the knowledge graph. First, the semantic space is defined, and a set of orthogonal basis vectors are generated through the emotional model (Deepseek) to form a low-dimensional semantic space, ensuring that all emotional entities can be represented in this space. Project to semantic space to minimize semantic distortion:

[0133]

[0134] On the server side of federated learning, when aggregating local data from multiple clients, there may be a risk of inference attacks, such as inferring user sensitive data through gradient inversion. Therefore, this solution implements secondary noise enhancement on the server side and dynamically allocates privacy budget to further enhance the protection of low-sensitivity entities. L , the server superimposes additional Gaussian noise to meet the stricter (∈ S ,δ)-Differential Privacy:

[0135]

[0136] Where: K is the number of clients participating in federated learning; ∈S =0.05, privacy budget, extremely low value ensures strong protection; δ = 10 -5 ,The privacy failure probability is negligible.

[0137] S22. For highly sensitive entities, the dataset is trained locally to achieve enhanced privacy protection and differentiated optimization. To maximize the model's ability to learn such information during the local training phase, we introduce a sensitivity-driven weighted loss function:

[0138]

[0139] Among them, L base (e i ) represents the standard loss, including cross entropy and graph neural network loss, S(e i ) is the sensitivity of the emotional entity, λ is introduced as the loss amplification factor for highly sensitive entities, λ>1, I[] is the indicator function, which takes 1 when the sensitivity value is high and 0 otherwise. E represents the set of all entities in the client's local data.

[0140] During the training phase, highly sensitive words are given greater learning weights, proactively enhancing their semantic representation capabilities before subsequent desensitization steps, such as noise injection, which may weaken the information. For graph-structured models, this loss structure can be directly constructed by nodes or edges to adapt to the graph context.

[0141] Regarding the optimization algorithm selection for local training, this paper proposes an improved Adam optimization algorithm, considering its adaptability and robustness, which is suitable for small-sample training, low-frequency entity learning, and sensitive information protection scenarios. This algorithm utilizes a triple adaptive mechanism—gradient sensitivity compensation, dynamic second-order moment decay, and privacy-constrained updates—to effectively address three key issues with traditional optimizers in federated learning scenarios: 1. Insufficient gradient updates for high-risk affective entities, such as suicidal tendencies; 2. Unstable parameter convergence for low-frequency entities (<100 occurrences); and 3. The imbalance between privacy protection and model utility.

[0142] Based on the first-order 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:

[0143]

[0144] Where: S(e i ) is the sensitivity of emotional entity; F(e i ) represents the frequency of occurrence of the entity in the training set; N is the total number of training samples; max(S) is the maximum sensitivity value in the current batch;

[0145] The design enables dual adaptability:

[0146] Sensitivity priority: for high-risk entities (S(e i )≥θ) gives up to 2-fold gradient amplification.

[0147] Frequency compensation: for low frequency entities (F(e i )<100) provides gradual compensation via a logarithmic decay function.

[0148] According to the difference in gradient sparsity of entities with different frequencies, a segmented attenuation coefficient is designed:

[0149]

[0150] Where: Threshold F thres =100, determined based on clinical research of the PHQ-9 scale; Minimum attenuation coefficient to ensure low-frequency entity foundation stability; Maximum attenuation coefficient, standard Adam recommended value.

[0151] The updating process uses the improved second-order moment estimation:

[0152]

[0153] in Represents the current corrected gradient value; v t Represents the second-order moment estimate of the current time step, that is, the weighted average of the squared gradient; v t-1 represents the second-order moment estimate of the previous time step; β 2,t (e i ) represents the segment attenuation coefficient.

[0154] Combined with the requirements of differential privacy, the final parameter update range is constrained:

[0155]

[0156] Where: Δθ t Represents the parameter update amount; ∈ local represents the local privacy budget, which is used to control the noise intensity; Δf represents the sensitivity, that is, the maximum difference of the function on adjacent data sets; α t represents the learning rate; Represents the first-order moment estimate after bias correction, which is used to correct the gradient direction; It represents the second-order moment estimate after bias correction, which is used to correct the gradient amplitude; δ is a very small constant to prevent the denominator from being zero.

[0157] Among them, the bias-corrected first-order moment estimate is:

[0158]

[0159] Bias-corrected second moment estimate:

[0160]

[0161] in: Indicates the first-order moment attenuation coefficient, the default is 0.9; β 2,k (e i ) represents the piecewise attenuation coefficient of the kth time step.

[0162] Local optimization also requires adversarial perturbation training to improve the robustness of the model and better resist small malicious changes in input data.

[0163] For the current model parameter θ, generate adversarial perturbation δ through gradient ascent:

[0164]

[0165] Where ∈ is the perturbation amplitude limit, x is the input data, and the adversarial sample is x adv =x+δ *

[0166] The adversarial weighted loss is:

[0167]

[0168] Where: L adv represents the adversarial loss, that is, the loss based on adversarial examples.

[0169] The final training goal is:

[0170] L total =(1-α)·L+α·L adv ,α∈[0,1] (19)

[0171]

[0172] Where: L total represents the total loss, which is the weighted sum of the standard loss and the adversarial loss; α represents the mixed weight of the adversarial loss; g t represents the gradient of the total loss with respect to the model parameters θ.

[0173] S4. Using the local client input information after the noise is injected, the sentiment knowledge classification model of the downloaded local client is trained.

[0174] S5. Upload the trained local client emotion knowledge classification model to the server and update the server emotion knowledge classification model.

[0175] During the server data aggregation phase, considering the typical Non-IID distribution used in this invention, the FedAdam algorithm framework is used to implement the server-side aggregation process to improve the overall model's performance on unbalanced data. Considering that highly sensitive words are often easily diluted in traditional cloud-based update frameworks due to their low frequency, this invention proposes an improved FedAdam aggregation framework.

[0176] Defining the global gradient

[0177]

[0178] in represents the parameter difference of the client's kth update, α k is the client weight, including the number of samples and sensitivity parameters, ω k is the low frequency compensation weight.

[0179] Define the client weight function as follows

[0180]

[0181] Where N is the total number of samples, n k represents the number of local samples of the client, λ s is the amplification factor, E k Represents the set of sentiment entities that appear in the client's k-th word update

[0182] The low-frequency compensation function is defined as follows

[0183]

[0184] The logarithmic function is used to amplify the influence of low-frequency terms and prevent overfitting. Similarly, N is the total number of samples, f(e i ) is e i Frequency of occurrence in the world.

[0185] Then ω k It can be set to the average value of the entities involved in the client, that is,

[0186]

[0187] Introducing S(e i ) γ To emphasize the degree of regulation of high-sensitivity + low-frequency words, where γ is the regulation coefficient, which is greater than 1 by default.

[0188] At the same time, refer to step 2 to give the following parameter update process

[0189] Update first-order momentum

[0190] m (t) =β1·m (t-1)+(1-β1)·g (t) (25)

[0191] Where β1 is the momentum decay factor

[0192] Update second-order momentum

[0193] v t =β2·v t-1 +(1-β2)·(g (t) ) 2 (26)

[0194] Where β2 is the second-order moment attenuation coefficient

[0195] The first-order momentum and second-order momentum deviation correction terms are as follows

[0196]

[0197] in Represents the first-order moment estimate after bias correction, which is used to correct the gradient direction; Represents the bias-corrected second-order moment estimate, which is used to correct the gradient amplitude

[0198] The final parameter update can be expressed as

[0199]

[0200] Here, ∈ is a smoothing factor to prevent division by zero.

[0201] Gradient projection technology is introduced to constrain the perturbed vector to a legal semantic space. Define the semantic space and generate a set of orthogonal basis vectors through the emotional model Deepseek to form a low-dimensional semantic space to ensure that all emotional entities can be represented in this space. Projecting into semantic space to minimize semantic distortion:

[0202]

[0203] 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, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.

Claims

1. A method for constructing a federated sentiment knowledge graph based on hierarchical noise injection driven by dynamic sensitivity, characterized in that: The specific method is as follows: Download the server's emotional knowledge classification model to the local client; Obtain the local client user's emotional entity sensitivity rating based on the local client input information; Inject noise into the local client input information based on the entity sensitivity level of the local client user situation; Using the local client input information after injecting noise, the sentiment knowledge classification model downloaded from the local client is trained; The trained local client emotion knowledge classification model is uploaded to the server to update the server emotion knowledge classification model.

2. The method for constructing a federated sentiment knowledge graph based on hierarchical noise injection driven by dynamic sensitivity according to claim 1, characterized in that: Get the local client user's emotional entity sensitivity rating. The specific method is as follows: Obtain the semantic relevance, social influence, and data distribution of local client input information; The sensitivity value is calculated by weighting semantic relevance, social influence, and data distribution as follows: S(e i )=α·NoYes(and i )+β·SocialW(e i )+γ·Sparsity(e i ) Among them, α+β+γ=1 is the adjustable coefficient; Obtain the local client user's emotional entity sensitivity rating based on the weighted results.

3. The method for constructing a federated sentiment knowledge graph based on hierarchical noise injection driven by dynamic sensitivity according to claim 2, characterized in that: Calculate semantic relevance. The specific method is as follows: The local client input information text is encoded through the universal large model to obtain a d-dimensional semantic vector; Calculate the language similarity between the local client input information and the high-risk vocabulary. The specific formula is: Among them, the input is a d-dimensional semantic vector, the output usually takes a similarity value ∈ [-1, 1], normalized to [0, 1], and the high-risk vocabulary is composed of a basic vocabulary built on standard clinical psychology terminology and low-recognition network terms expanded later.

4. The method for constructing a federated sentiment knowledge graph based on dynamic sensitivity-driven hierarchical noise injection according to claim 2, wherein: The data distribution is determined by the frequency of occurrence in the statistical knowledge graph. The specific calculation formula is as follows: When the frequency is less than 100, the value is increased to 2.

5. The method for constructing a federated sentiment knowledge graph based on dynamic sensitivity-driven hierarchical noise injection according to claim 2, wherein: Social impact is based on the PHQ-9 depression scale to estimate the weights of different degrees of emotional depression.

6. The method for constructing a federated sentiment knowledge graph based on dynamic sensitivity-driven hierarchical noise injection according to claim 2, wherein: For low-sensitivity entities in the aggregation results L , inject noise, the specific method is as follows: For low sensitivity entities S(e i )<θ, 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: When calculating dynamic noise data, the following conditions are met: Noise i ~N(0,σ 2 ) Where, f(e i ) refers to entity e i The sensitivity of , which indicates the maximum impact of the entity on the function output; ∈ G Refers to the privacy budget, which is used to control the intensity of adding noise. The smaller the value, the stronger the privacy protection. For low-sensitivity entities, the common value is usually ∈ G =1.0; The perturbed data is expressed as: Gradient projection technology is introduced to constrain the perturbed vectors to a valid semantic space. First, the semantic space is defined. A set of orthogonal basis vectors are generated through a universal large model to form a low-dimensional semantic space, ensuring that all emotional entities can be represented in this space. The noise-perturbed vector Project to semantic space to minimize semantic distortion: For low sensitivity entities e L , inject secondary noise into the server, the specific formula is as follows: Where K is the number of clients participating in federated learning; ∈ S =0.05,δ=10 -5 .

7. The method for constructing a federated sentiment knowledge graph based on dynamic sensitivity-driven hierarchical noise injection according to claim 2, wherein: Highly sensitive entities in the aggregation results i , the specific method of injecting noise is as follows: According to the sensitivity value, the emotional entities are divided into high-sensitivity entities and low-sensitivity entities; For highly sensitive entities i , based on the first-order 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: In the formula, S(e i ) is the sensitivity of emotional entity; F(e i ) represents the frequency of occurrence of the entity in the training set; N is the total number of training samples; max(S) is the maximum sensitivity value in the current batch; Provide up to 2 times gradient amplification for high-risk entities and provide progressive compensation for low-frequency entities through a logarithmic attenuation function; According to the difference in gradient sparsity of entities with different frequencies, a segmented attenuation coefficient is designed: Where, the threshold F thres =100, threshold F thres =100, The updating process uses the improved second-order moment estimation: in Represents the current corrected gradient value; v t Represents the second-order moment estimate of the current time step, that is, the weighted average of the squared gradient; v t-1 represents the second-order moment estimate of the previous time step; β 2,t (e i ) represents the segment attenuation coefficient; Combined with the requirements of differential privacy, the final parameter update range is constrained: Where Δθ t Represents the parameter update amount; ∈ local represents the local client privacy budget, which is used to control the noise intensity; Δf represents the sensitivity, that is, the maximum difference of the function on adjacent data sets; α t represents the learning rate; Represents the first-order moment estimate after bias correction, which is used to correct the gradient direction; Represents the second-order moment estimate after bias correction, which is used to correct the gradient amplitude; δ is a very small constant to prevent the denominator from being zero Among them, the bias-corrected first-order moment estimate is: Bias-corrected second moment estimate: in, Indicates the first-order moment attenuation coefficient, the default is 0.9; β 2,k (e i ) represents the piecewise attenuation coefficient of the kth time step; For the current model parameter θ, generate adversarial perturbation δ through gradient ascent: Where ∈ is the perturbation amplitude limit, x is the input data, and the adversarial sample is x adv =x+δ * ; The adversarial weighted loss is: Among them, L adv represents the adversarial loss, that is, the loss based on adversarial samples; The final training goal is: L total =(1-α)·L+α·L adv ,α∈[0,1] Among them, L total represents the total loss, which is the weighted sum of the standard loss and the adversarial loss; α represents the mixed weight of the adversarial loss; g t represents the gradient of the total loss with respect to the model parameters θ.

8. The method for constructing a federated sentiment knowledge graph based on dynamic sensitivity-driven hierarchical noise injection according to claim 1, wherein: Update the server's sentiment knowledge classification model. The specific method is as follows: Define the global gradient: in represents the parameter difference of the client's kth update, α k is the client weight, including the number of samples and sensitivity parameters, ω k is the low frequency compensation weight; Define the client weight function: Where N is the total number of samples, n k represents the number of local samples of the client, λ s is the amplification factor, E k Represents the set of sentiment entities that appear in the k-th word update on 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, f(e i ) is e i Frequency of occurrence in the global context; Then ω k It can be set to the average value of the entities involved in the client, that is, Introducing S(e i ) γ To emphasize the degree of regulation of high-sensitivity + low-frequency words, where γ is the regulation coefficient; Update first-order momentum m (t) =β1·m (t-1) +(1-β1)·g (t) Where β1 is the momentum decay factor Update second-order momentum v t =β2·v t-1 +(1-β2)·(g (t) ) 2 Among them, β2 is the second-order moment attenuation coefficient; The first-order momentum and second-order momentum deviation correction terms are as follows in Represents the first-order moment estimate after bias correction, which is used to correct the gradient direction; represents the bias-corrected second-order moment estimate, which is used to correct the gradient amplitude; The final parameter update is expressed as: Where ∈ is a smoothing factor to prevent division by zero The gradient projection technology is introduced to constrain the perturbed vector to a legal semantic space. Generate a set of orthogonal basis vectors through a universal large model to form a low-dimensional semantic space, ensuring that all emotional entities can be represented in this space; The vector Projecting into semantic space to minimize semantic distortion:

Citation Information

Patent Citations

  • Federal learning-based text sentiment classification method and terminal

    CN115221322A

  • Federal learning model training privacy protection method and system based on hybrid strategy

    CN116167084A

  • Secure federal learning method and system based on noise distribution

    CN117668882A

  • Local differential privacy protection and small gradient resampling method in federated learning

    CN118643524A

  • Online public opinion research, judgment, analysis, classification and grading early warning method and system

    CN119577144A