A fraudulent website identification method based on generative adversarial network

By generating an adversarial network model to extract and optimize URL features, the problem of insufficient samples and unbalanced categories in fraudulent URL identification is solved, the accuracy and stability of fraudulent URL identification are improved, and high-quality sample generation and classification performance are achieved. promote.

CN114756783BActive Publication Date: 2024-08-30BEIJING LANGGE INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210348108.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-29
Publication Date
2024-08-30
Estimated Expiration
2042-03-29

AI Technical Summary

Technical Problem

In the existing technology, the fraudulent website identification model has low classification accuracy and stability due to insufficient samples and unbalanced categories, making it difficult to effectively identify fraudulent website addresses.

Method used

A method of identifying fraudulent URLs based on generative adversarial networks is designed. By extracting URL attribute features, JavaScript features, page features and text features, a generator module and a discriminator module are constructed, and the self-attention mechanism and different loss functions are used to optimize the model. Generate high-quality sample data to enhance the original data set and train classification algorithms to improve recognition accuracy.

Benefits of technology

It effectively improves the accuracy and stability of the fraudulent website identification model, and solves the problem of reduced classification accuracy caused by insufficient samples and unbalanced categories. The generated data can be directly used to train the classification algorithm, improving the performance of fraudulent website identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114756783B
    Figure CN114756783B
Patent Text Reader

Abstract

The present invention relates to a fraudulent website identification method based on a generative adversarial network, which belongs to the field of big data mining, including obtaining legitimate websites and fraudulent websites as original sample data, preprocessing the obtained data, extracting website attribute features, website JavaScript features, website page features and website text features from the processed sample data, and performing a cleaning operation on the data after feature extraction; constructing a generator module and a discriminator module of a generative adversarial network; inputting the processed website data set into a model to train the generative adversarial network; enhancing the original website data set using the trained generative adversarial network; and training a classification algorithm using the enhanced website data to complete fraudulent website identification. The present invention improves the accuracy and stability of the classification algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of big data mining and relates to a fraudulent website identification method based on a generative adversarial network. Background Art

[0002] Using machine learning classification algorithms to identify fraudulent URLs is a common method currently. It mainly extracts the characteristics of fraudulent URL sample data and trains appropriate algorithm models to solve the problem of fraudulent URL identification. In order to improve the accuracy of classification algorithm recognition, it is usually necessary to collect a large amount of different types of fraudulent URL data as sample training algorithms. Because fraudulent URLs have a shorter life cycle than normal URLs, contain information that threatens user security, and force users to download junk software, the collection of fraudulent URL sample data is prone to high risks and imbalances between categories, which in turn leads to insufficient training of the classification algorithm and the classification accuracy cannot reach the ideal goal.

[0003] In order to improve the accuracy and stability of the fraudulent URL identification model, the URL data of the corresponding category can be generated by the generative model, and the original data can be combined with the data generated by the model to train the classification algorithm, which can effectively improve the performance of the algorithm. Generative adversarial network model, which can learn high-dimensional and complex real data distribution, that is, it does not rely on any assumptions about the real data distribution, and can simply generate real samples from the hidden variable space. The overall framework of the generative adversarial network mainly includes two different modules, a generator module G and a discriminator module D, which are used to confront each other during the training process. The discriminator uses a function D(x) to calculate the probability that the point x in the data space is the corresponding data distribution. The generator uses a function G(z) to map the random noise z from the previous p(z) to the data space. By training G(z), it can pass the detection of the discriminator as much as possible, making it believe that the samples it generates come from the real data space. The generator is trained by using the gradient of D(x) and using it to modify its parameters, and finally reaches the Nash equilibrium. Although the generative adversarial network can fit the distribution of real sample data to a certain extent, the original generative adversarial network model has problems such as training instability and model collapse, which makes the model training process and results uncontrollable. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a generative adversarial network model suitable for URL feature data, design different discriminator modules according to the extracted four types of URL features, ensure the quality of generated samples, and solve the problem of decreased classification accuracy due to insufficient samples and imbalance between categories by generating sample data of different categories.

[0005] In order to achieve the above object, the present invention provides the following technical solutions:

[0006] A fraudulent website identification method based on a generative adversarial network, which obtains legitimate websites and fraudulent websites as original sample data, pre-processes the obtained data, extracts website attribute features, website JavaScript features, website page features and website text features from the processed sample data, and performs a cleaning operation on the data after feature extraction; constructs a generator module and a discriminator module of a generative adversarial network; inputs the processed website data set into a model to train the generative adversarial network; uses the trained generative adversarial network to enhance the original website data set; uses the enhanced website data to train a classification algorithm to complete fraudulent website identification, and includes the following steps:

[0007] S1: Collect the original data of the website and pre-process the original data; extract the website attribute features, website JavaScript features, website page features and website text features from the processed website data, and perform cleaning operations on them;

[0008] S2: Encode the URL text features and convert the extracted four types of URL features to form a four-channel feature map;

[0009] S3: constructing a generator module and a discriminator module of a generative adversarial network according to the URL feature data, processing the feature graph formed in step S2 and the encoded URL text feature through the self-attention mechanism module, and then inputting them into the network model of the global discriminator D1 and the URL text feature discriminator D5 in combination with the URL category information for training; inputting the URL attribute feature, URL JavaScript feature, and URL page feature into the network model of the URL attribute feature discriminator D2, the URL JavaScript feature discriminator D3, and the URL page feature discriminator D4 in combination with the URL category information for training; and inputting the URL category information into the generator network model in combination with randomly generated noise data for training;

[0010] S4: Set the form of the model loss function. According to the internal structure of different discriminators, the data input by the global discriminator and the URL text feature discriminator have a high overall correlation, so the least square loss function form is adopted. The internal correlation of the input data of the URL attribute feature discriminator, the URL JavaScript feature discriminator and the URL page feature discriminator is not strong, so the cross entropy loss function form is adopted, and the parameters of each part are optimized to improve the accuracy of the model.

[0011] S5: Train the generative adversarial network. First, fix the parameters of the generator module to train the discriminator module to maximize the discriminator's ability to distinguish between real sample data and generated sample data. Then, fix the trained discriminator module parameters to train the generator module. The optimization direction is to make the discriminator unable to distinguish between the data generated by the generator and the real sample data. This cycle is repeated to form a state of mutual game until the set termination condition is reached.

[0012] S6: Use the trained generative adversarial network to generate labeled URL sample data to enhance the original URL dataset, and use the enhanced data to train the classification algorithm to complete the construction of the fraudulent URL identification model.

[0013] Furthermore, the preprocessing of the original data described in step S1 specifically includes: cleaning the URL data, deleting invalid data and abnormal data, and obtaining a processed URL data set U; analyzing the URL data set U, extracting the URL's attribute features, JavaScript features, page features, and text features, wherein the text features are represented in the form of word indexes to form a URL feature vector Z(i) = (a, j, p, t), wherein a represents the URL attribute feature vector, p represents the URL page feature vector, j represents the URL JavaScript feature vector, and t represents the URL text information feature vector.

[0014] Further, the step S2 specifically includes: analyzing the extracted URL text feature data, encoding the text data using the continuous bag of words technique after word segmentation and pause word removal, extracting the corresponding word vector data from the word library according to the word index, and randomly initializing the words not in the word library. The processed text data is represented as t i =[t 1i ,t 2i ,...,t di ], where t i Represents a word in the vocabulary, d represents the dimension of the word vector, and the URL text data is encoded to form a matrix t; a, j, and p are processed by the fully connected layer and combined with the matrix t to form a four-channel feature map X. Compared with directly inputting unprocessed data, the quality of the data generated by the generator can be improved.

[0015] Further, in step S3, the feature map X is processed by the convolution layer to obtain three new feature maps Q, K and V; then the result of the transpose multiplication of Q and K is calculated to represent the feature map after encoding, and the correlation information between the current feature and other features can be obtained through this operation. In order to prevent the problem of inconsistent values ​​of the correlation matrix calculated during the training process, it is necessary to normalize it, and the result of the transpose multiplication of Q and K is subjected to a softmax operation to obtain an attention map; the obtained attention map is multiplied with V and summed, and finally converted through a convolution layer to obtain a feature map X containing global information. The calculation formula is expressed as:

[0016]

[0017]

[0018]

[0019] where α i Represents the similarity between features, q i Denotes the feature vector i in Q, K T represents the transpose of K, d q,k represents the distance between Q and K, represents the normalized feature similarity, b i represents the feature vector with all feature information, v i represents the eigenvector i in V.

[0020] Furthermore, the network structure of the generator G includes a fully connected layer, a deconvolution layer, a batch normalization layer, an activation layer, and an output layer; the fully connected layer is used to convert the structure of the input data, the deconvolution layer upsamples the feature map by interpolation, expands the amount of information in the feature map, and transforms the input Gaussian noise into data similar to the real sample structure. The batch normalization layer can increase the output gradient while speeding up the model convergence time, and stabilizes the learning process of the model to a certain extent. The activation layer is used to improve the efficiency of feature extraction. Except for the output layer which uses the hyperbolic tangent activation function (Tanh), the remaining layers all use the ReLU activation function.

[0021] Furthermore, the network structure of the global discriminator D1 in step S3 is: using convolutional layers to continuously extract information in the feature map, and finally outputting a result vector composed of 0 and 1, 0 represents that the input data does not conform to the distribution of the real sample data, and 1 represents that the input data is similar to the distribution of the real sample data. Batch normalization operation and activation function are used in the middle of each convolutional layer, the final output layer uses a Sigmoid activation function, and the remaining layers all use a LeakyReLU activation function; the URL text feature discriminator D5 uses a network structure diagram similar to that of the global discriminator D1.

[0022] Furthermore, the network structure of the URL attribute feature identifier D2 includes three fully connected layers. The data output by the output layer is a result vector composed of 0 and 1. An activation layer and a dropout layer are provided after each fully connected layer to prevent overfitting. The final output layer uses the Sigmoid activation function, and the other layers use the LeakyReLU activation function. The URL JavaScript feature identifier D3 and the URL page feature identifier D4 both use the same network structure as the URL attribute feature identifier D2.

[0023] Further, in step S4, the total loss function of the model is:

[0024] L SAWF-GAN (G,L D1 ,L D2 ,L D3 ,L D4 ,L D5 )=

[0025] μ1L D1 +μ2L D2 +μ3L D3 +μ4L D4 +μ5L D5

[0026] Among them, G represents the generator, L D1 represents the loss function of the generator G and the global discriminator D1, L D2 represents the loss function of the generator G and the URL attribute feature discriminator D2, L D3 represents the loss function of the generator G and the URL JavaScript feature discriminator D3, L D4 represents the loss function of the generator G and the URL page feature discriminator D4, L D5 represents the loss function of the generator G and the URL text feature identifier D5, μ1, μ2, μ3, μ4, μ5 represent the proportion of each part of the loss function to the total loss function of the model, and satisfy μ1+μ2+μ3+μ4+μ5=1.

[0027] Furthermore, the loss function expression of the generator G and the global discriminator D1 is:

[0028]

[0029] Where x represents the overall URL sample features after combining the four types of URL features, y represents the corresponding sample category label, and f1 represents the data output by the generator function G(z|y);

[0030] The loss function expression of the generator G and the URL attribute feature discriminator D2 is:

[0031]

[0032] In the formula, a represents the URL attribute feature, and f2 represents the URL attribute feature data in the output data of the generator function G(z|y);

[0033] The loss function expression of the generator G and the URL JavaScript feature discriminator D3 is:

[0034]

[0035] In the formula, j represents the JavaScript feature of the URL, and f3 represents the data of the JavaScript feature part of the URL in the output data of the generator function G(z|y);

[0036] The loss function expression of the generator G and the URL page feature discriminator D4 is:

[0037]

[0038] In the formula, p represents the URL page feature, and f4 represents the URL page feature part of the output data of the generator function G(z|y);

[0039] The loss function expression of the generator G and the URL text feature discriminator D5 is:

[0040]

[0041] In the formula, t represents the URL text feature, and f5 represents the URL text feature part of the output data of the generator function G(z|y).

[0042] The beneficial effects of the present invention are:

[0043] 1) The present invention extracts URL attribute features, URL JavaScript features, URL page features, and URL text features from the URL original data set, taking into account the impact of various factors on identifying fraudulent URLs, and using an improved generative adversarial network model to solve the problem of low accuracy and stability of the classification algorithm caused by factors such as insufficient original sample size and imbalanced categories;

[0044] 2) The present invention designs a generative adversarial network model suitable for URL feature data, and establishes a global feature discriminator and a discriminator of corresponding URL features according to the four types of features extracted from the URL, so as to ensure the global quality of the generated data samples while improving the local detail features of the generated samples, and introduces a self-attention mechanism into the global discriminator and the web page text feature discriminator, which retains the advantage of the convolutional neural network that can be trained in parallel while improving its disadvantage that it can only focus on local information. A large amount of URL feature data of a specific category can be generated using the trained model, and the classification algorithm can be directly trained through the generated data, which solves the problem of reduced classification accuracy due to insufficient samples and imbalance between categories.

[0045] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:

[0047] Figure 1 This is a flow chart of the fraudulent website identification method based on the generative adversarial network according to the present invention;

[0048] Figure 2 This is a self-attention mechanism model diagram of the fraudulent website identification method based on generative adversarial network described in the present invention;

[0049] Figure 3 This is a network structure diagram of a generator G of the fraudulent website identification method based on a generative adversarial network according to the present invention;

[0050] Figure 4 This is a network structure diagram of the global discriminator D1 of the fraudulent website identification method based on the generative adversarial network described in the present invention;

[0051] Figure 5 This is a network structure diagram of a URL attribute feature identifier D2 of the fraudulent URL identification method based on a generative adversarial network according to the present invention;

[0052] Figure 6 This is the overall network structure diagram of the fraudulent URL identification method based on generative adversarial network described in the present invention. DETAILED DESCRIPTION

[0053] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0054] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.

[0055] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "back" and the like indicate directions or positional relationships, they are based on the directions or positional relationships shown in the drawings, which are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction. Therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0056] See also Figure 1 to Figure 6 The present invention proposes a fraudulent website identification method based on a generative adversarial network. The main contents of the method include: website data acquisition and preprocessing; extracting website attribute features, website JavaScript features, website page features and website text features; encoding the website text features and establishing a feature map; establishing a generator module and a discriminator module of a generative adversarial network according to the structure of the website features; designing a reasonable loss function according to the characteristics of the input data of the discriminator model; training the generator module and the discriminator module of the generative adversarial network in an alternating training manner to complete the optimization of the model; using the trained model to generate website sample data of the corresponding category to enhance the original sample set and train the classification algorithm to complete the construction of a fraudulent website identification model.

[0057] like Figure 1 As shown in Figure 1, the process of training a fraudulent URL identification model includes:

[0058] S1: Collect the original data of the website and pre-process the original data; extract the website attribute features, website JavaScript features, website page features and website text features from the processed website data, and perform cleaning operations on them;

[0059] S2: Encode the URL text features and convert the extracted four types of URL features to form a four-channel feature map;

[0060] S3: Construct the generator module and discriminator module of the generative adversarial network according to the URL feature data, process the feature map formed by S2 and the encoded URL text features through the self-attention mechanism module, and then input them into the network model of the global discriminator D1 and the URL text feature discriminator D5 in combination with the URL category information for training; input the URL attribute features, URL JavaScript features, and URL page features into the network models of the URL attribute feature discriminator D2, the URL JavaScript feature discriminator D3, and the URL page feature discriminator D4 in combination with the URL category information for training; input the URL category information into the generator network model in combination with randomly generated noise data for training;

[0061] S4: setting the form of the model loss function, which mainly includes the loss of the generator and the global discriminator D1, the loss of the generator and the URL attribute feature discriminator D2, the loss of the generator and the URL JavaScript feature discriminator D3, the loss of the generator and the URL page feature discriminator D4, and the loss of the generator and the URL text feature discriminator D5, and optimizing the parameters of each part to improve the accuracy of the model;

[0062] S5: Train the generative adversarial network. First, fix the parameters of the generator module to train the discriminator module to maximize the discriminator's ability to distinguish between real sample data and generated sample data. Then, fix the trained discriminator module parameters to train the generator module. The optimization direction is to make the discriminator unable to distinguish between the data generated by the generator and the real sample data. This cycle is repeated to form a state of mutual game until the set termination condition is reached.

[0063] S6: Use the trained generative adversarial network to generate labeled URL sample data to enhance the original URL dataset, and use the enhanced dataset to train the classification algorithm to complete the construction of the fraudulent URL identification model.

[0064] URL data is obtained in a variety of ways; the URL data obtained includes two major categories: legitimate URLs and fraudulent URLs. The fraudulent URLs are further divided into six categories: loans, marriage, futures, fake orders, making money and others. Among them, the legitimate URL samples are based on the reputable URLs published by the ALEXA website and obtained using crawler technology. The fraudulent URL samples are obtained using data provided by mobile operators that contain various fraud methods. Preprocessing of the obtained URL data includes cleaning the data and deleting invalid and abnormal data; using the processed data to extract URL features; the main extracted features include URL attribute features, URL JavaScript features, URL page features and URL text features, and the dimensions of the feature vectors are 8, 10, 12 and 32. Taking into account the diversity of URL feature data, in order to eliminate problems such as the value range, the data is z-score standardized, and the standardization formula is:

[0065]

[0066] Among them, x represents the original data, u represents the mean of the original data, σ represents the standard deviation of the original data, and z represents the processed data, whose mean is 0 and standard deviation is 1.

[0067] The processed data forms a URL feature vector Z(i)=(a,j,p,t), where a represents the URL attribute feature vector dimension size of 8, p represents the URL page feature vector dimension size of 12, j represents the URL JavaScript feature vector dimension size of 10, and t represents the URL text information feature vector. By counting all the text information, a total of 18,000 words are included, and most of the texts contain less than 32 words, so the length of each text is set to 32.

[0068] The extracted URL text feature data is analyzed. After word segmentation and pause word removal, the text data is encoded using the continuous bag of words technique. The corresponding word vector data is extracted from the word library according to the word index. The words that are not in the word library are randomly initialized. The processed text data is represented as t i =[t 1i ,t 2i ,...,t di ], where t i represents a word in the vocabulary, and d represents the dimension of the word vector. After encoding, the URL text data forms a 32×d matrix t.

[0069] like Figure 2As shown in the figure, a, j, and p are processed by the fully connected layer and combined with the matrix t to form a four-channel feature map X. After X is processed by the convolution layer, three new feature maps Q, K, and V are obtained. Then, the result of the transpose multiplication of Q and K is calculated to represent the feature map after encoding. This operation can obtain the correlation information between the current feature and other features. In order to prevent the problem of inconsistent values ​​of the correlation matrix calculated during the training process, it is necessary to normalize it. The above calculation results are subjected to the softmax operation to obtain the attention map. The obtained attention map is multiplied with V and summed, and finally converted through the convolution layer to obtain the feature map X containing global information. The calculation formula is expressed as:

[0070]

[0071]

[0072]

[0073] like Figure 3 As shown in the figure, the network structure of the generator G uses deconvolution operation and sets a reasonable convolution kernel size and step size. It upsamples the feature map by interpolation, expands the amount of information in the feature map, and transforms the input Gaussian noise into data similar to the real sample structure. Considering the problem of gradient vanishing during the training process of the model, the output of each deconvolution layer is batch normalized (BN) to make its mean and unit variance zero. While increasing the output gradient, it can speed up the convergence time of the model and stabilize the learning process of the model to a certain extent. After the batch normalization layer, the model also uses an activation layer to improve the efficiency of feature extraction. Except for the final output layer, which uses the hyperbolic tangent activation function (Tanh), the remaining layers all use the ReLU activation function.

[0074] like Figure 4As shown in the figure, the global discriminator D1 is mainly used to improve the quality of the generated URL sample feature data as a whole. By using the convolution layer to continuously extract information from the feature map, it will finally output a result vector composed of 0 and 1. 0 represents that the input data does not conform to the distribution of the real sample data, and 1 represents that the input data is similar to the distribution of the real sample data. The input data of the global discriminator is the combination of the feature map X containing global information and the category label y after the URL sample data is processed by the self-attention mechanism module. The output data is the judgment result of the input data. D1 also uses batch normalization operations and activation functions in the middle of each convolution layer. Compared with the generator model, D1 uses LeakyReLU as the activation function except for the output layer. The final output layer uses the Sigmoid activation function. The discriminator D5 uses a network structure diagram similar to the global discriminator D1.

[0075] like Figure 5 As shown in the figure, the discriminator D2 is proposed mainly to control the quality of URL attribute feature generation. D2 adopts the structure of a fully connected neural network. Its input data is a feature vector that combines URL attribute features with category label y. The distribution of input feature data is fully learned by using three fully connected layers. The number of nodes in each layer is 25, 9, and 1 respectively. The data output by the output layer is also a result vector composed of 0 and 1. In order to further improve the model training speed and prevent overfitting, activation layers and dropout layers are added after each fully connected layer. Except for the last output layer, which uses the Sigmoid activation function, the other layers use the LeakyReLU activation function. Because discriminators D3 and D4 control the quality of URL JavaScript feature data and URL page feature data generation respectively, their data structures are similar to URL attribute features. The main difference lies in the different dimensions of the input feature vectors, so the network structures of D3 and D4 both use the same network structure as D2.

[0076] like Figure 6 As shown, the generator module and the five discriminator modules are trained in an alternating manner, and the loss function is expressed as:

[0077] L SAWF-GAN (G,L D1 ,L D2 ,L D3 ,L D4 ,L D5 )=

[0078] μ1L D1 +μ2L D2 +μ3L D3 +μ4L D4 +μ5L D5

[0079] Among them, μ1, μ2, μ3, μ4, and μ5 represent the proportion of each part of the loss function to the total loss function of the model, and satisfy μ1+μ2+μ3+μ4+μ5=1.

[0080] The loss function expression of the generator G and the global discriminator D1 is:

[0081]

[0082] Where x represents the overall URL sample features after combining the four types of URL features, y represents the corresponding sample category label, and f1 represents the data output by the generator function G(z|y);

[0083] The loss function expression of the generator G and the discriminator D2 is:

[0084]

[0085] In the formula, a represents the URL attribute feature, and f2 represents the URL attribute feature data in the output data of the generator function G(z|y);

[0086] The loss function expression of the generator G and the discriminator D3 is:

[0087]

[0088] In the formula, j represents the JavaScript feature of the URL, and f3 represents the data of the JavaScript feature part of the URL in the output data of the generator function G(z|y);

[0089] The loss function expression of the generator G and the discriminator D4 is:

[0090]

[0091] In the formula, p represents the URL page feature, and f4 represents the URL page feature part of the output data of the generator function G(z|y);

[0092] The loss function expression of the generator G and the discriminator D5 is:

[0093]

[0094] In the formula, t represents the URL text feature, and f5 represents the URL text feature part of the output data of the generator function G(z|y).

[0095] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.

Claims

1. A fraudulent website identification method based on generative adversarial networks, characterized by: The following steps are involved: S1: Collect the original data of the website and pre-process the original data; extract the website attribute features, website JavaScript features, website page features and website text features from the processed website data, and perform cleaning operations on them; S2: Encode the URL text features and convert the extracted four types of URL features to form a four-channel feature map; S3: constructing a generator module and a discriminator module of a generative adversarial network according to the URL feature data, processing the feature graph formed in step S2 and the encoded URL text feature through the self-attention mechanism module, and then inputting them into the network model of the global discriminator D1 and the URL text feature discriminator D5 in combination with the URL category information for training; inputting the URL attribute feature, URL JavaScript feature, and URL page feature into the network model of the URL attribute feature discriminator D2, the URL JavaScript feature discriminator D3, and the URL page feature discriminator D4 in combination with the URL category information for training; and inputting the URL category information into the generator network model in combination with randomly generated noise data for training; S4: setting the form of the model loss function, according to the internal structure of different discriminators, adopting the least square loss function form for the global discriminator D1 and the URL text feature discriminator D5, adopting the cross entropy loss function form for the URL attribute feature discriminator D2, the URL JavaScript feature discriminator D3 and the URL page feature discriminator D4, and optimizing the parameters of each part; S5: Train the generative adversarial network. First, fix the parameters of the generator module to train the discriminator module to maximize the discriminator's ability to distinguish between real sample data and generated sample data. Then, fix the trained discriminator module parameters to train the generator module. The optimization direction is to make the discriminator unable to distinguish between the data generated by the generator and the real sample data. This cycle is repeated to form a state of mutual game until the set termination condition is reached. S6: Use the trained generative adversarial network to generate labeled URL sample data to enhance the original URL dataset, and use the enhanced data to train the classification algorithm to complete the construction of the fraudulent URL identification model.

2. The fraudulent website identification method based on generative adversarial network according to claim 1 is characterized by: The preprocessing of the original data described in step S1 specifically includes: cleaning the URL data, deleting invalid data and abnormal data, and obtaining a processed URL data set U; analyzing the URL data set U, extracting the URL attribute features, JavaScript features, page features and text features, wherein the text features are represented in the form of word indexes to form a URL feature vector Z(i) = (a, j, p, t), wherein a represents the URL attribute feature vector, p represents the URL page feature vector, j represents the URL JavaScript feature vector, and t represents the URL text information feature vector.

3. The fraudulent website identification method based on generative adversarial network according to claim 1 is characterized in that: The step S2 specifically includes: analyzing the extracted URL text feature data, encoding the text data using the continuous bag of words technique after word segmentation and pause word removal, extracting the corresponding word vector data from the word library according to the word index, and randomly initializing the words that are not in the word library. The processed text data is represented as t i =[t 1i ,t 2i ,...,t di ], where t i represents a word in the vocabulary, d represents the dimension of the word vector, and the URL text data is encoded to form a matrix t; a, j, and p are processed by the fully connected layer and combined with the matrix t to form a four-channel feature map X.

4. The fraudulent website identification method based on generative adversarial network according to claim 1 is characterized in that: In step S3, the feature map X is processed by the convolution layer to obtain three new feature maps Q, K and V; then the result of the transpose multiplication of Q and K is calculated to represent the feature map after encoding, the correlation matrix is ​​normalized, and the result of the transpose multiplication of Q and K is subjected to a softmax operation to obtain an attention map; the obtained attention map is multiplied with V and summed, and finally converted by the convolution layer to obtain a feature map X containing global information. The calculation formula is expressed as: where α i Represents the similarity between features, q i Denotes the feature vector i in Q, K T represents the transpose of K, d q,k represents the distance between Q and K, represents the normalized feature similarity, b i represents the feature vector with all feature information, v i represents the eigenvector i in V.

5. The fraudulent website identification method based on generative adversarial network according to claim 1 is characterized by: The network structure of the generator G includes a fully connected layer, a deconvolution layer, a batch normalization layer, an activation layer, and an output layer; the fully connected layer is used to convert the structure of the input data, the deconvolution layer upsamples the feature map in an interpolation manner, expands the amount of information in the feature map, and converts the input Gaussian noise into data similar to the real sample structure. The batch normalization layer can increase the output gradient while speeding up the model convergence time. The activation layer is used to improve the efficiency of feature extraction. Except for the output layer which uses the hyperbolic tangent activation function (Tanh), the remaining layers all use the ReLU activation function.

6. The fraudulent website identification method based on generative adversarial network according to claim 1 is characterized by: The network structure of the global discriminator D1 in step S3 is: using convolutional layers to continuously extract information in the feature map, and finally outputting a result vector composed of 0 and 1, 0 represents that the input data does not conform to the distribution of the real sample data, and 1 represents that the input data is similar to the distribution of the real sample data. Batch normalization operation and activation function are used in the middle of each convolutional layer, the final output layer uses the Sigmoid activation function, and the remaining layers all use the LeakyReLU activation function; the URL text feature discriminator D5 uses a network structure diagram similar to that of the global discriminator D1.

7. The fraudulent website identification method based on generative adversarial network according to claim 1 is characterized by: The network structure of the URL attribute feature identifier D2 includes three fully connected layers. The data output by the output layer is a result vector composed of 0 and 1. An activation layer and a dropout layer are provided after each fully connected layer to prevent overfitting. The final output layer uses the Sigmoid activation function, and the other layers use the LeakyReLU activation function. The URL JavaScript feature identifier D3 and the URL page feature identifier D4 both use the same network structure as the URL attribute feature identifier D2.

8. The fraudulent website identification method based on generative adversarial network according to claim 1 is characterized by: In step S4, the total loss function of the model is: L SAWF-GAN (G,L D1 ,L D2 ,L D3 ,L D4 ,L D5 )=μ1L D1 +μ2L D2 +μ3L D3 +μ4L D4 +μ5L D5 Among them, G represents the generator, L D1 represents the loss function of the generator G and the global discriminator D1, L D2 represents the loss function of the generator G and the URL attribute feature discriminator D2, L D3 represents the loss function of the generator G and the URL JavaScript feature discriminator D3, L D4 represents the loss function of the generator G and the URL page feature discriminator D4, L D5 represents the loss function of the generator G and the URL text feature identifier D5, μ1, μ2, μ3, μ4, μ5 represent the proportion of each part of the loss function to the total loss function of the model, and satisfy μ1+μ2+μ3+μ4+μ5=1.

9. The fraudulent website identification method based on generative adversarial network according to claim 8 is characterized by: The loss function expression of the generator G and the global discriminator D1 is: Where x represents the overall URL sample features after combining the four types of URL features, y represents the corresponding sample category label, and f1 represents the data output by the generator function G(z|y); The loss function expression of the generator G and the URL attribute feature discriminator D2 is: In the formula, a represents the URL attribute feature, and f2 represents the URL attribute feature data in the output data of the generator function G(z|y); The loss function expression of the generator G and the URL JavaScript feature discriminator D3 is: In the formula, j represents the JavaScript feature of the URL, and f3 represents the data of the JavaScript feature part of the URL in the output data of the generator function G(z|y); The loss function expression of the generator G and the URL page feature discriminator D4 is: In the formula, p represents the URL page feature, and f4 represents the URL page feature part of the output data of the generator function G(z|y); The loss function expression of the generator G and the URL text feature discriminator D5 is: In the formula, t represents the URL text feature, and f5 represents the URL text feature part of the output data of the generator function G(z|y).