利用模型算法部署图像识别

So, you have gathered a dataset, built a neural network, and trained your model.

因此,您已经收集了数据集,建立了神经网络并训练了模型。

But despite the hours (and sometimes days) of work you invested to create the model, it spits out predictions with an accuracy of 50–70%. Chances are, this is not what you expected.

但是,尽管您花费了数小时(有时是数天)来创建模型,但它仍能以50%至70%的准确性发出预测。 很有可能,这不是您所期望的。

Here are a few strategies, or hacks, to boost your model’s performance metrics.

这里有一些策略或技巧,可以提高模型的性能指标。

1.获取更多数据 (1. Get More Data)

Deep learning models are only as powerful as the data you bring in. One of the easiest ways to increase validation accuracy is to add more data. This is especially useful if you don’t have many training instances.

深度学习模型仅具有所引入数据的功能。提高验证准确性的最简单方法之一就是添加更多数据。 如果您没有很多训练实例,这将特别有用。

If you’re working on image recognition models, you may consider increasing the diversity of your available dataset by employing data augmentation. These techniques include anything from flipping an image over an axis and adding noise to zooming in on the image. If you are a strong machine learning engineer, you could also try data augmentation with GANs.

如果您正在使用图像识别模型,则可以考虑通过使用数据增强来增加可用数据集的多样性。 这些技术包括从在轴上翻转图像到增加噪声到放大图像的一切。 如果您是一位强大的机器学习工程师,则还可以尝试使用GAN进行数据增强。

Read more about data augmentation here.

在此处阅读有关数据增强的更多信息。

Keras has an amazing image preprocessing class to perform data augmentation: ImageDataGenerator.

Keras有一个惊人的图像预处理类来执行数据增强: ImageDataGenerator 。

Source资源

2.添加更多层(2. Add More Layers)

Adding more layers to your model increases its ability to learn your dataset’s features more deeply, and hence it will be able to recognize subtle differences that you, as a human, might not have picked up on.

在模型中添加更多层可以提高其更深入地学习数据集特征的能力,因此它能够识别出您作为人类可能尚未发现的细微差别。

This hack entirely relies on the nature of the task you are trying to solve.

此hack完全取决于您要解决的任务的性质。

For complex tasks, such as differentiating between the breeds of cats and dogs, adding more layers makes sense because your model will be able to learn the subtle features that differentiate a poodle from a shih tzu.

对于复杂的任务,例如区分品种 对于猫和狗,增加更多的层次是有道理的,因为您的模型将能够学习区分贵宾犬和西施犬的细微特征。

For simple tasks, such as classifying cats and dogs, a simple model with few layers will do.

对于简单的任务(例如对猫和狗进行分类),将需要一个具有很少层的简单模型。

More layers -> More nuanced model

更多图层->更细微的模型

Photo by Alvan Nee on Unsplash
Alvan Nee在Unsplash上的照片

3.更改图像大小(3. Change Your Image Size)

When you preprocess your images for training and evaluation, there is a lot of experimentation to be done with regards to the image size.

在对图像进行预处理以进行训练和评估时,需要对图像大小进行大量实验。

If you choose an image size that is too small, your model will not be able to pick up on the distinctive features that help with image recognition.

如果选择的图像尺寸太小,模型将无法使用有助于图像识别的独特功能。

Conversely, if your images are too big, it increases the computational resources required by your computer and/or your model might not be sophisticated enough to process them.

相反,如果图像太大,则会增加计算机所需的计算资源,并且/或者您的模型可能不够复杂,无法处理它们。

Common image sizes include 64x64, 128x128, 28x28 (MNIST) and 224x224 (VGG-16).

常见的图片大小包括64x64、128x128、28x28(MNIST)和224x224(VGG-16)。

Keep in mind that most preprocessing algorithms do not consider the aspect ratio of the image, so smaller-sized images might appear to have shrunk over a certain axis.

请记住,大多数预处理算法都没有考虑图像的长宽比,因此较小尺寸的图像可能会在特定轴上收缩。

Source资源

4.增加时代(4. Increase Epochs)

Epochs are basically how many times you pass the entire dataset through the neural network. Incrementally train your model with more epochs with intervals of +25, +100, and so on.

基本上,历元是您将整个数据集通过神经网络传递的次数。 以+ 25,+ 100等为间隔,以更多的时期递增地训练模型。

Increasing epochs makes sense only if you have a lot of data in your dataset. However, your model will eventually reach a point where increasing epochs will not improve accuracy.

仅当数据集中有大量数据时,增加历元才有意义。 但是,您的模型最终会达到增加历时不会提高准确性的地步。

At this point, you should consider playing around with your model’s learning rate. This little hyperparameter dictates whether your model reaches its global minimum (the ultimate goal for neural nets) or gets stuck in a local minimum.

此时,您应该考虑调整模型的学习率。 这个小超参数指示您的模型是达到其全局最小值(神经网络的最终目标)还是被困在局部 最低。

Source资源

5.减少色彩通道(5. Decrease Colour Channels)

Colour channels reflect the dimensionality of your image arrays. Most colour (RGB) images are composed of three colour channels, while grayscale images have just one channel.

颜色通道反映了图像阵列的尺寸。 大多数彩色(RGB)图像由三个颜色通道组成,而灰度图像只有一个通道。

The more complex the colour channels are, the more complex the dataset is and the longer it will take to train the model.

颜色通道越复杂,数据集越复杂,训练模型所需的时间也越长。

If colour is not such a significant factor in your model, you can go ahead and convert your colour images to grayscale.

如果颜色不是模型中的重要因素,则可以继续将彩色图像转换为灰度。

You can even consider other colour spaces, like HSV and L*a*b.

您甚至可以考虑其他颜色空间,例如HSV和L * a * b。

Source资源

6.转移学习(6. Transfer Learning)

Transfer learning involves the use of a pre-trained model, such as YOLO and ResNet, as a starting point for most computer vision and natural language processing tasks.

迁移学习涉及使用诸如YOLO和ResNet之类的预训练模型,作为大多数计算机视觉和自然语言处理任务的起点。

Pre-trained models are state-of-the-art deep learning models that were trained on millions and millions of samples, and often for months. These models have an astonishingly huge capability of detecting nuances in different images.

预先训练的模型是最先进的深度学习模型,对数百万个样本进行了训练,而且通常需要几个月的时间。 这些模型具有惊人的巨大能力,可以检测不同图像中的细微差别。

These models can be used as a base for your model. Most models are so good that you won’t need to add convolutional and pooling Layers.

这些模型可以用作模型的基础。 大多数模型都非常好,您无需添加卷积和池化层。

Read more about using transfer learning.

阅读有关使用转移学习的更多信息。

Nvidia blogNvidia博客

7.额外(7. Extra)

The hacks above offer a base for you to optimize a model. To really finetune a model, you’ll need to consider tuning the various hyperparameters and functions involved in your model, such as the learning rate (as discussed above), activation functions, loss functions, etc.

上面的技巧为您优化模型提供了基础。 要真正微调模型,您需要考虑调整模型中涉及的各种超参数和函数,例如学习率(如上所述),激活函数,损失函数等。

This hack comes as an “I hope you know what you’re doing” warning because there is a wider scope to mess up your model.

这种破解是“我希望您知道自己在做什么”的警告,因为存在更大的范围来弄乱您的模型。

小费 (Tip)

Always save your model every time you make a change to your deep learning model. This will help you reuse a previous configuration of the model if it provides greater accuracy.

每次更改深度学习模型时,请始终保存模型。 如果模型提供了更高的准确性,这将帮助您重用模型的先前配置。

Most deep learning frameworks like Tensorflow and Pytorch have a “save model” method.

大多数深度学习框架(例如Tensorflow和Pytorch)都具有“保存模型”方法。

# In Tensorflowmodel.save('model.h5') # Saves the entire model to a single artifact# In Pytorchtorch.save(model, PATH)

There are countless other ways to further optimize your deep learning, but the hacks described above serve as a base in the optimization part of deep learning.

还有无数其他方法可以进一步优化您的深度学习,但上述技巧是深度学习优化部分的基础。

Let me know what your favourite hack is!

让我知道您最喜欢的黑客是什么!

翻译自: https://levelup.gitconnected.com/supercharge-your-image-recognition-models-with-these-hacks-a0fb6bf6c79

利用模型算法部署图像识别


http://www.taodudu.cc/news/show-4459733.html

相关文章:

  • 项目部署的常用进程管理命令
  • 前后端部署在两台服务器 服务器配置要求_漫谈前后端分离
  • ☀️从0到1部署Hadoop☀️基于网站日志进行大数据分析【❤️建议收藏❤️】
  • Springboot实战项目---从需求分析到项目部署一站式开发,给简历添加一点色彩
  • cvs100e_CVS100E断路器
  • 华硕ASUS B250M PLUS+i5 7500+核显+macos12.0+opencore0.7.2
  • SSRF 攻击PHP-FPM(FastCGI 攻击):学习总结仅供参考
  • 粒子特效-Xffect
  • 计算机网络--第一章 概述--课后习题答案
  • 1.9 Cubemx_STM32F4_57步进电机(一)----驱动代码
  • linux下boost编译安装全过程脚本塈bzip2编译安装全过程脚本
  • netty对http协议解析原理解析
  • 区块链学习(8) EOS环境安装和智能合约部署实战(绝对干货!)
  • CTFHub-SSRF(全部)
  • codeforces 250B Restoring IPv6
  • 57BYG250B步进电机+SR4驱动器
  • 定格蓝方块小游戏
  • 原生js小游戏——俄罗斯方块
  • 基于51单片机的俄罗斯方块小游戏
  • Python自动玩俄罗斯方块小游戏
  • HTML俄罗斯方块小游戏
  • c++写俄罗斯方块小游戏
  • 用 Python 写个俄罗斯方块小游戏
  • (心得三)java俄罗斯方块小游戏编写心得
  • python实现俄罗斯方块小游戏
  • 学习完美方块小游戏(cocos creator)
  • C64+ cache资料集(更新中)
  • 针对C64x+的一些优化经验(转帖)
  • DSP程序开发与优化经验之四:TMS320C64x+ DSP------Using Cache
  • 各位端午节快乐 -- Happy the Dragon-Boat Festival

利用模型算法部署图像识别_利用这些技巧增强您的图像识别模型相关推荐

  1. python模型部署方法_终极开箱即用的自动化Python模型选择方法

    python模型部署方法 Choosing the best model is a key step after feature selection in any data science proje ...

  2. python狗图像识别_使用pytorch完成kaggle猫狗图像识别方式

    kaggle是一个为开发商和数据科学家提供举办机器学习竞赛.托管数据库.编写和分享代码的平台,在这上面有非常多的好项目.好资源可供机器学习.深度学习爱好者学习之用. 碰巧最近入门了一门非常的深度学习框 ...

  3. app inventor调用图像识别_+AI场景,3步懂图像识别产品

    本文重点讲述基于成熟的第三方AI平台阿里.某度.腾讯.谷歌等等中选择一个可供使用的SDK基于Python语言实现图像识别功能的GUI界面,从而一观图像识别车型.图像识别文本产品的实现过程. 我们正处于 ...

  4. 功率谱 魏凤英统计程序_单通道语音增强之统计信号模型

    [欢迎访问我的博客原文](单通道语音增强之统计信号模型) 1. 信号估计理论简述 信号估计理论是现代统计处理的基础课题[@ZhangXianDa2002ModernSP],在通信.语音.图像领域均有广 ...

  5. python实现图像识别_利用Python进行简单的图像识别(验证码)

    这是一个最简单的图像识别,将图片加载后直接利用Python的一个识别引擎进行识别 将图片中的数字通过 pytesseract.image_to_string(image)识别后将结果存入到本地的txt ...

  6. python利用集合的无重复性_利用Python程序完成ABAQUS中的一些重复性操作

    对于建立过大型的ABAQUS分析模型的同学们,肯定会面对繁琐的重复性建模过程.比如对上百个点施加集中力,比如建立几百个耦合约束.这些重复性操作,如果使用cae操作的话,不仅费时,而且极其容易出错. 利 ...

  7. 利用python处理dna序列_利用Python编程提取基因组基因序列

    生物技术. DOI: 10.16660/j.cnki.1674-098X.2019.11.141 利用Python编程提取基因组基因序列 ① 庞雪原 张婷婷 (东北农业大学生命科学学院 黑龙江哈尔滨 ...

  8. JAVA利用数组求两点距离_利用java、js或mysql计算高德地图中两坐标之间的距离

    利用java.js或mysql计算高德地图中两坐标之间的距离 2019-09-19 编程之家收集整理的这篇文章主要介绍了利用java.js或mysql计算高德地图中两坐标之间的距离,编程之家小编觉得挺 ...

  9. 利用python进行数据分析 笔记_利用python进行数据分析--(阅读笔记一)

    原博文 2016-06-17 23:21 − 以此记录阅读和学习<利用Python进行数据分析>这本书中的觉得重要的点! 第一章:准备工作 1.一组新闻文章可以被处理为一张词频表,这张词频 ...

最新文章

  1. 访谈计算机操作管理协会(Afcom)首席执行官Jill Eckhaus:数据中心问题出现在何处?...
  2. python能做什么游戏好-用Python可以做哪些有意思的小游戏呢?
  3. 深入理解JavaScript模拟私有成员
  4. 【小白学习C++ 教程】十五、C++ 中的template模板和泛型
  5. GDCM:gdcm::String的测试程序
  6. oracle 48小时内_缺血性脑梗死后48小时内使用阿替普酶能够降低脑损伤程度
  7. linux as5 启动mysql_Red Hat AS5进入救援模式的步骤
  8. Mysql中添加汉字乱码无法识别问题
  9. scala-传名函数和传值函数
  10. AI的10个开源工具/框架
  11. PAT 甲级 1018 Public Bike Management
  12. 7.7 Introduce Foreign Method 引入外部方法
  13. 视频号领域发布的不同时间,视频号上热门秘诀:国仁楠哥
  14. 如何在win11上运行VC6.0
  15. 【路由篇】01. 修改密码 ❀ 1900 ❀ CISCO 路由器
  16. 洛谷B2058 奥运奖牌计数
  17. ILRuntime学习(之一)
  18. JS Web API
  19. 数学-先验概率和后验概率和一系列概率公式理解
  20. 光明区关于促进科技创新的若干措施(征求意见稿)

热门文章

  1. 解决:Word中无法使用“粘贴”快捷键
  2. 谷歌地球如何下载使用高程数据
  3. C#中的true和false运算符
  4. BatchNorm1d
  5. linux pam 版本号,Linux中pam板块详解
  6. 超三万台电脑遭新恶意软件感染、联想修复特权提升漏洞|12月20日全球网络安全热点
  7. Unity 3d 最新下载与安装
  8. 游戏推广的引流软件有用吗
  9. 计算机磁盘管理找不到第二块硬盘,新加的硬盘没有显示怎么办?新加硬盘分区方法...
  10. [SDOI2009]学校食堂Dining 洛谷p2157