当前位置:网站首页>[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 .
边栏推荐
- Tips and extensions of graph theory
- [stonedb fault diagnosis] database instance crash
- Pyqt5 rapid development and practice 4.9 dialog controls
- iMeta | 国际标准刊号ISSN印刷版正式确认,双ISSN申请完成
- Test article
- 测试文章
- Www 2019 | Han: heterograph attention network
- 常用泰勒展开
- MySQL basic installation and startup
- containerd ctr运行ansible容器执行ansible-playbook任务完整命令
猜你喜欢

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

Cloudcompare & PCL point cloud equally spaced slices

Exercise --- BFS
![[C language] simulate and implement string functions (Part 1)](/img/13/afb015de3448e20a0b7b09c1aca4ad.png)
[C language] simulate and implement string functions (Part 1)

习题 --- BFS

See how Gan controls the image generation style step by step? Explain the evolution process of stylegan in detail

Find and leverage xxE – XML external entity injection

Introduction to the paper | language model for long text under transformer architecture

You don't know about redis. Let me explain the underlying data structure of redis in detail

20 character short domain name bypass replication
随机推荐
Promise solves asynchrony
Convnext:a convnet for the 2020s - model Brief
8000字讲透OBSA原理与应用实践
[elm classification] classification of UCI data sets based on nuclear limit learning machine and limit learning machine, with matlab code
Pentium快速系统调用学习
helm chart详解及常用命令:helm template / package / plugin
Cloud security daily 220714: Cisco identity service engine found an authentication bypass vulnerability and needs to be upgraded as soon as possible
只会Excel想做图表可视化,让数据动起来?可以,快来围观啦(附大量模板下载)
Keming food: the average increase in the sales price of various series of products is about 5%
Preparation of peptide kc2s modified albumin nanoparticles / targeting peptide GX1 modified human serum albumin nanoparticles probe
Unity 的基础光照
【数字识别】基于Hopfield神经网络识别0-9数字附Matlab代码
八大排序之冒泡、快排、堆排、基数排序
51 MCU internal peripherals: real time clock (SPI)
How do I shut down oracle?
20 character short domain name bypass replication
【GNN报告】加拿大蒙特利尔唐建:Geometric Deep Learning For Drug Discovery
Summary of exam on May 17, 2022
Tips and extensions of graph theory
How to narrow the gap between project planning and implementation?