• 大小: 63.64MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2022-08-31
  • 语言: Matlab
  • 标签: matlab  

资源简介

编写matlab程序进行鱼的分类和识别,对相应数据集进行训练达到很高的准确率

资源截图

代码片段和文件信息

function [ BGOT ] = interface_trainBGOTFromImage_update( features class_id )
%

% Usage syntax:
% [ model_data ] = interface_trainBGOTFromImage( rgbImg binImg class_id )
%
% Inputs:
%
% “features“ is the input features of fish. 
%
% “class_id“ is the class label.
%
% Outputs:
%
% “model_data“ is the BGOT model; it is a pre-trained hierarchical
%   classification tree.


% Written by:
%   Phoenix X. Huang
%   University of Edinburgh
%   U.K.
%
%   Email: Xuan.Huang@ed.ac.uk
%
%   2011 2012 2013

% -----------------------------------------------------------------------
% Copyright (2013): Phoenix X. Huang
%
% This software is distributed under the terms
% of the GNU General Public License 2.0.

% Permission to use copy  and distribute this software for
% any purpose without fee is hereby granted provided that this entire
% notice is included in all copies of any software which is or includes
% a copy or modification of this software and in all copies of the
% supporting documentation for such software.
% This software is being provided “as is“ without any express or
% implied warranty.  In particular the authors do not make any
% representation or warranty of any kind concerning the merchantability
% of this software or its fitness for any particular purpose.“
% ----------------------------------------------------------------------
%

%set default parameters
[samples dimens] = size(features);
featurei = 1:dimens; %feature id
traj = 1:samples; %trajectory id
fold=5; %5 fold cross validation
classifier=2; %use 1vs1 classifier
traj_vote=0; %not use trajectory voting
class_set=unique(class_id); %input class set
node_id = 1; %root node

%train binary split tree (BGOT without feature selection)
[ hier ] = append_constructRecursiveNode( features featurei class_id traj‘ fold classifier traj_vote class_set node_id);
hier.b_isTree = 1;
hier.node_classSet = class_set;
%an example of using forward sequential feature selection to select feature
%subset for BGOT. Note: if this function does not work for you you may try
%to do feature selection first and assign Subfeature by using
%append_hier_assignFSSubset. 
%
%append_hierFeatureSelection = feature selection + append_hier_assignFSSubset
[ BGOT ] = append_hierFeatureSelection( hier features featurei class_id traj‘ ‘.‘);
%set Root Subfeature field for node rejection
[featureSubset scoreResult] = classify_featureselection_fw(features featurei class_id traj‘ length(unique(featurei)) 3 fold classifier ‘fs_root‘);
[mv mi] = max(scoreResult(: standard));
BGOT.Root.Subfeature = featureSubset(1:mi);

%use cross validation for evaluation
%[  result] = classify_crossValidation(features featurei class_id traj‘ fold classifier 0 BGOT 1);
end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-03-05 15:48  fishRecognition\
     文件        2816  2018-03-05 15:25  fishRecognition\README
     文件      493449  2013-10-15 01:06  fishRecognition\features.mat
     目录           0  2018-03-05 15:48  fishRecognition\fish_recog\
     文件         468  2013-10-06 22:44  fishRecognition\fish_recog\CheckData.m
     文件        1910  2013-10-06 22:44  fishRecognition\fish_recog\GrabCut.m
     文件       14299  2013-10-06 22:44  fishRecognition\fish_recog\GraphCut.m
     文件      119633  2013-10-06 22:44  fishRecognition\fish_recog\GraphCutConstr.mexglx
     文件      127351  2013-10-06 22:44  fishRecognition\fish_recog\GraphCutMex.mexglx
     文件        1192  2013-10-06 22:44  fishRecognition\fish_recog\LocalColorModel.m
     文件        3233  2013-10-06 22:44  fishRecognition\fish_recog\RecognizeFish.m
     文件         170  2013-10-06 22:44  fishRecognition\fish_recog\SmoothnessTerm.m
     文件      178236  2013-10-06 22:44  fishRecognition\fish_recog\a_history.m
     文件         285  2013-10-06 22:44  fishRecognition\fish_recog\append_CalculateSim_byResult.m
     文件         509  2013-10-06 22:44  fishRecognition\fish_recog\append_acceptImage.m
     文件         625  2013-10-06 22:44  fishRecognition\fish_recog\append_addSpeciesSubfeature.m
     文件        2073  2013-10-06 22:44  fishRecognition\fish_recog\append_ami_afinv.txt
     文件         983  2013-10-06 22:44  fishRecognition\fish_recog\append_ami_cafmi.m
     文件         493  2013-10-06 22:44  fishRecognition\fish_recog\append_ami_cm.m
     文件         374  2013-10-06 22:44  fishRecognition\fish_recog\append_ami_readinv.m
     文件         633  2013-10-06 22:44  fishRecognition\fish_recog\append_cleanBinaryImage.m
     文件         249  2013-10-06 22:44  fishRecognition\fish_recog\append_compareChisquare.m
     文件         449  2013-10-06 22:44  fishRecognition\fish_recog\append_complexmoment.m
     文件        2175  2013-10-15 02:48  fishRecognition\fish_recog\append_constructRecursiveNode.m
     文件        2288  2013-10-06 22:44  fishRecognition\fish_recog\append_constructRecursiveNode_parfor.m
     文件        1241  2013-10-06 22:44  fishRecognition\fish_recog\append_construct_hier.m
     文件         673  2013-10-06 22:44  fishRecognition\fish_recog\append_convertScore_allNodes_15.m
     文件         147  2013-10-06 22:44  fishRecognition\fish_recog\append_convertlabel.m
     文件         304  2013-10-06 22:44  fishRecognition\fish_recog\append_convertscore.m
     文件        1814  2013-10-06 22:44  fishRecognition\fish_recog\append_createTreeFromTable.m
     文件         843  2013-10-06 22:44  fishRecognition\fish_recog\append_createZeroMeanUnitVarianceImage.m
............此处省略155个文件信息

评论

共有 条评论