GithubHelp home page GithubHelp logo

plants_disease_classify's Introduction

plants_disease_classify_pytorch

背景

pytorch 进行图像分类的代码(从实例掌握 pytorch 进行图像分类

数据

新增数据集下载链接:百度网盘 提取码:yae4 包含训练集、验证集、测试集A/B.

数据增强

data_aug.py 用于线下数据增强,支持的增强方式:

  • 高斯噪声
  • 亮度变化
  • 左右翻转
  • 上下翻转
  • 色彩抖动
  • 对比度变化
  • 锐度变化

注:对比度增强在可视化后,主观感觉特征更明显了,如果做了对比度增强,在测试集的时候最好也做一下。

比赛地址(已失效):农作物病害检测

成绩:线上 0.8805,线下0.875,由于划分存在随机性,可能复现会出现波动。

提醒

main.py 中的test函数已经修正,执行后在 ./submit/中会得到提交格式的 json 文件。依赖中的 pytorch 版本请保持一致,不然可能会有一些小 BUG。

1. 依赖

python3.6 pytorch0.4.1

2. 关于数据的处理

首先说明,使用的数据为官方更新后的数据,并做了一个统计分析(下文会给出),最后决定删除第 44 类和第 45 类。 并且由于数据分布的原因,将 train 和 val 数据集合并后,采用随机划分。

数据增强方式:

  • RandomRotation(30)
  • RandomHorizontalFlip()
  • RandomVerticalFlip()
  • RandomAffine(45)

图片尺寸选择了320。

3. 模型选择

模型目前就尝试了 resnet50。

4. 超参数设置

详情在 config.py 中

5.使用方法

  • 第一步:将测试集图片复制到 data/test/
  • 第二步:将训练集合验证集中的图片都复制到 data/temp/images/ 下,将两个 json 文件放到 data/temp/labels/
  • 执行 move.py 文件
  • 执行 main.py 进行训练

6.数据分布图

训练集

train

验证集

validation

7. 参考

Ai Challenger 2018 Competitions 农作物病害检测

plants_disease_classify's People

Contributors

wanghao15536870732 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.