当前位置:网站首页>[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 .
边栏推荐
- Basic lighting of unity
- Containerd CTR run the ansible container and execute the complete command of ansible playbook task
- Basic SQL DDL
- Summary of exam on May 17, 2022
- Www 2019 | Han: heterograph attention network
- Node-RED系列(三十):使用持久化ui-table 刷新页面不清空上一次的table数据
- 微信安装包11年膨胀575倍,UP主:“98%的文件是垃圾”;苹果应用商店被曝大量色情App;四大科技巨头呼吁废除闰秒|极客头条
- 常用泰勒展开
- 【GNN报告】加拿大蒙特利尔唐建:Geometric Deep Learning For Drug Discovery
- 八大排序之冒泡、快排、堆排、基数排序
猜你喜欢

Microsoft Office 2019 download installation activation tutorial (full process diagram)

【数字识别】基于Hopfield神经网络识别0-9数字附Matlab代码

Parameter transmission of components

JVM composition and memory model
软件测试功能测试全套常见面试题【功能测试】面试总结4-2

Desai wisdom number - other charts (parallel coordinate chart): family's willingness to allocate assets in the future

Safety foundation 2

【数字识别】基于知识库实现手写体数字识别附matlab代码

Vulnhub range double trouble

【信号去噪】基于卡尔曼滤波实现信号去噪附matlab代码
随机推荐
Parameter transmission of components
【数字识别】基于知识库实现手写体数字识别附matlab代码
How to narrow the gap between project planning and implementation?
Introduction to the paper | distributed graph simulation
毕设-基于SSM高校后勤管理系统
2022/6/9 exam summary
【数字识别】基于Hopfield神经网络识别0-9数字附Matlab代码
JVM composition and memory model
Keming food: the average increase in the sales price of various series of products is about 5%
On data management of data warehouse
只会Excel想做图表可视化,让数据动起来?可以,快来围观啦(附大量模板下载)
Cloud security daily 220714: Cisco identity service engine found an authentication bypass vulnerability and needs to be upgraded as soon as possible
Desai wisdom number - other charts (parallel coordinate chart): family's willingness to allocate assets in the future
20 character short domain name bypass replication
如何快捷地查看H.265视频播放器EasyPlayer的API属性及其使用方法?
The prefix is not removed when zuul gateway automatically routes
You don't know about redis. Let me explain the underlying data structure of redis in detail
Exercise --- BFS
Five network management trends in 2022
【StoneDB故障诊断】数据库实例crash