A mobile application recognition method based on CNN-GRU

Through the deep learning method based on CNN-GRU, the spatial and timing features of mobile applications are automatically extracted, and the problems of cumbersome and low recognition accuracy in traditional methods are solved, and higher recognition accuracy and simplified operation process are achieved. .

CN114724020BActive Publication Date: 2024-12-06NANJING UNIV OF POSTS & TELECOMM
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210392757.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-14
Publication Date
2024-12-06
Estimated Expiration
2042-04-14

AI Technical Summary

Technical Problem

In the prior art, mobile application recognition methods require cumbersome manual feature extraction process, and the recognition accuracy of the model is not high, making it difficult to effectively identify ciphertext traffic based on encryption technology.

Method used

Using deep learning method based on CNN-GRU, the spatial features of mobile application traffic are extracted through convolutional neural networks, and the timing features are extracted using gated loop units. Combined with the detection results of the full connection layer, automatic feature extraction and improvement are achieved. Identification accuracy.

Benefits of technology

Automatic feature extraction is realized, the accuracy of mobile application recognition is improved, manual operation is simplified, the dependence on prior knowledge is reduced, and network performance is enhanced through lightweight gated loop units and improved activation functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114724020B_ABST
    Figure CN114724020B_ABST
Patent Text Reader

Abstract

The present invention discloses a mobile application recognition method based on CNN-GRU. The method comprises the following steps: obtaining a mobile application data set, performing a preprocessing operation on the data set, and constructing a detection model. The detection model comprises a convolutional neural network model CNN and a gated recurrent unit GRU. The convolutional neural network model CNN is used for spatial features, and the gated recurrent unit GRU is used for extracting temporal features. Finally, the detection result is output through softmax, and the detection model is trained. The present invention simplifies operations such as manual feature extraction, does not require extremely strong prior knowledge, and has good accuracy in mobile application recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a mobile application recognition method based on CNN-GRU, belonging to the technical fields of network security and deep learning. Background Art

[0002] In recent years, the mobile internet has become an indispensable component of people's daily lives and work. Providing differentiated QoS services for different mobile application types has become a key task for network operations departments. For security reasons such as privacy protection, most mobile applications utilize encryption technology, which increases the challenge of identifying mobile applications. Therefore, mobile application type identification technology based on encrypted traffic has become a research hotspot in academia and industry both domestically and internationally.

[0003] Convolutional Neural Networks (CNNs) are a type of feedforward neural network with a deep structure that incorporates convolutional computations. They are a representative algorithm in deep learning and are often used to analyze visual images. CNNs were invented by renowned computer scientist Yann LeCun, who first applied them to the MNIST handwriting recognition task in the 1980s. Compared to traditional neural networks, CNNs have three fundamental concepts that also serve as improvements: local receptive field, weight sharing, and pooling.

[0004] Compared to other neural network models like CNNs, RNNs have the advantage of being able to process time series data. Their training principle is a backpropagation mechanism. However, RNNs also have significant shortcomings. They can cause exploding and vanishing gradients during parameter learning. Therefore, RNNs cannot analyze long sequences of data and can only memorize short-term data, making them incapable of predicting long-term sequences. Hochreiter et al. proposed an improved recurrent neural network, the Long Short-Term Memory (LSTM), to address the issue of long-term dependencies. However, LSTMs have many parameters and converge slowly. Cho et al. proposed the GRU. The GRU simplifies and improves upon the LSTM, with minor structural differences. While the LSTM has three gates, the GRU lacks cell states and has two gates: an update gate and a reset gate. The update gate represents the degree to which the previous moment's information influences the current state; a larger value indicates a greater influence. The reset gate represents the degree to which the previous moment's information has been disregarded; the more information disregarded, the lower the value. This structure has proven effective in a variety of applications. Its simpler structure and fewer parameters significantly improve the GRU's operational efficiency compared to the LSTM. Summary of the Invention

[0005] In order to solve the problems existing in the prior art, the present invention proposes a mobile application recognition method based on CNN-GRU, which can overcome the problems that traditional machine learning methods require a tedious manual feature extraction process and the recognition accuracy of the model is not high.

[0006] To achieve the above objectives, the present invention adopts a technical solution: a CNN-GRU-based mobile application identification method that uses a deep learning algorithm to extract the spatial and temporal features of mobile application traffic to complete the identification of mobile applications, including the following steps:

[0007] Step 1: Obtain a mobile application dataset to obtain network traffic data for mobile application identification.

[0008] Step 2: Preprocess the network dataset so that it retains its original semantics while conforming to the input of the neural network to obtain a training dataset.

[0009] Step 3: Build a detection model. The detection model includes a convolutional neural network model CNN, a gated recurrent unit GRU, and a fully connected layer. The convolutional neural network model CNN is used for spatial feature extraction, and the gated recurrent unit GRU model is used for temporal feature extraction. Finally, the detection result is output through the fully connected layer.

[0010] The overall neural network model consists of a sequentially connected convolutional layer (C1), a pooling layer (S1), a convolutional layer (C2), a pooling layer (S2), a fully connected layer (D1), GRU1, GRU2, and a fully connected layer (D2). Conv1: This convolutional layer has 32 convolution kernels, each 5*5 in size, with a sliding step of 1. The Leaky Relu function is used to nonlinearly map the output features, resulting in a mapping dimension of 32. The feature map after this layer is 32*21*21. MaxPooling1: This pooling layer has a size of 2*2, a sliding step of 2, and a maximum pooling strategy. The feature map after this layer is 32*11*11. Conv2: This convolutional layer has 64 convolution kernels, each 3*3 in size, with a sliding step of 1. The Leaky Relu function is used to nonlinearly map the output features, resulting in a feature map of 64*9*9. MaxPooling2: This pooling layer has a size of 2*2, a sliding stride of 2, and uses a max pooling strategy. The feature map after this layer is 64*5*5. Dense: The fully connected layer D1 has 128 neurons, and uses the Leaky Relu function followed by a dropout strategy to discard 20% of the features. The GRU1 has 92 neurons, and the dropout strategy discards 20% of the features. The GRU2 has 92 neurons, and the dropout strategy discards 30% of the features. The fully connected layer D2 has 128 neurons, and uses the Leaky Relu function followed by a dropout strategy to discard 30% of the features. Softmax classification output.

[0011] Step 4: Use the training data set to train the recognition model. One round of network training consists of a forward conduction process and a backpropagation process. First, the learned feature values ​​are passed layer by layer through the entire recognition model, and then the prediction of the recognition model is given. The loss value between the predicted value and the true value is calculated through the cross-entropy loss function. This is a round of forward conduction. The backpropagation process will optimize and update the parameters in the entire detection model based on the loss value. Finally, a trained recognition model is obtained, and then the recognition model after training and optimization is used for mobile application recognition.

[0012] The present invention utilizes the advantages of convolutional neural networks in image processing to extract the spatial features of mobile application traffic, and utilizes the advantages of GRU in contextual relationship processing to extract the temporal features of mobile application traffic, thereby improving the accuracy of mobile application recognition.

[0013] Furthermore, the mobile application dataset used in step 1 is captured by Wireshark and is authentic.

[0014] Furthermore, the preprocessing operation in step 2 is to preprocess the network data in the data set input into the convolutional neural network model CNN.

[0015] Furthermore, in step 2, the network data input to the convolutional neural network model (CNN) in the dataset is preprocessed as follows: the first five packets of each network flow are intercepted, each of which is 60 bytes long. If the length is insufficient, 0x00 is added to the end. Finally, the data is converted into a 25x25 two-dimensional grayscale image.

[0016] Furthermore, step 3 uses the Leaky Relu() activation function. This invention improves the activation function and uses the Leaky Relu() activation function to address the neuron "death" problem. Leaky ReLU is very similar to ReLU, differing only in the portion where the input is less than 0. Whereas ReLU inputs less than 0 are all zero, Leaky ReLU inputs less than 0 are negative and have a small gradient. This is a high-performance neural network activation function.

[0017] Furthermore, softmax() is used as the classification function in step 4. It can map the output of the network into values ​​between (0, 1), and the cumulative sum of these values ​​is 1 (satisfying the property of probability). Then the node with the largest probability value (that is, the largest corresponding value) is the final prediction target of the network.

[0018] Furthermore, in step 4, a cross entropy loss function (CrossEntropyLoss) is used as a loss function to calculate the loss value.

[0019] Furthermore, the Adam optimizer is used in step 4. Essentially, the Adam optimizer is RMSprop with a momentum term. It uses the first- and second-order moment estimates of the gradient to dynamically adjust the learning rate of each parameter. Its main advantage is that after bias correction, the learning rate for each iteration remains within a defined range, resulting in relatively stable parameter updates during training.

[0020] Compared with the prior art, the present invention has the following beneficial effects:

[0021] (1) The present invention utilizes the powerful autonomous learning ability of deep learning algorithms to automatically extract features through iterative training of network models. Compared with traditional machine learning methods, it eliminates the tediousness of manual feature extraction and does not require strong prior knowledge.

[0022] (2) The present invention extracts two kinds of spatial and temporal features of mobile application traffic, namely, self-features and contextual relationship features for detection. With the help of convolutional neural networks and gated recurrent units that have processing advantages for the above two kinds of features respectively, it has a higher accuracy rate than a single feature.

[0023] (3) The present invention uses gated recurrent units to replace traditional long-term and short-term neural networks, which is more lightweight.

[0024] (4) The present invention improves the use of Leaky ReLu() activation function to further enhance network performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a schematic diagram of the overall process of the present invention.

[0026] Figure 2 This is the specific network model structure of the present invention. DETAILED DESCRIPTION

[0027] The embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and are not to be construed as limiting the present invention.

[0028] A mobile application recognition method based on CNN-GRU, such as Figure 1 As shown in the figure, deep learning algorithms are used to extract the spatial and temporal features of mobile applications and perform network training to complete the identification of mobile applications. It mainly includes four stages: data set collection, data preprocessing, network model construction, and network model training.

[0029] 1. Dataset Collection,

[0030] The data set used in this experiment is captured using the Wireshark packet capture tool, including eight application traffic types such as QQ, WeChat, and Weibo.

[0031] 2. Data preprocessing,

[0032] The network data input to the convolutional neural network model (CNN) in the dataset was preprocessed as follows: the first five packets of each network flow were intercepted, each of which was 60 bytes long. If the length was insufficient, 0x00 was added to the end. Finally, the data was converted into a 25x25 two-dimensional grayscale image.

[0033] Data normalization: For the aforementioned traffic, each byte has a value range of [0, 255]. This is constructed into a vector, with each byte corresponding to a component. Each component is divided by 255 to normalize the value range to [0, 1]. This approach has the advantage of aligning the data distribution evenly, even though the original feature data may have significantly different ranges. Normalization reduces this distribution, leading to faster network learning and convergence, and less prone to non-convergence or vanishing gradients.

[0034] Labeling: After the previous processing, the sample needs to be labeled to indicate which type of network traffic it belongs to.

[0035] 3. Network model construction,

[0036] Construct a detection model, which includes a convolutional neural network model CNN and a gated recurrent unit GRU. The convolutional neural network model CNN is used for spatial feature extraction, and the gated recurrent unit GRU is used for temporal feature extraction. Finally, the detection results are output through the fully connected layer.

[0037] Improved convolutional neural network model uses GRU instead of LSTM, which has fewer parameters and better detection performance under the same training effect. And the activation function is improved, using Leaky Relu() activation function to solve the problem of neuron "death". The specific detection model structure is as follows Figure 2 As shown:

[0038] CNN-GRU model structure:

[0039] 1) Convolutional layer 1 C1: uses a 5x5 convolution kernel, 32 channels, and an output of 32x21x21;

[0040] 2) Pooling layer 1 S1: Perform a 2x2 maximum pooling operation, and the output is 32x11x11;

[0041] 3) Convolutional layer 2 C2: uses a 3x3 convolution kernel, 64 channels, and an output of 64x9x9;

[0042] 4) Pooling layer 2 S2: Perform a 2x2 maximum pooling operation, and the output is 64x5x5;

[0043] 5) Fully connected layer D1: consists of 128 neurons and is fully connected to the S2 layer;

[0044] 6) GRU layer G1: consists of 92 neurons and is fully connected to the D1 layer;

[0045] 7) GRU layer G2: consists of 92 neurons and is connected to the G1 layer;

[0046] 4. Network training process

[0047] (1) Classification function selection: This invention uses softmax() as the activation function. The softmax() function is usually used in multi-classification tasks as the final "classifier"

[0048] (2) Loss function selection: This paper adopts the cross entropy loss function (CrossEntropyLoss), which is

[0049] (3) Optimization function selection: This paper uses the Adam optimizer, which is essentially RMSprop with a momentum term. It uses the first-order and second-order moment estimates of the gradient to dynamically adjust the learning rate of each parameter. Its main advantage is that after bias correction, the learning rate of each iteration has a fixed range, which makes the parameter update relatively stable during the training process.

[0050] A round of network training consists of a forward propagation pass and a backpropagation pass. First, the learned feature values ​​are propagated layer by layer throughout the model, resulting in a prediction from the detection model. The cross-entropy loss function is then used to calculate the loss between the predicted value and the true value. This completes the forward propagation pass. The backpropagation (BP) process uses the Adam optimization function to optimize and update the parameters of the entire detection model based on this loss.

[0051] The finally trained recognition model can be used for mobile application recognition. The present invention uses a convolutional neural network to extract spatial features, and then uses a GRU to extract temporal features to capture contextual connections, improves the activation function and adopts a lighter-weight gated recurrent unit to improve the accuracy of mobile application recognition.

[0052] This method uses deep learning methods to extract features and perform detection via the network itself during training. Compared to traditional machine learning methods, this method simplifies manual feature extraction and eliminates the need for strong prior knowledge, resulting in high accuracy in mobile app recognition.

[0053] It should be noted that the above-mentioned embodiments illustrate rather than limit the invention and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims.

Claims

1. A mobile application recognition method based on CNN-GRU, comprising the following steps: Step 1, obtain a mobile application data set to obtain the mobile application traffic data used; Step 2: preprocess the mobile application dataset so that it retains its original semantics and conforms to the input of the neural network to obtain a training dataset; Step 3, constructing a detection model, the detection model includes a convolutional neural network model CNN, a gated recurrent unit GRU model and a fully connected layer; the convolutional neural network model CNN is used for spatial feature extraction, the gated recurrent unit GRU is used for temporal feature extraction, and the detection result is output through the fully connected layer; The overall neural network model includes a sequentially connected convolutional layer C1, a pooling layer S1, a convolutional layer C2, a pooling layer S2, a fully connected layer D1, GRU1, GRU2, and a fully connected layer D2; The input of spatial feature learning is k data packet images, and the output is network flow spatial features, i.e., k data packet vectors; Conv1: The number of convolution kernels of this convolution layer is 32, the size of a single convolution kernel is 5*5, the sliding step is 1, and the Relu function is used to perform nonlinear mapping on the result. The mapping dimension of the output feature is 32, and the feature map after this layer is 32*21*21; MaxPooling1: The size of this pooling layer is 2*2, the sliding step is 2, and the maximum pooling strategy is used. The feature map after this layer is 32*11*1 1; Conv2: The number of convolution kernels in this convolution layer is 64, the size of a single convolution kernel is 3*3, the sliding step is 1, and the Relu function is used to perform nonlinear mapping on the result. The feature map after this layer is 64*9*9; MaxPooling2: The size of this pooling layer is 2*2, the sliding step is 2, and the maximum pooling strategy is used. The feature map after this layer is 64*5*5; Dense: The number of neurons in the fully connected layer is 128, and the dropout strategy is used after using the Relu function to discard 20% of the features; The convolutional neural network learns the spatial features of each traffic data packet. After information extraction, each data packet is one-hot encoded. The data packet image obtained after encoding conversion is processed by the model convolution layer and pooling layer, and finally a vector containing the unique features of the data packet is obtained. GRU takes the feature mapping vector output by CNN as input and outputs the learning of network time series features. The input is composed of k feature mapping vectors and the output is the network flow time series feature vector. Step 4: Use the training data set to train the detection model. One round of network training consists of a forward conduction process and a back propagation process. First, the learned feature values ​​are transmitted layer by layer through the entire detection model, and then the prediction of the detection model is given. The loss value between the predicted value and the true value is calculated through the cross entropy loss function. This is a round of forward conduction. The back propagation process will optimize and update the parameters in the entire detection model according to the loss value. Finally, a trained detection model is obtained, and then the detection model after training and optimization is used for mobile application recognition.

2. The mobile application identification method based on CNN-GRU according to claim 1, characterized in that: The mobile application data set used in step 1 is traffic collection performed using the wireshark packet capture tool, and the collected data at least includes application traffic of QQ, WeChat, and Weibo.

3. The mobile application identification method based on CNN-GRU according to claim 1, characterized in that: The preprocessing operation in step 2 includes preprocessing the network data input into the convolutional neural network model CNN in the network data set.

4. The mobile application identification method based on CNN-GRU according to claim 3 is characterized in that: In the step 2, the network data input into the convolutional neural network model CNN in the network data set is preprocessed as follows: the bytes of the traffic data in the data set are grouped into data packets, and the data packets are grouped into network flows. The first 5 data packets are intercepted for each network flow, and each data packet takes 60 bytes. If the length is not enough, 0x00 is added at the end.

5. The mobile application identification method based on CNN-GRU according to claim 1, characterized in that: In step 3, Leaky ReLu() activation function is used for activation.

6. The mobile application identification method based on CNN-GRU according to claim 1, characterized in that: In step 4, softmax() is used as the classification function.

7. The mobile application identification method based on CNN-GRU according to claim 1, characterized in that: In step 4, the cross entropy loss function is used as the loss function to calculate the loss value.

8. The mobile application identification method based on CNN-GRU according to claim 1, characterized in that: In step 4, the Adam optimizer is used for optimization.

Citation Information

Patent Citations

  • CNN-GRU hierarchical neural network-based network intrusion detection method

    CN112839034A

  • Botnet detection method based on CNN-LSTM fusion

    CN112995150A

  • Botnet traffic detection method based on parallel neural network

    CN113364787A

  • A deep learning-based rural waste classification method

    JP6980958B1