Malicious entity detection method based on intelligent multi-task learning system
Through an intelligent multi-task learning system and hyperparameter adaptive optimizer, combining multiple task models and dynamic task management, the problems of inefficient and insufficient identification accuracy of traditional malicious entity detection methods are solved, and efficient and flexible malicious entities are achieved Detection improves the security and stability of cyberspace.
Patent Information
- Application Number
- CN202410931075.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-07-11
AI Technical Summary
Traditional malicious entity detection methods rely on a single model or manually adjust hyperparameters, making it difficult to adapt to different data distribution and task requirements, and lack effective utilization of correlations between different tasks, resulting in inefficiency and insufficient identification accuracy.
Adopting an intelligent multi-task learning system, combining keyword matching, naive Bayes classification and BERT classification model, the learning rate and task weight are dynamically adjusted through the hyperparameter adaptive optimizer to achieve effective integration and dynamic tuning of the multi-task model. Improve the accuracy and robustness of malicious entity detection.
It significantly improves the accuracy and robustness of malicious entity detection, improves the generalization ability and efficiency of the model, reduces the cost and difficulty of hyperparameter tuning, and provides more intuitive and trustworthy detection results.
Smart Images

Figure CN119004460A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of network and information security, and in particular relates to a malicious entity detection method based on an intelligent multi-task learning system. Background Art
[0002] With the rapid development and popularization of the Internet, social media platforms have become an important channel for people to obtain information, communicate and express their opinions. However, the convenience brought by them is accompanied by the abuse and malicious manipulation of online speech, including false information, malicious attacks and cyber warfare. These bad speeches not only disrupt the order of the Internet, but also have an impact on individuals, organizations and society.
[0003] Traditional malicious entity detection methods often rely on manual analysis and judgment, which is inefficient and difficult to meet the real-time detection needs of large-scale information. In recent years, intelligent malicious entity detection methods based on machine learning and deep learning have also emerged. For example, they use natural language processing, pattern recognition, and deep neural networks to identify and filter false information and malicious attacks in online speech. However, existing malicious entity detection methods still have some challenges, such as complex model training and optimization processes, difficulty in selecting hyperparameters, and insufficient information sharing between different tasks. In addition, traditional methods often use a single model or manually adjust hyperparameters to detect malicious entity speech, lacking effective use of the correlation between different tasks, and hyperparameter adjustment usually relies on expert experience or static settings, which is difficult to adapt to different data distributions and task requirements.
[0004] To this end, the present invention proposes a method for detecting malicious entity speech using an intelligent multi-task learning system, which improves the accuracy, efficiency and robustness of recognition through the synergy of multi-task models to protect the security and stability of cyberspace. Summary of the invention
[0005] In view of the defects and problems of traditional malicious entity detection methods, such as using a single model or manually adjusting hyperparameters to detect malicious entity speech, lacking effective use of the correlation between different tasks, and hyperparameter adjustment usually relying on expert experience or static settings, and being difficult to adapt to different data distributions and task requirements, the present invention provides a malicious entity detection method based on an intelligent multi-task learning system. By introducing a multi-task learning framework and a hyperparameter adaptive optimizer, the present invention realizes the effective integration and dynamic tuning of multiple task models, thereby improving the accuracy, robustness and generalization ability of the malicious entity detection system.
[0006] The solution adopted by the present invention to solve the technical problem is: a malicious entity detection method based on an intelligent multi-task learning system, comprising the following steps:
[0007] Step 1: Collect original text data related to malicious entity speeches from different platforms, and pre-process the original text data to ensure the quality and applicability of the data;
[0008] Step 2: Based on the preprocessed data, a multi-task learning model is constructed, wherein the multi-task learning model includes a keyword matching model, a naive Bayes classification model and a BERT classification model, and the multi-task learning model is trained by constructing a training set;
[0009] Step 3: Design a hyperparameter adaptive optimizer to dynamically adjust the learning rate, batch size, and regularization parameters based on the performance of the multi-task learning model on the validation set.
[0010] Step 4: Introduce a dynamic task management mechanism into the multi-task learning model to dynamically adjust the weights of different tasks according to the importance of the tasks, so as to optimize the effect of the model in the multi-task learning process;
[0011] Step 5: Integrate the trained multi-task learning model and the optimized hyperparameter adaptive optimizer to form a complete intelligent multi-task learning system; and use the validation set to perform model validation on the intelligent multi-task learning system;
[0012] Step 6: Input the text data to be tested into the intelligent multi-task learning system constructed above to obtain the test results, which include the classification labels and confidence scores of the malicious entity speech.
[0013] Furthermore, in the step 1, the collected data is preprocessed. First, the text is cleaned to remove HTML tags, special characters, and emoticons in the text to retain the basic content of the text; then a word segmentation operation is performed to decompose the text into a sequence of words or phrases; and then feature extraction is performed to convert the text data into a vector form.
[0014] Furthermore, the multi-task learning model in step 2 is implemented using a neural network structure, which includes multiple specific functional layers, each layer is optimized for different aspects of the overall task, thereby achieving effective data processing and learning, including:
[0015] 1) Input layer: used to receive raw text data or feature representation as input; for keyword matching tasks, the input can be raw text data containing text information; for naive Bayes classification and BERT classification tasks, the input can be text representation after preprocessing and feature extraction;
[0016] 2) Embedding layer: convert text data into dense vector representation. For keyword matching tasks, use the pre-trained word vector model Word2Vec to convert text into word embedding vectors. The output of the embedding layer is represented as:
[0017] e i =Embedding(w i )
[0018] For Naive Bayes classification and BERT classification tasks, use the pre-trained BERT model to encode and represent text;
[0019] 3) Multi-layer neural network; including multiple hidden layers, used to learn high-level representation of input data. Each hidden layer can use different activation functions and numbers of neurons to adapt to the characteristics of different tasks and data distribution. For hidden layer l, its output can be expressed as:
[0020] h (l+1) =f(W l h l +b l )
[0021] where h (l) is the output of layer l, W (l) and b l are the weight matrix and bias vector of the layer respectively, and f is the activation function;
[0022] 4) Task-specific layer: For keyword matching, naive Bayes classification and BERT classification tasks, add the corresponding task-specific layer at the output of the neural network; for the keyword matching task, use the output layer of the sigmoid activation function to predict whether the text contains specific keywords; for the classification task, use the output layer of the softmax activation function to predict the probability distribution of the text belonging to different categories; for the output layer of the keyword matching task, the formula is:
[0023]
[0024] Where σ is the sigmoid activation function.
[0025] For the output layer of the classification task, it can be expressed as:
[0026] p=softmax(Wh+b)
[0027] The softmax function converts the output of the neural network into a probability distribution.
[0028] 5) Loss function: Different loss functions are selected for optimization for different tasks. The binary cross entropy loss function is used for keyword matching tasks, and the multi-class cross entropy loss function is used for classification tasks. For the keyword matching task, the binary cross entropy loss function is expressed as:
[0029]
[0030] For classification tasks, the multi-class cross entropy loss function is expressed as:
[0031]
[0032] where y c is the one-hot encoding of the true label, p c is the predicted probability of the corresponding category;
[0033] 6) Optimizer: Use optimization algorithms to adjust network parameters to minimize the loss function; Under the framework of hyperparameter adaptive optimizer, dynamically adjust the learning rate and other hyperparameters according to the performance of the model on the validation set to improve the training effect and generalization ability of the model;
[0034] 7) Regularization: Regularization technology is introduced to prevent model overfitting. By integrating keyword matching, naive Bayes classification, and BERT classification tasks into a multi-task learning model, the system can simultaneously learn the correlation and shared information between different tasks, thereby improving the overall performance and efficiency of the model.
[0035] Furthermore, in step 3, the hyperparameter adaptive optimizer dynamically adjusts the learning rate, batch size and regularization parameters, including the following:
[0036] 1) Regarding the dynamic adjustment of the learning rate, follow the following calculation formula:
[0037]
[0038] η t represents the current learning rate, γ is a decay factor less than 1, and 1(condition) is an indicator function whose value is 1 when the loss increase is true and 0 otherwise;
[0039] 2) Regarding batch processing size adjustment, follow the following calculation formula:
[0040]
[0041] acc t is the accuracy at time t. This formula shows that if the accuracy of the model improves, the batch size will increase to speed up the training process; if the accuracy does not improve, the batch size remains unchanged;
[0042] 3) Regarding the adjustment of regularization parameters, follow the following calculation formula:
[0043] λ t+1 =λ t *(1-δ*1(acc t+1 <acc t ))
[0044] where λ t is the current regularization parameter and δ is a small positive value used to increase the regularization strength when the performance decreases to prevent overfitting.
[0045] Furthermore, the importance of the task in step 4 is determined based on its performance on the validation set, and the task weight update formula is as follows:
[0046]
[0047] In the above formula, w i is the weight of task i, σ i is the performance indicator of task i on the validation set, including accuracy and F1 score, and β is a hyperparameter that controls the speed of weight adjustment;
[0048] These weights are then used to calculate the weighted task loss, which is given by:
[0049]
[0050] In the above formula, L total is the weighted total loss, N is the number of tasks, and L i is the loss of task i.
[0051] Furthermore, in step six, the detection results are sorted or filtered according to the confidence score; by taking the confidence score as a reference standard, the detection results with higher confidence are presented or selected preferentially to improve the credibility and practicality of the results; the confidence score can also be filtered by setting a threshold, thereby excluding detection results with lower confidence, reducing the false alarm rate and improving the user experience.
[0052] Compared with the prior art, the present invention has the following beneficial effects:
[0053] The present invention provides a malicious entity detection method based on an intelligent multi-task learning system, which uses a multi-task learning framework and combines multiple task models such as keyword matching, naive Bayes classification, and BERT classification to achieve efficient detection of malicious entity speech. The method of the present invention can more effectively detect malicious entity speech, make up for the limitations of previous single models or tasks, and improve detection accuracy and robustness. The advantages include the following:
[0054] 1. Improvement of overall performance: Through the introduction of a multi-task learning framework, the present invention can simultaneously process multiple tasks such as keyword matching, naive Bayes classification, and BERT classification, thereby achieving a significant improvement in overall performance.
[0055] 2. Hyperparameter adaptive optimization: A hyperparameter adaptive optimizer is introduced to dynamically adjust the learning rate, batch size, and regularization parameters according to the actual performance of the model on the validation set, thereby improving the generalization ability and robustness of the model and reducing the labor cost and difficulty of hyperparameter tuning.
[0056] 3. Dynamic task management mechanism: Through the dynamic task attention mechanism, the weights of different tasks are dynamically adjusted according to the importance of the tasks, which effectively improves the model's adaptability to different tasks and makes the model more intelligent and flexible.
[0057] 4. Classification label and confidence score output: Outputting classification labels and confidence scores in the detection results can provide users with more intuitive and accurate judgments on malicious entity speech, improving the interpretability and credibility of the detection results.
[0058] The detection of malicious entities is realized based on the multi-task learning system described in the present invention, which can greatly improve the efficiency and accuracy of malicious entity detection. At the same time, it also provides users with a flexible management and response mechanism, which helps to build a safer and healthier network environment. It has important application value and broad development prospects for malicious entity detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 It is a schematic diagram of the overall process of the detection method of the present invention;
[0060] Figure 2 A schematic diagram of building and training a multi-task learning model of the present invention;
[0061] Figure 3 Schematic diagram of the automatic hyperparameter tuning process of the present invention;
[0062] Figure 4 A schematic diagram of the adjustment process of the dynamic task management mechanism of the present invention;
[0063] Figure 5 Schematic diagram of loss function and accuracy on training set and validation set of the present invention;
[0064] Figure 6 It is a schematic diagram of the performance indicators of the test set of the present invention on the model. DETAILED DESCRIPTION
[0065] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0066] Embodiment 1:
[0067] This embodiment provides a malicious entity detection method based on an intelligent multi-task learning system. Figure 1-6 As shown in the figure, by introducing a multi-task learning framework and a hyperparameter adaptive optimizer, the effective integration and dynamic tuning of multiple task models are achieved, and the accuracy, robustness and generalization ability of the multi-task learning model are improved. Specifically, the following steps are included:
[0068] 1. Data collection and preprocessing
[0069] First, text data related to malicious entity speech is collected from online social platforms. In this embodiment, malicious entity data information is collected from four platforms: Kuaishou, Douyin, Xiaohongshu and Weibo, including comments, posts, video titles and descriptions. The collected data is preprocessed. The first is text cleaning, which mainly removes HTML tags, special characters, emoticons, etc. in the text to retain the basic content of the text; then the word segmentation operation is performed to decompose the text into a sequence of words or phrases for subsequent processing; then feature extraction is performed to convert the text data into a feature representation that can be understood and processed by the computer. The feature extraction methods used in this embodiment include bag-of-words model, TF-IDF, word embedding, etc. The purpose of feature extraction is to convert text data into vector form to facilitate the training and processing of subsequent models.
[0070] The entire data processing process mentioned above takes into account the quality and applicability of the data, and can select appropriate data preprocessing methods according to different task requirements to ensure that the training and performance of the subsequent model can achieve the expected results.
[0071] 2. Construction and training of multi-task learning models
[0072] The collected and processed data are used to build a multi-task learning model, which includes a keyword matching model, a naive Bayes classification model and a BERT classification model. The specific process is as follows: Figure 2 As shown,
[0073] First, multiple tasks are defined, including keyword matching tasks, naive Bayes classification tasks, and BERT classification tasks. These tasks will pass through a shared layer, then connect to a fully connected layer, and finally output as [CLS] tags. In the process of building a shared model, BERT is used as a shared model to process long texts, learn semantic relationships in texts, and provide support for downstream tasks. Finally, multi-task training is performed, including gradient normalization, parameter sharing, and joint optimization. Gradient normalization is used to normalize the gradients of each task to ensure that they are on the same scale, which helps prevent learning imbalance caused by excessive weights of some tasks; parameter sharing refers to sharing some network parameters between different tasks, so that the similarities between different tasks can be utilized to improve the generalization ability of the model; and through joint optimization, the loss functions of all tasks can be merged into a total loss function, and then the shared network parameters are updated through back propagation, while considering the specific goals of each task. For each task, the system selects a suitable model structure and algorithm, and performs model training and optimization to improve the accuracy and efficiency of the model in malicious entity detection tasks.
[0074] Furthermore, the multi-task learning model is implemented using a neural network structure, which is used to simultaneously execute multiple task models such as keyword matching, naive Bayes classification and BERT classification to detect malicious entity speech.
[0075] The neural network consists of multiple layers of specific functions, each optimized for different aspects of the overall task, enabling efficient data processing and learning, including:
[0076] 1) Input layer: used to receive raw text data or feature representation as input. For keyword matching tasks, the input can be raw text data containing text information; for naive Bayes classification and BERT classification tasks, the input can be text representation after preprocessing and feature extraction.
[0077] 2) Embedding layer: convert text data into dense vector representation so that the neural network can process it. For the keyword matching task, the pre-trained word vector model Word2Vec is used to convert the text into word embedding vectors; the output of the embedding layer is represented as:
[0078] e i =Embedding(w i )
[0079] For the Naive Bayes classification and BERT classification tasks, the pre-trained BERT model is used to encode the text and learn representations.
[0080] 3) Multi-layer neural network; including multiple hidden layers, used to learn high-level representation of input data. Each hidden layer can use different activation functions and numbers of neurons to adapt to the characteristics of different tasks and data distribution. For hidden layer l, its output can be expressed as:
[0081] h (l+1) =f(W l h l +b l )
[0082] where h (l) is the output of layer l, W (l) and b l are the weight matrix and bias vector of the layer respectively, and f is the activation function.
[0083] 4) Task-specific layer: For tasks such as keyword matching, naive Bayes classification, and BERT classification, the system adds corresponding task-specific layers at the output of the neural network. For the keyword matching task, the output layer of the sigmoid activation function is used to predict whether the text contains specific keywords; for the classification task, the output layer of the softmax activation function is used to predict the probability distribution of the text belonging to different categories; for the output layer of the keyword matching task, the formula is:
[0084]
[0085] Where σ is the sigmoid activation function.
[0086] For the output layer of the classification task, it can be expressed as:
[0087] p=softmax(Wh+b)
[0088] The softmax function converts the output of the neural network into a probability distribution.
[0089] 5) Loss function: For different tasks, different loss functions are adaptively selected for optimization, such as the binary cross entropy loss function for keyword matching tasks and the multi-class cross entropy loss function for classification tasks. For the keyword matching task, the binary cross entropy loss function is expressed as:
[0090]
[0091] For classification tasks, the multi-class cross entropy loss function is expressed as:
[0092]
[0093] where y c is the one-hot encoding of the true label, p cis the predicted probability of the corresponding category.
[0094] 6) Optimizer: Use optimization algorithms to adjust network parameters to minimize the loss function. Under the framework of the hyperparameter adaptive optimizer, the learning rate and other hyperparameters are dynamically adjusted according to the performance of the model on the validation set to improve the training effect and generalization ability of the model.
[0095] 7) Regularization: Introducing regularization techniques such as L2 regularization and dropout to prevent model overfitting helps improve the generalization ability and stability of the model. By integrating keyword matching, naive Bayes classification, and BERT classification tasks into a multi-task learning model, the system can simultaneously learn the correlation and shared information between different tasks, improving the overall performance and efficiency of the model.
[0096] The keyword matching task model, the naive Bayes classification task model, and the BERT classification task model share some parameters, that is, in some layers or parameters of the model, these task models can share the same weights or representations, thereby reducing the number of model parameters and making better use of data information to improve model performance. The following is a specific implementation of shared parameters:
[0097] 1) Embedding layer parameter sharing: Different tasks may have the same word vector embedding layer, especially for keyword matching tasks and text classification tasks, which usually require similar word vector representations for text.
[0098] 2) Feature extraction layer parameter sharing: For the Naive Bayes classification task and the BERT classification task, they may share some convolutional layer or attention mechanism parameters to better extract text features.
[0099] Parameter sharing can reduce the number of model parameters, thereby reducing the complexity of the model and reducing the risk of overfitting. At the same time, parameter sharing can also make information sharing between different tasks more sufficient, improving the generalization ability and overall performance of the model.
[0100] 3. Design and tuning of hyperparameter adaptive optimizer
[0101] The multi-task learning system is designed with a hyperparameter adaptive optimizer, which dynamically adjusts the learning rate, batch size and regularization parameters according to the performance of the multi-task learning model on the validation set. Figure 3 ,
[0102] First, compile the multi-task learning model constructed above, then define some callback functions for the model and instantiate these callback functions for use in actual training. Before starting formal training, you can use the validation set to evaluate the performance of the model. By calculating the accuracy on the validation set, you can get a preliminary understanding of the quality of the model. According to the accuracy results of the validation set, you need to adaptively adjust the model's hyperparameters. After the above preparations, officially start the model training. The training process is as follows:
[0103] 1) First epoch training: In the first epoch training, the model will traverse the entire training set once. After each epoch, the callback function will be executed to monitor and adjust the training process.
[0104] 2) Second epoch training: After completing the first epoch training, the model will undergo a second epoch training. The model will traverse the entire training set again, and this time it will be updated based on the results of the previous training round.
[0105] 3) Multiple iterations: This process is repeated multiple times until a certain convergence criterion or a preset number of training times is reached. After all training and adjustments are completed, the model will be finally evaluated.
[0106] The system uses the validation set to evaluate the model performance and adjusts the hyperparameters based on the evaluation results to optimize the model training process and results. Specifically, the hyperparameter adaptive optimizer dynamically adjusts the model's hyperparameters based on the performance indicators of the validation set. The hyperparameter adaptive optimizer is designed to monitor and analyze the performance of the model on the validation set in real time, such as key performance indicators such as accuracy and loss value, and adjust key hyperparameters such as learning rate, batch size and regularization parameters accordingly, including the following:
[0107] 1) Regarding the dynamic adjustment of the learning rate, follow the following calculation formula:
[0108]
[0109] η t represents the current learning rate, γ is a decay factor less than 1, and 1(condition) is an indicator function that is 1 when the condition in the brackets (loss increase in this example) is true, otherwise it is 0. This formula is used to dynamically reduce the learning rate to prevent performance degradation during training.
[0110] 2) Regarding batch processing size adjustment, follow the following calculation formula:
[0111]
[0112] acc tis the accuracy at time t. This formula shows that if the accuracy of the model improves, the batch size will be increased to speed up the training process; if the accuracy does not improve, the batch size remains unchanged.
[0113] 3) Regarding the adjustment of regularization parameters, follow the following calculation formula:
[0114] λ t+1 =λ t *(1-δ*1(acc t+1 <acc t ))
[0115] where λ t is the current regularization parameter and δ is a small positive value used to increase the regularization strength when the performance decreases to prevent overfitting.
[0116] 4. Dynamic task management mechanism
[0117] The multi-task learning system introduces a dynamic task management mechanism, which aims to dynamically adjust the weights of different tasks according to the relative importance of the tasks to optimize the performance and effect of the model in the multi-task learning process. The importance of the task is determined according to its performance on the validation set. The update process is as follows: Figure 4 As shown, the specific process is as follows:
[0118] 1) Initialize task weights: At the beginning of the system, the same initial weight is assigned to each task to ensure that all tasks have the same attention in the early stage of model training.
[0119] 2) First epoch training: The model is trained for the first iteration (epoch) according to the initialized weights. During this process, the model calculates the performance indicators of each task under the current weights.
[0120] 3) Evaluate performance and calculate task weights: After completing an epoch of training, the system will evaluate the performance of each task and calculate the relative importance of each task based on these performance indicators. This is achieved by calculating indicators such as loss function value and accuracy.
[0121] 4) Adjust task weights: Based on the calculated task weights, the system will adjust the weights of each task. Tasks with higher weights will receive more attention in subsequent training, while tasks with lower weights will receive less attention accordingly.
[0122] 5) Second epoch training: After completing the weight adjustment, the model enters the second round of iterative training. This time, the model will continue to learn and update according to the new weight distribution.
[0123] 6) Continuous loop: This process will be repeated many times until a certain convergence standard or a preset number of training times is reached. Each loop will adjust the model's emphasis on tasks, thereby gradually optimizing its multi-task learning ability. When the training process is completed, the model will give the final result based on the weight distribution of the last iteration.
[0124] The task weight update formula is as follows:
[0125]
[0126] In the above formula, w i is the weight of task i, σ i is the performance indicator (accuracy and F1 score) of task i on the validation set, and β is a hyperparameter that controls the speed of weight adjustment.
[0127] These weights are then used to weight the task loss to better guide the model training process. The weighted task loss formula is as follows:
[0128]
[0129] In the above formula, L total is the weighted total loss, N is the number of tasks, and L i is the loss of task i.
[0130] The introduction of the above-mentioned dynamic task attention mechanism enables the model to allocate different resources and attention according to the importance of the task, so as to learn each task more effectively; this mechanism can make the model more flexible when facing multiple tasks, and can better adapt to the differences between different tasks, thereby improving the overall performance.
[0131] 5. Model integration and performance evaluation
[0132] The trained multi-task learning model and the optimized hyperparameter adaptive optimizer are integrated to form a complete intelligent multi-task learning system. This embodiment uses 1,200 online water army posts and 12,000 ordinary user posts from Kuaishou, Douyin, Weibo and Xiaohongshu platforms, of which the training set includes 1,000 online water army posts and 10,000 ordinary user posts, and the test set includes 200 online water army posts and 2,000 ordinary user posts. To implement the performance test of the model, the loss function and accuracy on the training set and the validation set are as follows: Figure 5As shown in the figure, we can see that after 10 epochs of training the neural network, both the training set and the validation set show a trend of gradually decreasing loss function and gradually increasing accuracy, and the performance on the training set is still very good. Then use the test set to evaluate the performance of the multi-task learning model, including accuracy, recall, F1 value and other indicators. The results are as follows Figure 6 As shown, to verify the effect and generalization ability of the model. Figure 6 It can be obtained that the accuracy, recall rate and F1 value are 0.850, 0.820 and 0.835 respectively. Therefore, the intelligent multi-task learning system and hyperparameter adaptive optimizer in the present invention have a relatively high detection accuracy for malicious entities.
[0133] 6. Malicious entity detection result output
[0134] The malicious entity detection method based on the intelligent multi-task learning system provided by the present invention realizes the detection of malicious entities based on the multi-task learning model constructed above, and the detection results include classification labels and confidence scores for malicious entity speeches. The classification labels are based on predefined categories, such as "fake news", "inflammatory speech", "advertising content", etc., and the confidence score reflects the confidence of the model in its classification decision. In addition, the system can automatically adjust key hyperparameters such as learning rate, batch size and regularization coefficient according to the performance feedback of the validation set, so as to optimize the performance in continuous training cycles. The detection results are sorted or filtered according to the confidence score. By using the confidence score as a reference standard, the system can give priority to presenting or selecting detection results with higher confidence to improve the credibility and practicality of the results. In addition, the system can also filter the confidence score by setting a suitable threshold according to specific application requirements, thereby excluding detection results with lower confidence, reducing the false alarm rate and improving the user experience. According to the detection results, corresponding processing measures are taken, including but not limited to adding suspicious speeches to the monitoring list, reporting to relevant agencies, etc.
[0135] The malicious entity detection method based on the intelligent multi-task learning system provided by the present invention can process multiple related tasks at the same time by constructing a multi-task learning framework, thereby improving the accuracy of the model in malicious entity detection; the application of hyperparameter adaptive optimizer and regularization technology helps to improve the robustness of the model, reduce overfitting, and make the model more stable when facing new data; the system can customize the model structure and processing flow according to different application requirements and data characteristics; it can monitor malicious speech on social platforms in real time and respond quickly to effectively curb the spread of malicious behavior; it can process multiple types of malicious entity detection tasks at the same time, thereby improving the use efficiency and application scope of the system. The present invention improves the efficiency and effect of malicious entity detection in an intelligent and automated manner, and also provides users with more flexible and reliable tools to cope with network security challenges.
[0136] The above description is only a preferred embodiment of the present invention and does not limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A malicious entity detection method based on an intelligent multi-task learning system, characterized in that: The following steps are involved: Step 1: Collect original text data related to malicious entity speeches from different platforms, and pre-process the original text data to ensure the quality and applicability of the data; Step 2: Based on the preprocessed data, a multi-task learning model is constructed, wherein the multi-task learning model includes a keyword matching model, a naive Bayes classification model and a BERT classification model, and the multi-task learning model is trained by constructing a training set; Step 3: Design a hyperparameter adaptive optimizer to dynamically adjust the learning rate, batch size, and regularization parameters based on the performance of the multi-task learning model on the validation set. Step 4: Introduce a dynamic task management mechanism into the multi-task learning model to dynamically adjust the weights of different tasks according to the importance of the tasks, so as to optimize the effect of the model in the multi-task learning process; Step 5: Integrate the trained multi-task learning model and the optimized hyperparameter adaptive optimizer to form a complete intelligent multi-task learning system; and use the validation set to perform model validation on the intelligent multi-task learning system; Step 6: Input the text data to be tested into the intelligent multi-task learning system constructed above to obtain the test results, which include the classification labels and confidence scores of the malicious entity speech.
2. The malicious entity detection method based on the intelligent multi-task learning system according to claim 1 is characterized in that: In the step 1, the collected data is preprocessed. First, the text is cleaned to remove HTML tags, special characters, and emoticons in the text to retain the basic content of the text; then a word segmentation operation is performed to decompose the text into a sequence of words or phrases; and then feature extraction is performed to convert the text data into a vector form.
3. The malicious entity detection method based on the intelligent multi-task learning system according to claim 1 is characterized in that: The multi-task learning model in step 2 is implemented using a neural network structure, which includes multiple specific functional layers, each layer is optimized for different aspects of the overall task, thereby achieving effective data processing and learning, including: 1) Input layer: used to receive raw text data or feature representation as input; for keyword matching tasks, the input can be raw text data containing text information; for naive Bayes classification and BERT classification tasks, the input can be text representation after preprocessing and feature extraction; 2) Embedding layer: convert text data into dense vector representation. For keyword matching tasks, use the pre-trained word vector model Word2Vec to convert text into word embedding vectors. The output of the embedding layer is represented as: e i =Embedding(w i ) For Naive Bayes classification and BERT classification tasks, use the pre-trained BERT model to encode and represent text; 3) Multi-layer neural network; including multiple hidden layers, used to learn high-level representation of input data. Each hidden layer can use different activation functions and numbers of neurons to adapt to the characteristics of different tasks and data distribution. For hidden layer 1, its output can be expressed as: h (l+1) =f(W l h l +b l ) where h (l) is the output of layer 1, W (l) and b l are the weight matrix and bias vector of the layer respectively, and f is the activation function; 4) Task-specific layer: For keyword matching, naive Bayes classification and BERT classification tasks, add the corresponding task-specific layer at the output of the neural network; for the keyword matching task, use the output layer of the sigmoid activation function to predict whether the text contains specific keywords; for the classification task, use the output layer of the softmax activation function to predict the probability distribution of the text belonging to different categories; for the output layer of the keyword matching task, the formula is: Where σ is the sigmoid activation function. For the output layer of the classification task, it can be expressed as: p=softmax(Wh+b) The softmax function converts the output of the neural network into a probability distribution. 5) Loss function: Different loss functions are selected for optimization for different tasks. The binary cross entropy loss function is used for keyword matching tasks, and the multi-class cross entropy loss function is used for classification tasks. For the keyword matching task, the binary cross entropy loss function is expressed as: For classification tasks, the multi-class cross entropy loss function is expressed as: where y c is the one-hot encoding of the true label, p c is the predicted probability of the corresponding category; 6) Optimizer: Use optimization algorithms to adjust network parameters to minimize the loss function; Under the framework of hyperparameter adaptive optimizer, dynamically adjust the learning rate and other hyperparameters according to the performance of the model on the validation set to improve the training effect and generalization ability of the model; 7) Regularization: Regularization technology is introduced to prevent model overfitting. By integrating keyword matching, naive Bayes classification, and BERT classification tasks into a multi-task learning model, the system can simultaneously learn the correlation and shared information between different tasks, thereby improving the overall performance and efficiency of the model.
4. The malicious entity detection method based on the intelligent multi-task learning system according to claim 1 is characterized in that: In step 3, the hyperparameter adaptive optimizer dynamically adjusts the learning rate, batch size, and regularization parameters, including the following: 1) Regarding the dynamic adjustment of the learning rate, follow the following calculation formula: η t represents the current learning rate, γ is a decay factor less than 1, and 1(condition) is an indicator function whose value is 1 when the loss increase is true and 0 otherwise; 2) Regarding batch processing size adjustment, follow the following calculation formula: acc t is the accuracy at time t. This formula shows that if the accuracy of the model improves, the batch size will increase to speed up the training process; if the accuracy does not improve, the batch size remains unchanged; 3) Regarding the adjustment of regularization parameters, follow the following calculation formula: l t+1 =λ t *(1-δ*1(acc t+1 <acc t )) where λ t is the current regularization parameter and δ is a small positive value used to increase the regularization strength when the performance decreases to prevent overfitting.
5. The malicious entity detection method based on the intelligent multi-task learning system according to claim 1 is characterized in that: The importance of the task in step 4 is determined based on its performance on the validation set, and the task weight update formula is as follows: In the above formula, w i is the weight of task i, σ i is the performance indicator of task i on the validation set, including accuracy and F1 score, and β is a hyperparameter that controls the speed of weight adjustment; These weights are then used to calculate the weighted task loss, which is given by: In the above formula, L total is the weighted total loss, N is the number of tasks, and L i is the loss of task i.
6. The malicious entity detection method based on the intelligent multi-task learning system according to claim 1 is characterized in that: In step six, the detection results are sorted or filtered according to the confidence score; by taking the confidence score as a reference standard, the detection results with higher confidence are presented or selected first to improve the credibility and practicality of the results; the confidence score can also be filtered by setting a threshold, thereby excluding detection results with lower confidence, reducing the false alarm rate and improving the user experience.
Citation Information
Patent Citations
Deep neural network hyper-parameter optimization method, electronic device and storage medium
CN110598842A
ABSC task syntactic constraint method based on dependency graph convolution and transfer learning
CN112883714A
Internet malicious entity detection method and storage medium
CN117834184A
Enhanced detection of polymorphic malicious content within an entity
US20180255073A1
Exploiting local inter-task relationships in adaptive multi-task learning
US20190026648A1
Cited By
Cloud edge size model collaboration method and system based on federal learning, and electronic equipment
CN119496824A
NLP-based violation speech processing method and apparatus, and computer device
CN121051246A
NLP-based illegal speech processing method and device, and computer equipment
CN121051246B
