pytorch 代码,没有注释,自己理解

mirrors / eecn / Hyperspectral-Classification · GitCodehttps://gitcode.net/mirrors/eecn/Hyperspectral-Classification?utm_source=csdn_github_accelerator读我:

DeepHyperX

A Python tool to perform deep learning experiments on various hyperspectral datasets.

Reference 

This toolbox was used for our review paper in Geoscience and Remote Sensing Magazine :

N. Audebert, B. Le Saux and S. Lefevre,
"Deep Learning for Classification of Hyperspectral Data: A Comparative Review,"
in IEEE Geoscience and Remote Sensing Magazine, vol. 7, no. 2, pp. 159-173, June 2019.

N. Audebert, B. Le Saux and S. Lefevre, "Deep Learning for Classification of Hyperspectral Data: A Comparative Review," in IEEE Geoscience and Remote Sensing Magazine, vol. 7, no. 2, pp. 159-173, June 2019.

 Bibtex format :

@article{8738045, author={N. {Audebert} and B. {Le Saux} and S. {Lefèvre}}, journal={IEEE Geoscience and Remote Sensing Magazine}, title={Deep Learning for Classification of Hyperspectral Data: A Comparative Review}, year={2019}, volume={7}, number={2}, pages={159-173}, doi={10.1109/MGRS.2019.2912563}, ISSN={2373-7468}, month={June},}

Note:

The original code forked from GitLib project Linkhttps://gitlab.inria.fr/naudeber/DeepHyperX.

And there is a repository on GitHub, which maybe is the official project code. DeepHyperXhttps://github.com/nshaud/DeepHyperX

This repository will not update in the feature.If you need continuous research, please go to the project DeepHyperXhttps://github.com/nshaud/DeepHyperX Requirements

This tool is compatible with Python 2.7 and Python 3.5+.

It is based on the PyTorch deep learning and GPU computing framework and use the Visdom visualization server.

Setup 

The easiest way to install this code is to create a Python virtual environment and to install dependencies using: pip install -r requirements.txt

 Hyperspectral datasets

Several public hyperspectral datasets are available on the UPV/EHU wiki. Users can download those beforehand or let the tool download them. The default dataset folder is ./Datasets/, although this can be modified at runtime using the --folder arg.

At this time, the tool automatically downloads the following public datasets:

  • Pavia University
  • Pavia Center
  • Kennedy Space Center
  • Indian Pines
  • Botswana

The original Data Fusion Contest 2018 hyperspectral dataset(DFC2018_HSI) cannot be obtained now, you can try new IGRSS Data or email me to get the original data.(For research and non commercial purposes,do not spread randomly)

In report HSIAL there is a  statement :
If you wish to use the data, please be sure to email us and provide your Name, Contact
information, affiliation (University, research lab etc.), and an acknowledgement that you
will cite this dataset and its source appropriately, as well as provide an acknowledgementto the IEEE GRSS IADF and the Hyperspectral Image Analysis Lab at the University of Houston, in any manuscript(s) resulting from it.

An example dataset folder has the following structure:

Datasets
├── Botswana
│   ├── Botswana_gt.mat
│   └── Botswana.mat
├── DFC2018_HSI
│   ├── 2018_IEEE_GRSS_DFC_GT_TR.tif
│   ├── 2018_IEEE_GRSS_DFC_HSI_TR
│   ├── 2018_IEEE_GRSS_DFC_HSI_TR.HDR
├── IndianPines
│   ├── Indian_pines_corrected.mat
│   ├── Indian_pines_gt.mat
├── KSC
│   ├── KSC_gt.mat
│   └── KSC.mat
├── PaviaC
│   ├── Pavia_gt.mat
│   └── Pavia.mat
└── PaviaU├── PaviaU_gt.mat└── PaviaU.mat

 Adding a new dataset

Adding a custom dataset can be done by modifying the custom_datasets.py file. Developers should add a new entry to the CUSTOM_DATASETS_CONFIG variable and define a specific data loader for their use case.

Models 

Currently, this tool implements several SVM variants from the scikit-learn library and many state-of-the-art deep networks implemented in PyTorch.

  • SVM (linear, RBF and poly kernels with grid search)
  • SGD (linear SVM using stochastic gradient descent for fast optimization)
  • baseline neural network (4 fully connected layers with dropout)
  • 1D CNN (Deep Convolutional Neural Networks for Hyperspectral Image Classification, Hu et al., Journal of Sensors 2015)
  • Semi-supervised 1D CNN (Autoencodeurs pour la visualisation d'images hyperspectrales, Boulch et al., GRETSI 2017)
  • 2D CNN (Hyperspectral CNN for Image Classification & Band Selection, with Application to Face Recognition, Sharma et al, technical report 2018)
  • Semi-supervised 2D CNN (A semi-supervised Convolutional Neural Network for Hyperspectral Image Classification, Liu et al, Remote Sensing Letters 2017)
  • 3D CNN (3-D Deep Learning Approach for Remote Sensing Image Classification, Hamida et al., TGRS 2018)
  • 3D FCN (Contextual Deep CNN Based Hyperspectral Classification, Lee and Kwon, IGARSS 2016)
  • 3D CNN (Deep Feature Extraction and Classification of Hyperspectral Images Based on Convolutional Neural Networks, Chen et al., TGRS 2016)
  • 3D CNN (Spectral–Spatial Classification of Hyperspectral Imagery with 3D Convolutional Neural Network, Li et al., Remote Sensing 2017)
  • 3D CNN (HSI-CNN: A Novel Convolution Neural Network for Hyperspectral Image, Luo et al, ICPR 2018)
  • Multi-scale 3D CNN (Multi-scale 3D Deep Convolutional Neural Network for Hyperspectral Image Classification, He et al, ICIP 2017)

 Adding a new model

Adding a custom deep network can be done by modifying the models.py file. This implies creating a new class for the custom deep network and altering the get_model function.

Usage 

Start a Visdom server: python -m visdom.server and go to http://localhost:8097 to see the visualizations (or http://localhost:9999 if you use Docker).

Then, run the script main.py.

The most useful arguments are: 

  • --model to specify the model (e.g. 'svm', 'nn', 'hamida', 'lee', 'chen', 'li'),
  • --dataset to specify which dataset to use (e.g. 'PaviaC', 'PaviaU', 'IndianPines', 'KSC', 'Botswana'),
  • the --cuda switch to run the neural nets on GPU. The tool fallbacks on CPU if this switch is not specified.

There are more parameters that can be used to control more finely the behaviour of the tool. See python main.py -h for more information.

Examples: 

  • python main.py --model SVM --dataset IndianPines --training_sample 0.3 This runs a grid search on SVM on the Indian Pines dataset, using 30% of the samples for training and the rest for testing. Results are displayed in the visdom panel.
  • python main.py --model nn --dataset PaviaU --training_sample 0.1 --cuda 0 This runs on GPU a basic 4-layers fully connected neural network on the Pavia University dataset, using 10% of the samples for training.
  • python main.py --model hamida --dataset PaviaU --training_sample 0.5 --patch_size 7 --epoch 50 --cuda 0 This runs on GPU the 3D CNN from Hamida et al. on the Pavia University dataset with a patch size of 7, using 50% of the samples for training and optimizing for 50 epochs.

License information 

Code for the DeepHyperX toolbox is dual licensed depending on applications, research or commercial.

pytorch 高光谱图像分类相关推荐

  1. 毕设路线—pytorch环境下的深度学习的高光谱图像分类问题

    毕设快要结束了,一路走来一直记录着点点滴滴的技术内容,主要想写给自己看吧,作为一个项目整理的大致框架,改完最终定稿,再填补每一部分的细节. 另外如果以后有做这个方向的朋友看到了,希望能提供一点小小的帮 ...

  2. 使用HybridSN进行高光谱图像分类

    文章目录 一.前言 二.高光谱图像 三.HybridSN模型 四.注意力机制 五.开始实验 5.1 下载数据集 5.2 PCA降维 5.3 训练模型 5.4 可视化结果 5.5 分析结论 六.思考 七 ...

  3. 高光谱图像分类 HybridSN混合网络

    本次实验主要参考<HybridSN: Exploring 3-D–2-DCNN Feature Hierarchy for Hyperspectral Image Classification& ...

  4. 【项目实战课】人人免费可学!基于Pytorch的图像分类简单任务数据增强实战

    欢迎大家来到我们的项目实战课,本期内容是<基于Pytorch的图像分类简单任务数据增强实战>.所谓项目实战课,就是以简单的原理回顾+详细的项目实战的模式,针对具体的某一个主题,进行代码级的 ...

  5. 基于pytorch实现图像分类——理解自动求导、计算图、静态图、动态图、pytorch入门

    1. pytorch入门 什么是PYTORCH? 这是一个基于Python的科学计算软件包,针对两组受众: 替代NumPy以使用GPU的功能 提供最大灵活性和速度的深度学习研究平台 1.1 开发环境 ...

  6. 深度学习和高光谱图像分类

    高光谱图像分类 本人研究生在读期间,研究方向是深度学习(图像分类.目标检测).导师给了针对于高光谱图像进行分类的相关项目,由于涉及了太多与研究方向不一致的光谱学相关的陌生知识,写下这篇博文的主要目的是 ...

  7. 高光谱图像分类_高光谱图像分析-分类

    高光谱图像分类 初学者指南 (Beginner's Guide) This article provides detailed implementation of different classifi ...

  8. 高光谱图像分类--HybridSN: Exploring 3-D–2-DCNN Feature Hierarchy for Hyperspectral Image Classification

    <HybridSN: Exploring 3-D–2-DCNN Feature Hierarchy for Hyperspectral Image Classification> S. K ...

  9. Pytorch CIFAR10图像分类 LeNet5篇

    Pytorch CIFAR10图像分类 LeNet5篇 文章目录 Pytorch CIFAR10图像分类 LeNet5篇 4.定义网络(LeNet5) 5. 定义损失函数和优化器 6. 训练 损失函数 ...

最新文章

  1. 学习canvas 过程中的几点总结
  2. JavaWeb学习笔记①——Java向下转型在JavaEE中运用——登陆验证
  3. python——json数据
  4. Java 开发提升十倍生产力:idea 远程一键部署 springboot 到 Docker
  5. PHP中error_reporting()详解
  6. StarUML使用说明-指导手册
  7. python之路2.0_Python之路【第二十一篇】:JS基础
  8. webStorm编辑器(左侧目录)如何显示、隐藏?
  9. mysql中sql批量插入_sql中insert如何批量插入多条记录?
  10. 免费WEB打印控件—PAZU
  11. linux打开python3_Linux环境安装python3
  12. 用mui索引实现动态数据仿通讯录的功能
  13. 华为平板与非华为电脑(Windows系统)连接
  14. Total Phase Data Center介绍
  15. python爬虫-喜马拉雅_晚安妈妈睡前故事
  16. 第一行代码-第二版(郭霖著)笔记十(Service)
  17. 2020前端最新面试题总结(js、html、小程序、React、ES6、Vue、算法、全栈热门视频资源)(3年前端菜鸟级开发师含泪总结)
  18. 可变参数模板实现可变参数字符串一定程度替代sprintf
  19. TensorFlow基础学习
  20. Bootstrap智能消息提示框

热门文章

  1. 分布式系统中CAP原理
  2. 使用virt-manager 创建虚拟机
  3. Communication-Efficient Federated Learning for Wireless Edge Intelligence in IoT
  4. niagara框架中串口的打开方式
  5. 天翼云内网服务器映射端口,天翼云服务器创建对等连接(不同账户组内网)
  6. java去掉字符串的空格_如何去掉字符串中的空格?
  7. Excel:多个单元格内容合并——“”-PHONETIC()函数-Text()函数
  8. 解决阿里云服务器提示挖矿程序风险
  9. 国内各IE内核浏览器所调用的IE版本--转了
  10. Redis各版本的特性及架构