# Class Image Processing Application of XSS Intrusion Intelligent Detection for Big Data in Campus Network Construction

Authors: Zhe Zhang
Journal: Security and Communication Networks
 (2022)

---

## Abstract

In order to improve the effect of XSS intrusion intelligent detection, this paper proposes an application of big data-oriented XSS intrusion intelligent detection based on class image processing in the construction of university campus network. In this application, image like processing method is used for data acquisition, data cleaning, data sampling, feature extraction, and other data preprocessing; design a word vector quantization algorithm based on neural network to realize word vector quantization and get word vector big data; through theoretical analysis and derivation, a variety of deep neural network intelligent detection algorithms with different depths are realized; through experiments, it is found that the average recognition rate of each deep DNN for the class I big data set is about 99.44%, the variance is about 0.000002, and the standard deviation is about 0.001589; the average recognition rate of class II big data set is about 99.77%, the variance is about 0.000006, and the standard deviation is about 0.002427. The experimental results show that this method has the characteristics of high recognition rate, good stability, and excellent overall performance.


---

## Body

## 1. Introduction

With the continuous development of information technology, cyberspace has become the fifth frontier after land, sea, sky, and space. As one of the key national information infrastructures, the Internet has played a huge role in the political, military, economic, transportation, and other fields. In the transport sector, smart connectivity can improve road safety and efficiency and make traffic flow more smoothly. And in the logistics sector, smart connectivity has the potential to improve the efficiency and flexibility of the delivery of goods, making logistics faster and cheaper. At the same time, the frequency and scale of attacks in the network also show an increasing trend year by year [1]. For example, in the Internet security threat report released by the United States in 2019, it was pointed out that: (1) in terms of malware, the frequency of malware attacks decreased slightly, and the number of blackmail software attacks decreased by 20% for the first time since 2013, but the number of attacks against enterprises increased by 12%. In 2018, the number of mine hijacking attacks was four times that of 2017. (2) In terms of mobile devices, the number of ransomware infections on mobile devices increased by 33% compared with 2017. The United States is the hardest hit area for mobile malware, accounting for 63% of the total, followed by China (13%) and Germany (10%). (3) In terms of web attacks, the total number of Web attacks on endpoints increased by 56% in 2018. In December, more than 1.3 million web attacks could be intercepted on endpoint machines every day. (4) In terms of targeted attacks, supply chain attacks and off ground attacks have become the mainstream of cybercrime, with supply chain attacks increasing by 78% in 2018. (5) In terms of the Internet of things, the number of attacks on the Internet of things increased significantly in 2017, reaching an average of 5,200 attacks per month, and stabilized in 2018. In addition, attacks such as DDoS attacks, mining, web attacks, and physical attacks are common on the Internet. These attacks have caused huge economic losses and even seriously threatened national security and social stability [2]. Therefore, how to effectively protect attacks from the network has become an urgent problem to be solved, as shown in Figure 1.Figure 1
Composition.


## 2. Literature Review

Since the web field has attracted extensive attention, the problem of web security has attracted more and more attention, and the research on web security is more and more necessary [3]. As important intrusion information for attackers, web logs have always been a research hotspot in intrusion detection. Hotspot technology is required when using the same graphic of a web page as the carrier of multiple hyperlinks. When the visitor moves the eye cursor to the hot spot, the cursor will change to a hand shape by default. The hot spot has different shapes such as rectangular area and circular area. Ilyas and Alharbi established a rule base for SQL injection attacks and focused on how SQL injection bypasses the detection filter, which makes the matching accuracy of the rule base high [4]. Lian et al. proposed that the hidden Markov model (HMM) can be used to simulate system call sequence, which provides an application basis for anomaly detection using the hidden Markov model [5]. Mendonca et al. proposed an XSS attack detection method based on support vector machine SVM classifier. This method analyzes a large number of XSS attack samples, extracts the most representative features and vectorizes them, then trains and tests the SVM algorithm, and evaluates the detection effect of the classifier through three indicators: accuracy, recall, and false positive rate [6]. Fan and Sharma analyzed the characteristics of SQL injection and XSS attack, selected 6 attack characteristics, trained the attack characteristics using SVM algorithm, and verified the feasibility of training the characteristics of SQL injection and XSS attack on Weka [7]. Shriram et al. proposed a network anomaly detection framework based on outlier mining and detection. The framework uses random forest algorithm to build network service patterns on network data and uses the built patterns to detect intrusion [8]. Alharbi et al. proposed a network anomaly detection using outlier approach (nado) [9]. Nado first uses a mutation form of clustering algorithm to cluster normal data and then calculates reference points from each cluster and constructs behavior profiles. Finally, calculate the outlier score of each point to be detected relative to the reference point. If the score is above the user's threshold, it will be considered an anomaly.The traditional computer virus detection method mainly uses the existing features in the virus feature database, extracts the features of the corresponding samples, and uses the virus database to search and compare whether there are matching features to determine the virus. This approach is usually based on knowledge of the disease. It is difficult to detect emerging viruses, especially for deformed viruses, and its efficiency is low, especially for big data. The current safety protection measures have changed from 80% protection +20% detection and response to 20% protection +80% detection and response [10]. Deep learning shows stronger learning ability than traditional machine learning methods in speech, image, and natural language processing, and has achieved very good results, especially for big data. Therefore, this paper studies the application of image processing oriented big data XSS intrusion intelligent detection in the construction of university campus network.


## 3. Research Methods

### 3.1. Big Data Processing and Modeling

Searching for negative websites is important, based on the analysis of the text, i. e., the number of extractions and physical visits, such as the number, mean, and variance of URL parameters, distribution of attributes, and frequency of visits. At present, there is a lack of sample data based on security protection, and few samples with labels. Therefore, data processing and modeling are required, including data acquisition, data preprocessing (data cleaning, data sampling, feature extraction), numerical analysis, and behavior decision making [11].In the computer, any information is represented by 0 and 1 binary sequences. For example, all characters (including letters, Chinese characters, English words, and other languages) have a code; images are also represented by digital files. Therefore, in this paper, the big data log text is converted into numerical data and represented by a matrix so as to use the image processing method for data processing and analysis. That is, the attack message is converted into a matrix similar to image data, i. e. pixels, and the string sequence samples are also converted into vectors with corresponding dimension values. Further operations such as matrix correlation, dimension reduction, clustering, and PCA can be obtained, and then the artificial intelligence method is used for user behavior analysis, network traffic analysis, and fraud detection [12].


#### 3.1.1. Corpus Big Data Acquisition

The data used for the experiment include two types of big data:① positive sample big data (with attack behavior), which is obtained by crawling from the website http://xssed.com/ using crawler tools, and is composed of payload data; ② in order to reflect the particularity and universality of negative sample big data (normal network requests), two pieces of data were collected, one from the access log big data of our network center from May to December last year, and the other from various network platforms through web crawlers. They are all unprocessed corpus big data [13].


#### 3.1.2. Big Data Processing

The continuous bag of words model (cbow), a word2vec tool based on neural network, is used to realize big data corpus processing, data cutting, word segmentation, and word vectorization. The one hot encoded word vector is mapped to a distributed word vector; this reduces dimensionality and sparsity. At the same time, the correlation degree of any word can be obtained by calculating the Euclidean distance or cosine of the included angle between vectors [14]. The specific treatment process is as follows:(1)
First, traverse the dataset, replace all the numbers with 0, and replace http/, http/, HTTPS/, HTTPS with http://; secondly, word segmentation is carried out according to HTML tags, JavaScript function body, http://,and parameter rules; build vocabulary based on diary documents and then encode words independently [15].(2)
The structure of word vectorization model based on neural network is constructed, including input layer, projection layer, and output layer. The model is trained with input samples to obtain distributed word vectors.(3)
The positive sample word set is counted, and 3,000 words with the highest word frequency are used to form a thesaurus. The others are marked as com. In this paper, the feature vector distribution is set to 128 dimensions, the maximum dimension of the distance between the current word and the predicted word is 5, the noise is 64, and 5 iterations are performed. Because the character length of each data is different, the maximum character length is taken as the standard, and if it is insufficient, it is filled with -1. When designing labels for datasets, one hot coding is used. The positive sample labels that belong to attack samples are represented by 1, and the negative sample labels that belong to normal network requirements are represented by 0.Through the above methods, a total of 40,637 positive sample datasets, 105,912 negative sample datasets, and 200,129 negative sample datasets are obtained, which are large in number and high in computational complexity. In order to improve the training results, the positive samples and two types of negative samples are mixed together, and randomly divided into training set and test set, with the quantity ratio of 7 : 3.


### 3.2. Algorithm Design

#### 3.2.1. Word Vectorization Algorithm Design

Cbow is used to realize word vector, that is, the probability of current word occurrence is predicted with known context words [16]. To this end, it is necessary to maximize the log likelihood function as follows (1):(1)L=∑w∈Clogpw|Contextw,where w represents the words in corpus C, which can be regarded as a multiclassification problem, and the multiclassification is composed of two classifications, so the hierarchical softmax method can be used [17]. First, we calculate the conditional probability of w, and the formula is as follows (2):(2)pw|Contextw=∏j=2lwpdjw|Xw,θj−1w,where pw means path; lw indicates the number of nodes; p1w, p2w,…, plww represents each node; d2w,d3w,…,dlww∈0,1 represents the code of word w; djw represents the code corresponding to the node in the path; θ1w,θ2w,…,θlw−1w∈Rm represents the parameter vector corresponding to the nonleaf node on the path. Each term on the right in (2) is a logistic regression to obtain (3):(3)pdjw|Xw,θj−1w=σXwTθj−1wdjw=01−σXwTθj−1wdjw=1.Sinced only takes 0 and 1, (3) can be expressed in exponential form as the following (4):(4)pdjw|Xw,θj−1w=σXwTθj−1w1−djw.1−σXwTθj−1wdjw.Substituting (4) into (1) yields (5):(5)L=∑w∈Clog∏j=2lwσXwTθj−1w1−djw⋅1−σXwTθj−1wdjw=∑w∈C∑j=2lw1−djw⋅logσXwTθj−1w+djw⋅log1−σXwTθj−1w.Each item in (5) can be recorded as the following (6):(6)Lw,j=1−djw⋅logσXwTθj−1w+djw⋅log1−σXwTθj−1w.To maximize (5) composed of the sum of polynomials, each term can be maximized respectively, i. e., (6). The random gradient method is used for two parameters, one is the parameter vector θj−1w of each node, and the other is the input Xw of the output layer. Calculate the partial derivatives respectively to obtain the following (7):(7)∂Lw,j∂θj−1w=∂∂θj−1w1−djw⋅logσXwTθj−1w+djw⋅log1−σXwTθj−1w,where σx is the sigmoid function. So, σ′x=σx1−σx, substituting into (7) can get (8):(8)1−djw1−σXwTθj−1wXw−djwσXwTθj−1wXw=1−djw−σXwTθj−1wXw.Finally, the iterative evaluation ofθj−1w is realized as follows:(9)θj−1w≔θj−1w+η1−djw−σXwTθj−1wXw.where η is the learning rate. From (6), it can be seen that Xw and θj−1w are symmetric, so we can get that the partial derivative about Xw is the following (10):(10)∂Lw,j∂Xw=1−djw−σXwTθj−1wθj−1w.SinceXw is the sum of the word vectors of the context, the entire updated value is applied to the word vectors of each word of the context during processing:(11)vw˜≔vw˜+η∑j=2lw∂Lw,j∂Xww˜∈Contextw,where vw˜ represents the context word vector.Based on the above main algorithms, the model is established, and the word vector can be obtained by taking the original corpus as the input.


#### 3.2.2. Deep Neural Network Algorithm Design

Compared with traditional neural networks or other ml algorithms, deep neural networks show excellent performance; especially for big data, it has the advantages of more identification, stronger robustness, and better generalization. Therefore, a deep neural network algorithm is designed to realize security protection detection, and the big data training model is adopted [18]. The mean square error during training can be expressed as the following equation (12):(12)jw,b=1m∑i=1mjw,b;xi,yi+λ2∑l=1nl−1∑j=1sl+1wjil2=1m∑i=1m12hw,bxi−yi2+λ2∑i=1nl−1∑j=1sl+1wjil2.In order to calculate the optimization parameters, the gradient descent method is used to minimize the function. Let the obtained partial derivatives be called the residual of each unit, and recorded asδil. The residual of the last layer (output layer) unit can be obtained as follows (13):(13)δinl=∂∂zinlJw,b;x,y=∂∂zinl12y−hw,bx2=∂∂zinl12∑j=1snlyi−ajnl2=∂∂zinl12∑j=1snlyj−fzjnl2=−yi−fzinl⋅f′zinl=−yi−ainl⋅f′zinl.Next, whenl=nl−1,nl−2,…,21/2, the residuals of the units in each layer can be calculated. For example, the residuals of the units in l=nl−1 layer are as follows (14):(14)δinl−1=∂∂zinl−1Jw,b;x,y=∂∂zinl−12y−hw,bx2=∂∂zinl−112∑j=1snlyi−ajnl2=12∑j=1snl∂∂zinl−1yj−fzjnl2=∑j=1snl−yi−fzjnl⋅∂∂zinl−1fzjnl=∑j=1snl−yi−fzjnl⋅f′zjnl⋅∂zjni∂zinl−1=∑j=1snlδjnl⋅∂zjnl∂zinl−1=∑j=1snlδjnl⋅∂∂zinl−1∑j=1snlfzknl−1⋅Wjknl−1=∑j=1snlδjnl⋅Wjknl−1⋅f′zinl−1=∑j=1snlWjknl−1δjnlf′zinl−1,where W represents the weight, b represents the offset, x,y represents the training sample, hW,bx represents the final output, and f· represents the activation function. Replace the relationship between nl−1 and nl in the formula with the relationship between l and l+1 to obtain the following formula (15):(15)δil=∑j=1sl+1Wjilδjl+1f′zil.By using the above formula, the residual of each unit can be calculated so as to further calculate the partial derivative based on variables such as weights as the following formula (16) [19]:(16)∂∂WijlJW,b;x,y=ajlδil+1.∂∂bilJW,b;x,y=δil+1..Thus, the weight change process can be obtained as follows:(17)Wij=Wij+ηajlδil+1.The change process of the offset term is [20]:(18)bi=bi+ηδil+1.Thus, DNN learning and training can be realized [21].


## 3.1. Big Data Processing and Modeling

Searching for negative websites is important, based on the analysis of the text, i. e., the number of extractions and physical visits, such as the number, mean, and variance of URL parameters, distribution of attributes, and frequency of visits. At present, there is a lack of sample data based on security protection, and few samples with labels. Therefore, data processing and modeling are required, including data acquisition, data preprocessing (data cleaning, data sampling, feature extraction), numerical analysis, and behavior decision making [11].In the computer, any information is represented by 0 and 1 binary sequences. For example, all characters (including letters, Chinese characters, English words, and other languages) have a code; images are also represented by digital files. Therefore, in this paper, the big data log text is converted into numerical data and represented by a matrix so as to use the image processing method for data processing and analysis. That is, the attack message is converted into a matrix similar to image data, i. e. pixels, and the string sequence samples are also converted into vectors with corresponding dimension values. Further operations such as matrix correlation, dimension reduction, clustering, and PCA can be obtained, and then the artificial intelligence method is used for user behavior analysis, network traffic analysis, and fraud detection [12].


### 3.1.1. Corpus Big Data Acquisition

The data used for the experiment include two types of big data:① positive sample big data (with attack behavior), which is obtained by crawling from the website http://xssed.com/ using crawler tools, and is composed of payload data; ② in order to reflect the particularity and universality of negative sample big data (normal network requests), two pieces of data were collected, one from the access log big data of our network center from May to December last year, and the other from various network platforms through web crawlers. They are all unprocessed corpus big data [13].


### 3.1.2. Big Data Processing

The continuous bag of words model (cbow), a word2vec tool based on neural network, is used to realize big data corpus processing, data cutting, word segmentation, and word vectorization. The one hot encoded word vector is mapped to a distributed word vector; this reduces dimensionality and sparsity. At the same time, the correlation degree of any word can be obtained by calculating the Euclidean distance or cosine of the included angle between vectors [14]. The specific treatment process is as follows:(1)
First, traverse the dataset, replace all the numbers with 0, and replace http/, http/, HTTPS/, HTTPS with http://; secondly, word segmentation is carried out according to HTML tags, JavaScript function body, http://,and parameter rules; build vocabulary based on diary documents and then encode words independently [15].(2)
The structure of word vectorization model based on neural network is constructed, including input layer, projection layer, and output layer. The model is trained with input samples to obtain distributed word vectors.(3)
The positive sample word set is counted, and 3,000 words with the highest word frequency are used to form a thesaurus. The others are marked as com. In this paper, the feature vector distribution is set to 128 dimensions, the maximum dimension of the distance between the current word and the predicted word is 5, the noise is 64, and 5 iterations are performed. Because the character length of each data is different, the maximum character length is taken as the standard, and if it is insufficient, it is filled with -1. When designing labels for datasets, one hot coding is used. The positive sample labels that belong to attack samples are represented by 1, and the negative sample labels that belong to normal network requirements are represented by 0.Through the above methods, a total of 40,637 positive sample datasets, 105,912 negative sample datasets, and 200,129 negative sample datasets are obtained, which are large in number and high in computational complexity. In order to improve the training results, the positive samples and two types of negative samples are mixed together, and randomly divided into training set and test set, with the quantity ratio of 7 : 3.


## 3.1.1. Corpus Big Data Acquisition

The data used for the experiment include two types of big data:① positive sample big data (with attack behavior), which is obtained by crawling from the website http://xssed.com/ using crawler tools, and is composed of payload data; ② in order to reflect the particularity and universality of negative sample big data (normal network requests), two pieces of data were collected, one from the access log big data of our network center from May to December last year, and the other from various network platforms through web crawlers. They are all unprocessed corpus big data [13].


## 3.1.2. Big Data Processing

The continuous bag of words model (cbow), a word2vec tool based on neural network, is used to realize big data corpus processing, data cutting, word segmentation, and word vectorization. The one hot encoded word vector is mapped to a distributed word vector; this reduces dimensionality and sparsity. At the same time, the correlation degree of any word can be obtained by calculating the Euclidean distance or cosine of the included angle between vectors [14]. The specific treatment process is as follows:(1)
First, traverse the dataset, replace all the numbers with 0, and replace http/, http/, HTTPS/, HTTPS with http://; secondly, word segmentation is carried out according to HTML tags, JavaScript function body, http://,and parameter rules; build vocabulary based on diary documents and then encode words independently [15].(2)
The structure of word vectorization model based on neural network is constructed, including input layer, projection layer, and output layer. The model is trained with input samples to obtain distributed word vectors.(3)
The positive sample word set is counted, and 3,000 words with the highest word frequency are used to form a thesaurus. The others are marked as com. In this paper, the feature vector distribution is set to 128 dimensions, the maximum dimension of the distance between the current word and the predicted word is 5, the noise is 64, and 5 iterations are performed. Because the character length of each data is different, the maximum character length is taken as the standard, and if it is insufficient, it is filled with -1. When designing labels for datasets, one hot coding is used. The positive sample labels that belong to attack samples are represented by 1, and the negative sample labels that belong to normal network requirements are represented by 0.Through the above methods, a total of 40,637 positive sample datasets, 105,912 negative sample datasets, and 200,129 negative sample datasets are obtained, which are large in number and high in computational complexity. In order to improve the training results, the positive samples and two types of negative samples are mixed together, and randomly divided into training set and test set, with the quantity ratio of 7 : 3.


## 3.2. Algorithm Design

### 3.2.1. Word Vectorization Algorithm Design

Cbow is used to realize word vector, that is, the probability of current word occurrence is predicted with known context words [16]. To this end, it is necessary to maximize the log likelihood function as follows (1):(1)L=∑w∈Clogpw|Contextw,where w represents the words in corpus C, which can be regarded as a multiclassification problem, and the multiclassification is composed of two classifications, so the hierarchical softmax method can be used [17]. First, we calculate the conditional probability of w, and the formula is as follows (2):(2)pw|Contextw=∏j=2lwpdjw|Xw,θj−1w,where pw means path; lw indicates the number of nodes; p1w, p2w,…, plww represents each node; d2w,d3w,…,dlww∈0,1 represents the code of word w; djw represents the code corresponding to the node in the path; θ1w,θ2w,…,θlw−1w∈Rm represents the parameter vector corresponding to the nonleaf node on the path. Each term on the right in (2) is a logistic regression to obtain (3):(3)pdjw|Xw,θj−1w=σXwTθj−1wdjw=01−σXwTθj−1wdjw=1.Sinced only takes 0 and 1, (3) can be expressed in exponential form as the following (4):(4)pdjw|Xw,θj−1w=σXwTθj−1w1−djw.1−σXwTθj−1wdjw.Substituting (4) into (1) yields (5):(5)L=∑w∈Clog∏j=2lwσXwTθj−1w1−djw⋅1−σXwTθj−1wdjw=∑w∈C∑j=2lw1−djw⋅logσXwTθj−1w+djw⋅log1−σXwTθj−1w.Each item in (5) can be recorded as the following (6):(6)Lw,j=1−djw⋅logσXwTθj−1w+djw⋅log1−σXwTθj−1w.To maximize (5) composed of the sum of polynomials, each term can be maximized respectively, i. e., (6). The random gradient method is used for two parameters, one is the parameter vector θj−1w of each node, and the other is the input Xw of the output layer. Calculate the partial derivatives respectively to obtain the following (7):(7)∂Lw,j∂θj−1w=∂∂θj−1w1−djw⋅logσXwTθj−1w+djw⋅log1−σXwTθj−1w,where σx is the sigmoid function. So, σ′x=σx1−σx, substituting into (7) can get (8):(8)1−djw1−σXwTθj−1wXw−djwσXwTθj−1wXw=1−djw−σXwTθj−1wXw.Finally, the iterative evaluation ofθj−1w is realized as follows:(9)θj−1w≔θj−1w+η1−djw−σXwTθj−1wXw.where η is the learning rate. From (6), it can be seen that Xw and θj−1w are symmetric, so we can get that the partial derivative about Xw is the following (10):(10)∂Lw,j∂Xw=1−djw−σXwTθj−1wθj−1w.SinceXw is the sum of the word vectors of the context, the entire updated value is applied to the word vectors of each word of the context during processing:(11)vw˜≔vw˜+η∑j=2lw∂Lw,j∂Xww˜∈Contextw,where vw˜ represents the context word vector.Based on the above main algorithms, the model is established, and the word vector can be obtained by taking the original corpus as the input.


### 3.2.2. Deep Neural Network Algorithm Design

Compared with traditional neural networks or other ml algorithms, deep neural networks show excellent performance; especially for big data, it has the advantages of more identification, stronger robustness, and better generalization. Therefore, a deep neural network algorithm is designed to realize security protection detection, and the big data training model is adopted [18]. The mean square error during training can be expressed as the following equation (12):(12)jw,b=1m∑i=1mjw,b;xi,yi+λ2∑l=1nl−1∑j=1sl+1wjil2=1m∑i=1m12hw,bxi−yi2+λ2∑i=1nl−1∑j=1sl+1wjil2.In order to calculate the optimization parameters, the gradient descent method is used to minimize the function. Let the obtained partial derivatives be called the residual of each unit, and recorded asδil. The residual of the last layer (output layer) unit can be obtained as follows (13):(13)δinl=∂∂zinlJw,b;x,y=∂∂zinl12y−hw,bx2=∂∂zinl12∑j=1snlyi−ajnl2=∂∂zinl12∑j=1snlyj−fzjnl2=−yi−fzinl⋅f′zinl=−yi−ainl⋅f′zinl.Next, whenl=nl−1,nl−2,…,21/2, the residuals of the units in each layer can be calculated. For example, the residuals of the units in l=nl−1 layer are as follows (14):(14)δinl−1=∂∂zinl−1Jw,b;x,y=∂∂zinl−12y−hw,bx2=∂∂zinl−112∑j=1snlyi−ajnl2=12∑j=1snl∂∂zinl−1yj−fzjnl2=∑j=1snl−yi−fzjnl⋅∂∂zinl−1fzjnl=∑j=1snl−yi−fzjnl⋅f′zjnl⋅∂zjni∂zinl−1=∑j=1snlδjnl⋅∂zjnl∂zinl−1=∑j=1snlδjnl⋅∂∂zinl−1∑j=1snlfzknl−1⋅Wjknl−1=∑j=1snlδjnl⋅Wjknl−1⋅f′zinl−1=∑j=1snlWjknl−1δjnlf′zinl−1,where W represents the weight, b represents the offset, x,y represents the training sample, hW,bx represents the final output, and f· represents the activation function. Replace the relationship between nl−1 and nl in the formula with the relationship between l and l+1 to obtain the following formula (15):(15)δil=∑j=1sl+1Wjilδjl+1f′zil.By using the above formula, the residual of each unit can be calculated so as to further calculate the partial derivative based on variables such as weights as the following formula (16) [19]:(16)∂∂WijlJW,b;x,y=ajlδil+1.∂∂bilJW,b;x,y=δil+1..Thus, the weight change process can be obtained as follows:(17)Wij=Wij+ηajlδil+1.The change process of the offset term is [20]:(18)bi=bi+ηδil+1.Thus, DNN learning and training can be realized [21].


## 3.2.1. Word Vectorization Algorithm Design

Cbow is used to realize word vector, that is, the probability of current word occurrence is predicted with known context words [16]. To this end, it is necessary to maximize the log likelihood function as follows (1):(1)L=∑w∈Clogpw|Contextw,where w represents the words in corpus C, which can be regarded as a multiclassification problem, and the multiclassification is composed of two classifications, so the hierarchical softmax method can be used [17]. First, we calculate the conditional probability of w, and the formula is as follows (2):(2)pw|Contextw=∏j=2lwpdjw|Xw,θj−1w,where pw means path; lw indicates the number of nodes; p1w, p2w,…, plww represents each node; d2w,d3w,…,dlww∈0,1 represents the code of word w; djw represents the code corresponding to the node in the path; θ1w,θ2w,…,θlw−1w∈Rm represents the parameter vector corresponding to the nonleaf node on the path. Each term on the right in (2) is a logistic regression to obtain (3):(3)pdjw|Xw,θj−1w=σXwTθj−1wdjw=01−σXwTθj−1wdjw=1.Sinced only takes 0 and 1, (3) can be expressed in exponential form as the following (4):(4)pdjw|Xw,θj−1w=σXwTθj−1w1−djw.1−σXwTθj−1wdjw.Substituting (4) into (1) yields (5):(5)L=∑w∈Clog∏j=2lwσXwTθj−1w1−djw⋅1−σXwTθj−1wdjw=∑w∈C∑j=2lw1−djw⋅logσXwTθj−1w+djw⋅log1−σXwTθj−1w.Each item in (5) can be recorded as the following (6):(6)Lw,j=1−djw⋅logσXwTθj−1w+djw⋅log1−σXwTθj−1w.To maximize (5) composed of the sum of polynomials, each term can be maximized respectively, i. e., (6). The random gradient method is used for two parameters, one is the parameter vector θj−1w of each node, and the other is the input Xw of the output layer. Calculate the partial derivatives respectively to obtain the following (7):(7)∂Lw,j∂θj−1w=∂∂θj−1w1−djw⋅logσXwTθj−1w+djw⋅log1−σXwTθj−1w,where σx is the sigmoid function. So, σ′x=σx1−σx, substituting into (7) can get (8):(8)1−djw1−σXwTθj−1wXw−djwσXwTθj−1wXw=1−djw−σXwTθj−1wXw.Finally, the iterative evaluation ofθj−1w is realized as follows:(9)θj−1w≔θj−1w+η1−djw−σXwTθj−1wXw.where η is the learning rate. From (6), it can be seen that Xw and θj−1w are symmetric, so we can get that the partial derivative about Xw is the following (10):(10)∂Lw,j∂Xw=1−djw−σXwTθj−1wθj−1w.SinceXw is the sum of the word vectors of the context, the entire updated value is applied to the word vectors of each word of the context during processing:(11)vw˜≔vw˜+η∑j=2lw∂Lw,j∂Xww˜∈Contextw,where vw˜ represents the context word vector.Based on the above main algorithms, the model is established, and the word vector can be obtained by taking the original corpus as the input.


## 3.2.2. Deep Neural Network Algorithm Design

Compared with traditional neural networks or other ml algorithms, deep neural networks show excellent performance; especially for big data, it has the advantages of more identification, stronger robustness, and better generalization. Therefore, a deep neural network algorithm is designed to realize security protection detection, and the big data training model is adopted [18]. The mean square error during training can be expressed as the following equation (12):(12)jw,b=1m∑i=1mjw,b;xi,yi+λ2∑l=1nl−1∑j=1sl+1wjil2=1m∑i=1m12hw,bxi−yi2+λ2∑i=1nl−1∑j=1sl+1wjil2.In order to calculate the optimization parameters, the gradient descent method is used to minimize the function. Let the obtained partial derivatives be called the residual of each unit, and recorded asδil. The residual of the last layer (output layer) unit can be obtained as follows (13):(13)δinl=∂∂zinlJw,b;x,y=∂∂zinl12y−hw,bx2=∂∂zinl12∑j=1snlyi−ajnl2=∂∂zinl12∑j=1snlyj−fzjnl2=−yi−fzinl⋅f′zinl=−yi−ainl⋅f′zinl.Next, whenl=nl−1,nl−2,…,21/2, the residuals of the units in each layer can be calculated. For example, the residuals of the units in l=nl−1 layer are as follows (14):(14)δinl−1=∂∂zinl−1Jw,b;x,y=∂∂zinl−12y−hw,bx2=∂∂zinl−112∑j=1snlyi−ajnl2=12∑j=1snl∂∂zinl−1yj−fzjnl2=∑j=1snl−yi−fzjnl⋅∂∂zinl−1fzjnl=∑j=1snl−yi−fzjnl⋅f′zjnl⋅∂zjni∂zinl−1=∑j=1snlδjnl⋅∂zjnl∂zinl−1=∑j=1snlδjnl⋅∂∂zinl−1∑j=1snlfzknl−1⋅Wjknl−1=∑j=1snlδjnl⋅Wjknl−1⋅f′zinl−1=∑j=1snlWjknl−1δjnlf′zinl−1,where W represents the weight, b represents the offset, x,y represents the training sample, hW,bx represents the final output, and f· represents the activation function. Replace the relationship between nl−1 and nl in the formula with the relationship between l and l+1 to obtain the following formula (15):(15)δil=∑j=1sl+1Wjilδjl+1f′zil.By using the above formula, the residual of each unit can be calculated so as to further calculate the partial derivative based on variables such as weights as the following formula (16) [19]:(16)∂∂WijlJW,b;x,y=ajlδil+1.∂∂bilJW,b;x,y=δil+1..Thus, the weight change process can be obtained as follows:(17)Wij=Wij+ηajlδil+1.The change process of the offset term is [20]:(18)bi=bi+ηδil+1.Thus, DNN learning and training can be realized [21].


## 4. Result Analysis

### 4.1. Experimental Data

Section3.2 implements the acquisition, processing, modeling, word segmentation, and word vectorization of corpus big data. A total of 40,637 positive sample datasets, 105,912 negative sample datasets, and 200,129 negative sample datasets were obtained; the number is large and the computational complexity is high. In order to improve the training effect, the two types of negative sample sets are merged with the positive sample set, respectively, and are randomly divided into the training set and the test set in the ratio of 7 : 3, which are recorded as the first and second large datasets [2, 22].


### 4.2. Experimental Results and Analysis

Based on DNN, the depth of 3, 4, 5, 6, and 7 layers are constructed, respectively, and different superparameters are designed, including sample block size, learning rate, and the number of different neurons contained in each layer. A dataset of word-sized vectors for the model used for training and testing experiments. In order to test the stability of the system, 20 experiments were carried out on each type of data. The results are as follows:(1)
Based on the different superparameters of each deep DNN design, the recognition rate obtained from 20 experiments on the class I big dataset. The lowest recognition rate is 0.9839, and the highest recognition rate is 0.9955. The recognition rate increases with the increase of training times and finally tends to be stable. The curve is shown in Figure2.(2)
Based on the different superparameters of each deep DNN design, the recognition rate obtained from 20 experiments on the class II large dataset. The minimum recognition rate is 0.9864 and the maximum recognition rate is 0.9990. The recognition rate increases with the increase of training times and finally tends to be stable. The curve is shown in Figure3.Figure 2
Recognition rate curve obtained from 20 experiments on class I large datasets.Figure 3
Recognition rate curve obtained from 20 experiments on class II large datasets.In addition, through experiments, it is found that the average recognition rate of each deep DNN for class I large dataset is about 99.44%, the variance is about 0.000002, and the standard deviation is about 0.001589, as shown in Table1.Table 1
Average recognition rate, variance, and standard deviation of each deep DNNS in 20 experiments on class I big datasets.
Recognition methodsAverage recognition rate (%)VarianceStandard deviationDepth 399.450.0000020.001589Depth 499.460.0000010.000944Depth 599.440.0000010.001243Depth 699.300.0000050.002239Depth 799.250.0000050.002279Similarly, through experiments, the average recognition rate of each deep DNN for class II large dataset is about 99.77%, the variance is about 0.000006, and the standard deviation is about 0.002427, as shown in Table2.Table 2
Average recognition rate, variance, and standard deviation of each deep DNNS in 20 experiments on class II big datasets.
Recognition methodsAverage recognition rate (%)VarianceStandard deviationDepth 399.740.0000050.002268Depth 499.780.0000050.002206Depth 599.770.0000060.002427Depth 699.720.0000120.003550Depth 799.770.0000050.002396The change process curve of average absolute error is obtained, as shown in Figure4. It can be seen that the average absolute error decreases and tends to the minimum stable value with the progress of training.Figure 4
Variation curve of average absolute error.


## 4.1. Experimental Data

Section3.2 implements the acquisition, processing, modeling, word segmentation, and word vectorization of corpus big data. A total of 40,637 positive sample datasets, 105,912 negative sample datasets, and 200,129 negative sample datasets were obtained; the number is large and the computational complexity is high. In order to improve the training effect, the two types of negative sample sets are merged with the positive sample set, respectively, and are randomly divided into the training set and the test set in the ratio of 7 : 3, which are recorded as the first and second large datasets [2, 22].


## 4.2. Experimental Results and Analysis

Based on DNN, the depth of 3, 4, 5, 6, and 7 layers are constructed, respectively, and different superparameters are designed, including sample block size, learning rate, and the number of different neurons contained in each layer. A dataset of word-sized vectors for the model used for training and testing experiments. In order to test the stability of the system, 20 experiments were carried out on each type of data. The results are as follows:(1)
Based on the different superparameters of each deep DNN design, the recognition rate obtained from 20 experiments on the class I big dataset. The lowest recognition rate is 0.9839, and the highest recognition rate is 0.9955. The recognition rate increases with the increase of training times and finally tends to be stable. The curve is shown in Figure2.(2)
Based on the different superparameters of each deep DNN design, the recognition rate obtained from 20 experiments on the class II large dataset. The minimum recognition rate is 0.9864 and the maximum recognition rate is 0.9990. The recognition rate increases with the increase of training times and finally tends to be stable. The curve is shown in Figure3.Figure 2
Recognition rate curve obtained from 20 experiments on class I large datasets.Figure 3
Recognition rate curve obtained from 20 experiments on class II large datasets.In addition, through experiments, it is found that the average recognition rate of each deep DNN for class I large dataset is about 99.44%, the variance is about 0.000002, and the standard deviation is about 0.001589, as shown in Table1.Table 1
Average recognition rate, variance, and standard deviation of each deep DNNS in 20 experiments on class I big datasets.
Recognition methodsAverage recognition rate (%)VarianceStandard deviationDepth 399.450.0000020.001589Depth 499.460.0000010.000944Depth 599.440.0000010.001243Depth 699.300.0000050.002239Depth 799.250.0000050.002279Similarly, through experiments, the average recognition rate of each deep DNN for class II large dataset is about 99.77%, the variance is about 0.000006, and the standard deviation is about 0.002427, as shown in Table2.Table 2
Average recognition rate, variance, and standard deviation of each deep DNNS in 20 experiments on class II big datasets.
Recognition methodsAverage recognition rate (%)VarianceStandard deviationDepth 399.740.0000050.002268Depth 499.780.0000050.002206Depth 599.770.0000060.002427Depth 699.720.0000120.003550Depth 799.770.0000050.002396The change process curve of average absolute error is obtained, as shown in Figure4. It can be seen that the average absolute error decreases and tends to the minimum stable value with the progress of training.Figure 4
Variation curve of average absolute error.


## 5. Conclusion

In this paper, we use the image like processing method to process the word vector of big data in the access traffic corpus and realize the XSS intrusion intelligent detection for big data with the proposed intelligent algorithm. Firstly, based on the unstructured characteristics of traffic corpus data, image like processing methods are cleverly used for data acquisition, cleaning, sampling, and feature extraction; secondly, an algorithm based on neural network is designed to realize word vectorization of corpus big data; then, through theoretical analysis and verification, a variety of different deep neural network intelligent detection algorithms are proposed; finally, repeated experiments are carried out, different super parameters are designed, and the results such as maximum recognition rate, minimum recognition rate, mean value, variance, standard deviation, recognition rate change process curve, and average absolute error change process curve are obtained. It is proved that the image processing XSS intrusion intelligent detection system studied in this paper has the advantages of high recognition rate, good stability, and excellent overall performance. In order to better handle big data, we will continue to explore intelligent intrusion detection based on parallelization of cloud computing clusters in the future.



---

*Source: 6757104-2022-08-17.xml*