摘要
相比于传统机器学习算法,卷积神经网络“端到端”的黑盒特性使其内部工作机制缺乏透明性和可解释性,导致其在某些安全性要求较高的领域受到一定限制。为此,提出一种基于注意力机制的卷积神经网络可视化方法,用于可视化解释卷积神经网络中间层所学特征。该方法首先将注意力机制添加到网络结构中,跟随网络一起训练;然后,获取训练后模型的最高层特征图,并使用双线性插值将其放大到输入图像大小;最后,将处理后的特征图与输入图像叠加形成热力图,用于定位输入图像的关键区域,实现对卷积神经网络所学特征的理解和解释。在CIFAR10数据集上实验结果表明,相比于直接对特征图进行可视化,基于注意力机制的可视化方法能够更准确地定位目标的关键特征,从而帮助理解卷积神经网络所学特征。
Compared with traditional machine learning algorithms,the end-to-end black box nature of convolutional neural networks results in the lack of transparency and interpretability in the internal working mechanism,leading to restrictions in certain areas with high security requirements.To this end,this paper proposes a visualization method of convolutional neural network based on attention mechanism,which is used to visually explain the feature representation learned by the middle layer of convolutional neural network.First,this method adds the attention mechanism to the network structure and makes it train with the network.Then,the last layer feature map of the trained model is obtained and the bilinear interpolation is used to enlarge it to the input image size.Finally,the processed feature map is superimposed with the input image to form a final heatmap,which is used to locate the key area of the input image and realize the understanding and interpretation of the features learned by the convolutional neural network.Experimental results on CIFAR10 dataset show that,compared to directly visualizing the feature map,the visualization method based on the attention mechanism can accurately locate the key features of the object,thus helping understand the learned features of the convolutional neural network.
作者
司念文
常禾雨
张文林
屈丹
SI Nianwen;CHANG Heyu;ZHANG Wenlin;QU Dan(Information Engineering University,Zhengzhou 450001,China)
出处
《信息工程大学学报》
2021年第3期257-263,共7页
Journal of Information Engineering University
基金
国家自然科学基金资助课题(61673395)。
关键词
卷积神经网络
可解释性
可视化
注意力机制
热力图
deep neural network
interpretability
visualization
attention mechanism
heatmap