At present, there are still some problems in the multi-label classification algorithm based on deep learning, such as the relevance between labels needs to be improved, and how to solve the problem that small targets are more difficult to identify than large targets. In this paper, we propose a multi-label image classification algorithm that uses the split attention network ResNeSt for feature extraction and uses a dual-branch Transformer to query class labels. In addition, we use the cross-attention module in Transformer Decoder to extract the local features adaptively. On this basis, in order to enhance the classification effect of the Transformer module, we introduce BatchformerV2 to make the Transformer form a double-branch network. The mAP of the model on the COCO dataset is 88.4%, and the average precision on the VOC2007 dataset is 96.0%, which improves the accuracy of multi-label image classification to a certain extent.
本文引入了一种新的Transformer结构:BatchFormerV2。该模块提出了一种密集表示的样本学习方法,不仅具有空间注意,而且加入了批处理注意,实现了从图像级到像素级的表示。相比于Transformer需要大量图片进行训练而言,引入的BatchFormerV2模块可以缓解样本稀缺问题,这有利于多标签图像分类精度的提升,Transformer中注意力模块的输出 Z 表示为
式中:分别为查询矩阵、键矩阵和值矩阵,N为图像特征块的数量,C为嵌入维度;d为通道数。查询矩阵 Q 与键矩阵 K 内积,得到一个注意力矩阵,它表示了 Q 与 K 的相关程度,对该注意力矩阵进行归一化并通过softmax激活函数,然后点乘值矩阵 V 得到 Z。
CAOLihua, LIUWei, LIGuohui.Research and implementation of an image retrieval algorithm based on multiple primary colors[J].Journal of Computer Research and Development, 1999, 36(1): 96-100. (in Chinese)
[3]
ALKSASBEHM Z, AL-OMARIA H, ALQARALLEHB A Y,et al.Smart hand gestures recognition using K-NN based algorithm for video annotation purposes[J].Indonesian Journal of Electrical Engineering and Computer Science,2021,21(1):242-252.
[4]
CHENS, GUOZ, LIX,et al.Query2Set:single-to-multiple partial fingerprint recognition based on attention mechanism[J].IEEE Transactions on Information Forensics and Security,2022,17:1243-1253.
[5]
ZHUF, LIH, OUYANGW,et al.Learning spatial regularization with image-level supervisions for multi-label image classification[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition,2017:5513-5522.
[6]
CHENZ M, WEIX S, WANGP,et al.Multi-label image recognition with graph convolutional networks[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition,2019:5177-5186.
[7]
CHENT, XUM, HUIX,et al.Learning semantic-specific graph representation for multi-label image recognition[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision,2019:522-531.
[8]
YEJ, HEJ, PENGX,et al.Attention-driven dynamic graph convolutional network for multi-label image recognition[C]//European Conference on Computer Vision,2020:649-665.
[9]
DOSOVITSKIYA, BEYERL, KOLESNIKOVA,et al.An image is worth 16x16 words:Transformers for image recognition at scale[J].arXiv preprint arXiv:2020.
[10]
CARIONN, MASSAF, SYNNAEVEG,et al.End-to-end object detection with transformers[C]//European Conference on Computer Vision,2020:213-229.
[11]
LIUS, ZHANGL, YANGX,et al.Query2label:a simple transformer way to multi-label classification[J].arXiv preprint arXiv:2021.
[12]
RIDNIKT, SHARIRG, BEN-COHENA,et al.Ml-decoder:scalable and versatile classification head[C]//Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, 2023:32-41.
CUBUKE D, ZOPHB, SHLENSJ,et al.Randaugment:practical automated data augmentation with a reduced search space[C]//Proceedings of the IEEE/CVF Conference on Computer vision and Pattern Recognition Workshops,2020:702-703.
[15]
RIDNIKT, BEN-BARUCHE, ZAMIRN,et al.Asymmetric loss for multi-label classification[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision,2021:82-91.
[16]
GAOB B, ZHOUH Y.Learning to discover multi-class attentional regions for multi-label image recognition[J].IEEE Transactions on Image Processing,2021,30:5920-5932.
[17]
LANCHANTINJ, WANGT, ORDONEZV,et al.General multi-label image classification with transformers[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition,2021:16478-16488.