资源简介
BP神经网络实现图像识别(BP神经网络实现图像识别,批量输入图像得到识别结果。)

代码片段和文件信息
% clear all;close all;
% %读取训练数据
% [f1f2f3f4class] = textread(‘floTrainData.txt‘ ‘%f%f%f%f%f‘150);
tic;
clc;clear all;close all;
% % listing=dir(‘F:\桌面\ELM数据集\1(*).jpg‘);
% Files1 = dir(fullfile(‘C:\Users\Administrator\Desktop\AUV声呐论文\BP\数据\正\‘‘*.jpg‘));
% Length = length(Files1);
% for i=1: Length
% I = imread(strcat(‘C:\Users\Administrator\Desktop\AUV声呐论文\BP\数据\正\‘Files1(i).name));
% I=imresize(I[100 100]);
% x1(:i)=reshape(I100*1001);
% end
% Files2 = dir(fullfile(‘C:\Users\Administrator\Desktop\AUV声呐论文\BP\数据\负\‘‘*.jpg‘));
% Length = length(Files2);
% for i=1: Length
% I = imread(strcat(‘C:\Users\Administrator\Desktop\AUV声呐论文\BP\数据\负\‘Files2(i).name));
% I=imresize(I[100 100]);
% x2(:i)=reshape(I100*1001);
% end
% t=ones(1Length);
% jzcs_9ping40=cat(1tx);
%---------------------------------------------------
%输入输出数据
%---------------------------------------------------
load(‘F:\程序\胶州湾识别\程序\BPcode\JZtest_70pingcd_jhbw_bp.mat‘)
load(‘F:\程序\胶州湾识别\程序\BPcode\JZtrain_70pingcd_jhbw_bp.mat‘)
x=JZtrain_70pingcd_jhbw_bp(2:end:);
label=JZtrain_70pingcd_jhbw_bp(1:);
x_test=JZtest_70pingcd_jhbw_bp(2:end:);
label_test=JZtest_70pingcd_jhbw_bp(1:);
% x=[x1 x2];
% label=[1 1 1 1 1 1 1 2 2 2 2 2 2 2];
% x=double(x);
% x_test=x(:6:9);
% label_test=label(:6:9);
%特征值归一化
[inputminImaxI] = premnmx(x) ;
%构造输出矩阵
class=label‘;
s = length( class) ;
output = zeros( s 1 ) ;%改标签类型
for i = 1 : s
output( i class( i1 )) = 1 ;
end
%创建神经网络
net = newff( minmax(input) [10 2] { ‘logsig‘ ‘purelin‘ } ‘traingdx‘ ) ;
%设置训练参数
net.trainparam.show = 50 ;
net.trainparam.epochs = 500 ;
net.trainparam.goal = 0.01 ;
net.trainParam.lr = 0.01 ;
%开始训练
net = train( net input output‘ ) ;
%读取测试数据
% [t1 t2 t3 t4 c] = textread(‘floTestData.txt‘ ‘%f%f%f%f%f‘150);
%测试数据归一化
testInput = tramnmx ( x_test minI maxI ) ;
c=label_test‘;
%仿真
Y = sim( net testInput )
%统计识别正确率
[s1 s2] = size( Y ) ;
hitNum = 0 ;
for i = 1 : s2
[m Index] = max( Y( : i ) ) ;
if( Index == c(i) )
hitNum = hitNum + 1 ;
end
end
sprintf(‘识别率是 %3.3f%%‘100 * hitNum / s2 )
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2318 2017-03-17 19:56 BP.m
- 上一篇:用回溯法解决TSP问题
- 下一篇:中国电信笔试题资料通信类
相关资源
- bp神经网络源代码,可直接运行
- 改进的BP神经网络算法
- [免费]图像识别c 源码
- 基于bp神经网络的表情识别
- 基于熵权法的PHC管桩承载力组合预测
- 基于ARIMA、BP神经网络与GM的组合模型
- 基于双隐含层BP神经网络的预测
- 基于PSO优化BP神经网络的水质预测研究
- BP神经网络算法逼近一个正弦函数
- 基于opencv的图像识别识别图像中的色
- 基于主成分分析与BP神经网络的雾天能
- 一种基于模板匹配的人民币编号识别
- 水果识别代码
- 基于BP神经网络的挖掘机液压系统故障
- BP神经网络在手机评价中的应用
- 基于因素分析与BP神经网络的上市公司
- BP神经网络计算过程详解
- 图像识别程序代码Version 2.0 January 20
- 微信小程序使用AI开放平台,实现图像
- 医学图像识别研究
- 基于BP神经网络电力系统短期负荷预测
- BP神经网络用于两类图片识别分类
- 各种优化BP神经网络算法
- 勘智K210 20种物体识别工程添加图像处
- 基于BP神经网络的车牌识别技术
- 基于LabVIEW的BP神经网络算法的设计实
- 基于人工神经网络的图像识别和分类
- bp神经网络图像识别
- tesseract-ocr/tessdata 语言包
- 基于BP神经网络的人脸识别的源代码
评论
共有 条评论