张潜(1992-), 男, 重庆大学硕士, 主要从事深度学习、软件工程等方向研究, (E-mail)
细粒度图像分类是对传统图像分类的子类进行更加细致的划分,实现对物体更为精细的识别,它是计算机视觉领域的一个极具挑战的研究方向。通过对现有的细粒度图像分类算法和Xception模型的分析,提出将Xception模型应用于细粒度图像分类任务。用ImageNet分类的预训练模型参数作为卷积层的初始化,然后对图像进行缩放、数据类型转换、数值归一化处理,以及对分类器参数随机初始化,最后对网络进行微调。在公开的细粒度图像库CUB200-2011、Flower102和Stanford Dogs上进行实验验证,得到的平均分类正确率为71.0%、89.9%和91.4%。实验结果表明Xception模型在细粒度图像分类上有很好的泛化能力。由于不需要物体标注框和部位标注点等额外人工标注信息,Xception模型用在细粒度图像分类上具有较好的通用性和鲁棒性。
Fine-grained image classification is a more detailed division of the sub-categories of traditional image classification, which achieves a more sophisticated identification of objects. And it is a very challenging research in the field of computer vision. By analyzing the existing fine-grained image classification algorithm and Xception model, we propose to apply the Xception model to the fine-grained image classification task. Initialization of convolution layers uses pre-training model parameters of ImageNet classification. Then we resize images, transform data type, normalize value, and randomly initialize classifier. Finally, the network is fine-tuned. Our method obtains 71.0%, 89.9% and 91.4% per-image accuracy on the CUB200-2011, Flower102 and Stanford Dogs dataset respectively. The experimental results show that the Xception model has good generalization ability in fine-grained image classification. Because it does not need additional annotation information such as object bounding box and part annotation, the Xception model has good versatility and robustness in fine-grained image classification.
随着深度学习[
细粒度图像分类可以分为强监督的细粒度图像和弱监督的细粒度图像。强监督的细粒度图像分类算法,在模型训练时,除了图像的类别标签外,还使用了物体标注框、部位标注点等额外的人工标注信息。文献[
弱监督的细粒度图像分类算法仅使用标签,而不需要额外的标注信息。局部区域信息对于细粒度图像分类至关重要,要实现更好的弱监督的细粒度图像分类,需要解决的是如何检测并定位这些局部区域。文献[
卷积神经网络[
目前,强监督的和弱监督的细粒度图像分类过程大多都分为2个步骤,先提取图像的局部区分性区域,再使用卷积神经网络对这些区域进行特征学习。不同于上述方法,研究采用的是Xception模型,不需要分2步进行,让神经网络自动学习到局部区分性特征。同时,不需要物体标注框和部位标注点信息,仅使用类别标签信息。使用Xception模型在公开的细粒度图像库CUB200-2011、Flower102和Stanford Dogs[
2014年,由谷歌研究院提出的GoogLeNet在ILSVRC图像分类获得冠军。GoogLeNet对网络中传统卷积层进行修改,提出在同一层中使用不同大小卷积核的Inception结构。后续相继提出了改进版本Inception
其中:
Inception
Inception的思想是将一个卷积核需要同时映射跨通道相关性和空间相关性的过程分解成一系列相互独立的操作,即Inception模块首先处理跨通道相关性,通过一组1×1卷积,将输入数据映射到3或4个小于原始输入的不同空间;然后处理空间相关性,通过3×3或者5×5卷积将所有相关性映射到更小的3D空间。实际上Inception背后的基本的假设是使跨通道相关性和空间相关性充分解耦。在Inception假设和思想基础下,对Inception
Inception
A canonical Inception module (Inception
简化的Inception模块结构[
A simplified Inception module[
完全等价的简化Inception模块[
A strictly equivalent reformulation of the simplified Inception module[
“极致”版本的Inception模块[
An "extreme" version of Inception module[
Xception模型使用深度可分离卷积增加网络宽度,不仅提升了分类的正确率,也增强了网络对细微特征的学习能力,提供了Xception用在弱监督的细粒度图像分类的可行性。基于上述分析,尝试将Xception应用于细粒度图像分类。
选择CUB200-2011、Flower102和Stanford Dogs3个公开的细粒度图像库进行分析研究。其中CUB200-2011数据库是细粒度图像分类领域一个经典的数据库,也是最常用的一个数据库,共包含200种不同类别的鸟,每个类别包含41到60张图像不等,共11 788张图像。Flower102数据库分为2种不同规模的版本,分别包含17种类别和102种类别的花。实验用的是102种类别的数据库,每个类别包含了40到258张图像数据,总共有8 189张图像。Stanford Dogs数据包库包含120类狗,每类包含148到252张图像不等,总共有20 580张图像。
3种数据库样本示例
The example of three datasets
第一步:图像数据归一化。首先将图像缩放到299×299像素,再把图像的每个像素数据类型转化为浮点型,并归一化到[-1, +1],归一化公式如下
其中:
第二步:模型参数初始化。微调是训练神经网络的一种常用的方式,即用已训练好的公开模型和参数,加上自己的数据,来训练新的模型。微调相当于使用公开预训练好的模型来提取特征,然后再用到自己的分类中。微调不用完全重新训练模型,从而提高效率,能够在比较少的迭代次数得到一个比较好的效果。在数据量不是很大的情况下,微调是一个比较好的选择。本实验选择的数据库中每类的数据不是很多,所以使用ImageNet分类[
第三步:模型训练。采用有监督学习方式,利用BP算法对卷积层参数进行细微的调整,以及对分类器参数进行训练,即比较分类器的输出值与期望输出的差别,得到误差信号并进行反向传播来微调各层参数,直到损失趋于不变。
训练过程中使用动态调整学习率的Adam优化器,避免对学习率的手动调节,参数更新公式如下
其中:
为了提高网络的泛化能力,降低网络过拟合,采用Dropout正则化技术,值取0.5,公式如下
其中:
第四步:分类预测。测试数据在已经优化好的神经网络中进行正向传播获得网络输出,并将得到的实际输出与标签数据值进行比较,从而判别测试图像所属的类别,统计正确分类的数量,计算出正确率。
大多数深度学习方法对于数据库的处理是将数据库以一定比例分配生成训练集、验证集和测试集。在实验中,将CUB200-2011、Stanford Dogs和Flower102的3个数据库按8:2的比例随机生成训练验证集和测试集;在训练验证集中,将其80%作为训练数据集,剩余的20%作为验证数据集。
经实验训练、验证以及测试均在NVIDIA Tesla K80 GPU上完成,基于深度学习框架Keras进行,通过数次实验择优原则获取结果。
在CUB200、Flower102和Stanford Dogs数据库上的分类结果[
不同数据库上的细粒度图像分类结果
Fine-grained image classification results on different datasets
模型 | 数据库 | 分类结果/% |
B-CNN[ |
CUB200-2011 | 72.5 |
Xception | CUB200-2011 | 71.0 |
Murray | Flower102 | 84.6 |
Xception | Flower102 | 89.9 |
Xiao | Stanford Dogs | 88.9 |
Xception | Stanford Dogs | 91.4 |
从
Xception模型在CUB200-2011、Flower102和Stanford Dogs 3个数据库上的正确率都取得较优的效果,说明Xception模型在细粒度图像分类上具有很好细微特征学习能力。而在CUB200-2011数据库上正确率偏低主要是因为该数据库不仅种类很多、每类的数据量较少,而且有些图像目标对象很小。在Stanford Dogs数据库上正确率较高在于该数据库的图像来源于ImageNet数据库,而在Flower102数据库上进行实验,取得88.9%的正确率,进一步验证了Xception模型对细粒度图像分类的实用性。
细粒度图像分为基于强监督信息和基于弱监督信息2类,选择仅使用标签信息的弱监督方式。使用Xception模型在3个公开的细粒度图像分类数据库上进行研究分析。通过实验对比发现,基于Xception方法分类准确率均较为优异,具有很好的泛化能力,用于细粒度图像分类有较好的鲁棒性。由于细粒度图像的类别精度更加细致,类间差异更加细微,往往只能借助于微小的局部差异才能区分出不同的类别,因此神经网络学习这些细微的特征需要更多的数据。在未来的工作里,将结合双通道思想,一个通道学习局部有区分性信息检测,一个通道学习物体对象级别检测,来减少对数据量的需要,并进一步提升细粒度图像分类的正确率。
Hinton G E, Salakhutdinov R R. Reducing the dimensionality of data with neural networks[J]. Science, 2006, 313(5786):504.
Lecun Y, Bengio Y, Hinton G. Deep learning[J]. Nature, 2015, 521(7553):436-444.
He K, Zhang X, Ren S, et al. Deep residual learning for image recognition[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016. Las Vegas, USA: IEEE, 2016: 770-778.
Krizhevsky A, Sutskever I, Hinton G E, et al. Imagenet classiflcation with deep convolutional neural networks[C]//Proceedings of the 25th International Conference on Neural Information Processing Systems. Nevada-December 03-06, 2012. Lake Tahoe, USA: ACM, 2012: 1097-1105.
Huang G, Liu Z, Weinberger K Q, et al. Densely connected convolutional networks[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017. USA: IEEE, 2017: 1-4.
Chen Y, Li J, Xiao H, et al. Dual path networks[C]//Advances in Neural Information Processing Systems. Long Beach: IEEE, 2017: 4470-4478.
罗建豪, 吴建鑫.基于深度卷积特征的细粒度图像分类研究综述[J].自动化学报, 2017, 43(8):1306-1318.
LUO Jianhao, WU Jianxin. A Survey on fine-grained image categorization using deep convolutional features[J]. Acta Automatica Sinica, 2017, 43(8):1306-1318. (in Chinese)
Wah C, Branson S, Welinder P, et al. The Caltech-UCSD Birds-200-2011 dataset[C]//Technical Report CNS-TR-2011-001, USA: California Institute of Technology, 2011: 38-42.
Nilsback M E, Zisserman A. Automated flower classification over a large number of classes[C]//Proceedings of the 6th Indian Conference on Computer Vision, Graphics & Image Processing, 2008. Bhubaneswar, India: IEEE, 2008: 722-729.
Zhang N, Donahue J, Girshick R, et al. Part-based r-CNNs for fine-grained category detection[C]//European Conference on Computer Vision, 2014. Zurich, Switzerland: Springer, 2014: 834-849.
https://arxiv.org/abs/1406.2952. ]]>
Wei X S, Xie C W, Wu J, et al. Mask-CNN:Localizing parts and selecting descriptors for fine-grained bird species categorization[J]. Pattern Recognition, 2018, 76(2):704-714.
Xiao T, Xu Y, Yang K, et al. The application of two-level attention models in deep convolutional neural network for fine-grained image classification[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015. Boston, Massachusetts: CVPR, 2015: 842-850.
Simon M, Rodner E. Neural activation constellations: Unsupervised part model discovery with convolutional networks[C]//Proceedings of the IEEE International Conference on Computer Vision, 2015. Santiago, Chile: CVPR, 2015: 1143-1151.
Lin T Y, RoyChowdhury A, Maji S. Bilinear cnn models for fine-grained visual recognition[C]//Proceedings of the IEEE International Conference on Computer Vision, 2015. Santiago, Chile: ICCV, 2015: 1449-1457.
LeCun Y, Boser B E, Denker J S, et al. Handwritten digit recognition with a back-propagation network[C]//Advancesin Neural Information Processing Systems, Denver 1989. Colorado, USA: NIPS Conference, 1989: 396-404.
He K, Zhang X, Ren S, et al. Spatial pyramid pooling in deep convolutional networks for visual recognition[C]//European Conference on Computer Vision, 2014. Zurich, Switzerland: Springer, Cham, 2014: 346-361.
Hinton G, Deng L, Yu D, et al. Deep neural networks for acoustic modeling in speech recognition:The shared views of four resear chgroups[J]. IEEE Signal Processing Magazine, 2012, 29(6):82-97.
Szegedy C, Liu W, Jia Y, et al. Going deeper with convolutions[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015. Boston, Massachusetts: CVPR, 2015: 1-9.
Chollet F. Xception: Deep learning with depthwise separable convolutions[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. USA: IEEE, 2017: 1800-1807.
Deng J, Dong W, Socher R, et al. ImageNet: a large-scale hierarchical image database[C]//Proceedings of 2009 IEEE Conference on Computer Vision and Pattern Recognition, 2009. Miami, USA: IEEE, 2009: 248-255.
Khosla A, Jayadevaprakash N, Yao B, et al. Novel dataset for fine-grained image categorization: Stanford dogs[C]//Proc. CVPR Workshop on Fine-Grained Visual Categorization (FGVC). [S. l. ]: IEEE, 2011, 3-8.
Ioffe S, Szegedy C. Batch normalization: Accelerating deep network training by reducing internal covariate shift[C]//International Conference on Machine Learning, 2015. Lille, France: ICML, 2015: 448-456.
Szegedy C, Vanhoucke V, Ioffe S, et al. Rethinking the inception architecture for computer vision[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016. Las Vegas, NV, USA: CVPR, 2016: 2818-2826.
Szegedy C, Ioffe S, Vanhoucke V, et al. Inception-v4, inception-resnet and the impact of residual connections on learning[C]//Proceedings of the Thirty-First AAAI Conference on Artificial Intelligence, 2017. San Francisco, California, USA: AAAI, 2017: 4278-4284.
Russakovsky O, Deng J, Su H, et al. Imagenet large scale visual recognition challenge[J]. International Journal of Computer Vision, 2015, 115(3):211-252.
Murray N, Perronnin F. Generalized max pooling[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2014, Columbus, USA: CVPR, 2014: 2473-2480.
https://arxiv.org/abs/1603.06765. ]]>