👨🎓个人主页
💥💥💞💞欢迎来到本博客❤️❤️💥💥
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
📋📋📋本文目录如下:🎁🎁🎁
目录
💥1 概述
摘要:我们提出了一种基于稀疏性的轻量级算法,即用于高光谱图像(HSI)分类的基本阈值分类器(BTC)。BTC是一个像素分类器,仅使用给定测试像素的光谱特征。它使用由标记的训练像素组成的预定字典执行分类。然后,它生成测试像素的类标签和残差矢量。由于在HSI分类中纳入空间和光谱信息是提高分类准确性的有效方法,因此我们将建议扩展到三步空间光谱框架。首先,给定HSI的每个像素都使用BTC进行分类。由此产生的残差向量形成一个立方体,可以解释为表示残差图的图像堆栈。其次,使用平均过滤器过滤每个残差图。最后,根据最小残差确定每个测试像素的类标签。在公共数据集上的数值结果表明,我们的提案在分类精度和计算成本方面都优于众所周知的基于支持向量机的技术和基于稀疏的贪婪方法,如同步正交匹配追踪。
基于阈值分类器(BTC)的高光谱图像分类研究详解
一、BTC的基本原理与定义
基本阈值分类器(Basic Thresholding Classifier, BTC)是一种基于稀疏性理论的轻量级像素级分类算法,专为高光谱图像(HSI)设计。其核心思想是通过预定义的训练样本字典生成残差向量,并利用最小残差准则确定类别标签。具体流程如下:
-
字典构建:由标记训练样本组成的光谱特征字典,每个类别对应一个子字典。
-
残差计算:对测试像素进行稀疏表示,生成各子字典下的残差向量,公式为:
-
空间-光谱融合:通过平均滤波器对残差图进行平滑处理,消除噪声干扰,最终选择最小残差对应的类别作为分类结果。
优势:
- 计算高效:无需复杂优化,仅需线性运算,适合实时处理。
- 抗休斯现象:通过稀疏表示缓解高维数据下样本不足的问题。
二、高光谱图像分类的主要技术挑战
BTC需应对以下核心问题:
- 维度灾难(Curse of Dimensionality):
- 光谱波段数(如Indian Pines的224个波段)远超过训练样本量,导致分类器泛化能力下降。
- 同物异谱与异物同谱:
- 光照、大气条件变化导致同类地物光谱差异大,不同类光谱相似。
- 空间异质性:
- 低空间分辨率下混合像素普遍存在,如城市区域中建筑与植被的混合。
- 计算资源限制:
- 传统方法(如SVM)参数调整复杂,深度学习模型训练成本高。
三、BTC与传统分类器的性能对比
指标 | BTC | SVM | 随机森林(RF) |
---|---|---|---|
分类精度 | 平均OA达95.2%(Indian Pines) | OA约92-94% | OA约89-91% |
计算速度 | 单像素分类耗时<1ms | 核函数计算复杂度高,耗时较长 | 多树集成,并行效率高但内存占用大 |
参数敏感性 | 仅需调节阈值参数(如M=100) | 需优化核函数、惩罚因子C | 树深度、特征采样比例影响显著 |
适用场景 | 小样本、实时分类任务 | 中等规模数据集,需精确调参 | 大数据集、非线性特征明显时 |
实验结论:在Indian Pines数据集上,BTC的总体分类精度(OA)比SVM提高3-5%,计算时间减少约40%。
四、BTC的最新研究进展
- 空间-光谱联合优化:
- 三步框架:原始分类→残差图平均滤波→二次分类,显著提升边缘区域准确性(如农田边界分类精度提高8%)。
- 核化BTC(Kernel-BTC):
- 引入核函数映射非线性特征,解决光谱非线性可分问题,在Pavia University数据集上OA提升至97.1%。
- 集成学习扩展:
- 通过多个阈值参数生成基分类器,再投票集成,降低过拟合风险。
- 自适应阈值选择:
- 利用充分识别条件(SIC)动态调整阈值,减少人工干预。
五、常用数据集与评价指标
数据集 | 传感器 | 空间尺寸 | 波段数 | 类别数 | 典型应用场景 |
---|---|---|---|---|---|
Indian Pines | AVIRIS | 145×145 | 224 | 16 | 农作物分类 |
Pavia University | ROSIS | 610×340 | 103 | 9 | 城市地物识别 |
Salinas Scene | AVIRIS | 512×217 | 204 | 16 | 植被与土壤分析 |
评价指标:
- 总体精度(OA) :正确分类像素数占总像素比例,反映全局性能。
- 平均精度(AA) :各类别精度的算术平均,避免类别不平衡影响。
- Kappa系数(κ) :衡量分类结果与随机分类的一致性,范围0-1,>0.8为优秀。
六、未来研究方向
- 多模态融合:结合LiDAR或SAR数据增强空间上下文信息。
- 轻量化部署:设计FPGA专用硬件加速BTC的实时分类。
- 半监督扩展:利用未标记样本提升小数据场景下的鲁棒性。
- 可解释性增强:可视化残差图与阈值决策过程,满足遥感应用的可信需求。
通过上述技术创新,BTC有望在农业监测、环境评估等领域实现更高效的精准分类应用。
📚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.