【源码】基于混合数据增强的CNN图像分类

在这里插入图片描述
本程序演示了如何实现一种称为mix-up[1]/sample-pairing[2]的数据增广方法。

This demo shows how to implement a kind of data augmentation called mix up [1] /sample pairing [2].

训练图像是用一对像alpha混合的图像合成的。

Training images are synthesized using a pair of images just like alpha blending.

使用带有预先训练的网络ResNet-18的精细调节进行分类。

The classification was done using fine-tuining with a pre-trained network ResNet-18.

参考了Matlab的官方文献[3-5]。

The Matlab official documents [3-5] were also refferred.

在这个演示中,使用了一个称为多类天气数据集的图像分类数据集[6]。

In this demo, a dataset called Multi-class Weather Dataset for Image Classification [6] was used.

上图中的图像来自数据集中[6]。

The images in the figure above were derived from the dataset [6].

每个子图标题中的比率表示分类的组成。

The ratio in the title of each subfigure represents the composition of the classes.

[Japanese]

このデモでは、mix up [1] やsample pairing [2] と呼ばれる方法を用いて、

訓練データのデータ拡張(水増し)を行い、画像データセットの分類を行います。

もとのコードは [3-5] を参考にしています。

天気のデータセット [6] を用いて畳み込みニューラルネットワーク(CNN)による分類を行います。

ここでは、複数のクラスの画像を組み合わせ、サムネイルのようなブレンドされた画像を訓練データとして用います。

また、正解ラベルの値も通常のような、[0 0 1]といったone-hotベクトルにするのではなく、

配合するバランスに応じて、たとえば、[0.2 0 0.8]のようにします。

これらの方法により過学習を抑制できる可能性が知られています。

参考文献:

[1] Zhang, Hongyi, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. “mixup: Beyond empirical risk minimization.” arXiv preprint arXiv:1710.09412 (2017).

[2] Inoue, Hiroshi. “Data augmentation by pairing samples for images classification.” arXiv preprint arXiv:1801.02929 (2018).

This code with custom training loop was made based on the Matlab Official Document located at

[3] Train Network Using Custom Training Loop: https://jp.mathworks.com/help/deeplearning/ug/train-network-using-custom-training-loop.html

[4] Transfer Learning: https://jp.mathworks.com/discovery/transfer-learning.html.

[5] Transfer Learning Using AlexNet: https://jp.mathworks.com/help/deeplearning/examples/transfer-learning-using-alexnet.html

[6] Multi-class Weather Dataset for Image Classification: https://data.mendeley.com/datasets/4drtyfjtfy/1

更多精彩文章请关注公众号:在这里插入图片描述

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值