A method for identifying illegal websites based on deep learning

Through deep learning technology, combined with BERT-CNN and ResNet-18 models, it solves the problem of judgment bias caused by dynamic changes in HTML of illegal websites, achieves accurate identification of illegal websites, and improves detection performance.

CN117951389BActive Publication Date: 2024-09-17EAST CHINA UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410324702.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-21
Publication Date
2024-09-17
Estimated Expiration
2044-03-21

AI Technical Summary

Technical Problem

The HTML of illegal websites is dynamically modified through JavaScript, causing the text feature extraction model to be unable to accurately obtain the content of the home page of the web page, resulting in biased judgment results of illegal websites.

Method used

Using a method based on deep learning, combined with BERT-CNN and ResNet-18 models, illegal websites are identified through text and image feature fusion algorithms, BERT model is used to extract text features and ResNet-18 model is used to extract image features, and different states are simulated through timers Changes in web pages can generate more accurate judgments about illegal websites.

Benefits of technology

Effectively identifies illegal websites, reduces the impact of dynamic content changes on judgment results, improves accuracy and reliability, and improves illegal website detection performance through multi-feature fusion and multi-dimensional analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117951389B
    Figure CN117951389B
Patent Text Reader

Abstract

The present invention relates to the technical field of website screening, and discloses a method for identifying illegal websites based on deep learning, S100: inputting the HTML content of the website into the BERT‑CNN model, and outputting the probability that the website is an illegal website; S200: inputting the image of the website into the ResNet‑18 model, and outputting the probability that the website is an illegal website; S300: obtaining the output of the BERT‑CNN model and the ResNet‑18 model, and fusing the two classification results through a fusion algorithm, and predicting the probability that the website to be identified is an illegal website; S400: marking the website URL of the website to be identified that has been judged to be an illegal website, and entering it into an illegal website library for storage. The present invention uses the BERT model and the ResNet model to study the feature analysis and extraction of different dimensional information of illegal websites, and improves the problems existing in the local feature extraction of the BERT model. Experimental tests are carried out on public data sets, and the evaluation indicators of the model show good performance, which can effectively detect and identify illegal websites.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of website screening, and more specifically, to a method for identifying illegal websites based on deep learning. Background Art

[0002] With the rapid development of the Internet, network security issues have become increasingly prominent. The HTML content of some illegal websites usually contains long text, a large amount of information and complex structures, and may contain dynamically generated JavaScript scripts, which increases the complexity of the page, making the text content difficult to read and understand, and increasing the difficulty of model recognition.

[0003] In particular, the HTML of some illegal websites' web pages will dynamically modify the page content through JavaScript. Specifically, JavaScript is used to set a timer to change the text content at regular intervals to achieve a dynamic text change effect. When the text feature extraction model is used to extract text features from the HTML of the web page, the extracted text features and image features extracted from the website screenshots are not completely the homepage of the web page, causing deviations in the judgment results of illegal websites. Summary of the invention

[0004] The present invention provides an illegal website identification method based on deep learning, which solves the technical problem that in the related art, illegal websites use JavaScript to set a timer to change the text content at regular intervals to achieve a dynamic change effect of the text, which will cause the HTML of the web page to be subjected to text feature extraction by a text feature extraction model. The extracted text features and image features extracted from the website screenshot are not completely the homepage of the web page, resulting in deviations in the judgment results of illegal websites.

[0005] The present invention provides a method for identifying illegal websites based on deep learning, comprising the following steps:

[0006] S100: Input the HTML content of the website into the BERT (Bidirectional Encoder Representations from Transformers)-CNN (Convolutional Neural Network) model, and output the probability that the website is an illegal website;

[0007] S200: Input the website image into the ResNet-18 model and output the probability that the website is an illegal website;

[0008] S300: Obtain the outputs of the BERT-CNN model and the ResNet-18 model, fuse the two classification results through a fusion algorithm, and predict the probability of the website to be identified as an illegal website. When the probability of being predicted as an illegal website is greater than 0.5, the website to be identified is an illegal website;

[0009] The calculation formula of the fusion algorithm is as follows:

[0010] ;

[0011] It represents the probability that the i-th website to be identified is predicted to be an illegal website after considering the text and image features. and Represent the first feature weight coefficient and the second feature weight coefficient respectively, is the probability that the i-th website in the test set is an illegal website based on the prediction of the BERT-CNN model, is the probability that the i-th website in the test set is an illegal website based on the prediction of the ResNet-18 model;

[0012] S400: Marking the website URL of the website to be identified that has been determined to be an illegal website, and entering it into the illegal website database for storage.

[0013] Furthermore, step S100 also includes:

[0014] S110, dividing the first webpage text and the second webpage text into sentences respectively to generate a first sentence set and a second sentence set, wherein the first sentence set includes all sentences of the first webpage text sentence, and the second sentence set includes all sentences of the second webpage text sentence;

[0015] Extracting webpage text once at a certain interval until a webpage text different from the webpage text extracted for the first time is extracted, the webpage text extracted for the last time is the second webpage text, and the webpage text extracted for the first time is the first webpage text;

[0016] S120, deleting sentences that are negative sentences in the first sentence set and the second sentence set;

[0017] S130, comparing the sentences in the first sentence set with the sentences in the second sentence set one by one, and performing the following operations in each comparison:

[0018] Delete the repeated words, and then put the non-repeated words into the first word bank;

[0019] S140, identifying words in the first word library that are sensitive words and putting them into the second word library;

[0020] S150, extracting sentences containing words from the second vocabulary from the first sentence set in step S110 to generate a third sentence set;

[0021] Extract sentences containing words from the second vocabulary from the second sentence set in step S110 to generate a fourth sentence set;

[0022] S160, deleting sentences that do not belong to the third sentence set from the first webpage text to obtain a first text;

[0023] Deleting sentences that do not belong to the fourth sentence set from the second webpage text to obtain a second text;

[0024] After combining the second text with the first text, a third text is obtained, and the third text is input into the BERT-CNN model as the HTML content of the website.

[0025] Further, in step S120, the definition of a negative sentence is: a sentence contains an odd number of negative words;

[0026] When judging whether a word is a negative word, the sentence is segmented, and then the segmented word is matched with the word in the negative word vocabulary. If the same word is matched, the word is judged to be a negative word;

[0027] The negative word library is a library including all negative words.

[0028] Furthermore, step S100 further includes the following steps:

[0029] S101: Segment the text features in the home page image, and add classification tags and segmentation tags, as well as corresponding position codes;

[0030] S102: Input the encoded text into the BERT model to obtain the hidden state of the model on the text, usually extracting the hidden state of the last layer as text embedding;

[0031] The calculation formula of the attention mechanism of the BERT model is:

[0032] ;

[0033] Q stands for Query matrix, also known as query vector matrix, which represents the target word or the word to be annotated; V stands for Value matrix, also known as value vector matrix, which represents the original value representation of each word in the context; K stands for Key matrix, also known as key vector matrix, which represents the key vector representation of each word in the context. The dimensions of the vectors in Q and K matrices are ;

[0034] S103: The obtained text embedding is used as a first text feature vector;

[0035] S104: inputting the first text feature vector into a CNN model, the CNN model comprising a local feature convolution layer, a fully connected layer and a classifier layer based on a convolutional neural network, the local feature convolution layer using a convolution kernel to extract local salient features of key phrases contained in the text as a second text feature vector;

[0036] S105: The high-level feature vector is input into the fully connected layer, and the output of the fully connected layer is input into the classifier layer. The SoftMax function is used in the classifier layer to output the probability that the website is an illegal website.

[0037] Furthermore, in step S104, the local feature convolution layer includes multiple convolution operations, each of which generates a significant feature, and these features are connected in series to form a high-level feature vector, which is expressed as:

[0038] ;

[0039] , , Respectively represent the significant features obtained by the 1st, 2nd, and yth convolution operations. This high-level feature vector As the output of the local feature convolution module, it is used in the final text classification task;

[0040] For a convolution operation, a one-dimensional convolution operation is used to generate a feature map ;

[0041] Then the feature map Perform maximum pooling to extract the maximum value As the corresponding salient features;

[0042] Convolution operations are used to extract local salient features of key phrases contained in the text.

[0043] In step S200, the following steps are also included:

[0044] S201: Perform preliminary dimensionality reduction and feature extraction on the website images through the convolution layer and pooling layer of the ResNet-18 model to obtain image features in the website images;

[0045] S202: The ResNet-18 model consists of four stages through a series of stacked residual blocks. Each stage contains multiple residual blocks, where each residual block consists of two 3×3 convolutional layers.

[0046] The residual is calculated as:

[0047] ;

[0048] is the input of the current residual block, is the output of the current residual block, Indicates the weight parameters used to adjust the convolution layer, affecting the input of the current residual block The transformation of is the residual part, which consists of two or three convolutional layers. The output of After addition, the output of the residual block is obtained through the nonlinear activation relu function.

[0049] S203: The output of the last residual block is sent to the global average pooling layer to average the feature values ​​of each channel, thereby reducing the spatial size of the feature map;

[0050] S204: Map the processed feature map to the classification label of the website through a fully connected layer, and the output result is processed into a probability value through the SoftMax function.

[0051] Furthermore, the recognition method also includes a confusion matrix for performance standard evaluation, and the indicators of performance standard evaluation include accuracy, precision, recall rate and statistics.

[0052] Furthermore, the confusion matrix consists of four values: true positives, true negatives, false positives, and false negatives.

[0053] Furthermore, the expression of accuracy is:

[0054] ;

[0055] Where TP refers to true positive examples, TN refers to true negative examples, FP refers to false positive examples, and FN refers to false negative examples; TP is the number of illegal websites correctly predicted as illegal websites, TN is the number of normal websites correctly predicted as normal websites, FP is the number of normal websites incorrectly predicted as illegal websites, and FN is the number of illegal websites incorrectly predicted as normal websites;

[0056] The expression for accuracy is:

[0057] ;

[0058] The expression of recall is:

[0059] ;

[0060] Furthermore, F-measure is the harmonic mean of recall and precision, and its expression is:

[0061] ;

[0062] Represents the harmonic mean.

[0063] The present invention also provides an illegal website identification system based on deep learning, which identifies illegal websites through an illegal website identification method based on deep learning, including:

[0064] Web page extraction module: used to obtain web page data from the Internet and pass it to the subsequent recognition model;

[0065] Data preprocessing module: cleans, formats and structures the acquired web page data for subsequent analysis and identification processing;

[0066] Feature extraction module: extracts feature information from web page content, including text content, images, and links, for subsequent classification and recognition;

[0067] Classification model module: including text classification model and image classification model, which is used to classify web page content and determine whether it is illegal content;

[0068] Identification module: Based on pre-set rules and strategies, it matches and identifies web page content and determines the probability that the website to be identified is an illegal website;

[0069] Illegal website database: used to record and collect URL information of websites identified as illegal websites.

[0070] The present invention also provides a storage medium storing non-temporary computer-readable instructions, which, when executed by a computer, can execute the steps in a method for identifying illegal websites based on deep learning.

[0071] The beneficial effects of the present invention are as follows: the website identification method is a text-visual multi-feature identification method, which utilizes natural language processing technology and image recognition technology in deep learning, and combines the research ideas of multi-feature fusion and multi-dimensional analysis. The BERT model and the ResNet model are used to study the feature analysis and extraction of different dimensional information of illegal websites, and the problems existing in the local feature extraction of the BERT model are improved. Experimental tests are conducted on public data sets, and the evaluation indicators of the model show good performance, which can effectively detect and identify illegal websites.

[0072] At the same time, by adding a timer to the extraction model of illegal websites, the extracted text features and image features extracted from website screenshots cover web page texts in different states, so that the judgment results of illegal websites will not be affected by the hidden means of timed jumps in the website. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] Figure 1 It is a BERT-CNN network structure diagram of the present invention;

[0074] Figure 2 This is a text structure diagram interpreted by the BERT model of the present invention;

[0075] Figure 3 It is the ResNet-18 network structure diagram of the present invention;

[0076] Figure 4 is a flow chart of the fusion algorithm of the present invention;

[0077] Figure 5 It is the confusion matrix of the evaluation index of the present invention. DETAILED DESCRIPTION

[0078] The subject matter described in the present invention will now be discussed with reference to example embodiments. It should be understood that the discussion of these embodiments is only to enable those skilled in the art to better understand and implement the subject matter described in the present invention, and the functions and arrangements of the elements discussed may be changed without departing from the scope of protection of the present specification. Each example may omit, replace or add various processes or components as needed. In addition, the features described relative to some examples may also be combined in other examples.

[0079] See also Figure 1-Figure 5 As shown, a method for identifying illegal websites based on deep learning includes the following steps:

[0080] S100: Input the HTML content of the website into the BERT-CNN model and output the probability that the website is an illegal website;

[0081] The HTML content of a website refers to the HTML source code of the web page, including the text, images, links, styles and other elements in the web page. These HTML contents define the structure, layout and presentation of the web page. By viewing the HTML content of a website, you can understand how the web page is constructed and the various elements and information contained in it;

[0082] The BERT-CNN model represents the combination of the BERT model and the CNN model;

[0083] S200: Input the website image into the ResNet-18 model and output the probability that the website is an illegal website;

[0084] S300: Obtain the outputs of the BERT-CNN model and the ResNet-18 model, fuse the two classification results through a fusion algorithm, and predict the probability of the website to be identified as an illegal website. When the probability of being predicted as an illegal website is greater than 0.5, the website to be identified is an illegal website;

[0085] The calculation formula of the fusion algorithm is as follows:

[0086] ;

[0087] It represents the probability that the i-th website to be identified is predicted to be an illegal website after considering the text and image features. and Represent the first feature weight coefficient and the second feature weight coefficient respectively.

[0088] like Figure 4 As shown, the method for obtaining the first feature weight coefficient and the second feature weight coefficient includes:

[0089] The constructed BERT-CNN text classification model and ResNet-18 model are used to extract and classify the text and image features of the web pages in the dataset, and then four sets of probability sets are obtained. , , and Where n and m are the number of websites in the training set and test set respectively. The following is the definition of the resulting probability set:

[0090] yes An element in the probability set. is the probability that the i-th website in the training set is an illegal website, predicted by the text classification model (BERT-CNN).

[0091] yes An element in the probability set. is the probability that the i-th website in the test set is an illegal website based on the prediction of the text classification model (BERT-CNN).

[0092] yes An element in the probability set. is the probability that the i-th website in the training set is an illegal website, predicted by the image classification model (ResNet-18).

[0093] yes An element in the probability set. The probability that the i-th website in the test set is an illegal website, predicted by the image classification model (ResNet-18).

[0094] List of probabilities based on the training set and It is used as a new two-dimensional feature vector of the logistic regression (LR) model to train the LR model to obtain the importance measure of text features and image features and express their influence on the classification results.

[0095] use and Respectively represent characteristics and In order to facilitate the subsequent weighted calculation, we will and The values ​​of are mapped to the interval [0,1] and expressed as and , the calculation method is as follows:

[0096] ;

[0097] ;

[0098] in, and Represent the first feature weight coefficient and the second feature weight coefficient respectively, satisfying .

[0099] The larger the weight coefficient, the better the classification result. The more significant the impact.

[0100] The dataset includes both normal and illegal websites.

[0101] The entire dataset is divided into two main parts, one is the data of HTML text features, and the other is the image feature data of img images.

[0102] S400: marking the website URL of the website to be identified that has been determined to be an illegal website, and entering it into the illegal website database for storage;

[0103] A website URL usually consists of multiple parts, including protocol type, host name, path, etc., which are used to uniquely identify the location of network resources.

[0104] The illegal website database is a database that records and collects information about illegal or illegal websites. The websites in the database may have violated laws and regulations.

[0105] For S100, it specifically includes the following steps:

[0106] S101: Segment the text features in the home page image, and add classification tags and segmentation tags, as well as corresponding position codes;

[0107] The BERT model limits the number of input characters to a maximum of 512 characters. The entire webpage text needs to be divided into short texts, such as Figure 1As shown in Text 1 and Text 2.

[0108] Subsequently, these short text pairs are encapsulated into a series of Token sequences.

[0109] For example, for text 1, its format is ([CLS], Tok1, Tok2, … [SEP], Toki, … TokN, [SEP]). [CLS] represents the classification tag, [SEP] represents the segmentation tag, and Toki corresponds to the i-th token of the text. Token is the smallest unit for processing text, which can be a word, character, or phrase. The input of the BERT model is defined as ,in ∈ is the i-th embedding constructed by the corresponding Token, segment and position, d is the maximum embedding dimension, is the length of the maximum input sequence; It represents the combination of the word vector encoding, paragraph number encoding and token position encoding of the i-th token. This combination can be the concatenation or addition of the encodings. The whole process is as follows: Figure 2 shown.

[0110] S102: Input the encoded text into the BERT model to obtain the hidden state of the model on the text, usually extracting the hidden state of a certain layer (such as the last layer) as text embedding;

[0111] The calculation formula of the attention mechanism of the BERT model is:

[0112] ;

[0113] Q stands for Query matrix, also known as query vector matrix, which represents the target word or the word to be annotated; V stands for Value matrix, also known as value vector matrix, which represents the original value representation of each word in the context; K stands for Key matrix, also known as key vector matrix, which represents the key vector representation of each word in the context. The dimensions of the vectors in Q and K matrices are ;

[0114] S103: The obtained text embedding is used as a first text feature vector;

[0115] S104: inputting the first text feature vector into a CNN model, wherein the CNN model includes a local feature convolution layer, a fully connected layer, and a classifier layer based on a convolutional neural network, wherein the local feature convolution layer uses a convolution kernel to extract local significant features such as key phrases contained in the text as a second text feature vector;

[0116] The local feature convolution layer contains multiple convolution operations (multiple convolution kernels), each of which produces a significant feature. These features are concatenated to form a high-level feature vector, which is expressed as:

[0117] ;

[0118] , , Respectively represent the significant features obtained by the 1st, 2nd, and yth convolution operations. This high-level feature vector As the output of the local feature convolution module, it is used in the final text classification task;

[0119] For a convolution operation, a one-dimensional convolution operation is used to generate a feature map Then the feature map Perform maximum pooling to extract the maximum value As a corresponding salient feature.

[0120] Use convolution kernels to extract local salient features such as key phrases contained in the text;

[0121] S105: The high-level feature vector is input into the fully connected layer, and the output of the fully connected layer is input into the classifier layer. The SoftMax function is used in the classifier layer to output the probability that the website is an illegal website.

[0122] For S200, Figure 3 The ResNet-18 network structure diagram shown in the figure includes the following steps:

[0123] S201: Perform preliminary dimensionality reduction and feature extraction on the website images through the convolution layer and pooling layer of the ResNet-18 model to obtain image features in the website images;

[0124] S202: The ResNet-18 model consists of four stages through a series of stacked residual blocks. Each stage contains multiple residual blocks, where each residual block consists of two 3×3 convolutional layers.

[0125] The residual is calculated as:

[0126] ;

[0127] is the input of the current residual block, is the output of the current residual block, Indicates the weight parameters used to adjust the convolution layer, affecting the input of the current residual block The transformation of is the residual part, which is generally composed of two or three convolutional layers. The output of After addition, the output of the residual block is obtained through the nonlinear activation relu function.

[0128] S203: The output of the last residual block is sent to the global average pooling layer to average the feature values ​​of each channel, thereby reducing the spatial size of the feature map;

[0129] S204: Map the processed feature map to the classification label of the website through a fully connected layer, and the output result is processed into a probability value through the SoftMax function.

[0130] Multiple indicators such as accuracy, precision, recall and F-measure (statistic) are used as performance criteria for evaluating the method proposed in the present invention.

[0131] like Figure 5 The confusion matrix of the evaluation index is shown, which consists of four values: true positive (TP), true negative (TN), false positive (FP), and false negative (FN). Among them, TP is the number of illegal websites correctly predicted as illegal websites, TN is the number of normal websites correctly predicted as normal websites, FP is the number of normal websites incorrectly predicted as illegal websites, and FN is the number of illegal websites incorrectly predicted as normal websites.

[0132] The accuracy rate measures the proportion of websites that are correctly predicted to be illegal and legitimate as a percentage of all websites:

[0133] ;

[0134] Indicates accuracy;

[0135] Precision measures the proportion of sites that are correctly predicted to be illegal compared to all sites that are predicted to be illegal:

[0136] ;

[0137] Indicates accuracy;

[0138] Recall measures the proportion of websites that are correctly predicted to be illegal out of all illegal websites:

[0139] ;

[0140] represents the recall rate;

[0141] Among them, TP refers to true positive examples, TN refers to true negative examples, FP refers to false positive examples, and FN refers to false negative examples; specifically, TP is the number of illegal websites correctly predicted as illegal websites, TN is the number of normal websites correctly predicted as normal websites, FP is the number of normal websites incorrectly predicted as illegal websites, and FN is the number of illegal websites incorrectly predicted as normal websites;

[0142] F-measure is the harmonic mean of recall and precision:

[0143] ;

[0144] represents the harmonic mean;

[0145] The HTML of existing illegal websites will dynamically modify the page content through JavaScript. Specifically, JavaScript is used to set a timer to change the text content at regular intervals to achieve a dynamic text change effect. When the HTML of the web page is subjected to text feature extraction by the text feature extraction model, the extracted text features and image features extracted from the website screenshots are not completely the homepage of the web page, causing deviations in the judgment results of illegal websites.

[0146] In order to solve the aforementioned technical problem, in one embodiment of the present invention, step S100 further includes:

[0147] S110, dividing the first webpage text and the second webpage text into sentences respectively to generate a first sentence set and a second sentence set, wherein the first sentence set includes all sentences of the first webpage text sentence, and the second sentence set includes all sentences of the second webpage text sentence;

[0148] The webpage text is extracted once at a certain interval until a webpage text different from the first extracted webpage text is extracted. The webpage text extracted last is the second webpage text, and the webpage text extracted first is the first webpage text.

[0149] The aforementioned web page texts are completely identical, which means that the web page texts contain exactly the same words and are arranged in the same order.

[0150] S120, deleting sentences that are negative sentences in the first sentence set and the second sentence set;

[0151] The definition of a negative sentence is: a sentence contains an odd number of negative words;

[0152] To determine whether a word is a negative word, the sentence can be segmented, and then the segmented word is matched with the word in the negative word database. If the same word is matched, the word is judged to be a negative word.

[0153] The negative word library is a word library including all negative words, including but not limited to negative words such as "no", "no", "no" and so on;

[0154] The first sentence set and the second sentence set may firstly be processed to delete duplicate sentences.

[0155] S130, comparing the sentences in the first sentence set with the sentences in the second sentence set one by one, and performing the following operations in each comparison:

[0156] Delete the repeated words, and then put the non-repeated words into the first word bank;

[0157] In one embodiment of the present invention, step S130 also includes a process of reducing the size of the first vocabulary, and the first vocabulary after the reduction includes only nouns, verbs, adjectives, numerals and quantifiers.

[0158] By reducing the scale, the difficulty of semantic processing can be reduced and the impact on the identification of illegal websites can be minimized.

[0159] S140, identifying words in the first word library that are sensitive words and putting them into the second word library;

[0160] The semantics of sensitive words can represent the illegal characteristics of illegal websites;

[0161] One method of identifying sensitive words is to match the words in the first word library with the words in the sensitive word library, and if the same words are matched, the word is determined to be a sensitive word;

[0162] The sensitive word database includes all sensitive words, including but not limited to sensitive words such as "gambling", "murder", and "pornography".

[0163] S150, extracting sentences containing words from the second vocabulary from the first sentence set in step S110 to generate a third sentence set;

[0164] Extract sentences containing words from the second vocabulary from the second sentence set in step S110 to generate a fourth sentence set;

[0165] S150, deleting sentences that do not belong to the third sentence set from the first webpage text to obtain a first text;

[0166] Deleting sentences that do not belong to the fourth sentence set from the second webpage text to obtain a second text;

[0167] After combining the second text with the first text, a third text is obtained, and the third text is input into the BERT-CNN model as the HTML content of the website.

[0168] Since the first text and the third text are obtained by deleting sentences from the first web page text and the second web page text, the original paragraph structure is retained, and the paragraph encoding of the BERT model can be applied.

[0169] At least one embodiment of the present invention provides an illegal website identification system based on deep learning, including:

[0170] Web page extraction module: used to obtain web page data from the Internet and pass it to the subsequent recognition model;

[0171] Data preprocessing module: cleans, formats and structures the acquired web page data for subsequent analysis and identification processing;

[0172] Feature extraction module: extracts feature information from web page content, including text content, images, and links, for subsequent classification and recognition;

[0173] Classification model module: including text classification model or image classification model, which is used to classify web page content and determine whether it is illegal or pornographic content;

[0174] Identification module: Based on pre-set rules and strategies, it matches and identifies web page content and determines the probability that the website to be identified is an illegal website;

[0175] Illegal website database: used to record and collect URL information of websites identified as illegal websites.

[0176] At least one embodiment of the present disclosure provides a storage medium storing non-transitory computer-readable instructions for executing one or more steps in the aforementioned method for identifying illegal websites based on deep learning.

[0177] The computer program may be stored / distributed on a suitable medium, such as an optical storage medium or a solid-state medium supplied together with or as part of other hardware, but may also be distributed in other forms, such as via the Internet or other wired or wireless telecommunication systems. Any reference signs in the claims should not be construed as limiting the scope.

[0178] The above describes an embodiment of the present embodiment, but the present embodiment is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present embodiment, ordinary technicians in this field can also make many forms, all of which are within the protection of the present embodiment.

Claims

1. A method for identifying illegal websites based on deep learning, characterized in that: The following steps are involved: S100: Input the HTML content of the website into the BERT-CNN model and output the probability that the website is an illegal website; S200: Input the website image into the ResNet-18 model and output the probability that the website is an illegal website; S300: Obtain the outputs of the BERT-CNN model and the ResNet-18 model, fuse the two classification results through a fusion algorithm, and obtain the probability that the website to be identified is predicted to be an illegal website. When the probability of being predicted to be an illegal website is greater than 0.5, the website to be identified is an illegal website. The calculation formula of the fusion algorithm is as follows: ; It represents the probability that the i-th website to be identified is predicted to be an illegal website after considering the text and image features. and Represent the first feature weight coefficient and the second feature weight coefficient respectively, is the probability that the i-th website in the test set is an illegal website based on the prediction of the BERT-CNN model, The probability that the i-th website in the test set is an illegal website based on the prediction of the ResNet-18 model; S400: marking the website URL of the website to be identified that has been determined to be an illegal website, and entering it into the illegal website database for storage; Step S100 also includes: S110, dividing the first webpage text and the second webpage text into sentences respectively to generate a first sentence set and a second sentence set, wherein the first sentence set includes all sentences of the first webpage text sentence, and the second sentence set includes all sentences of the second webpage text sentence; Extracting webpage text once at a certain interval until a webpage text different from the webpage text extracted for the first time is extracted, the webpage text extracted for the last time is the second webpage text, and the webpage text extracted for the first time is the first webpage text; S120, deleting sentences that are negative sentences in the first sentence set and the second sentence set; S130, comparing the sentences in the first sentence set with the sentences in the second sentence set one by one, and performing the following operations in each comparison: Delete the repeated words, and then put the non-repeated words into the first word bank; Step S130 also includes a process of reducing the size of the first vocabulary, where the first vocabulary after the reduction only includes nouns, verbs, adjectives, numerals and quantifiers; S140, identifying words in the first word library that are sensitive words and putting them into the second word library; S150, extracting sentences containing words from the second vocabulary from the first sentence set in step S110 to generate a third sentence set; Extract sentences containing words from the second vocabulary from the second sentence set in step S110 to generate a fourth sentence set; S160, deleting sentences that do not belong to the third sentence set from the first webpage text to obtain a first text; Deleting sentences that do not belong to the fourth sentence set from the second webpage text to obtain a second text; After combining the second text with the first text, a third text is obtained, and the third text is input into the BERT-CNN model as the HTML content of the website.

2. According to claim 1, a method for identifying illegal websites based on deep learning is characterized in that: In step S120, the definition of a negative sentence is: a sentence contains an odd number of negative words; When judging whether a word is a negative word, the sentence is segmented, and then the segmented word is matched with the word in the negative word vocabulary. If the same word is matched, the word is judged to be a negative word; The negative word library is a library including all negative words.

3. The method for identifying illegal websites based on deep learning according to claim 2, characterized in that: Step S100 also includes the following steps: S101: Segment the text features in the home page image, and add classification tags and segmentation tags, as well as corresponding position codes; S102: Input the encoded text into the BERT model, obtain the hidden state of the model on the text, and extract the hidden state of the last layer as text embedding; S103: The obtained text embedding is used as a first text feature vector; S104: inputting the first text feature vector into a CNN model, the CNN model comprising a local feature convolution layer, a fully connected layer and a classifier layer based on a convolutional neural network, the local feature convolution layer using a convolution kernel to extract local salient features of key phrases contained in the text as a second text feature vector; S105: The high-level feature vector is input into the fully connected layer, and the output of the fully connected layer is input into the classifier layer. The SoftMax function is used in the classifier layer to output the probability that the website is an illegal website.

4. The method for identifying illegal websites based on deep learning according to claim 3 is characterized in that: In step S104, the local feature convolution layer includes multiple convolution operations, each of which generates a significant feature. These features are connected in series to form a high-level feature vector, which is expressed as: ; , , Respectively represent the significant features obtained by the 1st, 2nd, and yth convolution operations. This high-level feature vector As the output of the local feature convolution module, it is used in the final text classification task; For a convolution operation, a one-dimensional convolution operation is used to generate a feature map ; Then the feature map Perform maximum pooling to extract the maximum value As the corresponding salient features; Convolution operations are used to extract local salient features of key phrases contained in the text.

5. The method for identifying illegal websites based on deep learning according to claim 1, characterized in that: In step S200, the following steps are also included: S201: Perform preliminary dimensionality reduction and feature extraction on the website images through the convolution layer and pooling layer of the ResNet-18 model to obtain image features in the website images; S202: The ResNet-18 model consists of four stages through a series of stacked residual blocks. Each stage contains multiple residual blocks, where each residual block consists of two 3×3 convolutional layers. The residual is calculated as: ; is the input of the current residual block, is the output of the current residual block, Indicates the weight parameters used to adjust the convolution layer, affecting the input of the current residual block The transformation of is the residual part, which consists of two or three convolutional layers. The output of After addition, the output of the residual block is obtained by nonlinearly activating the relu function; S203: The output of the last residual block is sent to the global average pooling layer to average the feature values ​​of each channel, thereby reducing the spatial size of the feature map; S204: Map the processed feature map to the classification label of the website through a fully connected layer, and the output result is processed into a probability value through the SoftMax function.

6. The method for identifying illegal websites based on deep learning according to claim 5, characterized in that: The recognition method also includes a confusion matrix for performance standard evaluation. The indicators of performance standard evaluation include accuracy, precision, recall rate and statistics. The confusion matrix consists of four values: true positive examples, true negative examples, false positive examples and false negative examples.

7. The method for identifying illegal websites based on deep learning according to claim 6, characterized in that: The expression of accuracy is: ; Where TP refers to true positive examples, TN refers to true negative examples, FP refers to false positive examples, and FN refers to false negative examples; TP is the number of illegal websites correctly predicted as illegal websites, TN is the number of normal websites correctly predicted as normal websites, FP is the number of normal websites incorrectly predicted as illegal websites, and FN is the number of illegal websites incorrectly predicted as normal websites; The expression for accuracy is: ; The expression of recall is: 。 8. The method for identifying illegal websites based on deep learning according to claim 7, characterized in that: F-measure is the harmonic mean of recall and precision, and its expression is: ; Represents the harmonic mean.

9. An illegal website identification system based on deep learning, characterized in that: The method for identifying illegal websites based on deep learning according to any one of claims 1 to 8 is used to identify illegal websites, including: Web page extraction module: used to obtain web page data from the Internet and pass it to the subsequent recognition model; Data preprocessing module: cleans, formats and structures the acquired web page data for subsequent analysis and identification processing; Feature extraction module: extracts feature information from web page content, including text content, images, and links, for subsequent classification and recognition; Classification model module: including text classification model and image classification model, which is used to classify web page content and determine whether it is illegal content; Identification module: Based on pre-set rules and strategies, it matches and identifies web page content and determines the probability that the website to be identified is an illegal website; Illegal website database: used to record and collect URL information of websites identified as illegal websites.

10. A storage medium, characterized in that: It stores non-transitory computer-readable instructions, and when the non-transitory computer-readable instructions are executed by a computer, it can execute the steps in the method for identifying illegal websites based on deep learning as described in any one of claims 1-8.