【图像分类】基于阈值分类器(BTC)进行高光谱图像分类研究(Matlab代码实现)

 👨‍🎓个人主页:研学社的博客    

💥💥💞💞欢迎来到本博客❤️❤️💥💥

🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。

⛳️座右铭:行百里者,半于九十。

📋📋📋本文目录如下:🎁🎁🎁

目录

💥1 概述

📚2 运行结果

🎉3 参考文献

🌈4 Matlab代码实现


💥1 概述

文献来源:

 摘要:我们提出了一种基于稀疏性的轻量级算法,即用于高光谱图像(HSI)分类的基本阈值分类器(BTC)。BTC是一个像素分类器,仅使用给定测试像素的光谱特征。它使用由标记的训练像素组成的预定字典执行分类。然后,它生成测试像素的类标签和残差矢量。由于在HSI分类中纳入空间和光谱信息是提高分类准确性的有效方法,因此我们将建议扩展到三步空间光谱框架。首先,给定HSI的每个像素都使用BTC进行分类。由此产生的残差向量形成一个立方体,可以解释为表示残差图的图像堆栈。其次,使用平均过滤器过滤每个残差图。最后,根据最小残差确定每个测试像素的类标签。在公共数据集上的数值结果表明,我们的提案在分类精度和计算成本方面都优于众所周知的基于支持向量机的技术和基于稀疏的贪婪方法,如同步正交匹配追踪。

原文摘要:

ABSTRACT:
We propose a lightweight sparsity-based algorithm, namely, the basic thresholding classifier (BTC), for hyperspectral image (HSI) classification. BTC is a pixelwise classifier which uses only the spectral features of a given test pixel. It performs the classification using a predetermined dictionary consisting of labeled training pixels. It then produces the class label and residual vector of the test pixel. Since incorporating spatial and spectral information in HSI classification is quite an effective way of improving classification accuracy, we extend our proposal to a three-step spatial–spectral framework. First, every pixel of a given HSI is classified using BTC. The resulting residual vectors form a cube which could be interpreted as a stack of images representing residual maps. Second, each residual map is filtered using an averaging filter. Finally, the class label of each test pixel is determined based on minimal residual. Numerical results on public data sets show that our proposal outperforms well-known support vector machine-based techniques and sparsity-based greedy approaches like simultaneous orthogonal matching pursuit in terms of both classification accuracy and computational cost.

地球表面的不同物质具有不同的电磁光谱特征。在给定的 场景中,这些特征可以被具有小空间和光谱分辨率的远程传感器捕获。每个像素 捕获的高光谱图像(HSI)或数据立方体包含非常有用的光谱测量值或特征,这些测量值或特征可能是 用于区分不同的材料和物体。随着传感器技术的进步,电流传感器 能够捕获数百个光谱测量值。但是,增加HSI像素的光谱特征数量 并不总是有助于提高像素的正确分类率。例如,在监督 分类技术,在某些时候,进一步增加输入特征向量的大小可能会减少 分类准确性。这被称为高维问题或休斯现象[1]。

已经提出了几种降维技术来消除休斯现象的影响[2]-[4]。此外,为了提高分类准确性,各种方法都有 被提议。其中,支持向量机(SVM)技术优于经典方法,如K-near。 邻居 (K-NN) 和径向基函数 (RBF) 网络 [5]。已经表明,SVM 在分类方面与众不同 准确性,计算成本和对休斯现象的低脆弱性,并且需要一些训练样本[5],[6]。另一方面,SVM 方法有一些局限性。首先,它有 参数调整 (C,γ和容错)和内核(线性、RBF 等) 使用 k 折叠交叉验证完成的选择步骤,其中部分训练数据用于 测试目的。这些程序很麻烦,并且生成的参数集可能不是测试集的最佳参数集[7]。其次,由于 SVM 是一个二元分类器,因此将策略转换为 需要多类大小写。一个简单的方法是一对多(OAA)策略,其中测试样本可能导致 未分类,导致分类精度低[7]。另一种策略是一对一(OAO)方法,其中数字 二元分类器(K(K−1)/2)随着类数的增多而急剧增加(K)增加。最后的限制是概率 不能直接提供 SVM 分类器的输出,需要估计程序,例如 logistic 乙状结肠 [8]。因此,使用概率输出的基于 SVM 的方法必须依赖于 这些估计。

前面描述的 SVM 方法属于像素算法类,因为它仅使用光谱特征。 众所周知,像素级分类器的性能可以通过合并空间信息来提高 基于HSI均匀区域中的相邻像素具有相似的光谱特征的事实。 因此,已经提出了各种方法来结合光谱和空间信息。例如,一个 [9] 中提出了复合核方法,该方法成功地提高了 SVM 的分类精度。一个 [10]中提出的基于分割的技术结合了通过聚类和像素获得的分割图 SVM 技术的分类结果。最终决定由自适应定义的多数票做出 窗户。[11]中提出了一个类似的框架,该框架利用分割图使用流域变换。都 这些方法具有共同的局限性,因为它们基于 SVM 方法。

最近的空间光谱框架之一,它利用边缘保持滤波器,已经在[12]中提出。该方法使用 SVM 分类器作为像素分类步骤。 对于每个类,概率图(即 SVM 分类器的后验概率输出)将被平滑处理 通过带有灰度或RGB引导图像的边缘保留滤镜。然后根据每个像素做出最终决定 在最大概率上。作为边缘保护过滤器,它们使用最新的先进技术之一, 即引导图像过滤[13]。由于所提出的框架基于 SVM,因此它也具有通用性 基于 SVM 的分类器的问题。SVM 分类器的一种替代方法是多项式逻辑回归 (国土资源局)[14] 学习类后验概率分布的方法 使用贝叶斯框架。MLR已成功应用于[15]-[17]中的HSI分类。[18]中提出了一种基于MLR的最新技术。该方法通过拆分和增强使用逻辑回归 拉格朗日(LORSAL)[19]算法与主动学习,以估计后验 分布。在分割阶段,它在对空间进行编码之前利用多级逻辑 (MLL) 信息。与传统的分割方法相比,LORSAL-MLL(L-MLL)技术取得了有希望的结果。

📚2 运行结果

 主函数代码:

clc;
clear all;
close all;

addpath('./Dataset')
addpath('./BTC')

% ---- options ------
determineM = 0; %uses already determined threshold parameter
%determineM = 1; %determines the best threshold

spectralOnly = 1; % spectral only classification with BTC
%spectralOnly = 0; %spatial - spectral classification (BTC-WLS)


trainPercent = 10; %percentage of randomly selected train samples

M = 100; %threshold parameter

if spectralOnly == 1
    alpha = 1e-4; %optimum alpha in order to prevent ill-condioned matrix inverse
else
    alpha = 1e-10; %small alpha in order to prevent ill-condioned matrix inverse
end

imageName = 'IndianPines';

img = importdata([imageName,'.mat']);

GroundT = importdata([imageName,'_groundT.mat']);
no_classes = max(GroundT(:,2));

%%%% estimate the size of the input image
[no_lines, no_rows, no_bands] = size(img);

%%%% vectorization
img = ToVector(img);
img = img';

GroundT=GroundT';

%%%% construct training and test datasets

[indexes] = generateTrainIndexes(GroundT, trainPercent);

%%% get the training-test indexes
trainIndexes = GroundT(1,indexes);
trainLabels = GroundT(2,indexes);
groundIndexes = GroundT(1,:);
groundLabels = GroundT(2,:);
testIndexes = groundIndexes;
testLabels = groundLabels;
testIndexes(indexes) = [];
testLabels(indexes) = [];

%%% get the training-test samples
trainSamples = img(:, trainIndexes)';

testSamples = img(:, testIndexes)';

numLabel = [];
numTestLabel = [];
for jj =1 : no_classes
    numLabel = [numLabel; length(find(trainLabels==jj))];
    numTestLabel = [numTestLabel; length(find(testLabels==jj))];
end
disp(numLabel)
disp(numTestLabel)


img = img';
trainSamples = trainSamples';

trainSamples = normcol(trainSamples);

if determineM == 1
    disp('please wait ...')
    [avgBeta, bestM] = averageBeta(trainLabels, trainSamples, alpha);
    figure;
    plot(avgBeta);
    disp(bestM)
end

%%% BTC Classification
tic;
[BTCresult, errMatrix] = fxBtc(trainLabels, trainSamples, img', M, alpha);

elapsedTime =toc;
disp(['time = ',num2str(elapsedTime)]);


% evaluate the results
[BTCOA,BTCAA,BTCkappa,BTCCA]=confusion(testLabels, BTCresult(testIndexes)');
sprintf('%0.2f\n',BTCCA*100)
disp(['BTC OA = ',num2str(BTCOA*100),' AA = ',num2str(BTCAA*100),' K = ',num2str(BTCkappa*100)])


% display results of BTC
showMap(no_lines, no_rows, groundIndexes, BTCresult(groundIndexes), imageName);

mask = zeros(size(BTCresult));
mask(groundIndexes)=1;
BTCresult = mask.*BTCresult;
BTCresult = reshape(BTCresult,no_lines,no_rows);

if spectralOnly == 0
    
    % filter the results
    tic
    lambda = 0.4;  alphax = 0.9;
    EPFresult = BtcWls(img, BTCresult, errMatrix', lambda, alphax);
    toc;
    
    % display results after filtering
    EPFresult =reshape(EPFresult,[no_rows*no_lines 1]);
    [OA,AA,kappa,CA]=confusion(testLabels, EPFresult(testIndexes)');
    sprintf('%0.2f\n',CA*100)
    disp(['OA = ',num2str(OA*100),' AA = ',num2str(AA*100),' K = ',num2str(kappa*100)])
    
    % show filtered result map
    showMap(no_lines, no_rows, groundIndexes, EPFresult(groundIndexes), imageName);
    
    % show ground
    showMap(no_lines, no_rows, groundIndexes, groundLabels, imageName);
    
    % show train samples
    showMap(no_lines, no_rows, trainIndexes, trainLabels, imageName);
    
end

🎉3 参考文献

部分理论来源于网络,如有侵权请联系删除。

[1] M. A. Toksoz and I. Ulusoy, “Hyperspectral image classification via basic thresholding classifier,”
IEEE Transactions on Geoscience and Remote Sensing, 2016, doi:10.1109/TGRS.2016.2535458.
[2] M. A. Toksoz and I. Ulusoy, “Classification via ensembles of basic thresholding
classifiers,” IET Computer Vision, 2016, doi:10.1049/ietcvi.2015.0077.
Please cite them.

🌈4 Matlab代码实现

  • 17
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值