CN101504736A - Method for implementing neural network algorithm based on Delphi software - Google Patents

Method for implementing neural network algorithm based on Delphi software Download PDF

Info

Publication number
CN101504736A
CN101504736A CNA2009100608800A CN200910060880A CN101504736A CN 101504736 A CN101504736 A CN 101504736A CN A2009100608800 A CNA2009100608800 A CN A2009100608800A CN 200910060880 A CN200910060880 A CN 200910060880A CN 101504736 A CN101504736 A CN 101504736A
Authority
CN
China
Prior art keywords
matlab
delphi
neural network
algorithm
activex
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CNA2009100608800A
Other languages
Chinese (zh)
Inventor
漆为民
杨晓林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jianghan University
Original Assignee
Jianghan University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jianghan University filed Critical Jianghan University
Priority to CNA2009100608800A priority Critical patent/CN101504736A/en
Publication of CN101504736A publication Critical patent/CN101504736A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a Delphi software-based method for realizing a neural net algorithm, which comprises the following steps: after establishing an ActiveX automatic connection between a Delphi application program and a Matlab, executing a Matlab command in the Delphi to realize effective database calling by using the Matlab; performing the neural net learning analysis of the effective data; and feeding back an algorithm result to the Delphi in real time and successfully applying the algorithm result to actual control. In the method, the Matlab neural net algorithm is successfully applied to a control program of the Delphi, and the algorithm executing efficiency of the Matlab is improved considerably; and at the same time, the problems of seamless interfaces and unified packing of an artificial neural net algorithm program and other application programs are solved, so the neural net algorithm program has high reliability, unalterability and security.

Description

Realize the method for neural network algorithm based on Delphi software
Technical field
The invention belongs to the application of computer software technology aspect the establishment neural networks application programs, be specifically related to a kind of method that realizes neural network algorithm based on Delphi software.
Background technology
Artificial neural network is an important tool of carrying out multiple algorithm research, general artificial neural network application software all is to work out under the platform of Matlab, and then with other interface applications software interface, form the situation that a plurality of application platform softwares are arranged in the computing machine.
Artificial neural network is an important tool software platform of the various complicated algorithms of research, carry out the applied research of neural network, will be under the platform of Matlab, programme with special programmed statements, this program is difficult to be compiled as an executable file, and promptly the neural network source program is opened below the Matlab platform only; In addition, the result that the algorithm software of neural network carries out also will carry out interface with other system application, and this interfacing is more complicated also.Therefore in the middle of the application technology of a reality, if existing general application program has the algorithm routine of neural network again, general application program can be packaged as executable file, and this executable file user can't see source program, so this program has confidentiality and reliability; And Application of Neural Network software can not be packed, and the user can see source program, and can carry out hack to this program, causes potential safety hazard.
Summary of the invention
The object of the present invention is to provide a kind of method that realizes neural network algorithm based on Delphi software; It directly adopts Delphi software programming neural network algorithm software under the platform of application program, the formation executable file of then algorithm software and application software being packed together, two kinds of softwares are realized seamless links, and the user can't see source program, more impossible source program are made amendment.Increase the security and the reliability of algorithm routine greatly, also increased the confidentiality of program.
Technical scheme of the present invention is: the method that realizes neural network algorithm based on Delphi software, it is after the ActiveX robotization connection of setting up between a Delphi application program and the Matlab, the order of carrying out Matlab in Delphi has realized calling efficient database with Matlab, valid data are carried out the neural network learning analysis, and return arithmetic result in real time to Delphi and successfully apply in the working control; It is as follows for the process of promptly carrying out the Matlab order in Delphi that described Delphi calls the neural network algorithm process: the registration ActiveX object; Produce and obtain the Matlab object; Matlab reads expert database; Matlab generates improved Elman neural network; The neural network learning training parameter is set; Neural network learning training back is calculated output and is used for the Delphi program.
Described registration ActiveX object is that Matlab registers in the registration table of Windows operating system; Form is carried out following order: mattlab/Regserver; The method of generation and acquisition Matlab object is: use following statement: Matlab=Creatoleobject (' Matlab.Application ') in Delphi; A method carrying out the Matlab object in Delphi is to use Matlab.Execute (command) function, wherein the command string of parameters C ommand for wanting Matlab to carry out.
Described Delphi application program is obtained array from Matlab ActiveX Automation object method is GetFullMatrix, and the method for transmitting array in Matlab ActiveX Automation object is PutFullMattix.Delphi is a visual programming language very flexibly, but too low in aspect efficient such as numerical value Treatment Analysis and algorithms.And Matlab has ripe algorithm at aspects such as control automatically, neural networks.The algorithm the Matlab neural network successful in this patent applies in the control program of Delphi, has reached the control effect of expection.
Be used for the automatic control system that dynamic data processing such as waterworks produce at this patent, utilize Delphi to set up complete acquisition database, by neural network the data of gathering are learnt, analyzed and provide and throw the alum controlled quentity controlled variable.Because data volume is bigger, if directly the mass data in the database is directly operated (such as deleting invalid data automatically) with Matlab, speed is too slow, because for cycle efficieny is very low among the Matlab.And Delphi has the very high database interface of operational efficiency, after by Delphi the valid data in the database being put in order, sets up the database of a Matlab special use, can improve the algorithm of Matlab greatly and carry out efficient.
Delphi supports Windows OLE control end agreement, and Matlab supports Windows OLE server-side protocol, in case the connection protocol between them is successfully set up, can write and carry out any Matlab order with Delphi.Realized calling efficient database by the information concerning order of in Delphi, carrying out Matlab in this patent, valid data have been carried out analysis of neural network, and returned arithmetic result in real time to Delphi and successfully apply in the working control with Matlab.
Whether throw in the alum system in intelligence, Matlab calls neural network function and carries out computing on the backstage, and master routine is display result on the interface only then, correct to make things convenient for producers to monitor to throw the alum amount.Delphi calls Matlab following several mode: the M file is converted into the Dll file, calls in Delphi; Or use DDE dynamic data exchanged form; Or use the ActiveX technology.And Delphi will call the neural network function among the Matlab and involve Matlab when calling database file, and it is the most suitable adopting the ActiveX technology.The ActiveX automation protocol is the agreement that an a kind of application program of permission (control end) removes to control Another application program (server end).Matlab supports the ActiveX server-side protocol, and Delphi also supports ActiveX robotization control end agreement, therefore, if the ActiveX robotization of setting up between a Delphi application program and the Matlab connects, can make things convenient at swap data between the two.
The Delphi that adopts among the present invention is a visual programming language very flexibly, and Matlab has ripe algorithm at aspects such as control automatically, neural networks simultaneously.The successful in the present invention algorithm the Matlab neural network applies in the control program of Delphi, improves the algorithm of Matlab greatly and carries out efficient; The seamless interfacing and the uniform packing problem of artificial neural network algorithm program and other application programs have been solved simultaneously, make the neural network algorithm program have more reliability, can not property revised and confidentiality, it makes whole application program integrated degree improve, the reliability of software improves greatly, confidentiality increases, and what software was carried out speeds up.
Description of drawings
Fig. 1 Delphi calls the neural network algorithm block diagram.
Fig. 2 improves the schematic network structure of Elman.
Fig. 3 artificial neural network output error variation diagram.
Fig. 4 Elman neural network learning training block diagram.
Embodiment
As shown in Figure 1, the foundation of ActiveX object: Matlab is as server, and the Delphi application program wants to set up this connection as control end, at first will set up ActiveX object, also is that Matlab registers in the registration table of Windows operating system.Its method is to carry out following order with the form of order line:
mattlab/Regserver
This order if just carry out once can, except that the non-moving position of Matlab software in hard disk.The ActiveX object of Matlab software in registration table is called " Matlab.Application ", in order to produce and to obtain the Matlab object, uses following statement to get final product in Delphi:
Matlab=Creatoleobject(‘Matlab.Application’)
In Delphi, carry out the Matlab order:
A main method of Matlab ActiveX Automation object is to use Matlab.Execute (command) function, wherein the command string of parameters C ommand for wanting Matlab to carry out; Operation result returns with character string, and figure then shows with the form of Matlab graphical window.All available this function call of the every fill order that can key at the Matlab command window.The Delphi application program is obtained array from Matlab ActiveX Automation object method is GetFullMatrix, and the method for transmitting array in Matlab ActiveX Automation object is PutFullMatrix.
Will call the neural network function of Matlab in the Delphi program, and show operation result on the interface, main code is as follows:
procedure?TForml.FormCreate(Sender:TObject);
begin
matlab:=CreateOleObject(′matlab.application′);
end;
procedure?TForml.Button2Click(Sender:TObject);
begin
% reads data in the experts database
Rstr:=matlab.execute (net=modelm (minmax (P), [25,1], ' tansig ', ' purelin ' }; ); % generates improved Elman neural network
Neural Network Training Parameter is set below the %
rstr:=matlab.execute(net.trainFcn=′traingdx′;);
rstr:=matlab.execute(net.trainParam.epochs=1000;);
rstr:=matlab.execute(net.trainParam.show=50;);
rstr:=matlab.execute(net.trainParam.lr=0.03;);
rstr:=matlab.execute(net.trainParam.mc=0.8;);
rstr:=matlab.execute(net.trainParam.goal=le-3;);
rstr:=matlab.execute([net,tr]=train(net,P,T););
Rstr:=matlab.execute (A=sim (net, P); ); After finishing, calculates the % neural metwork training output
rstr:=matlab.execute(E=T-A;);
rstr:=matlab.execute(MSE=mse(E););
rstr:=matlab.execute(xc3=postmnmx(A,minxc3,maxxc3));
% shows operation result in the interface
end;
end.
Improve dynamic Elman neural network
Consider that administration system is a dynamic system non-linear, large time delay, adopt its dynamic property of traditional static feedforward network (as the BP network) to meet the demands.This control system has been taked a kind of improved Elman dynamic network through repeatedly experiment, has improved approximation capability preferably, has accelerated speed of convergence.
The Elman neural network is a kind of typical dynamic neural network, self contains dynamic link, need not to use the system with more state as input, thereby has reduced the input layer unit number.But basic Elman network is only to effectively identification of first-order system, and throwing alum system of water factory is the nonlinear high-order system, and we adopt improved Elman network to realize control and prediction to model for this reason.As shown in Figure 2; Being connected of its input layer of this network, hidden layer and output layer is similar to feedforward network, and the unit of input layer only plays the signal transmitting effect, and output layer unit plays linear weighting effect.The transport function of hidden layer unit adopts nonlinear function, and it is output as the Nonlinear Superposition of input layer information and structural sheet information; Structural sheet is used for preserving the output valve of hidden layer unit and the previous moment of self, returns to hidden layer after the stack, can think one one step time-delay operator.This network has increased by one group of self feed back factor at the structural sheet of basic Elman network, makes network have better memory characteristic, more is applicable to the identification of dynamic model.
If the number of the input layer of network, output layer, hidden layer is respectively m, n, r, w 1, w 2, w 3Be respectively structural unit and arrive hidden layer, and hidden layer is to the connection weight matrix of output layer, f to hidden layer, input layer
Figure A200910060880D0007112516QIETU
With
Figure A200910060880D00071
Be respectively the Nonlinear Vector function that the excitation function of output unit and hidden layer unit is formed.Its nonlinear state space expression formula is:
x j ( k ) = f ( Σ j = 1 m w 2 i , j u i ( k ) + Σ i = 1 r w 1 i , j c i ( k ) ) - - - ( 1 )
c i(k)=x i(k-1)+α×c i(k-1) (2)
y j ( k ) = g ( Σ i = 1 r w 3 i , j x j ( k ) ) - - - ( 3 )
In the following formula
Figure A200910060880D00074
Can adopt the Sigmoid function, promptly f ( x ) = 1 1 + e - x ;
Figure A200910060880D00076
Can adopt linear function, i.e. g (x)=kx.
Weights correction and error recursive algorithm can be consulted the gradient descent method of BP algorithm and revise, and the algorithm implementation step is:
(1) initialization model and neural network.The off-line preliminary neural network training presets neural network initial weight and threshold value;
(2) detect actual output y (k), the output of forward calculation network
Figure A200910060880D00077
And calculating predicated error e (k);
(3) calculate compensation input component Δ u cWith control increment Δ u;
(4) calculate u c(k+1) and u (k+1);
(5) use least square method of recursion learning network weights and threshold value once;
(6) make k=k+1, change (2) over to;
Elman neural network learning training process as shown in Figure 4.
This learning method can be consulted document:
[1]Cheng?Y?C,Qi?W?M,Cai?W?Y.Dynamic?Properties?of?Elman?and?Modified?ElmanNeural?Network[A].Proc?of?the?lst?Int?Conf?on?Machine?Learning?andCybernetics[C].Beijing,2002,2(2):637-640.
[2] lacquer is the people, Cheng Yuanchu, and Ji Qiaoling, Cai Wei is by .PID type Elman network and the applied research [J] in the dynamic system identification. control and decision-making, 2005,20 (10): 1197-1200.
[3]Gao?X?Z,Gao?X?M,Ocaska?S?J.A?Modifi?ed?Elman?Neural?Network?Model?withApplication?to?Dynami?cal?Systems?Identification[A].IEEE?Int?Conf?onSystems,Man,and?Cybernetics[C].Beijing,1996:1376-1381.
Operation result is analyzed:
Use the Elman network data in the process of waterworks production are trained, through 1000 study, error is exported less than 0.03.Sampled data was got mean value one time in per 3 minutes, had overcome disturbance.Input quantity comprises flow of inlet water, influent turbidity, temperature, the preceding water turbidity of filter, obtains 1200 groups of data altogether, constitutes experts database with the PREDICTIVE CONTROL amount.Fig. 3 is the error output map that improves the Elman neural network.
Predicted value and the practical operation value exported through the improvement Elman neural network of self study compare.Improve the control predicted value of Elman network, with workman's working control value (the alum amount is thrown in representative), both most of situations are coincide, and neural network has been removed the workman's maloperation signal in the actual production automatically simultaneously, by analysis, has reached higher control accuracy.
The 10000 groups of data of sampling, the system that after 2000 study, obtains output.Increase though flow (flux) is carved suddenly at a time, perhaps influent turbidity reduces suddenly, and it is similar than stable status and artificial optimum operation that the output of neural network still keeps.This shows that the Elman neural network has the clutter in the intelligence removal input signal, tries to achieve the characteristic of optimum control scheme automatically.Near the pump stroke actual value of the 6000th group of workman's operation of data has bigger variation, neural network output then relatively steadily, this be since during the 5000th group of data flow sudden change has taken place, but the workman sees that flow changes suddenly during manually-operated, may frequently regulate volume pump.By analysis, dispensing has hysteresis quality in the reaction time, and the sudden change of flow can not cause in the reaction tank turbidity to be undergone mutation, so the control output valve of neural network is correct, its control effect is better than manual control greatly, has both guaranteed the safety of producing, and reaches energy saving purposes again.
The output of neural network is further finely tuned by expert system, and experts database comprises historical preference database and three days practical operation databases, and per two hours of artificial neural network is once learnt these two databases, approximately 2 minutes consuming time.The parameter of actual measurement was carried out an output parameter in per then 5 minutes and deduce, form a final controlling value at last and go volume pump is controlled.The initial degree of confidence of data in the experts database gets 0.5, if its output meets the demands behind the neural network learning, the degree of confidence that the match is successful writes down is added 0.01, otherwise then deduct 0.01.After long-time running, degree of confidence can be thought bad data less than the record of average degree of confidence 15% in the experts database, is deleted by self study mechanism.
System software adopts the Dephi language development, and travelling speed meets on-the-spot requirement in real time.Database is set up under the Access platform, and friendly interface is easy to operate.The security of system performance is very high, adopts computing machine, artificial two prosecutor formulas.Be computer controlled automatic generally speaking and throw alum, only undergo mutation, when too greatly consequently neural network can't be learnt with data differences in the experts database, the manual emergency action of alarm staff at turbidity, flow.

Claims (4)

1, a kind of method that realizes neural network algorithm based on Delphi software, it is after the ActiveX robotization connection of setting up between a Delphi application program and the Matlab, the order of carrying out Matlab in Delphi has realized calling efficient database with Matlab, valid data are carried out the neural network learning analysis, and return arithmetic result in real time to Delphi and successfully apply in the working control; It is as follows for the process of promptly carrying out the Matlab order in Delphi that described Delphi calls the neural network algorithm process: the registration ActiveX object; Produce and obtain the Matlab object; Matlab reads expert database; Matlab generates improved Elman neural network; The neural network learning training parameter is set; Output is calculated in neural network learning training back.
2, realize the method for neural network algorithm according to claim 1 based on Delphi software, it is characterized in that described neural network is a dynamic network, comprises input layer, hidden layer, structural sheet and output layer; The unit of input layer only plays the signal transmitting effect, and output layer unit plays linear weighting effect; The transport function of hidden layer unit adopts nonlinear function, and it is output as the Nonlinear Superposition of input layer information and structural sheet information; Structural sheet is used for preserving the output valve of hidden layer unit and the previous moment of self, returns to hidden layer after the stack.
3, realizing the method for neural network algorithm according to claim 1 based on Delphi software, it is characterized in that described registration ActiveX object, is that Matlab registers in the registration table of Windows operating system; Form is carried out following order: mattlab/Regserver; The method of generation and acquisition Matlab object is: use following statement: Matlab=Creatoleobject (' Matlab.Application ') in Delphi; A method carrying out the Matlab object in Delphi is to use Matlab.Execute (command) function, wherein the command string of parameters C ommand for wanting Matlab to carry out.
4, realize the method for neural network algorithm according to claim 1 based on Delphi software, it is characterized in that described Delphi application program is obtained the method for array from Matlab ActiveX Automation object be GetFullMatrix, the method for transmitting array in Matlab ActiveX Automation object is PutFullMatrix.
CNA2009100608800A 2009-02-27 2009-02-27 Method for implementing neural network algorithm based on Delphi software Pending CN101504736A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2009100608800A CN101504736A (en) 2009-02-27 2009-02-27 Method for implementing neural network algorithm based on Delphi software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2009100608800A CN101504736A (en) 2009-02-27 2009-02-27 Method for implementing neural network algorithm based on Delphi software

Publications (1)

Publication Number Publication Date
CN101504736A true CN101504736A (en) 2009-08-12

Family

ID=40976971

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2009100608800A Pending CN101504736A (en) 2009-02-27 2009-02-27 Method for implementing neural network algorithm based on Delphi software

Country Status (1)

Country Link
CN (1) CN101504736A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101807046A (en) * 2010-03-08 2010-08-18 清华大学 Online modeling method based on extreme learning machine with adjustable structure
CN102705303A (en) * 2012-05-16 2012-10-03 北京航空航天大学 Fault location method based on residual and double-stage Elman neural network for hydraulic servo system
CN102902203A (en) * 2012-09-26 2013-01-30 北京工业大学 Time series prediction and intelligent control combined online parameter adjustment method and system
CN103912026A (en) * 2014-03-20 2014-07-09 中冶集团武汉勘察研究院有限公司 BP (back propagation) neural network based mechanic index determining method for twin-bridge static sounding data
CN106484926A (en) * 2015-08-27 2017-03-08 新疆维吾尔自治区煤炭科学研究所 The method that application Delphi and Matlab software interactive processes transient electromagnetic data
CN110188886A (en) * 2018-08-17 2019-08-30 第四范式(北京)技术有限公司 Visualization method and system are carried out to the data processing step of machine-learning process
CN113091333A (en) * 2021-03-26 2021-07-09 西安交通大学 Flow feedforward-feedback control method for tower type photo-thermal power station heat absorber

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101807046A (en) * 2010-03-08 2010-08-18 清华大学 Online modeling method based on extreme learning machine with adjustable structure
CN102705303A (en) * 2012-05-16 2012-10-03 北京航空航天大学 Fault location method based on residual and double-stage Elman neural network for hydraulic servo system
CN102705303B (en) * 2012-05-16 2014-12-24 北京航空航天大学 Fault location method based on residual and double-stage Elman neural network for hydraulic servo system
CN102902203A (en) * 2012-09-26 2013-01-30 北京工业大学 Time series prediction and intelligent control combined online parameter adjustment method and system
CN102902203B (en) * 2012-09-26 2015-08-12 北京工业大学 The parameter on-line tuning method and system that time series forecasting is combined with Based Intelligent Control
CN103912026A (en) * 2014-03-20 2014-07-09 中冶集团武汉勘察研究院有限公司 BP (back propagation) neural network based mechanic index determining method for twin-bridge static sounding data
CN103912026B (en) * 2014-03-20 2017-07-11 中冶集团武汉勘察研究院有限公司 A kind of mechanical index of the Double lumen intubation data based on BP neural network determines method
CN106484926A (en) * 2015-08-27 2017-03-08 新疆维吾尔自治区煤炭科学研究所 The method that application Delphi and Matlab software interactive processes transient electromagnetic data
CN110188886A (en) * 2018-08-17 2019-08-30 第四范式(北京)技术有限公司 Visualization method and system are carried out to the data processing step of machine-learning process
CN113091333A (en) * 2021-03-26 2021-07-09 西安交通大学 Flow feedforward-feedback control method for tower type photo-thermal power station heat absorber

Similar Documents

Publication Publication Date Title
CN101504736A (en) Method for implementing neural network algorithm based on Delphi software
CN101689045B (en) Nonlinear model predictive control of a biofuel fermentation process
CN101782771B (en) Spinning process intelligent optimized design method based on immune neural network
CN115545321A (en) On-line prediction method for process quality of silk making workshop
Zhao et al. Fuzzy-based adaptive event-triggered control for nonlinear cyber-physical systems against deception attacks via a single parameter learning method
CN102053599A (en) Integrated optimization and control for production plants
CN101158693A (en) Bulk production process malfunction detection method based on multiple nucleus independent elements analyse
CN101556458B (en) Automatic control algorithm for feeding vitriol in tap water by coagulation
CN101286044A (en) Coal-burning boiler system mixing modeling method
Li et al. Online self-learning stochastic configuration networks for nonstationary data stream analysis
CN117236650B (en) Water-fertilizer integrated intelligent pump house control method
CN102156407A (en) Predictive control method and device for ARM (advanced RISC machines)-based embedded type model
CN117784620B (en) Intelligent parameter adjusting system and method for tailing dry-discharging dehydrator
CN111582562A (en) Neural network prediction control method based on optimization control platform
Yunfeng et al. On-line fault detection using SVM-based dynamic MPLS for batch processes
Wang et al. Soft-sensing modeling based on ABC-MLSSVM inversion for marine low-temperature alkaline protease MP fermentation process
CN106682312A (en) Industrial process soft-measurement modeling method of local weighing extreme learning machine model
CN108351622A (en) The method for generating the fuzzy knowledge base for may be programmed fuzzy controller
CN1597918A (en) Method and device for controlling temperature in liquid fermentation process of edible fungi
CN115674191B (en) Mechanical arm control method and system based on digital twin
CN115933412A (en) Aero-engine control method and device based on event-triggered predictive control
CN112257278B (en) Unit consumption difference calculation model acquisition method, consumption difference acquisition method and system
Kaipbergenov et al. Modeling of the Technological Process of Ammonization of Soda Production Under Conditions of Changing Initial Data
Phatwong et al. Kappa number prediction of pulp digester using LSTM neural network
Wang et al. Research on water and fertilizer PH control strategy of automatic fertilizer application system in cotton field

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Open date: 20090812