An email detection method and electronic device

By combining homomorphic encryption and zero-knowledge proofs with generative adversarial networks, this method solves the problems of data leakage and model performance degradation in federated learning systems, achieving feature privacy protection and high-accuracy email detection.

CN121037134BActive Publication Date: 2026-01-30LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511574996.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-31
Publication Date
2026-01-30
Estimated Expiration
2045-10-31

AI Technical Summary

Technical Problem

Existing federated learning systems face problems such as uneven data quality among participants leading to decreased model performance, static noise injection preventing dynamic adjustment of noise intensity, malicious users potentially interfering with global model updates by uploading tampered model parameters, and even leaking sensitive data from other participants. Furthermore, direct transmission of plaintext features or simple encryption can lead to data leakage.

Method used

Homomorphic encryption is used to encrypt and aggregate features, and zero-knowledge proof is used to verify the authenticity and integrity of the features. A detection model is built by generative adversarial networks, and multi-dimensional features are integrated for detection, ensuring feature privacy protection while retaining discriminative power.

Benefits of technology

It effectively avoids data leakage, improves the accuracy of detection results, reduces the risk of model performance degradation, enhances system security and robustness, and improves detection accuracy and adversarial sample defense capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121037134B_ABST
    Figure CN121037134B_ABST
Patent Text Reader

Abstract

This application discloses an email detection method and electronic device, applied on a server-side, relating to the field of machine learning technology. The method includes: acquiring target features of emails to be detected sent by each client after adding noise based on data sensitivity; performing homomorphic encryption on the target features and then performing an aggregation operation to obtain aggregated features; constructing a zero-knowledge proof based on the aggregated features and sending it to the client, and receiving the returned zero-knowledge proof verification result; if the verification passes, fusing the decrypted target features to obtain fused features; and using a target detection model based on a generative adversarial network to detect the fused features and obtain the detection result. Adding noise based on the data sensitivity of the data features avoids compromising feature usability, preserving feature discriminative power while protecting feature privacy. Furthermore, it allows for verification of aggregated features based on zero-knowledge proofs, preventing missed emails and improving the accuracy of the detection results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of machine learning technology, and in particular to an email detection method and electronic device. Background Technology

[0002] In the digital society, the security and privacy protection of sensitive data are receiving increasing attention. Data analysis in fields such as healthcare, finance, and education requires collaboration among multiple institutions. Traditional data analysis methods typically require centralizing data from all parties onto a unified server for processing. This centralized approach has significant shortcomings in protecting the privacy of sensitive data. Once data is leaked during transmission or storage, it can cause irreparable damage to user privacy.

[0003] To resolve the conflict between privacy protection and data sharing, federated learning achieves privacy protection by training models locally on each participating party and transmitting only model parameters or gradients instead of raw data. However, in practical applications, existing federated learning systems still face technical challenges such as uneven data quality among participants leading to model performance degradation, the inability to dynamically adjust noise intensity due to static noise injection, and the potential for malicious users to interfere with global model updates by uploading tampered model parameters, or even leak sensitive data from other participants. Summary of the Invention

[0004] This application provides an email detection method and electronic device to at least solve the problem of data leakage caused by directly transmitting plaintext features or using only simple encryption. It preserves the discriminative power of features while achieving feature privacy protection, and can also verify aggregated features based on zero-knowledge proofs to avoid missed email detection and improve the accuracy of detection results.

[0005] This application provides an email detection method applied to a server, including:

[0006] The target features of the emails to be detected sent by each client are homomorphically encrypted, and the encrypted features are aggregated to obtain aggregated features; the target features are the features obtained by adding noise to the data features based on the data sensitivity corresponding to the data features of the emails to be detected.

[0007] The corresponding zero-knowledge proof is constructed based on the aggregated features, the zero-knowledge proof is sent to the client, and the verification result returned by the client is received; the verification result is the result obtained by the client after verifying the aggregated features based on the zero-knowledge proof.

[0008] If the verification result indicates that the aggregated feature has passed the verification, then the aggregated feature is decrypted to obtain the target feature, and the target feature is fused to obtain the fused feature;

[0009] Based on the preset detection rules in the preset knowledge base, the target detection model is used to detect fusion features to obtain the detection results of the email to be detected; the target detection model is a model built based on generative adversarial network.

[0010] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described email detection methods.

[0011] This application first obtains the data sensitivity corresponding to the data features of the email to be detected from the client, adds noise to the data features to obtain the target features, performs homomorphic encryption on the target features, and performs an aggregation operation on the encrypted features to obtain aggregate features. Then, it constructs a corresponding zero-knowledge proof based on the aggregate features and sends it to the client, receives the verification result of the aggregate features returned by the client. If the verification result indicates that the aggregate features have been verified, it fuses the target features obtained by decrypting the aggregate features to obtain the fused features. Based on the preset detection rules in the preset knowledge base, it uses a target detection model built on generative adversarial networks to detect the fused features to obtain the detection result of the email to be detected.

[0012] Through the above technical solution, the client in this application can add noise to the original data features according to sensitivity levels, and generate ciphertext features through homomorphic encryption. The server then aggregates the ciphertext features to obtain aggregated features, and can construct zero-knowledge proofs based on the aggregated features so that the client can verify the authenticity and integrity of the aggregation results, ensuring that the aggregated features have not been tampered with. After successful verification, the aggregated features are decrypted, and multi-dimensional features are fused to generate fused features. Then, a detection model based on generative adversarial networks is used for detection. In this way, data leakage caused by directly transmitting plaintext features or using only simple encryption can be avoided. Furthermore, by adding noise according to the data sensitivity of the data features before feature encryption and aggregation, the usability of the features is not compromised. While protecting feature privacy, the discriminative power of the features is preserved. At the same time, the aggregated features can be verified based on zero-knowledge proofs to avoid missed email detections and improve the accuracy of the detection results. Attached Figure Description

[0013] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 A flowchart of an email detection method provided in this application embodiment;

[0015] Figure 2An adaptive privacy budget allocation flowchart is provided for embodiments of this application;

[0016] Figure 3 A schematic diagram of feature fusion provided in an embodiment of this application;

[0017] Figure 4 A schematic diagram of a federated adversarial learning framework provided in an embodiment of this application;

[0018] Figure 5 A diagram illustrating a sensitive data security analysis system architecture based on federated learning, provided for embodiments of this application;

[0019] Figure 6 A flowchart of a sensitive data security analysis method based on federated learning is provided for embodiments of this application;

[0020] Figure 7 This is a schematic diagram of an email detection device provided in an embodiment of this application. Detailed Implementation

[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0022] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0023] Currently, when multiple institutions collaborate on data analysis, traditional data analysis methods typically require centralizing all data on a unified server for processing. This can lead to data leaks during transmission or storage, potentially causing irreparable damage to user privacy. Furthermore, uneven data quality among participants can result in degraded model performance and malicious users interfering with global model updates by uploading tampered model parameters. This application addresses this issue by adding noise to data features based on their sensitivity before feature encryption and aggregation. This avoids data leaks caused by directly transmitting plaintext features or using only simple encryption, preserving feature discriminative power while protecting feature privacy. Simultaneously, it allows for verification of aggregated features using zero-knowledge proofs, improving the accuracy of detection results.

[0024] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0025] Next, this embodiment will describe the execution flow of the email detection method in detail, such as... Figure 1 As shown, an embodiment of this application provides an email detection method, including:

[0026] Step S11: Homomorphically encrypt the target features of the emails to be detected sent by each client, and perform an aggregation operation on the encrypted features to obtain aggregated features; the target features are the features obtained by adding noise to the data features based on the data sensitivity corresponding to the data features of the emails to be detected.

[0027] In this embodiment, firstly, the data sensitivity of each client based on the data features of the email to be detected can be obtained. The target features are obtained by adding noise to the data features. Then, the target features of the received email to be detected are homomorphically encrypted, and an aggregation operation is performed on the encrypted features to obtain aggregated features. Specifically, as follows... Figure 2 As shown, the client module first extracts feature vectors from sensitive data, and then evaluates the privacy sensitivity of each feature. For example, sensitivity evaluation is based on information entropy and mutual information theory. The feature sensitivity calculation adopts a weighted combination method, which weights the feature information entropy reflecting the uncertainty of the feature and the mutual information of the feature and label reflecting the classification value of the feature. It can be understood that the trade-off parameter when performing the weighted average is usually set between 0.3 and 0.7, with an optimal value of 0.6. This balances the privacy sensitivity and classification value of the feature, which helps to achieve differentiated privacy protection.

[0028] Subsequently, a differentiated privacy budget is dynamically allocated based on feature sensitivity. The privacy budget allocation employs a proportional allocation mechanism, distributing the base privacy budget according to a weighted combination of feature importance and sensitivity. Specifically, during calculation, the feature importance weight and sensitivity are multiplied by a balancing parameter (ranging from 0.2 to 0.6), and the budget is then allocated according to the proportion of this combined value among all features. This allocation method considers both feature importance and sensitivity, allocating more budget to important and less sensitive features to preserve their detection value, and less budget to unimportant and highly sensitive features to enhance privacy protection. Then, calibration noise is added to generate protective features based on the allocated privacy budget. The noise calibration uses a Laplace mechanism, determining the noise distribution parameters based on the global feature sensitivity and the allocated privacy budget, and then sampling from this distribution and adding it to the original features. In this way, by adding an appropriate amount of Laplace noise, the inference risk of specific user data can be effectively controlled even if an attacker possesses all data except for the target user.

[0029] Furthermore, this embodiment employs the Paillier homomorphic encryption algorithm to encrypt the target features for secure transmission of protection features. It is understood that Paillier encryption possesses additive homomorphic properties, meaning that multiplying the ciphertext is equivalent to adding the plaintext, allowing feature aggregation within the ciphertext domain without decryption. For example, using a 2048-bit key length ensures both security and computational efficiency. In this way, the coordination layer module can receive encrypted protection features from multiple clients and perform secure aggregation within the ciphertext domain. Due to the additive homomorphic nature of Paillier encryption, the coordination layer can directly multiply the encrypted features without decrypting the original features. Aggregation is achieved by multiplying all the encrypted protection features uploaded by clients, ensuring that the aggregation operation is completed without revealing the original features.

[0030] Step S12: Construct the corresponding zero-knowledge proof based on the aggregated features, send the zero-knowledge proof to the client, and receive the verification result returned by the client; the verification result is the result obtained by the client after verifying the aggregated features based on the zero-knowledge proof.

[0031] In this embodiment, a corresponding zero-knowledge proof can be constructed based on aggregated features and sent to the client. The client then returns a verification result obtained after verifying the aggregated features based on the zero-knowledge proof. In other words, in this embodiment, to verify the correctness of the computation process, a zero-knowledge proof can be generated based on the aggregated features for verification. It is understood that zero-knowledge proofs allow the verifier to be certain of the computation's correctness without obtaining any information about the input; this is achieved by the prover providing proof materials to the verifier. In this embodiment, a zero-knowledge proof scheme of moderate complexity can be used to balance security and computational overhead.

[0032] Specifically, in this embodiment, the verification process is a single interaction, allowing the verifier to confirm that the computation follows the protocol without needing to know the specific input. This enhances the system's credibility, especially in scenarios where multiple parties do not fully trust each other, further ensuring the security of feature aggregation. Furthermore, this embodiment performs aggregation operations on the encrypted features. After obtaining the aggregated features, it can also determine the aggregated features, target features, the zero-knowledge proof corresponding to the aggregated features, and the client list corresponding to the target features during the aggregation operation. An operation identifier corresponding to the aggregation operation is then created, and the corresponding data aggregation information is constructed based on the operation identifier, client list, aggregated features, target features, and zero-knowledge proof. In other words, this embodiment can also maintain the aggregation session state, participant information, and computation results. Each aggregation operation creates a unique session ID, recording the participant list, encrypted features, proof materials, and aggregation state. This allows for the orderly management of multiple aggregation operations, ensuring data consistency and integrity.

[0033] Step S13: If the verification result represents the aggregated feature verification as passed, then decrypt the aggregated feature to obtain the target feature, and fuse the target feature to obtain the fused feature.

[0034] In this embodiment, the decryption key corresponding to the target feature is first determined, a first number of clients is determined, and key fragments corresponding to the first number are generated based on the decryption key. Then, each key fragment is distributed to its respective client. When the obtained verification result indicates that the aggregated feature verification is successful, the key fragments sent by the client are received, and a second number of received key fragments is determined. Then, it is determined whether the second number is greater than a preset threshold. If the second number is greater than the preset threshold, the decryption key is restored based on the received key fragments, and the aggregated feature is decrypted using the decryption key to obtain the target feature. The preset threshold is half of the first number.

[0035] In other words, this embodiment employs a (t, n) threshold secret sharing mechanism during data encryption and decryption. For example, using the Shamir threshold scheme, n secret fragments are generated using a t-1 degree polynomial, with each participant receiving one fragment. It can be understood that, based on the above threshold scheme, the key can be stored in the constant term of the polynomial, requiring at least t fragments to recover the secret. Typically, the threshold value is set to more than half the number of participants, meaning that cooperation from at least more than half of the participants is required to recover the secret. This effectively prevents single-point leakage, enhancing the system's security and robustness. Furthermore, combining the aforementioned adaptive privacy budget allocation and multi-party aggregation feature technologies, this embodiment can effectively reduce the risk of data leakage. In specific application scenarios of phishing email detection, the leakage risk can be reduced by more than 85%, while maintaining high detection performance. Under the same level of privacy protection, the detection accuracy is improved by 10-15%.

[0036] Furthermore, in this embodiment, before feature fusion, the feature dimensions of the target features can be determined, and the correlation between the target features corresponding to each feature dimension can be determined. Based on the correlation, a corresponding feature map is constructed. Then, based on the feature map, the mutual information matrix between each feature dimension is determined, and a dimension correlation map is constructed based on the mutual information matrix and a preset mutual information value threshold, so as to fuse the target features based on the feature map and the dimension correlation map. That is to say, in the feature representation stage, this embodiment first constructs a feature topology space, mapping the aggregated features to a high-dimensional representation space. For example, for the four dimensions of text, behavior, time, and network features, a feature map Gi(Vi, Ei) is constructed for each dimension, where Vi is the feature node and Ei is the feature correlation edge. And the neighborhood relationship of each node is determined through local connectivity analysis, establishing an initial topology structure, so that the system can understand the intrinsic relationship between features. It should be noted that in the above process, this embodiment introduces a homology group calculation method to analyze the topological structure of the feature space and identify nonlinear relationships between features. This helps to capture more specific correlation features between features that are difficult to capture using traditional methods. For example, when analyzing email sending behavior, this embodiment can discover high-order correlation patterns between sending time, number of recipients, and email size. Subsequently, the system can construct an inter-dimensional relationship graph, calculate the mutual information matrix M between features of different dimensions, and construct a dimensional correlation graph D(Vd, Ed) based on a threshold τ (initial value set to 0.35). Correspondingly, this embodiment uses a persistent homology learning algorithm to extract multi-scale structural relationships in the above process. This allows the system to identify feature correlation patterns at different resolutions. For example, the system may find that certain text features are highly correlated with network features under specific conditions. This correlation may indicate potential phishing attack patterns. The system also monitors changes in the Betti number of the feature topology. When a significant change in the topology is detected, structural reconstruction is triggered to ensure that the feature representation always reflects the latest data distribution.

[0037] Subsequently, when fusing target features to obtain fused features, the feature nodes in the feature maps corresponding to each feature dimension can be determined, and the corresponding attention weights can be determined based on each feature node and its corresponding first-order neighborhood. The feature maps are then updated based on the attention weights to obtain the first target feature map. Then, the credibility of each client is determined, and the second target feature map is generated based on the credibility of each client and the first target feature map. Then, based on each feature node in the second target feature map and the corresponding target neighborhood that meets the preset neighborhood order condition, the corresponding feature association information is determined, and the second target feature map is updated based on the feature association information to obtain the third target feature map. Finally, graph diffusion convolution is performed on the third target feature map and the dimension association map to generate a global feature association map, and the fused features are obtained based on the global feature association map.

[0038] Furthermore, after generating a global feature association map by graph diffusion convolution on the third target feature map and the dimension association map, a persistent map can be constructed based on the topology and lifecycle of the global feature association map. Key features in the global feature association map are then selected based on the persistent map, and the Forman-Ricci curvature of the key features is determined. The global feature association map is then adjusted according to the preset curvature threshold and the Forman-Ricci curvature of each key feature to obtain several versions of the target feature association map.

[0039] like Figure 3 As shown, in the feature fusion stage, this embodiment designs a three-layer graph convolutional network architecture to process feature structures at different scales. The micro-layer uses local graph convolution, limiting the receptive field to a 1-hop neighborhood, primarily capturing local feature similarity, which helps focus on the nearest neighbor relationships of features and identify directly related feature combinations. The meso-layer uses ChebNet graph convolution, approximating the receptive field to a 2-5hop range through Chebyshev multinomials, capturing medium-scale structural relationships, which helps understand broader feature interaction patterns, such as the comprehensive relationship between email subject, sending time, and link type. The macro-layer uses diffuse graph convolution to simulate a global information propagation mechanism, constructing a representation covering the entire feature space. In this way, the above three-layer structure forms a feature understanding system from local to global, ensuring that the system can comprehensively grasp the multi-scale information of features.

[0040] Specifically, to preserve structural information during the fusion process, this embodiment employs homotopy-preserving graph pooling. Specifically, key feature nodes are selected based on the persistence diagram, and the Forman-Ricci curvature of each node is calculated. Nodes with high curvature are preferentially retained as the structural skeleton, ensuring that the most characteristic structures are preserved. Furthermore, a Mapper algorithm is used to achieve multi-resolution representation of the feature graph, maintaining topological equivalence at different levels of abstraction. In this way, the feature graph can retain key structural information while reducing dimensionality, solving the information loss problem in traditional methods. In the knowledge extraction stage, the system constructs a knowledge graph Gk(Vk, Ek) based on the fusion features. Vk nodes represent key knowledge concepts, and Ek edges represent knowledge associations. Further, to capture more complex knowledge structures, this embodiment introduces a higher-order topological structure, constructing a knowledge complex containing simplexes. This topological structure helps improve the expressive power of the graph structure, enabling the description of the overall relationships between multiple concepts. Through persistent homology analysis, this embodiment can identify key topological features in the knowledge graph, such as connected components, loops, and cavities, and assign weights to knowledge nodes based on the importance of these topological features. For example, in phishing email detection, the system may find that three features—fake domain name, urgent tone, and abnormal link—form a stable topological ring structure, which may correspond to a specific type of phishing attack pattern.

[0041] Based on the above structure, this embodiment also designs a topology-aware data augmentation strategy to generate positive sample pairs that preserve structural characteristics. Specifically, this data augmentation strategy can be implemented through structural perturbation based on Ricci flow, feature perturbation based on spectral graph theory, and context sampling based on random walks. This allows the system to generate diverse but structurally consistent samples, enhancing the effectiveness of contrastive learning. Simultaneously, this embodiment introduces a structure-sensitive contrastive loss function, considering both node feature similarity and structural role similarity. The contrastive loss function is designed as a negative logarithmic form, using cosine similarity to measure the difference between positive and negative sample pairs, and introducing a temperature parameter to adjust the contrast intensity. In this way, the system can perform contrastive learning at multiple topological abstraction levels, capturing hierarchical knowledge representations and ensuring an understanding of feature relationships at different granularities.

[0042] Furthermore, based on the above technical solutions, this embodiment can also support the continuous updating and distribution of knowledge through knowledge distillation and evolution mechanisms. Specifically, it can assess the importance of knowledge based on topological persistence and identify key knowledge points in the structure; detect knowledge update needs by monitoring changes in topological invariants; and simplify the knowledge graph based on Ricci flow, removing redundant nodes and connections. This achieves multi-granularity knowledge distillation, transferring knowledge at different levels of abstraction, ensuring that the system can continuously absorb new knowledge, adapt to changing threat environments, and maintain the simplicity and effectiveness of knowledge representation.

[0043] In this way, after receiving the aggregated features from the coordination layer, a high-quality fused feature representation can be generated through a three-level fusion architecture and knowledge extraction mechanism. Furthermore, through the aforementioned hierarchical feature fusion and knowledge extraction methods, a deep understanding of the feature structure can be achieved, key knowledge can be extracted, and phishing email detection performance can be significantly improved, increasing the phishing email detection accuracy by approximately 22%, especially significantly enhancing the detection capability for phishing emails with complex structures. At the same time, the robustness of the system's model is also improved, with adversarial example defense capability enhanced by 35%, particularly with a significantly enhanced resistance to topological perturbations. In addition, feature representation efficiency is also significantly improved, reducing feature dimensions by 65% ​​while maintaining performance, and greatly reducing computational and storage overhead.

[0044] Step S14: Based on the preset detection rules in the preset knowledge base, use the target detection model to detect fusion features to obtain the detection result of the email to be detected; the target detection model is a model built based on generative adversarial network.

[0045] In this embodiment, after feature fusion is achieved, the fused features can be detected using a target detection model built on a generative adversarial network (GAN) based on preset detection rules in a preset knowledge base, thus obtaining the detection result of the email to be detected. It should be noted that during the training and optimization of the target detection model, a corresponding dataset can be constructed based on preset training data and the fused features of the preset training data. The generator and detector in the initial detection model are then alternately optimized using this dataset to obtain the target detection model. The generator has one optimization round, and the detector has a preset number of optimization rounds, where the preset number of rounds is greater than one. Specifically, when alternately optimizing the generator and detector in the initial detection model using the dataset, the feature importance of the fused features in the preset training data in the dataset is first determined. The fused features of the preset training data are then ranked according to their feature importance to obtain the ranking result. The loss function corresponding to the detector in the initial detection model and the gradient of the loss function with respect to the fused features are then determined. A preset perturbation is then added to the fused features based on the ranking result and the gradient to obtain updated features. The generator then generates adversarial examples based on the updated features. Finally, the initial detection model is optimized based on the adversarial examples to obtain the target detection model.

[0046] like Figure 4 As shown, in this embodiment, the adversarial learning module constructs a phishing email generator and detector based on fused feature representations. Both the generator and detector employ deep neural network structures. The generator contains three fully connected layers with hidden layer dimensions of 256 and 128, respectively; the detector also contains three fully connected layers with hidden layer dimensions of 128 and 64, respectively. The generator and detector improve each other's capabilities through adversarial training. The training objective adopts a minimax game format, where the generator attempts to generate samples that can deceive the detector, while the detector attempts to accurately distinguish between real and generated samples. Furthermore, this embodiment employs an alternating optimization strategy for adversarial training, with each round of training including k steps of detector optimization and one step of generator optimization. In this way, the system can continuously improve its detection capabilities and adapt to new attack patterns.

[0047] Furthermore, the system can generate targeted adversarial examples based on feature importance to test its robustness under key feature perturbations. The adversarial perturbation employs the gradient sign method, adding a finite-sized perturbation to the gradient direction of the input according to the loss function. The perturbation size is typically between 0.1 and 0.3. The system dynamically adjusts the perturbation size based on feature importance, applying larger perturbations to important features to evaluate the system's robustness. Subsequently, based on the adversarial training results, the defense strategy is dynamically adjusted. Specifically, the defense parameters are updated using gradient descent, guided by a robust loss function that fuses the original loss and the adversarial loss with a weight ratio of 7:3. In this way, by continuously optimizing the defense parameters, the system enhances its ability to resist adversarial attacks. Further, this embodiment can comprehensively evaluate the defense capability through multiple metrics, including adversarial example detection accuracy, minimum perturbation threshold, and model stability. The evaluation results are used to guide the optimization of the defense strategy and the improvement of the generator, forming a virtuous cycle. Experiments show that compared with traditional unidirectional training, the federated adversarial learning framework in this embodiment can improve the system's adaptability to novel phishing attacks, increasing detection capability by more than 50%.

[0048] Furthermore, this embodiment can also generate corresponding detection mode knowledge based on the target feature association graph, obtain detection rule knowledge corresponding to the target detection model, determine the model parameters of the target detection model, and generate corresponding detection model knowledge based on the model parameters. Then, email detection knowledge is constructed based on the detection mode knowledge, detection rule knowledge, and detection model knowledge, and saved to a preset knowledge base. Subsequently, corresponding soft tags are constructed based on the email detection knowledge, and the soft tags are distributed to each client. That is to say, as... Figure 5The knowledge base module shown can maintain multi-granularity knowledge representations, including pattern knowledge, rule knowledge, and model knowledge. Its hierarchical storage design helps improve the efficiency of knowledge organization, retrieval, and updating. Pattern knowledge includes typical characteristic patterns of phishing attacks; rule knowledge includes detection rules and threshold conditions; and model knowledge includes key parameters of the detection model. The system then distributes knowledge to clients through knowledge distillation. This knowledge distillation uses a soft-label delivery method, measuring the difference between the student and teacher model outputs using Kullback-Leibler divergence, and introducing a temperature parameter to adjust the smoothness of the soft labels. This temperature parameter is typically set to 4.0. In this way, the generalization ability of the teacher model can be delivered through soft labels, allowing client models to benefit from global knowledge without directly sharing model parameters.

[0049] Furthermore, in this embodiment, after detecting fused features using the target detection model, updated pattern knowledge can be generated based on the detection results of the email to be detected, and updated rule knowledge and updated model knowledge can be generated during the target detection model optimization process. Then, updated detection knowledge is generated based on the updated pattern knowledge, updated rule knowledge, and updated model knowledge, and the similarity between the updated detection knowledge and the email detection knowledge is determined. It is judged whether the similarity is not less than a preset similarity threshold. If the similarity is not less than the preset similarity threshold, the email detection knowledge in the preset knowledge base is updated based on the updated detection knowledge.

[0050] In other words, this embodiment can update the knowledge base based on environmental changes and newly acquired knowledge. Specifically, knowledge updates can be achieved by combining the current knowledge state, newly acquired knowledge, and environmental change information. In this way, the system can continuously update the knowledge base based on new detection results and adversarial training outcomes, adapting to changes in the threat environment. Furthermore, to ensure the consistency of the knowledge base, this embodiment can detect knowledge conflicts and use a similarity threshold to determine retention strategies. The consistency check is achieved by calculating the similarity between new knowledge and existing knowledge and comparing it with a preset threshold, typically set to 0.75. Thus, when new knowledge conflicts with existing knowledge, an update decision can be made based on similarity, timeliness, and reliability scores, ensuring the consistency and effectiveness of the knowledge base.

[0051] It should be noted that this embodiment can also manage knowledge access permissions based on component roles, employing a role-based access control (RBAC) model to assign different levels of permissions to different components. This helps ensure that sensitive knowledge is only visible to authorized components, preventing knowledge leakage and misuse. Based on the above technical solution, and through the aforementioned adaptive federated adversarial learning and knowledge base evolution method, this embodiment achieves high adaptability to new phishing attacks, reducing the adaptation time to new attacks by 75%, increasing the zero-day attack detection rate by 35%, and significantly enhancing the system's continuous evolution capability, enabling it to continuously adapt to changing threat environments.

[0052] Through the above technical solution, in this embodiment, the client can add noise to the original data features according to sensitivity levels, and generate ciphertext features through homomorphic encryption. The server then aggregates the ciphertext features to obtain aggregated features, and can construct zero-knowledge proofs based on the aggregated features so that the client can verify the authenticity and integrity of the aggregation result, ensuring that the aggregated features have not been tampered with. After successful verification, the aggregated features are decrypted, and multi-dimensional features are fused to generate fused features. Then, a detection model based on generative adversarial networks is used for detection. In this way, data leakage caused by directly transmitting plaintext features or using only simple encryption can be avoided. Furthermore, by adding noise according to the data sensitivity of the data features before feature encryption and aggregation, the usability of the features is not compromised. While protecting feature privacy, the discriminative power of the features is preserved. At the same time, the aggregated features can be verified based on zero-knowledge proofs to avoid missed emails and improve the accuracy of the detection results.

[0053] Based on the above technical solutions, such as Figure 5 As shown, this embodiment constructs a sensitive data security analysis system based on federated learning, including a client module, a coordination layer module, a fusion layer module, an adversarial learning module, and a knowledge base module. These modules are connected through secure communication and internal collaboration mechanisms, forming a closed-loop optimization system from local privacy protection to global collaborative modeling and continuous evolution.

[0054] The client module is deployed within participating organizations, such as financial institutions and corporate email servers, and is responsible for the initial processing and privacy protection of sensitive data. First, feature vectors are extracted from the raw data across four dimensions: text, behavior, time, and network. For example, in phishing email detection, text features include email subject word frequency and semantic representation of content; behavioral features include sender's historical sending patterns and recipient interaction frequency; time features include sending time patterns and holiday behavior characteristics; and network features cover IP address location (Internet Protocol Address) and email path topology. Then, the privacy sensitivity of each feature is evaluated, a differentiated privacy budget is dynamically allocated, and calibration noise is added to generate protective features. Finally, these protective features are securely transmitted to the coordination layer using homomorphic encryption.

[0055] The coordination layer module and the client module are securely connected. The coordination layer can receive encrypted features from multiple clients and perform feature aggregation in the ciphertext space using homomorphic encryption. The computation can be completed without decryption, effectively preventing the leakage of original data. Simultaneously, an (t, n) threshold secret-sharing mechanism is implemented to ensure that the aggregation result can only be recovered when at least t participants collaborate, preventing single-point-of-contact leakage. Furthermore, zero-knowledge proofs can be generated to verify the correctness of the computation, enabling all parties to be confident that the aggregation process conforms to the protocol without revealing any input details, providing verifiability assurance for system operation.

[0056] The fusion layer module is the core processing unit of the system. It receives aggregated features from the coordination layer and performs multi-level feature fusion. Specifically, it adopts a three-level fusion architecture of micro, meso, and macro to comprehensively mine complementary information between features: at the micro level, feature-level fusion is achieved through an attention mechanism to capture the intrinsic relationships between features of different dimensions; at the meso level, organizational-level feature weighting is performed based on organizational data quality and credibility to balance the contributions of each participant; at the macro level, graph convolutional networks are used to integrate inter-organizational relationships and construct a global feature representation. In this way, key knowledge can be further refined through a contrastive learning mechanism to enhance the discriminative ability of the feature representation and ultimately generate a high-quality fused feature representation.

[0057] The adversarial learning module is tightly integrated with the fusion layer, constructing a phishing email generator and detector based on the fused feature representation. The generator produces simulated phishing email samples, while the detector attempts to distinguish between real and generated samples. Through adversarial game theory, the detection capability is continuously improved, and the system's adaptability to new attacks is enhanced. Furthermore, targeted adversarial samples can be generated based on feature importance to test the system's robustness under key feature perturbations. Defense strategies are dynamically optimized based on the adversarial training results, forming a comprehensive security protection mechanism.

[0058] The knowledge base module is connected to the fusion layer and adversarial learning module, storing multi-granularity knowledge representations, including pattern knowledge, rule knowledge, and model knowledge. The consistency and validity of the knowledge base can be maintained through knowledge verification and conflict resolution mechanisms, supporting continuous system evolution. Knowledge is distributed to clients through federated knowledge distillation technology, achieving a balance between global knowledge and local privacy. In this way, the system can learn from historical experience, continuously adapt to changing threat environments, and form a dynamically evolving intelligent defense system.

[0059] Based on the above system, such as Figure 6 As shown, the client first extracts features from sensitive data and performs privacy-preserving processing; second, the coordination layer securely aggregates these features; then, the fusion layer generates a unified representation through multi-level fusion; next, the adversarial learning module performs adversarial training to enhance defense capabilities; finally, the knowledge base is continuously updated and knowledge is distributed to the client, promoting continuous optimization of the entire system. This helps to continuously improve security analysis capabilities while protecting data privacy, and through a hierarchical privacy-enhancing feature fusion framework, it achieves an adaptive privacy budget allocation mechanism, a secure multi-party homomorphic aggregation protocol, hierarchical feature fusion and knowledge extraction, an adaptive federated adversarial learning framework, a distributed secure knowledge base, and a continuous evolution mechanism, further achieving a balance between privacy protection and security analysis.

[0060] In one specific embodiment, the system described above can be deployed in the email system of a financial institution with five branches. Each branch deploys a client module, while the coordination and fusion layers are deployed in the headquarters data center. The test dataset contains 100,000 tagged emails, including 5,000 confirmed phishing emails. Specifically, before deploying the system, the organization used a traditional centralized detection solution with an accuracy rate of 85% and a false positive rate of 10%, processing approximately 5,000 emails daily. After deploying the system, the accuracy rate increased to 95%, the false positive rate decreased to 3%, and the processing capacity remained unchanged. In particular, the detection capability for new types of phishing emails was significantly improved, enabling timely identification of previously unseen attack patterns. Regarding privacy protection, it ensures that sensitive data from different branches is not directly shared. Furthermore, through federated learning, the detection model was collaboratively optimized, reducing the risk of data leakage by more than 85% compared to traditional solutions, while also meeting relevant data protection regulations. In terms of system efficiency, training time was reduced by 40% compared to traditional federated learning solutions, communication overhead was reduced by 60%, and resource utilization increased by 25%. Through a knowledge distillation mechanism, the system can quickly adapt to new types of attacks, shortening the adaptation time by 75%.

[0061] In this way, through hierarchical feature fusion and knowledge extraction, the system can deeply understand the feature structure, extract key knowledge, and significantly improve the performance of phishing email detection. Compared with traditional methods, the feature expression efficiency is significantly improved, the feature dimension is reduced by 65% ​​while maintaining performance, and computational and storage overhead is greatly reduced. At the same time, the adversarial learning framework and knowledge base evolution mechanism enable the system to continuously evolve and adapt to new attack patterns. Tests show that the system's adversarial sample defense capability is improved by 35%, and its resistance to topological perturbations is significantly enhanced.

[0062] Therefore, the email detection system in this embodiment can achieve efficient and accurate phishing email detection while protecting the privacy of sensitive data. It is also understood that the above technical solution is not limited to phishing email detection in the financial industry, but is also applicable to other fields such as healthcare and education that require detection based on data characteristics. Through a hierarchical privacy-enhancing feature fusion framework, it can achieve efficient and accurate email detection while protecting the privacy of sensitive data, helping to solve the problem of balancing privacy protection and security analysis in the field of network security.

[0063] like Figure 7 As shown, embodiments of this application also provide an email detection device, applied to a server, comprising:

[0064] The feature aggregation module 11 is used to homomorphically encrypt the target features of the emails to be detected sent by each client, and perform an aggregation operation on the encrypted features to obtain aggregated features; the target features are the features obtained by the client adding noise to the data features based on the data sensitivity corresponding to the data features of the emails to be detected.

[0065] The feature verification module 12 is used to construct corresponding zero-knowledge proofs based on aggregated features, send the zero-knowledge proofs to the client, and receive the verification results returned by the client; the verification results are the results obtained by the client after verifying the aggregated features based on the zero-knowledge proofs.

[0066] The feature fusion module 13 is used to decrypt the aggregated features to obtain the target features if the verification result characterizes the aggregated features to pass the verification, and then fuse the target features to obtain the fused features.

[0067] The feature detection module 14 is used to detect fused features based on preset detection rules in a preset knowledge base and a target detection model to obtain the detection result of the email to be detected; the target detection model is a model built based on a generative adversarial network.

[0068] For a description of the features in the embodiments of the email detection device described above, please refer to the relevant descriptions in the embodiments of the email detection method, which will not be repeated here.

[0069] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0070] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above-described email detection method embodiments.

[0071] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described email detection method embodiments when running.

[0072] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0073] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described email detection method embodiments.

[0074] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described email detection method embodiments.

[0075] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0076] The above provides a detailed description of the email detection method and electronic device provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to help understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A mail detection method characterized by comprising: Applied to a server, comprising: Homomorphically encrypt target features of a to-be-detected email sent by each client, and perform aggregation operation on the encrypted features to obtain aggregated features; the target feature is a feature obtained by adding noise to a data feature based on the data sensitivity of the to-be-detected email by the client; Based on the aggregated features, construct a corresponding zero-knowledge proof, send the zero-knowledge proof to each client, and receive the verification result returned by each client; the verification result is obtained by the client based on the zero-knowledge proof to verify the aggregated features; If the verification result indicates that the aggregated features pass the verification, decrypt the aggregated features to obtain the target features, and fuse the target features to obtain fused features; Based on the preset detection rules in the preset knowledge base, the target detection model is used to detect the fused features to obtain the detection result of the to-be-detected email; the target detection model is a model constructed based on a generative adversarial network; Wherein, if the verification result indicates that the aggregated features pass the verification, then decrypt the aggregated features to obtain the target features, comprising: Determine the decryption key corresponding to the target feature, determine the first number of the client, and generate the key fragment corresponding to the first number according to the decryption key; Distribute each key fragment to the corresponding client respectively; When the obtained verification result indicates that the aggregated features pass the verification, receive the key fragment sent by the client, and determine the second number of the received key fragment; Determine whether the second number is greater than a preset number threshold; the preset number threshold is half of the first number; If the second number is greater than the preset number threshold, restore the decryption key based on the received key fragment, and decrypt the aggregated features to obtain the target features using the decryption key.

2. The mail detecting method according to claim 1, characterized by, Before the fused features are fused, the target features are fused to obtain the fused features, further comprising: Determine the feature dimension of the target feature, and determine the association relationship between the target features corresponding to each feature dimension based on the association relationship, and construct a corresponding feature graph based on the association relationship; Determine the mutual information matrix between each feature dimension based on the feature graph, and construct a dimension association graph based on the mutual information matrix and a preset mutual information value threshold, so as to fuse the target features based on the feature graph and the dimension association graph.

3. The mail detecting method according to claim 2, characterized by, The fused features include: Determine the feature node in the feature graph corresponding to each feature dimension, and determine the corresponding attention weight based on each feature node and the corresponding first-order neighborhood, so as to update the feature graph to obtain a first target feature graph based on the attention weight; Determine the credibility corresponding to each client, and generate a second target feature graph based on the credibility of each client and the first target feature graph; determine corresponding feature association information based on each feature node in the second target feature map and a corresponding target neighborhood, and update the second target feature map based on the feature association information to obtain a third target feature map; the target neighborhood is a neighborhood that meets a preset neighborhood order condition; perform graph diffusion convolution on the third target feature map and the dimension association graph to generate a global feature association graph, and obtain the fusion feature based on the global feature association graph.

4. The mail detecting method according to claim 3, characterized by, After the graph diffusion convolution is performed on the third target feature map and the dimension association graph to generate the global feature association graph, the method further includes: constructing a persistent graph corresponding to the global feature association graph; the persistent graph is a graph constructed based on a topological structure in the global feature association graph and a corresponding life cycle; filtering key features in the global feature association graph based on the persistent graph, and determining Forman-Ricci curvatures of the key features; adjusting the global feature association graph according to a preset curvature threshold and the Forman-Ricci curvatures of the key features to obtain a plurality of versions of target feature association graphs.

5. The mail detecting method according to claim 1, characterized by, After the aggregation operation is performed on the encrypted feature to obtain an aggregated feature, the method further includes: determining the aggregated feature, the target feature, the zero-knowledge proof corresponding to the aggregated feature, and a client list corresponding to the target feature during the execution of the aggregation operation, and creating an operation identifier corresponding to the aggregation operation; constructing corresponding data aggregation information according to the operation identifier, the client list, the aggregated feature, the target feature, and the zero-knowledge proof.

6. The mail detecting method according to any one of claims 1 to 5, characterized by, Further comprising: constructing a corresponding data set based on preset training data and fusion features of the preset training data, and alternately optimizing a generator and a detector in an initial detection model using the data set to obtain the target detection model; the optimization round of the generator is one, and the optimization round of the detector is a preset round, wherein the preset round is greater than one; wherein the alternately optimizing the generator and the detector in the initial detection model using the data set comprises: determining feature importance of the fusion features of the preset training data in the data set, and sorting the fusion features of the preset training data according to the feature importance to obtain a sorting result; determining a loss function corresponding to the detector in the initial detection model, and determining a gradient of the loss function with respect to the fusion features; adding a preset amplitude of disturbance to the fusion features according to the sorting result and the gradient to obtain updated features; generating an adversarial sample based on the updated features using the generator, and optimizing the initial detection model based on the adversarial sample to obtain the target detection model.

7. The mail detecting method according to claim 4, characterized by, Further comprising: generating corresponding detection mode knowledge based on the target feature association graph; obtaining detection rule knowledge corresponding to the target detection model; determining model parameters of the target detection model, and generating corresponding detection model knowledge according to the model parameters; construct mail detection knowledge based on the detection mode knowledge, the detection rule knowledge and the detection model knowledge, and save the mail detection knowledge to the preset knowledge base; construct corresponding soft labels based on the mail detection knowledge, and distribute the soft labels to each of the clients.

8. The mail detecting method according to claim 7, characterized by, After detecting the fused features based on the preset detection rule in the preset knowledge base by using the target detection model, the method further includes: generate updated mode knowledge based on the detection result of the mail to be detected, and generate updated rule knowledge and updated model knowledge in the optimization process of the target detection model; generate updated detection knowledge based on the updated mode knowledge, the updated rule knowledge and the updated model knowledge; determine the similarity between the updated detection knowledge and the mail detection knowledge, and determine whether the similarity is not less than a preset similarity threshold; if the similarity is not less than the preset similarity threshold, update the mail detection knowledge in the preset knowledge base based on the updated detection knowledge.

9. An electronic device, comprising: include: a memory for storing a computer program; a processor for implementing the steps of the mail detection method according to any one of claims 1 to 8 when executing the computer program.

Citation Information

Patent Citations

  • Device, method, and graphical user interface for manipulating user interfaces based on fingerprint sensor inputs

    CN105659522A

  • Phishing mail detection method based on personalized federal learning

    CN114928501A