当前位置:网站首页>[number recognition] recognize 0-9 numbers based on Hopfield neural network with matlab code
[number recognition] recognize 0-9 numbers based on Hopfield neural network with matlab code
2022-07-27 23:26:00 【Matlab scientific research studio】
1 Content introduction
since 1943 year McCulloch and Pitts Since the artificial neuron model was first proposed , New neuron models and their neural networks have been proposed constantly , It has become a major research direction of nonlinear science and computational intelligence . among , With the development of modern computer technology, neural network image recognition technology 、 The image processing 、 Artificial intelligence 、 Pattern recognition theory is developing rapidly , It is an image recognition method that combines the traditional image recognition method and neural network algorithm [3-4]. Character recognition using neural network plays a more and more important role in the field of computer recognition , And it is widely used in traffic license plate recognition in fog or at night 、 Machine vision and other practical applications . In recent years , utilize Hopfield Neural networks recognize noisy characters 、 Examples such as car license plate characters show that this method has a high recognition rate 、 Lu Great sex good And have Yes very good Of real use sex : example Such as zhu offer writing [5] Research 了 The base On Legacy Pass on count Law Hopfield Character recognition method based on neural network ; Wei Wu [6] Et al. Improved the neural network method of license plate character recognition template matching ; Qiu min [7] Et al. In the application of vehicle license plate character recognition Hopfield and BP The combination of network improves the recognition rate ;Tatem[8] Others took advantage of Hopfield Neural network recognizes land cover targets in remote sensing images . The above research on character recognition regards noise as a harmful factor , Focus on noise elimination , The beneficial effect of noise is ignored , In fact, noise can enhance the information processing ability of neurons , That is, the phenomenon of stochastic resonance in neuroscience [9-11]. lately ,Hopfield Great progress has been made in the study of stochastic resonance in Neural Networks , Such as Katada[9] And so on Hopfield Stochastic resonance in Networks , And extend to include 156 In a network of neurons ;Pinamonti[10] Et al. Studied the important characteristics of multimodal stochastic resonance in Complex Networks ;Nishimura[11] Et al. Studied by 3 Stochastic resonance feedback in a neural network composed of neurons , Take it as an effective double potential well model of chaotic dynamics . This paper mainly uses discrete Hopfield Neural network recognizes handwritten digits , Turn the binary encoding of the recognized image into serial encoding , According to the law that the signal returns and reciprocates in the steady state, it is input to Hopfield In Neural Networks , Not only the amplitude modulation of input signal is studied , The influence of inter symbol interval and the number of neuron coupling on network recognition image , The nonlinear characteristics of noise intensity and image recognition error rate during transmission are also studied Hopfield Neural network is composed of Hopfield[12-13] On 1982 A single-layer 、 The output is a binary fully connected feedback nerve The Internet . discrete Hopfield Neural networks have only one neuron layer , The first 0 Layer is only used as the input of the network , No calculation function , And the first 1 Layers are neurons layer , It is used to calculate the cumulative sum of the product of input data and weight coefficient , And the output information is generated after being processed by the nonlinear activation function . The network simulates biological nerves The memory mechanism of the network , It has the function of associative memory .3 A discrete of neurons Hopfield Neural networks can be represented by weighted undirected graphs , Pictured 1 Shown . chart 1 discrete Hopfield Neural network structure Fig.1 Architectureofdiscreteneuralnetworks From the picture 1 It can be seen that neurons are interconnected , And the net The output of each neuron in the collateral is fed back to other neurons , Every time The weight on the edge indicates the connection strength between relevant neurons , Each section A dot represents a neuron and is attached with a threshold , When a neuron receives When the stimulus exceeds its threshold , Neurons are activated , otherwise Neurons are at rest . We take the neuron activation function [9] by



2 Simulation code
function out1 = newhop(varargin)%NEWHOP Design a Hopfield recurrent network.%% Hopfield networks perform a kind of pattern recall. They are included% primarily for historical purposes. For more robust pattern recognition% use <a href="matlab:doc patternnet">patternnet</a>.%% <a href="matlab:doc newhop">newhop</a>(T) takes an RxQ matrix of Q target vectors T with element% values of +1 or -1, and returns a new Hopfield recurrent neural% network with stable points at the vectors in T.%% Here a Hopfield network with two three-element stable points is% designed and simulated.%% T = [-1 -1 1; 1 -1 1]';% net = <a href="matlab:doc newhop">newhop</a>(T);% Ai = T;% [Y,Pf,Af] = net(2,[],Ai)%% To see if the network can correct a corrupted vector, run% the following code which simulates the Hopfield network for% five timesteps. (Since Hopfield networks have no inputs,% the second argument to SIM is {Q TS} = [1 5] when using cell% array notation.)%% Ai = {[-0.9; -0.8; 0.7]};% [Y,Pf,Af] = net({1 5},{},Ai);% Y{1}%% If you run the above code Y{1} will equal T(:,1) if the% network has managed to convert the corrupted vector Ai to% the nearest target vector.%% See also SIM, SATLINS.% Mark Beale, 11-31-97% Copyright 1992-2011 The MathWorks, Inc.%% =======================================================% BOILERPLATE_START% This code is the same for all Network Functions.persistent INFO;if isempty(INFO), INFO = get_info; endif (nargin > 0) && ischar(varargin{1}) ...&& ~strcmpi(varargin{1},'hardlim') && ~strcmpi(varargin{1},'hardlims')code = varargin{1};switch codecase 'info',out1 = INFO;case 'check_param'err = check_param(varargin{2});if ~isempty(err), nnerr.throw('Args',err); endout1 = err;case 'create'if nargin < 2, error(message('nnet:Args:NotEnough')); endparam = varargin{2};err = nntest.param(INFO.parameters,param);if ~isempty(err), nnerr.throw('Args',err); endout1 = create_network(param);out1.name = INFO.name;otherwise,% Quick info field accesstryout1 = eval(['INFO.' code]);catch %#ok<CTCH>nnerr.throw(['Unrecognized argument: ''' code ''''])endendelse[args,param] = nnparam.extract_param(varargin,INFO.defaultParam);[param,err] = INFO.overrideStructure(param,args);if ~isempty(err), nnerr.throw('Args',err,'Parameters'); endnet = create_network(param);net.name = INFO.name;out1 = init(net);endendfunction v = fcnversionv = 7;end% BOILERPLATE_END%% =======================================================function info = get_infoinfo = nnfcnNetwork(mfilename,'Hopfield Network',fcnversion, ...[ ...nnetParamInfo('targets','Target Data','nntype.data',{1},...'Target output data.'), ...]);endfunction err = check_param(param)err = '';endfunction net = create_network(param)% Formatt = param.targets;if iscell(t), t = cell2mat(t); end% CHECKINGif (~isa(t,'double')) || ~isreal(t) || isempty(t)error(message('nnet:NNData:TargetsNotRealNonEmpty'));end% DIMENSIONS[S,Q] = size(t);% NETWORK PARAMETERS[w,b] = solvehop2(t);% NETWORK ARCHITECTUREnet = network(0,1,[1],[],[1],[1]);% RECURRENT LAYERnet.layers{1}.size = S;net.layers{1}.transferFcn = 'satlins';net.b{1} = b;net.lw{1,1} = w;net.layerWeights{1,1}.delays = 1;end%==========================================================function [w,b] = solvehop2(t)[S,Q] = size(t);Y = t(:,1:Q-1)-t(:,Q)*ones(1,Q-1);[U,SS,V] = svd(Y);K = rank(SS);TP = zeros(S,S);for k=1:KTP = TP + U(:,k)*U(:,k)';endTM = zeros(S,S);for k=K+1:STM = TM + U(:,k)*U(:,k)';endtau = 10;Ttau = TP - tau*TM;Itau = t(:,Q) - Ttau*t(:,Q);h = 0.15;C1 = exp(h)-1;C2 = -(exp(-tau*h)-1)/tau;w = expm(h*Ttau);b = U * [ C1*eye(K) zeros(K,S-K);zeros(S-K,K) C2*eye(S-K)] * U' * Itau;end%==========================================================
3 Running results

4 reference
[1] Wang Xiaofeng . Based on discrete Hopfield Research on number recognition of neural network [J]. Journal of Xinzhou Normal University , 2012, 028(002):21-24.
[2] Ren Donghong , Lin Peng , and Yuan Qingping . " Based on discrete Hopfield Digital pattern recognition based on Neural Network ." Modern vocational education 14(2018):1.
About bloggers : Good at intelligent optimization algorithms 、 Neural networks predict 、 signal processing 、 Cellular automata 、 The image processing 、 Path planning 、 UAV and other fields Matlab Simulation , relevant matlab Code problems can be exchanged by private letter .
Some theories cite network literature , If there is infringement, contact the blogger to delete .
边栏推荐
- 毕设-基于SSM高校后勤管理系统
- 51 MCU internal peripherals: real time clock (SPI)
- Process and planned task management
- Main security risks and Countermeasures of cloud computing services
- 如何快捷地查看H.265视频播放器EasyPlayer的API属性及其使用方法?
- Object creation process and object layout
- Zhihu data analysis training camp all-round class
- Arm32进行远程调试
- 许锦波:AI蛋白质预测与设计
- Do you want to be dismissed? Let's take a look at the "exit tips" of programmers
猜你喜欢

一篇文章读懂人工神经网络

【图像检测】基于Combined Separability Filter实现鼻孔和瞳孔等圆检测matlab源码

小程序容器技术超有料,可以让移动研发效率大幅提升

4 轮拿下字节 Offer,面试题复盘

迪赛智慧数——其他图表(平行坐标图):家庭未来资产配置意愿

Pyqt5 rapid development and practice 4.9 dialog controls

Pyqt5 rapid development and practice 4.10 window drawing controls

Preparation of peptide kc2s modified albumin nanoparticles / targeting peptide GX1 modified human serum albumin nanoparticles probe

【GNN报告】加拿大蒙特利尔唐建:Geometric Deep Learning For Drug Discovery

Desai wisdom number - other charts (parallel coordinate chart): family's willingness to allocate assets in the future
随机推荐
Security-001
小程序容器技术超有料,可以让移动研发效率大幅提升
Preliminary understanding of Panda3D audio and advanced interactive components
【GNN报告】加拿大蒙特利尔唐建:Geometric Deep Learning For Drug Discovery
Cy3 fluorescent labeling antibody / protein Kit (10~100mg labeling amount)
图基本知识代码
八大排序之冒泡、快排、堆排、基数排序
【数字识别】基于知识库实现手写体数字识别附matlab代码
Pentium fast system call learning
"The faster the code is written, the slower the program runs."
你不知道的Redis那些事,我来详解Redis底层数据结构
[idea] fluency optimization
常用泰勒展开
Three consecutive high-frequency interview questions of redis online celebrity: cache penetration? Cache breakdown? Cache avalanche?
Convnext:a convnet for the 2020s - model Brief
The significance of enterprise digital transformation, digital transformation is not a choice
2022/6/9 exam summary
习题 --- BFS
containerd ctr运行ansible容器执行ansible-playbook任务完整命令
Harmonyos third operation