摘要
为了解决普通深度学习模型存在的难以区分信息重要性差异,以及单一注意力机制存在的关注维度单一的问题,文中提出了一种基于卷积神经网络和多注意力机制的模型对XSS攻击进行检测。首先,将经过word2vec转换后的数据输入到卷积神经网络提取局部特征;然后,使用自注意力模块学习数据的长距离依赖关系,并加强模型对序列维度上重要特征的关注;接着,经过通道注意力模块从通道维度对不同的通道特征图加权;之后,将经注意力模块处理过的特征输入到池化层进行下采样处理,并使用Dropout层提高模型的泛化能力;最后,利用提取到的特征对样本进行分类。使用测试数据集对文中提出的模型进行实验,结果显示,该模型对XSS攻击的检测效果良好,准确率与F1值相比其他深度学习模型有一定程度提升。
In order to solve the problems that ordinary deep learning models are difficult to distinguish the difference of the importance of information,and the attention dimension of single attention mechanism is single,a model based on convolutional neural network and multi-attention mechanism is proposed to detect XSS attacks.Firstly,the data converted by word2vec are input into convolutional neural network to extract local features.Then,the self attention module is used to learn the long-distance dependencies of the data and strengthen the model’s attention on the important features in the sequence dimension.Next,through the channel attention module,different channel feature maps are weighted from the channel dimension.After that,the features processed by the attention modules are input into the pooling layer for down-sampling,and the Dropout layer is used to improve the generalization ability of the model.Finally,the extracted features are used to classify the samples.The test data set is used to test the proposed model,the results show that the model has a good detection effect on XSS attacks,the accuracy and F1 values are improved to a certain extent compared with other deep learning models.
作者
关慧
曹同洲
GUAN Hui;CAO Tong-zhou(School of Computer Science and Technology,Shenyang University of Chemical Technology,Shenyang 110142,China;Liaoning Province Key Laboratory of Industrial Intelligence Technology on Chemical Process,Shenyang 110142,China)
出处
《计算机技术与发展》
2023年第4期175-181,共7页
Computer Technology and Development
基金
辽宁省2021年度教育科学研究经费项目(LJKZ0434)。