Caffe-通过裁剪进行图像增强 [英] Caffe - Image augmentation by cropping

查看:119
本文介绍了Caffe-通过裁剪进行图像增强的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

咖啡的种植策略是应用 random-crop 进行训练, center-crop 进行测试。

The cropping strategy of caffe is to apply random-crop for training and center-crop for testing.

从实验中,我观察到如果在训练过程中我可以为同一幅图像提供两个裁剪版本(随机和居中),则识别的准确性会提高。这些实验数据(尺寸为100x100)是通过在115x115尺寸的图像上进行随机裁剪和中心裁剪而离线生成的(不使用caffe)。

From experiment, I observed that accuracy of recognition improves if I can provide two cropped version (random and center) for the same image during training. These experimental data (size 100x100) are generated offline (not using caffe) by applying random and center cropping on a 115x115 sized image.

我想知道如何执行

注意:我想使用2个数据层,每个层具有不同的裁剪(中心和随机),然后执行串联。但是,我发现在训练过程中,咖啡因不允许中心收割。

Note: I was thinking to use 2 data layers, each with different cropping (center and random), and then perform concatenation. However, I found that caffe does not allow center crop during training.

推荐答案

简单的答案是准备另一个已经裁剪的数据集您的训练数据,裁剪为100x100。然后将此数据集与原始数据混合并训练。这样,随机裁剪新图像实际上可以使您进行中心裁剪。

Easy answer would be to prepare another already-cropped dataset of your training data, cropped to 100x100. Then mix this dataset with your original data and train. In this way, random cropping of your new images will actually give you center cropping.

更复杂的方法是使用caffe API(MATLAB和Python)手工制作批处理,将手工制作的批次动态地馈送到网络。
您可以查看此链接,以了解实现此问题的不同方法。

More complex way is hand-crafting your batches using caffe APIs (MATLAB and Python) and feeding the hand-crafted batches on-the-fly to the network. You can check this link for different ways to achieve this.

这篇关于Caffe-通过裁剪进行图像增强的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆