Mail content risk assessment method and system based on triple cascade model and generative adversarial network
Through the combination of triple cascade model and generative adversarial network, the existing email security detection methods are solved, and efficient and accurate malicious email recognition and real-time detection are achieved.
Patent Information
- Application Number
- CN202510196449.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-06-13
AI Technical Summary
The existing email security detection methods are cost-effective and have insufficient robustness, making it difficult to effectively identify complex malicious emails, and are sensitive to confrontation samples.
Mail content risk assessment method based on triple cascade model and generative adversarial network is used to identify malicious content through lightweight filtering, medium complexity analysis and deep semantic understanding cascade detection, and an adversarial sample optimization model is generated through GAN adversarial network.
It reduces computing costs, improves the accuracy and robustness of email content recognition, meets the real-time requirements of enterprise-level email gateways, and effectively deals with complex and changeable malicious email attacks.
Smart Images

Figure CN120150991A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network security technology, and particularly to a method and system for risk assessment of email content based on a triple cascade model and a generative adversarial network. Background Art
[0002] With the wide application of email, the number of malicious emails such as spam has increased sharply, seriously threatening the information security and privacy of users. Traditional email filtering methods mainly rely on rule matching and simple single machine learning models. These methods are unable to cope with the increasingly complex malicious email attacks. Rule matching depends on a static keyword library and is difficult to deal with new types of attacks such as semantic spoofing emails. A single machine learning model consumes a large amount of computing resources. For example, the latency of the BERT model is >300ms, and it is sensitive to adversarial samples. In recent years, deep learning technology has made remarkable progress in the field of email content recognition, but its computing cost is high, making it difficult to meet the real-time and resource limitation requirements in practical applications. In addition, the means of malicious email attacks are constantly evolving, and the robustness and adaptability of traditional models also face challenges. Summary of the Invention
[0003] Therefore, the present invention provides a method and system for risk assessment of email content based on a triple cascade model and a generative adversarial network, which solves the problems of high computing cost and insufficient robustness in existing email security detection and recognition. Malicious content such as spam in the target network is identified through cascade detection of lightweight filtering, medium complexity analysis, and deep semantic understanding, and on-demand allocation of computing resources can be achieved.
[0004] According to the design scheme provided by the present invention, on the one hand, a method for risk assessment of email content based on a triple cascade model and a generative adversarial network is provided, including:
[0005] Collect email content sample data and preprocess the email content sample data. The preprocessing includes cleaning of email content data and annotation of email content risk labels;
[0006] Construct a triple cascade model. The triple cascade model includes a first model that preliminarily classifies normal emails, malicious emails, and abnormal emails based on the text features of the email content, a second model that detects hidden features in abnormal emails based on the time series features of the email content and classifies the abnormal emails into normal emails, malicious emails, and pending emails, and a third model that classifies abnormal emails and / or pending emails into normal emails and malicious emails through deep semantic analysis of the email content;
[0007] Train the triple - cascade model using the email content sample data, generate adversarial samples of the email content sample data through the GAN adversarial network, optimize the first - stage model and the second - stage model using the adversarial samples, and use the trained and optimized triple - cascade model as the email risk assessment model;
[0008] Deploy the email risk assessment model to the target email server, extract the text features of the email content to be detected and input them into the email risk assessment model of the target server, and use the email risk assessment model to identify the risk level of the email content to be detected.
[0009] As the email content risk assessment method of the present invention based on the triple - cascade model and the generative adversarial network, further, pre - process the email content sample data, including:
[0010] Scan the email content, translate the non - target - language email content into the target language, and extract the key information in the email content. The key information includes sender metadata, email content text, email content attachments, and email content link structure. The sender metadata includes the sender's email sending frequency, email sending time period, and the corresponding recipient group distribution;
[0011] Use a pre - trained encoder to encode the key information of the email content into a unified semantic space;
[0012] Label the risk types of the email content sample data. The risk types include normal emails and malicious emails.
[0013] As the email content risk assessment method of the present invention based on the triple - cascade model and the generative adversarial network, further, the first - stage model uses a lightweight algorithm and preliminarily classifies the email text features using preset rules. The preset rules include keyword matching and / or email format checking.
[0014] As the email content risk assessment method of the present invention based on the triple - cascade model and the generative adversarial network, further, the first - stage model uses a lightweight neural network model. The lightweight neural network model includes a tokenizer for word segmentation of the email text, a convolutional layer for capturing semantic pattern features of different granularities of the email text words, and a dynamic shunt output layer for classifying and outputting semantic pattern features of different granularities of the text words. The convolutional layer is constructed using parallel convolutional kernels of different scales.
[0015] As the email content risk assessment method based on the triple - cascade model and the generative adversarial network of the present invention, further, the second - stage model adopts a medium - scale neural network model; the medium - scale neural network model uses bidirectional LSTM units to capture hidden features in the email and locates key sentences in the email content through the multi - head attention mechanism to classify and identify the abnormal emails output by the first - stage model.
[0016] As the email content risk assessment method based on the triple - cascade model and the generative adversarial network of the present invention, further, the third - stage model adopts an open - source large - language model to parse semantic information of a specific distance length in the email content to identify malicious emails in abnormal emails and / or pending emails.
[0017] As the email content risk assessment method based on the triple - cascade model and the generative adversarial network of the present invention, further, generating adversarial samples of email content sample data through the GAN adversarial network, including:
[0018] Setting the generator in the GAN adversarial network according to the third - stage model, enabling the generator to share the basic architecture with the third - stage model, and generating confused - email adversarial sample data by learning the text features of both normal emails and malicious emails;
[0019] Setting the discriminator of the GAN adversarial network according to the first - stage model or the second - stage model, and promoting the discriminator to perform multi - task learning by adding a classification branch to the discriminator;
[0020] Optimizing the generator using reinforcement learning and based on the reward mechanism and the punishment mechanism so that the generator generates confused - email adversarial samples.
[0021] On the other hand, the present invention also provides an email content risk assessment system based on the triple - cascade model and the generative adversarial network, including: a data collection module, a model construction module, a model training module, and a risk assessment module, where,
[0022] The data collection module is used to collect email content sample data and pre - process the email content sample data, and the pre - processing includes the cleaning of email content data and the annotation of email content risk labels;
[0023] The model construction module is used to construct a triple - cascade model, and the triple - cascade model includes a first - stage model that preliminarily classifies normal emails, malicious emails, and abnormal emails according to the text features of the email content, a second - stage model that detects hidden features in abnormal emails according to the time - series features of the email content and classifies abnormal emails into normal emails, malicious emails, and pending emails, and a third - stage model that classifies abnormal emails and / or pending emails into normal emails and malicious emails through in - depth semantic analysis of the email content;
[0024] A model training module, which is used to train a triple - cascade model using email content sample data, generate adversarial samples of the email content sample data through a GAN adversarial network, optimize the first - stage model and the second - stage model using the adversarial samples, and use the triple - cascade model after training and optimization as an email risk assessment model;
[0025] A risk assessment module, which is used to deploy the email risk assessment model to a target email server, extract the text features of the email content to be detected and input them into the email risk assessment model of the target server, and use the email risk assessment model to identify the risk level of the email content to be detected.
[0026] Advantages of the present invention:
[0027] The present invention adopts a hierarchical processing mechanism of lightweight filtering, medium - complexity analysis, and deep semantic understanding, gradually analyzes the email content, reduces the computational cost while improving the accuracy and robustness of email content recognition. Through experimental verification, the cascade architecture of the solution in this case reduces the average processing delay from 320ms to 35ms - 45ms, meeting the real - time requirements (SLA < 100ms) of enterprise - level email gateways; on the test set containing adversarial samples such as TextFooler and DeepWordBug, the detection rate is increased from 72.5% to 98.2%; and through the zero - shot learning mechanism, the recall rate for unseen new attacks (such as malicious emails generated by ChatGPT) is maintained at 89.7%. The experimental data can further verify that the solution in this case can effectively cope with complex and changeable malicious email attacks and has good application prospects in the field of enterprise and institutional network security detection. Description of the Drawings
[0028] Figure 1 It is a schematic diagram of the email content risk assessment process based on a triple - cascade model and a generative adversarial network in the embodiment;
[0029] Figure 2 It is a schematic diagram of the inference process of the triple - cascade model in the embodiment. Detailed Embodiment
[0030] To make the objectives, technical solutions, and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to the drawings and technical solutions.
[0031] As a major network communication tool, while facilitating information transmission, email also faces many security threats. There may be malicious links hidden in the email, malicious attachments carried, etc. Once the user clicks or opens them, it may lead to serious consequences such as device attacks and data leakage. Existing email security protection measures, such as email filtering and virus scanning, although having certain effects, are difficult to completely eliminate security risks. For this reason, in the embodiments of the present invention, refer to Figure 1As shown in the figure, a method for risk assessment of email content based on a triple cascade model and a generative adversarial network is provided, including:
[0032] S101. Collect sample data of email content and preprocess the sample data of email content. The preprocessing includes cleaning of email content data and annotation of email content risk labels.
[0033] Specifically, the preprocessing of the sample data of email content can be designed to include:
[0034] Scan the email content, translate the non-target language email content into the target language, and extract key information in the email content. The key information includes sender metadata, email content text, email content attachments, and email content link structure. The sender metadata includes the sender's email sending frequency, email sending time period, and the distribution of the corresponding recipient groups.
[0035] Use a pre-trained encoder to encode the key information of the email content into a unified semantic space.
[0036] Label the risk types of the sample data of email content. The risk types include normal emails and malicious emails.
[0037] The public dataset can adopt the Enron-Spam dataset and the anonymized email data within the enterprise to construct sample data by collecting a large amount of normal and malicious email data.
[0038] In the embodiments of this case, the traditional single text analysis mode is broken through, and the detection accuracy is improved through multi-dimensional data joint modeling. For example, analyze the reputation of the sender's domain name (the risk of newly registered domain names is increased by 30%), and the attachment types (the risk weights of.exe / .js files are doubled); after translating non-English emails into the target language using the M2M-100 model, use the LaBSE encoder to map them into a unified semantic space to solve the problem of identifying multi-language attack samples; extract 15-dimensional features such as the domain name registration time of the URL (Whois query), the top-level domain name type (the risk coefficient difference between.com / .net), and the path depth (e.g., " / login.php" is 2.3 times more risky than " / index.html"); construct a portrait of the sender's historical behavior, including: detection of sudden changes in sending frequency (Z-score > 3 is regarded as abnormal), analysis of the sending time period (normal users mostly send emails between 9:00 and 18:00), and distribution of recipient groups (identification of abnormal mass sending behavior). Among them, the risk coefficient calculation can be set to meet the normalization constraint of ∑(feature weights) ≤ 1.0 to avoid probability distortion caused by the superposition of multi-dimensional features.
[0039] S102. Construct a triple - cascade model. The triple - cascade model includes a first - stage model that preliminarily classifies normal emails, malicious emails, and abnormal emails based on the text features of the email content, a second - stage model that detects hidden features in abnormal emails based on the time - series features of the email content and classifies the abnormal emails into normal emails, malicious emails, and pending emails, and a third - stage model that classifies abnormal emails and / or pending emails into normal emails and malicious emails through in - depth semantic analysis of the email content.
[0040] Among them, the first - stage model can adopt a lightweight algorithm and use preset rules to preliminarily classify the email text features. The preset rules include keyword matching and / or email format checking. According to the preset rules and lightweight algorithms, such as keyword matching and email format checking, quickly judge the risk level of the email content, so as to send the identified high - risk email content, such as text containing suspicious script code, links pointing to unknown domains, large attachments from unknown sources, etc., to the third - stage model; send the medium - risk email content, such as text containing some suspicious words, emails from infrequent contacts, etc., to the second - stage model.
[0041] Or the first - stage model adopts a lightweight neural network model. The lightweight neural network model includes a tokenizer for word segmentation of the email text, a convolutional layer for capturing semantic pattern features of different granularities of the email text words, and a dynamic shunt output layer for classifying and outputting semantic pattern features of different granularities of the text words. The convolutional layer is constructed with parallel convolutional kernels of different scale sizes.
[0042] In the first - stage model, the BERT tokenizer can be used to perform sub - word segmentation on the email text. For example: "bankaccount" → ["bank","account"], truncate / pad to a fixed length of 512. A convolutional layer of 3×64 (convolutional kernels of 3 / 5 / 7) is used in parallel to capture local semantic patterns of different granularities. For example, 3 - gram convolution can identify short keywords such as "verification code", and 7 - gram convolution can detect long phrases such as "There is an abnormality in your account". And directly classify the samples with Softmax output probability > 0.85, and pass the remaining samples to the second - stage model to avoid resource waste.
[0043] The first - stage model can adopt the TextCNN or FastText architecture to quickly analyze the email content, extract text features and perform preliminary classification, identify obvious malicious patterns, such as keywords in spam emails, common URL structures, etc., and directly classify simple malicious emails, while passing complex email content to the second - stage model.
[0044] Among them, the second - stage model can adopt a medium - scale neural network model; the medium - scale neural network model uses bidirectional LSTM units to capture hidden features in the email and locates key sentences in the email content through a multi - head attention mechanism to classify and identify abnormal emails output by the first - stage model.
[0045] The second - stage model can adopt an LSTM or GRU architecture to further analyze the complex email content passed by the first - stage model. This model can capture the time - series features of the email content and identify more concealed malicious content (such as phishing emails disguised as normal emails). For email content that is difficult to judge, it is passed to the third - stage model.
[0046] The second - stage model can also adopt a BiLSTM + Attention architecture, using bidirectional LSTM units to record forward / backward hidden states. For example, it captures the progressive discourse structure of "creating a sense of tension → providing a solution → inducing clicks" typical in phishing emails. Through a 4 - head self - attention mechanism, it locates key sentences, such as highlighting "Please reset your password immediately", providing an interpretable basis for subsequent manual review.
[0047] The third - stage model can adopt an open - source large - language model to parse semantic information of a specific distance length in the email content to identify malicious emails in abnormal emails and / or pending emails.
[0048] The open - source large - language model can adopt LLaMA - 7B to perform in - depth semantic analysis on the email content passed by the second - stage model. This model can understand the context semantics of the email and finally judge whether the email content is malicious. For example, for a phishing email disguised as a normal business email, the third - stage model can identify its potential malicious intent through semantic analysis. In model pre - training, the LoRA technique is used for model fine - tuning. Only a low - rank adapter with a rank of 8 is injected into the Query / Value matrix of the attention layer, reducing the number of fine - tuning parameters from 7 billion to 0.28 billion, avoiding overfitting of the large model. Dynamically quantizing the FP16 weights to 8 - bit integers reduces the memory footprint by 50%; removing the last 4 layers of the decoder (experiments show that the impact on the classification task accuracy is <0.5%) improves the inference speed by 40%.
[0049] S103. Use the email content sample data to train the triple - cascaded model, generate adversarial samples of the email content sample data through a GAN adversarial network, use the adversarial samples to optimize the first - stage model and the second - stage model, and use the triple - cascaded model after training and optimization as the email risk assessment model.
[0050] Specifically, generating adversarial samples of the email content sample data through a GAN adversarial network can be designed to include:
[0051] Set the generator in the GAN adversarial network according to the third model, so that the generator shares the basic architecture with the third model, and generates obfuscated email adversarial sample data by learning the text features of both normal emails and malicious emails;
[0052] Set the discriminator of the GAN adversarial network according to the first model or the second model, and promote the discriminator to perform multi-task learning by adding a classification branch to the discriminator;
[0053] Optimize the generator using reinforcement learning and based on the reward mechanism and punishment mechanism, so that the generator generates obfuscated email adversarial samples.
[0054] Use the prepared dataset to train the triple model and the GAN model. During the training process, adopt a phased training strategy, first train the triple model, and then introduce GAN adversarial training. Among them, the generative adversarial network (GAN) is based on an open-source large language model (such as LLaMA), learns the text features of normal emails and malicious emails, and generates email content sufficient to confuse the inference results of the triple model. The goal of the generator is to generate malicious emails that can bypass the detection of the triple model, including: simple malicious emails that can bypass the detection of the first model; complex malicious emails that can deceive the second model.
[0055] The discriminator is the first model or the second model in the triple cascade model, distinguishes the email content generated by the generator from the real email content, and feeds back the discriminant result to the generator to prompt the generator to generate more realistic malicious email content. The goal of the discriminator is to improve the ability to identify malicious emails while reducing misjudgments.
[0056] Use independently initialized LLaMA-7B as the generator, share the basic architecture with the third classification model but isolate the parameters. The optional actions for each generation step include: inserting typos, replacing synonyms, restructuring sentence structures, etc. The action probabilities are output by the policy network of LLaMA-7B. Set the threshold ε = 0.2 to limit the difference between the new and old policies and prevent training divergence. The calculation formula can be expressed as:
[0057] ratio = π_new(a|s) / π_old(a|s)
[0058] clip_ratio = clip(ratio,1 - ε,1 + ε)
[0059] loss = -min(ratio*A,clip_ratio*A)
[0060] where A is the advantage function, reflecting the gain of the current action relative to the average level.
[0061] Add a binary classification branch after the fully connected layer of the discriminator, and the loss function is:
[0062] L_total = L_CE + 0.3 * L_BCE
[0063] Among them, L_CE is the original categorical cross - entropy loss, and L_BCE is the adversarial sample discrimination loss. And a global gradient norm threshold of 1.0 is set to prevent the problem of gradient explosion in adversarial training.
[0064] Optimize the generator through the reinforcement learning method to make it generate more effective adversarial samples. Specifically as follows:
[0065] In the reward mechanism, when the malicious content generated by the generator successfully bypasses the detection of the triple - model, a positive reward is given to the generator to encourage it to generate more similar malicious content.
[0066] In the penalty mechanism, when the malicious content generated by the generator is successfully identified by the triple - model, a negative penalty is given to the generator to inhibit it from generating similar malicious content.
[0067] In the policy gradient update, according to the reward and penalty signals, use the policy gradient algorithm (such as REINFORCE or PPO) to update the parameters of the generator to make it generate more effective adversarial samples.
[0068] During the process of policy gradient update, combined with the fine - tuning of the open - source large - model of the generator, dynamically adjust the parameters of the generator to make it generate more realistic and complex adversarial samples.
[0069] Among them, the reward function R is used to evaluate the quality of the email content generated by the generator. When the generated email content successfully bypasses the detection of the triple - model, the generator obtains a positive reward; when the generated email content is identified as a malicious email by the triple - model, the generator obtains a negative reward. The reward function can be expressed as:
[0070]
[0071] Among them, g is the email content generated by the generator.
[0072] The policy gradient method is used to update the parameters θ of the generator to maximize the expected reward. The policy gradient formula is:
[0073]
[0074] Among them, J(θ) is the expected reward, πθ is the policy of the generator, and logπθ(g) is the logarithmic probability of the generator generating the email content g.
[0075] During the process of policy gradient update, combined with the fine - tuning of the open - source large - model of the generator, dynamically adjust the parameters of the generator to make it generate more realistic and complex adversarial samples. The fine - tuning formula is:
[0076]
[0077] where α is the fine-tuning learning rate, and L fine-tune (θ t ) is the fine-tuning loss function.
[0078] To address the problem of low-quality samples generated by traditional GANs, the solution in this case introduces Proximal Policy Optimization (PPO algorithm). Its technical chain includes: The generator receives normal email templates and malicious intent instructions, such as "generate a transfer request disguised as a company executive", and creates highly adversarial samples through a hybrid generation strategy (30% regular perturbation + 70% free generation); uses a reward function to design a comprehensive detection bypass reward (+1 when the discriminator misjudges) and a semantic similarity reward (cosine similarity based on Sentence-BERT > 0.7) to ensure that the adversarial samples have both attack effectiveness and content rationality; uses the discriminator to perform multi-task learning. In addition to the classification main task, an adversarial sample detection sub-task is added to improve the model's generalization ability by sharing the underlying feature extraction layer.
[0079] Through the above formula, the generator can be effectively optimized to generate more effective adversarial samples, thereby improving the robustness and recognition ability of the triple model.
[0080] S104. Deploy the email risk assessment model to the target email server, extract the text features of the email content to be detected and input them into the email risk assessment model of the target server, and use the email risk assessment model to identify the risk level of the email content to be detected.
[0081] Deploy the trained model to the email server to perform real-time detection on the received emails. For example Figure 2As shown, in actual deployment, the email content can be processed specifically according to the recognition results of the triple model. For high-risk email content, attachment links, etc., they are converted into non-interactive image formats. For example, the text content is rendered into an image, the link address is displayed in text form in the image and a non-clickable sign is added, and the attachment content (such as PDF, etc.) is converted into image pages and a warning watermark is added. For medium-risk email content, a floating virus warning method is used to alert users. When the user hovers the mouse over the relevant text or link, a warning box pops up to prompt potential risks. If a user believes that a certain link or attachment has been misjudged as malicious, the user can submit feedback information through the feedback button in the user feedback module. After receiving the feedback, the data closed-loop unit first performs key information removal processing on the feedback content. For example, it removes the user's personal information in the email body, sensitive data in the attachment, etc., and then encrypts the remaining information using a high-strength encryption algorithm such as AES-256 to ensure the security of the data during transmission and storage. The encrypted feedback information is directly aggregated into the cloud model training module as incremental learning data. Cloud training uses a lifelong learning algorithm to fuse the new data with the existing knowledge of the model, update the model parameters, and optimize the model performance, enabling the system to continuously adjust and improve according to the latest user feedback and enhancing the accuracy and effectiveness of the risk assessment of email content.
[0082] In each stage of the triple cascade model, multiple versions of the model are retained. When assessing the risk of email content, each version of the model gives a judgment result, and then the final risk level is determined through a voting mechanism. For example, in the first stage of the model, there can be 5 versions of the model. If 3 versions judge it as high risk and 2 versions judge it as medium risk, then the email content is finally determined to be high risk. This voting mechanism for multiple versions of the model can effectively avoid catastrophic forgetting when a single model learns new knowledge, maintain the high robustness of the system, and ensure that the system can still stably and accurately identify the risks of email content during the continuous optimization process. The processed email content is sent to the recipient. In the email received by the recipient, the high-risk content is properly processed, and the medium-risk content is clearly warned. This not only retains the original information of the email for the user to view and understand, but also effectively avoids the attack of unsafe information in the email on the recipient.
[0083] Furthermore, based on the above method, an embodiment of the present invention also provides an email content risk assessment system based on a triple cascade model and a generative adversarial network, including: a data collection module, a model construction module, a model training module, and a risk assessment module, where,
[0084] The data collection module is used to collect email content sample data and preprocess the email content sample data. The preprocessing includes cleaning the email content data and annotating the email content risk labels;
[0085] A model construction module for constructing a triple - cascade model. The triple - cascade model includes a first - stage model that preliminarily classifies normal emails, malicious emails, and abnormal emails based on the text features of the email content, a second - stage model that detects hidden features in abnormal emails based on the time - series features of the email content and classifies abnormal emails into normal emails, malicious emails, and pending emails, and a third - stage model that classifies abnormal emails and / or pending emails into normal emails and malicious emails through in - depth semantic analysis of the email content;
[0086] A model training module for training the triple - cascade model using email content sample data, generating adversarial samples of the email content sample data through a GAN adversarial network, optimizing the first - stage model and the second - stage model using the adversarial samples, and using the trained and optimized triple - cascade model as an email risk assessment model;
[0087] A risk assessment module for deploying the email risk assessment model to a target email server, extracting the text features of the email content to be detected and inputting them into the email risk assessment model of the target server, and using the email risk assessment model to identify the risk level of the email content to be detected.
[0088] To verify the effectiveness of the solution in this case, further explanations will be given below in combination with experimental data:
[0089] The publicly available Enron - Spam dataset is used, which contains approximately 30,000 normal emails and 30,000 spam emails each. For positive samples (malicious emails), the TextAttack tool is used to generate adversarial samples with a modification ratio ≤ 10% to ensure semantic consistency; for negative samples (normal emails), synonym replacement (based on WordNet) and sentence restructuring are performed to improve the generalization ability of the model; and the SMOTE oversampling technique is adopted to make the sample size difference of various malicious emails < 20%. The Tensor Core unit of NVIDIA A100 GPU is used to accelerate training with FP16 precision, while retaining the FP32 main weight copy to prevent gradient underflow. The Zero - 3 phase parameter sharding strategy is configured to shard the optimizer state, gradients, and parameters to multiple GPUs respectively, reducing the video memory occupancy by 8 times.
[0090] Using the cascade architecture in the solution of this case, the average processing delay is reduced from 320ms to 35ms - 45ms, meeting the real - time requirements of enterprise - level email gateways (SLA < 100ms); and on the test set containing adversarial samples such as TextFooler and DeepWordBug, the detection rate is increased from 72.5% to 98.2%; through the zero - sample learning mechanism, an 89.7% recall rate is maintained for unseen new attacks (such as phishing emails generated by ChatGPT).
[0091] During the deployment process, in edge-side inference, the TextCNN model is converted into a TensorRT engine, and with the use of FP16 and layer fusion technologies, a latency of around 15 ms is achieved on the Jetson Xavier device; for cloud elastic scaling, the LLaMA inference service is deployed based on Kubernetes, and the number of instances is dynamically adjusted according to the request volume (HPA policy) to ensure an SLA availability of 99.95%. The real-time nature of email security detection is ensured by optimizing the inference speed of the model, enabling efficient detection of malicious content such as spam.
[0092] Unless otherwise specifically stated, the relative steps, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present invention.
[0093] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts among the various embodiments can be referred to each other. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method section.
[0094] The units and method steps of the various examples described in connection with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of the various examples have been generally described in terms of function in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those of ordinary skill in the art can use different methods to implement the described functions for each specific application, but such implementation is not considered to exceed the scope of the present invention.
[0095] Those of ordinary skill in the art can understand that all or part of the steps in the above methods can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disc, etc. Optionally, all or part of the steps in the above embodiments can also be implemented using one or more integrated circuits. Correspondingly, the various modules / units in the above embodiments can be implemented in the form of hardware or in the form of software functional modules. The present invention is not limited to any specific form of the combination of hardware and software.
[0096] Finally, it should be noted that the above-described embodiments are only specific embodiments of the present invention, used to illustrate the technical solutions of the present invention, rather than limiting it. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that any person skilled in the art within the technical scope disclosed by the present invention can still modify the technical solutions described in the foregoing embodiments or can easily conceive of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A method for email content risk assessment based on a triple cascade model and a generative adversarial network, characterized in that: Include: Collecting email content sample data and preprocessing the email content sample data, wherein the preprocessing includes cleaning the email content data and labeling email content risk tags; Constructing a triple cascade model, the triple cascade model comprising a first model for performing preliminary classification based on text features of email content to obtain normal emails, malicious emails and abnormal emails, a second model for detecting hidden features in abnormal emails based on time series features of email content and classifying abnormal emails into normal emails, malicious emails and pending emails, and a third model for classifying abnormal emails and / or pending emails into normal emails and malicious emails by performing deep semantic analysis on email content; The triple cascade model is trained using email content sample data, and adversarial samples of email content sample data are generated through the GAN adversarial network. The adversarial samples are used to optimize the first and second models, and the trained and optimized triple cascade model is used as the email risk assessment model. The email risk assessment model is deployed to the target email server, the text features of the email content to be detected are extracted and input into the email risk assessment model of the target server, and the email risk assessment model is used to identify the risk level of the email content to be detected.
2. According to claim 1, the email content risk assessment method based on triple cascade model and generative adversarial network is characterized in that: Preprocess the email content sample data, including: Scan email content, translate non-target language email content into target language, and extract key information from email content, including sender metadata, email content text, email content attachments, and email content link structure. Sender metadata includes sender email sending frequency, email sending time period, and corresponding recipient group distribution; Use pre-trained encoders to encode key information in email content into a unified semantic space; The risk types of the email content sample data are labeled, and the risk types include normal emails and malicious emails.
3. The email content risk assessment method based on triple cascade model and generative adversarial network according to claim 1 is characterized in that: The first model uses a lightweight algorithm and preset rules to preliminarily classify email text features, and the preset rules include keyword matching and / or email format checking.
4. The email content risk assessment method based on triple cascade model and generative adversarial network according to claim 1 is characterized in that: The first model adopts a lightweight neural network model, which includes a word segmenter for word segmentation of email text, a convolution layer for capturing semantic pattern features of different granularities of email text words, and a dynamic diversion output layer for classifying and outputting semantic pattern features of different granularities of text words. The convolution layer is constructed using parallel convolution kernels of different scales.
5. The email content risk assessment method based on triple cascade model and generative adversarial network according to claim 1 is characterized in that: The second model adopts a medium-scale neural network model; the medium-scale neural network model uses a bidirectional LSTM unit to capture hidden features in emails and locates key sentences in email content through a multi-head attention mechanism to classify and identify abnormal emails output by the first model.
6. The email content risk assessment method based on triple cascade model and generative adversarial network according to claim 1 is characterized in that: The third model uses an open source large language model to parse specific distance length semantic information in the email content to identify abnormal emails and / or malicious emails in pending emails.
7. The email content risk assessment method based on triple cascade model and generative adversarial network according to claim 6 is characterized in that: Generate adversarial samples of email content sample data through GAN adversarial network, including: The generator in the GAN adversarial network is set according to the third-layer model, so that the generator shares the infrastructure with the third-layer model, and generates obfuscated email adversarial sample data by learning the text features of both normal emails and malicious emails; The discriminator of the GAN adversarial network is set according to the first model or the second model, and a classification branch is added to the discriminator to enable the discriminator to perform multi-task learning; Reinforcement learning is used to optimize the generator based on reward and penalty mechanisms so that the generator can generate obfuscated email adversarial samples.
8. An email content risk assessment system based on a triple cascade model and a generative adversarial network, characterized in that: It includes: data collection module, model building module, model training module and risk assessment module, among which: A data collection module is used to collect email content sample data and preprocess the email content sample data, wherein the preprocessing includes cleaning the email content data and labeling the email content risk labels; A model building module, for building a triple cascade model, the triple cascade model comprising a first model for performing preliminary classification based on text features of email content to obtain normal emails, malicious emails and abnormal emails, a second model for detecting hidden features in abnormal emails based on time series features of email content and classifying abnormal emails into normal emails, malicious emails and pending emails, and a third model for classifying abnormal emails and / or pending emails into normal emails and malicious emails by performing deep semantic analysis on email content; The model training module is used to train the triple cascade model using the sample data of the email content, and generate adversarial samples of the sample data of the email content through the GAN adversarial network, and optimize the first model and the second model using the adversarial samples, and use the triple cascade model after training and optimization as the email risk assessment model; The risk assessment module is used to deploy the email risk assessment model to the target email server, extract the text features of the email content to be detected and input them into the email risk assessment model of the target server, and use the email risk assessment model to identify the risk level of the email content to be detected.
9. An electronic device, characterized in that: include: at least one processor, and a memory coupled to the at least one processor; The memory stores a computer program, and the computer program can be executed by the at least one processor to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 7 can be implemented.
Citation Information
Cited By
Encrypted traffic detection model training method, detection method and electronic equipment
CN120710770A
Training method and detection method of encrypted traffic detection model and electronic device
CN120710770B
Tunnel fire detection method and device and medium
CN121725429A
A tunnel fire detection method, device and medium
CN121725429B
Phishing mail detection method and system based on multi-agent collaboration and reinforcement learning, electronic equipment and storage medium
CN121864470A