当前位置:网站首页>[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 .
边栏推荐
- Main security risks and Countermeasures of cloud computing services
- Convnext:a convnet for the 2020s - model Brief
- Solve the problem that the last bit of IP address access is odd and even, or even and odd (the problem encountered when the cloud encryption machine connects to the cloud server, the whole process is
- Safety Fundamentals 1
- The security dilemma of software supply chain faced by enterprises
- 知乎数据分析训练营全能班
- 【ELM分类】基于核极限学习机和极限学习机实现UCI数据集分类附matlab代码
- Find and leverage xxE – XML external entity injection
- Preparation of peptide kc2s modified albumin nanoparticles / targeting peptide GX1 modified human serum albumin nanoparticles probe
- 51 MCU internal peripherals: real time clock (SPI)
猜你喜欢

习题 --- BFS

Blender plug-in of 2022

The wechat installation package has expanded 575 times in 11 years, and the up owner: "98% of the documents are garbage"; Apple App store was exposed to a large number of pornographic apps; Four techn

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

微信安装包11年膨胀575倍,UP主:“98%的文件是垃圾”;苹果应用商店被曝大量色情App;四大科技巨头呼吁废除闰秒|极客头条

Excel VBA finds out the maximum and minimum values of a column of time, and repeatedly pastes multiple values according to the actual situation

Cy3 fluorescent labeling antibody / protein Kit (10~100mg labeling amount)

Quartus:Instantiation of ‘sdram_ model_ plus‘ failed. The design unit was not found.

Three consecutive high-frequency interview questions of redis online celebrity: cache penetration? Cache breakdown? Cache avalanche?

Basic SQL DQL
随机推荐
Promise解决异步
Network development socket and UDP, TCP protocols
图基本知识代码
Basic SQL general syntax and classification
What is the MySQL data storage method?
Cloud native enthusiast weekly: a complete collection of client go examples
Px4 module design part 13: workqueue design
面试官:说一下网络数据传输的具体流程
常用泰勒展开
一篇文章读懂人工神经网络
360入选中国安全产业全景图63个领域 ISC2022共话安全服务方向
Dry goods semantic web, Web3.0, Web3, metauniverse, these concepts are still confused? (medium)
图论的小技巧以及扩展
【图像检测】基于Combined Separability Filter实现鼻孔和瞳孔等圆检测matlab源码
Library management system based on SSM framework
2022/5/18 exam summary
看GAN如何一步步控制图像生成风格?详解StyleGAN进化过程
[idea] fluency optimization
怎么使用xshell免费版
Shuffle, partition and read of tfrecord