资源简介
基于半监督的svm的图像分类方法。通过聚类核的方法利用无标记样本局部正则化训练核的表达式。这种方法通过图像直接学习一个自适应的核。程序仿真的文章是:Semi-supervised Remote Sensing Image Classification
代码片段和文件信息
% Matlab demo for Bagged Support Vector Machines (BAG SVM)
% http://www.uv.es/gcamps/bagsvm/
% Paper: “Semi-supervised Remote Sensing Image Classification with Cluster Kernels“
% Devis Tuia and Gustavo Camps-Valls
% IEEE Geoscience and Remote Sensing Letters 2008 submitte
% Inputs: - train = vector (m x p + 1) containing
% p features of the m labeled data (m x p)
% 1 label vector (m x 1)
% - testX = vector (n x p + 1) containing
% p features of the n unlabeled data (n x p)
% 1 label vector (n x 1)
% - mode = ‘p‘ (product) or ‘s‘ (sum). Default = ‘s‘
% Outputs: - accSVM = accuracy of the standard SVM
% - accBAG = accuracy of the BAG SVM
% requires LibSVM (http://gpds.uv.es/~jordi/libsvm/)
% Devis Tuia (devis.tuia@unil.ch) and Gustavo Camps-Valls (gcamps@uv.es) 2008
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [accSVM accBAG] = demo_BAG_SVM(traintestNkmode)
close all
addpath(‘./code_svm‘)
if exist(‘mode‘‘var‘) == 0
mode = [‘s‘];
disp(‘No mode selected sum kernel by default.‘)
else
if (mode ~= [‘s‘])
if(mode ~= [‘p‘])
mode = [‘s‘];
disp(‘No mode selected sum kernel by default.‘)
end
end
end
%-----------------------------------------
%data prep (if not used as a function)
% train = textread(‘labeled.txt‘);
% test = textread(‘unlabeled.txt‘);
%
% %----
% %good results are obtained with:
% k = 5
% N = 50
% mode = [‘s‘]
% k = 2
% N = 50
%mode = [‘p‘]
%----
Xtrain = train(:1:2);
Ytrain = train(:3);
Xtest = test(:1:2);
Ytest = test(:3);
scatter(test(:1)test(:2)30test(:3))
hold on
scatter(train(:1)train(:2)303*train(:3)‘filled‘)
title(‘Initial dataset‘)
[tempidtr]=sortrows(Ytrain);
[tempidts]=sortrows(Ytest);clear temp
%-----------------------------------------
%Standard SVM
disp(‘Full SVM‘)
j=0;
trainings = 10
for ss = logspace(-33trainings)
Ktrain = kernelmatrix(‘rbf‘Xtrain‘Xtrain‘ss);
for cc = logspace(-33trainings)
j=j+1;
model = svmtrain(YtrainKtrain[‘-t 4 -v 3 -c ‘ num2str(cc)]);
RES_SVM(j:) = [ss cc model];
end;
end;
% Select the best model
[kk j] = max(RES_SVM(:3));
sigma = RES_SVM(j1);
C = RES_SVM(j2);
clear trainings j ss cc
% Train with the best model
Ktrain = kernelmatrix(‘rbf‘Xtrain‘Xtrain‘sigma);
Ktest = kernelmatrix(‘rbf‘Xtrain‘Xtest‘sigma);
model = svmtrain(YtrainKtrain[‘-t 4 -c ‘ num2str(C)]);
% Predict in test
[YpredaccSVM] = svmpredict(YtestKtest‘model);
figure
scatter(test(:1)test(:2)30Ypred‘filled‘)
hold on
scatter(train(:1)train(:2)303*train(:3)‘filled‘)
title(‘Standard SVM‘)
%ACCURACY_FULL = assessment(YtestYpred‘class‘);
%-----------------------------------------
%Construct BagSVM
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2008-09-01 15:39 demoBagSVM\
文件 6363 2008-09-01 09:05 demoBagSVM\BagSVM.m
文件 3436 2008-09-01 15:39 demoBagSVM\README
文件 704 2008-09-01 15:28 demoBagSVM\demo.m
文件 1629 2008-07-08 18:26 demoBagSVM\build_Kbag.m
文件 1191 2008-05-23 12:42 demoBagSVM\kernelmatrix.m
文件 387 2008-06-02 09:06 demoBagSVM\closerCluster.m
目录 0 2008-09-01 15:06 demoBagSVM\code_svm\
文件 68500 2008-05-23 12:42 demoBagSVM\code_svm\svmtrain.mexglx
文件 28672 2008-05-26 09:14 demoBagSVM\code_svm\svmpredict.dll
文件 64561 2008-05-23 12:42 demoBagSVM\code_svm\svmpredict.mexglx
文件 49152 2008-05-26 09:14 demoBagSVM\code_svm\svmtrain.dll
文件 6148 2008-08-30 18:23 demoBagSVM\code_svm\.DS_Store
文件 9117 2008-08-30 18:08 demoBagSVM\unlabeled.txt
文件 549 2008-08-30 18:55 demoBagSVM\labeled.txt
文件 2067 2007-10-05 15:54 demoBagSVM\L2_distance.m
- 上一篇:加权K近邻语音情感识别
- 下一篇:rvctools 机器人视觉伺服工具箱
相关资源
- SVM的手写数字识别(Handwriting recogni
- PSO SVM SVM用于分类时的参数优化
- 很好的matlab libsvm应用案例( heart_sc
- HoG SVm 人脸识别方
- SVM light 工具箱 包含和说明文件 包含
- SVM之MATLAB的简单实现
- 基于HOG+SVM的行人检测系统
- pso_svm.m-matlab程序。
- SVM参数寻优及交叉验证matlab
- 支持向量机进行预测SVMMatlab版
- 基于Matlab植物虫害检测GUI,注释,s
- Matlab PCA+SVM人脸识别包含GUI界面设计
- 支持向量机进行预测(SVM)Matlab版.
- matlab中LS_SVMlab工具箱
- L-M 优化算法和贝叶斯正则化算法训练
- 支撑向量机SVM和支撑向量回归SVR的参
- SVM的Matlab工具箱,具有详细工具箱安
- lssvm(最小二乘支持向量机)matlab
- matlab实现HOG+LBP+HIKSVM行人检测算法
- RBF and svm matlab code matlab回归预测的源
- 基于svm dtc 的船舶电力推进系统仿真模
- PCA SVM 程序
- libsvm SVM分类器
- PSO SampEn ApproxiEN RVM PSO:粒子群优化算
- matlab的libsvm3.18工具箱
- 基于pso的matlab svm参数优化寻优
- libsvm-mat-2.89-3[FarutoUltimate3.0] SVM分类、
- matlab实现的SVM多分类
- SFLA-LSSVM 混洗蛙跳算法优化最小二乘支
- PSO_LSSVM
评论
共有 条评论