keras构建卷积神经网络

by John David Chibuk

约翰·大卫·奇布克(John David Chibuk)

通过此简单教程学习在网络上构建卷积神经网络 (Learn to build a Convolutional Neural Network on the web with this easy tutorial)

This post explains how to build your first Convolutional Neural Network (CNN) to detect between two image types: for example, a bunny or a puppy.

这篇文章介绍了如何构建您的第一个卷积神经网络(CNN),以在两种图像类型之间进行检测:例如,兔子或小狗。

Thanks to Google’s new web tool, getting started building and prototyping your own neural network can be quite easy.

借助Google的新网络工具,您可以很轻松地开始构建自己的神经网络并进行原型设计。

Here is a link to the web-based application. It shows you the code and lets you run “paragraph by paragraph” (shift+enter) jupyter notebook code to let you train a model and then test it. Find the Github public repo here.

这是基于Web的应用程序的链接 。 它 向您显示代码,并让您运行“逐段”( shift + enter )jupyter笔记本代码,以训练模型然后进行测试。 在此处找到Github公共仓库 。

The first step is to set up the Colab notebook + image data folders on your own Google drive, so let’s do that!

第一步是在您自己的Google驱动器上设置Colab笔记本+图像数据文件夹,让我们开始吧!

In your Google drive, you will need to set up folders with images that store the data to be trained. You can copy this folder directly and put in your own Google drive, and then unzip it and put it in a folder called “Colab Notebooks” in your base Google drive folder.

在您的Google云端硬盘中,您需要设置包含图像的文件夹,这些图像存储了要训练的数据。 您可以直接复制此文件夹并放入您自己的Google驱动器中,然后将其解压缩并放入基本Google驱动器文件夹中名为“ Colab Notebooks”的文件夹中。

In the images folder, there are two subfolders.

在images文件夹中,有两个子文件夹。

train

培养

test

测试

Each of these folders then contains folders to represent the types of images you want to identify.

这些文件夹中的每一个都包含代表您要识别的图像类型的文件夹。

bunny

兔子

puppy

小狗

There should be a bunny and puppy folder in each train + test folder.

每个火车+测试文件夹中应该有一个兔子和小狗文件夹。

Fill these folders with images. Put ~80% in the train folder and 20% in the test folder.

用图像填充这些文件夹。 将约80%放置在训练文件夹中,并将20%放置在测试文件夹中。

The tricky part of the tutorial is getting the folders linked properly within Google drive. You need to connect via API keys a few times to establish the proper connection to your personal Google drive folder.

本教程的棘手部分是将文件夹正确链接到Google驱动器中。 您需要通过API密钥连接几次,以建立与您的个人Google驱动器文件夹的正确连接。

Please note: you need to keep the same folder structure as defined in the tutorial to have it run properly.

请注意:您需要保持与教程中定义的文件夹结构相同的文件夹结构,以使其正常运行。

In your base Google Drive folder, you should have a folder called: Colab Notebooks.

在基本的Google云端硬盘文件夹中,您应该有一个名为Colab笔记本的文件夹。

Inside there should be a directory called: Simple CNN Image Tutorial

里面应该有一个目录:Simple CNN Image Tutorial

This should contain the contents of the images and Colab notebook from above.

这应该包含上面图像和Colab笔记本的内容。

一步步 (Step by step)

Step 1 installs the required libraries to build and train a model with Google’s tensorflow + Keras. Keras is a simplified layer to make model training easier on top of Tensorflow.

第1步安装所需的库,以使用Google的tensorflow + Keras构建和训练模型。 Keras是一个简化的层,可以使在Tensorflow之上的模型训练更加容易。

Step 2–5 links your Google drive up to the project, copies the keys over from the cells, and pastes them in the notebook as they are generated. This might take a few tries, but its okay!

第2-5步将您的Google驱动器链接到项目,从单元格复制密钥,然后将其粘贴到笔记本中。 这可能需要几次尝试,但是还可以!

Step 6 You can change the structure, but you will need to update the path in the notebook to match where you put the base Simple CNN Image Tutorial folder.

步骤6您可以更改结构,但需要更新笔记本中的路径以匹配放置“基本CNN图像教程”文件夹的位置。

Step 7 confirms that you have your images loaded in Google drive.

步骤7确认您已将图像加载到Google驱动器中。

To run the process, simply click the first paragraph area and click “shift + enter” on your keyboard. This runs the code in each cell and lets you step through the process.

要运行该过程,只需单击第一段区域,然后在键盘上单击“ Shift + Enter”。 这将在每个单元格中运行代码,并让您逐步完成该过程。

Step 9 trains your model. If everything is referenced properly it should show output like this ->

第9步训练您的模型。 如果正确引用了所有内容,则应显示如下输出->

When it’s done, your model will be trained and you can test images from what you put in the new images folder:

完成后,将对模型进行训练,并且可以从新图像文件夹中放置的图像中测试图像:

Simply change the image name text in the line of code:

只需在代码行中更改图像名称文本:

test_image = image.load_img(‘./newimages/puppy3.jpg’, target_size = (64, 64))

So you would change for example:

因此,您将例如进行更改:

‘./newimages/puppy3.jpg’ to ‘./newimages/bunny1.jpg’

Finally run the paragraph and see what your model classifies the new image to be!

最后运行该段落,看看您的模型将新图像分类为什么!

恭喜,您刚刚训练和测试了您的第一个卷积神经网络-香蕉! (Congrats you have just trained and tested your first convolutional neural network — it’s bananas!)

翻译自: https://www.freecodecamp.org/news/learn-to-build-a-convolutional-neural-network-on-the-web-with-this-easy-tutorial-2d617ffeaef3/

keras构建卷积神经网络

keras构建卷积神经网络_通过此简单教程学习在网络上构建卷积神经网络相关推荐

  1. python2.7交通标志识别图_(四)深度学习初探:基于LeNet-5卷积神经网络的交通标志识别...

    1.项目任务 在常见深度学习模型的基础上(本文为LeNet-5),调整模型结构和参数,使用Tensorflow进行部署.利用公开的德国交通标志数据集进行训练,得到模型,并利用该模型对新的图片进行预测. ...

  2. angular 模块构建_我如何在Angular 4和Magento上构建人力资源门户

    angular 模块构建 Sometimes trying a new technology mashup works wonders. Both Magento 2 + Angular 4 are ...

  3. linux 异构 计算_在Linux(或异构)网络上共享计算机,第1部分

    linux 异构 计算 为了有效地测试和编写各种软件程序,我在本地网络上保留了相当多的计算机. 这些机器运行各种操作系统,并使用各种硬件配置. 有时我正在评估各种平台上的工具: 其他时候我正在测试和调 ...

  4. 一维卷积神经网络_序列特征的处理方法之二:基于卷积神经网络方法

    前言 上一篇文章介绍了基本的基于注意力机制方法对序列特征的处理,这篇主要介绍一下基本的基于卷积神经网络方法对序列特征的处理,也就是TextCNN方法.序列特征的介绍,背景以及应用可以参考上一篇的详细介 ...

  5. 优达学城深度学习之三(上)——卷积神经网络

    学习如何用神经网络来解决分类问题. 开始都会说什么是机器学习?机器学习的应用是什么?用机器在海量数据中学习得到可以解决一类问题的办法,这就是我的理解.图像处理.文本处理.无人驾驶.等,深度学习最热门的 ...

  6. 孪生神经网络_驾驶习惯也能识人?基于时空孪生神经网络的轨迹识别

    ⬆⬆⬆ 点击蓝字 关注我们 AI TIME欢迎每一位AI爱好者的加入! 前言: 给定一组单独的人员(例如行人,出租车司机)的历史轨迹以及由特定人员生成的一组新轨迹,轨迹识别问题旨在验证传入的轨迹是否是 ...

  7. 基于hadoop构建对象存储系统_基于Hadoop企业私有云存储平台的构建

    量数据存储.数据规模易扩展性的要求. 关键词: 企业级用户:私有云:云存储: Hadoop :云计算:海量数据: HBase :元数据 中图分类号: TP 391 文献标志码: A Establish ...

  8. 论文模型构建的步骤_最新论文:智能安全情报分析模型的构建

    智能安全情报分析模型的构建 摘要: [目的/意义] 人工智能凭借其强大的信息处理能力正在改变安全情报分析方式.因此,开展结合人工智能的智能安全情报分析研究具有重大意义. [方法/过程] 首先,剖析人工 ...

  9. master节点重置后添加node报错_超强教程!在树莓派上构建多节点K8S集群!

    在很长一段时间里,我对于在树莓派上搭建Kubernetes集群极为感兴趣.在网络上找到一些教程并且跟着实操,我已经能够将Kubernetes安装在树莓派上,并在三个Pi集群中工作.然而,在master ...

最新文章

  1. 数据结构与算法(7-1)图的存储(邻接矩阵、邻接表)
  2. 字节首推Java成长笔记:(原理+应用+源码+调优全都有)
  3. 天翼云从业认证(2.1)云计算的定义、特点、背景和发展历程
  4. 20180525小测
  5. 原来还有dynamic这东西。
  6. “互联网+”为移动医疗提供的七大有力武器!
  7. VS编译错误与链接错误汇总
  8. 【知识点总结】电机学——题目部分
  9. BLM战略规划的核心是业务模式创新
  10. 初二计算机英语作文,初二英语作文带翻译
  11. 用python进行数据分析(一:数据理解)
  12. 宽带和下载速度(下载速率)之间的区别
  13. 嵌入式OS的现状、智能的物联网与未来的机器人
  14. 问题 - GitLab repositories 文件夹权限异常
  15. vi 怎么 保存, 退出编辑
  16. The path to the Subversion executable is probably wrong. Fix it.
  17. Ryzen 5 5600G windows 10 企业版 - 高温 BUG
  18. Java基础:01Java语言概述(常见的DOS命令,Java语言的特点、核心机制、环境搭建,HelloWorld,注释,Java API 文档)
  19. win10平板读写TF卡异常的解决记录
  20. 滚动轴承故障诊断MATLAB程序:快速谱峭度、谱峭度+包络谱分析

热门文章

  1. 0906周测题目一 循环题的答案
  2. dj电商-项目开发流程
  3. bootstap-水果节案例-编辑中
  4. 亲测可用,超详细RabbitMQ消息队列集群配置
  5. angular6--创建项目
  6. 手把手Maven搭建SpringMVC+Spring+MyBatis框架(超级详细版)
  7. 答网友:如何在Sbo Add-on中激活或者禁止系统增加、查找和导航按钮?
  8. HDU 6178 Monkeys
  9. CentOs6.5 修改主机名
  10. Java实验二 计算机 1501 王奕开 18