Microsoft Word - cet-01.docx CHEMICAL ENGINEERING TRANSACTIONS VOL. 46, 2015 A publication of The Italian Association of Chemical Engineering Online at www.aidic.it/cet Guest Editors: Peiyu Ren, Yancang Li, Huiping Song Copyright © 2015, AIDIC Servizi S.r.l., ISBN 978-88-95608-37-2; ISSN 2283-9216 Soft-sensing Modeling Based on PSO-FNN Inversion for Penicillin Fermentation Process Bo Wang*, Xiao F. Ji, Zhi K. Zhuang School of Electric Information Engineering, Jiangsu University, Zhenjiang 212013, China. wangbo@ujs.edu.cn As for the problem that the crucial parameters of penicillin fermentation process are difficult to be online measured, a soft-sensing modeling method is proposed based on PSO-FNN inversion. Firstly, a dynamic system model is developed based on the material balance relation of the penicillin fed-batch fermentation process, and existence of inverse system is analyzed. And then, an inverse model has been developed offline by use of fitting capacity of fuzzy neural network (FNN); online optimization is made by use of particle swarm optimization (PSO) algorithm on the basis of deviation information. Finally, to connect the inverse model and original fermentation process in serial into a compound pseudo-linear system, and based on the inverse system theory, realize the prediction of the crucial parameters. The simulation experiment shows that a better prediction for the crucial parameters of penicillin fermentation process is obtained based on PSO-FNN inversion algorithm. 1. Introduction As the first kind of antibiotic that is purified and clinically used in a large scale, penicillin has initiated a new era of antibiotic therapy and now is the antibiotic in the largest global demand (Chi et al., 2015). However, as penicillin fermentation process involves growth, reproduction and metabolism processes of microorganism, during such fermentation, multiple parameters feature a multi-variable, strong coupling and uncertain nonlinear dynamic relation among them. Meanwhile, it is hard to make online or fast measurement of some crucial parameters that reflect quality during fermentation. Currently they are mostly obtained by way of laboratory offline analysis and assay following timing sampling and come with substantial time delay in measurement, making it hard to meet requirements on real-time control and greatly limiting application of advanced technology in penicillin fermentation process. Soft-sensing technology is an effective way to solve this problem. Therefore, research in soft-sensing of penicillin fermentation process is of great theoretical significance and application value (Qi et al., Nestaas and Wang, 2006; Sun et al., 2010). In recent years, inverse system theory has been provided an effective approach for soft-sensing of non-linear system because of its clear concept, simple method. However, the application of the inverse system method requires the associated object’s mathematical model and specific system parameters to be established. Moreover, the analytic expression of the inverse system should be accurately determined. All these considerations greatly limit the application of the inverse system method in soft-sensing of non-linear systems. Specific to the foregoing “bottlenecks”, Dai xianzhong et al. (2006) introduced the idea of intelligent control into inverse system method, used neural network to tell between inverse models of non-linear systems, and applied that to soft-sensing of fermentation. However, in this method, the process system model for inverse system analysis is based on simplified model of Monod equation, which ignored many non-linear components, making it inconsistent with practice of fermentation site and unreasonable to the original non-linear system. Also neural network method is based on the black box theory,it is difficult to utilize existing experiential knowledge and can’t process and describe fuzzy information, meanwhile, it requires a higher demand for sample. So it is difficult to well identify the complicated non-linear system as penicillin fermentation process. On the basis of this, in this work, with use of a mechanism modeling approach, a dynamic system model is developed based on the material balance relation in penicillin fermentation process. With respect to the multi- variable non-linear model, inverse system method is combined with fuzzy neural network combining fuzzy systems with neural network, and a modeling approach based on fuzzy neural network (FNN) inversion is DOI: 10.3303/CET1546223 Please cite this article as: Wang B., Ji X.F., Zhuang Z.K., 2015, Soft-sensing modeling based on pso-fnn inversion for penicillin fermentation process, Chemical Engineering Transactions, 46, 1333-1338 DOI:10.3303/CET1546223 1333 presented. The theoretical analysis and simulation result demonstrated that the approach provides higher accuracy in predicting crucial parameters during penicillin fermentation process. 2. Fermentation process modeling In this work where penicillin fed-batch fermentation process is taken as an example, the concentrations of mycelia and metabolite in various feeding liquids are assumed to be 0. According to material balance relation Eq (1) of various substances (mycelia, substrate, metabolite, oxygen, H+ and so on) in the penicillin fermentation process, a system dynamic model (Nestaas Eirik et al., 2006) was developed as ( , , , d d pH d d ) x x X S P X t tV V μ −= (1) where { , , , , pH}Lx X S P C∈ , , , , , pH,LX S P C V are mycelia concentration, substrate concentration, product concentration ,dissolved oxygen concentration, pH value and the volume of the fermentation liquor respectively; μ is the specific rate of various substances. In the penicillin fed-match fermentation process, various substrates were fed continuously as per specific concentrations to provide the necessary carbon source, nitrogen source, inorganic salt and precursor substances, as well as to adjust and control the pH value of the fermentation liquor to be maintained in an optimal range. The fermentation volume V and pH varied as the addition of various substrates. Their balance equations were expressed respectively as d d c nh s p paa V f f f f f t = + + + + ( dpH d , d d , )H, p, nh nh c cL s s p p paa paaf f S f S f fV t S S SX X S P C X V Vt γ − − − − += − (2) (3) where , , ,c nh s pf f f f and paaf are feeding rates of glucose, aqueous ammonia, ammonium sulfate(APS), monopotassium phosphate (KDP) and phenylacetic acid (PAA) respectively; , , , ,snh c p paaS S SS S are the flow liquid concentrations of aqueous ammonia, glucose, APS, KDP and PAA respectively; and γ is the specific consumption rate of H+. As the only restrictive substrate of penicillin fermentation, carbon source was required in a large quantity and would be consumed at a comparatively quickly. Considering the influence of source of carbon (glucose) in the fermentation process, the balance equation of substrates was expressed as d d , p( , , , )H d dL c c s S X S P C X f Vt V S V t ν + −= − (4) where ν is the specific consumption rate of various substrates. In the stage of penicillin synthesis, the hydrolysis reactions of precursor substance (PAA) and penicillin would significantly affect the penicillin yield. The influence of PAA addition and hydrolysis rate K on the fermentation process has been considered in the following balance equation of product concentration 1d d( , pH d , d , ), paL a P V X K P X S KP t t P C f V V ρ −= − + (5) where K is hydrolysis rata, 1K is inhibition constant and ρ is specific production rate of the product. With respect to the aerobiotic characteristic of penicillin fermentation and in the consideration of the influence of reactor size on the dissolved oxygen level of the fermentation liquor, the volumetric oxygen mass transfer coefficient ( LK a ) was introduced into dissolved oxygen balance equation *( , , , d d , pH) ( ) d dL L L L L L C X S P C X C V a C C t K V t η + −= − − (6) where *LC is the oxygen saturation concentration and η is the specific consumption rate of oxygen. The mycelia concentration, substrate concentration and product concentration [ ]Tˆ , ,X S P=x are selected as non-direct measurable parameters; the dissolved oxygen concentration, pH value and fermentation liquor 1334 volume [ ] [ ]T1 2 3, , ,pH,Lz z z C V= =z are selected as direct measurable parameters; and the feeding rates of various substrates T , , , ,c nh s pap af f f f f =  u are selected as input. The state equations are given by 5 1 1 1 16 5 2 2 1 16 6 5 3 5 3 3 1 1 2 3 4 5 1 1 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 4 5 2 1 2 3 4 5 1 2 3 16 6 5 4 4 1 4 16 6 1 5 ( , , , , ) ( , , , , ) ( , , , , ) ( , , , , ) ( , , , , ) i i i i i i i i x x x x x x x x u x s u x x x x x x x x u x x s u x x x x x x x x s x u x x x x x x x x x x s x s u x s u s x x x x x x x μ ν ρ η γ = = = = = − = − + − = − + − = − − + − − = +          5 8 4 9 51 7 3 5 6 16 5 6 1 1 2 3 4 5 i i i i u s u s u s u x u x x u u u u u x u = =              − − − −   = = + + + +    (7) where [ ] [ ]T T1 2 3 4 5 6 L, , , , , , , , , pH,x x x x x x X S P C V= =x is a state vector; [ ] TT 1 2 3 4 5, , , , , , , ,c nh s p paau u u u u f f f f f = =  u is an input vector; , , , ,μ ν ρ η γ are the analytical functions of respective status variables; ( 1, ,9)is i =  are all non-zero constants. 3. System reversibility analysis Specific to the dynamic system model (7), the soft-sensing modeling is established based on inverse system method. Inverse system method has a good effect in soft-sensing modeling of nonlinear system, which is a kind of feedback linearization method of nonlinear system. Under the condition that the original system is invertible, the inverse system, with the function of dynamic compensator, is cascaded with the original system to transform the input-output relationship of the compound system to be a decoupled identity mapping relation. This realizes the mirror of some crucial parameters. The reversibility analysis and the corresponding inverse model are given as follows. Lemma 1: System Σ is invertible in a certain ( )0 0,x u neighborhood, if and only if the relative order of this system equals ( )T Tˆm mrank r l∂ ∂ = =Z x , where l is the number of variables impossible to measure directly. The Interactor algorithm is used to analyses the reversibility of the penicillin fermentation process, with the analysis process, with the analysis process as follow: The derivative of direct measurable parameters to time should be calculated primarily until the useful information for structuring the inverse model could be obtained. The Eq(7) leads to 1 2 3 4 5 1 4 5 4 1 2 4 5 6 5 4 4 4 16 5 6 2 1 7 3 8 5 1 2 4 1 4 5 16 5 1 9 5 6 ( , , , , ) ( , ) ( , , , , ) ( , , , ) i i i i x x x x x x x x s x s u x x g g x x x s u s u s u s u s u x x x x x x x u xx η γ = =  = − − + −  = +  − − − − = + −    x u u u    (8) where 5 3 4 5 5 2 1 1 1 1 1 1 2 1 6 4 1 4 5 1 4 1 1 62 3 4 5 3 5 4 46 6 ( , ) i i x x x g x x x x x u u s u s x x s x s x x x x x x x x x x x x x x η η η η η η η η η μη η =  ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ = + + + + − − − + − +  ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂ ∂  x u 5 7 3 8 4 8 5 2 3 1 15 5 5 1 1 3 1 1 1 1 1 6 6 6 2 56 6 2 ( )i i x x x x x s u s u u s u s x x s u x x x x x x x x x x x η η η η η η η = ∂ ∂ ∂ ∂ ∂ ∂ + + + + + − − ∂ ∂ ∂ ∂ ∂ ∂ 2 1 2 3 4 51 ( )x x x x x x η η η η η μ ν ρ η γ ∂ ∂ ∂ ∂ ∂ − − + − + ∂ ∂ ∂ ∂ ∂ 5 5 5 5 25 2 4 6 4 2 1 1 1 24 4 4 4 4 4 5 16 6 6 6 2 2 ( , , , ) ( )i i i i i i i i s x s x x g x x u u s x s s u u x x x x= = = = = − + − − +   u u  Let matrix T T 2 111 2 3ˆ ( , , ) ( , , )m z z z x x x= ∂ ∂ = ∂ ∂J Z x    , then 1 1 1 6 5 31 1 1 1 3 4 1 1 1 1 11 1 1 1 2 3 4 2 3 2 3 2 3 ( , ) 0 0 ( , ) ( , ) ( , ) ( , ) ( , ) ( , ( , ) ( , ) ) 0 g g gx x x g x x x g g x x x g x x x x x xx x x x x g x g η η η ν ν ν ν νν ν ν η      −∂ ∂ ∂      ∂ ∂ ∂  == − − − → =  ∂ ∂ ∂ ∂ ∂ − ∂    ∂ ∂ ∂   +∂ ∂ ∂    ∂ ∂ ∂ ∂ ∂ ∂   + x u x u x x u x u x u x u J J x u x u u  (9) where 3 1 1 1 3 13 ( , ) ( )g x x x x x x ην η νν η   ∂∂ ∂ ∂ = + − − ∂ ∂ ∂ ∂  x u ; 4 1 2 3 3 2 1( , )g x x x x x x ην η ν  ∂∂ ∂ ∂ = − ∂ ∂ ∂ ∂  x u 1335 1 1 1 11 5 3 3 ( , ) ( , ) ( , ) ( ) g g g x x x xx ν ν ν ∂ ∂ ∂ ∂ = − + ∂ ∂ ∂∂   x u x u x u ; 6 2 3 3 1 1 2 ( , ) ( , ) ( , ) g g g x x xx ν ν ∂ ∂ ∂ ∂ = −  ∂ ∂ ∂∂   x u x u x u If ( )det J is constantly not zero in the whole real vector space, it can be known from Lemma 1 that 1 22 3 T T 1 1ˆ ( , , ) ( , 3, )m z z z x x x= ∂ ∂ = ∂ ∂ =J Z x   , meeting the system reversibility condition, i.e. the system is globally reversible. However, as far as ( )det J is concerned, it is hard to ensure that the condition of not being zero is met everywhere in the whole real vector space R. Based on the foregoing, and in consideration of the current operation of penicillin fermentation process (always operating in certain specific working area and such area is only a very small one of the real vector space R). Therefore, let’s firstly assume ( )det J in the working area of penicillin fermentation process is constantly not zero, meeting the system reversibility condition. Afterwards, use the method herein to build the inverse soft-sensing model, and then use actual test result to judge whether such assumption is reasonable. Assuming the system meets the system reversibility condition in working area of penicillin fermentation process, so according to inverse function existence theorem and expressions (7) and (8), the structure of the inverse model for penicillin fermentation process is: ( ) ( ) ( ) 1 4 5 6 4 4 51 2 2 4 5 6 4 4 5 3 3 4 5 6 4 4 5 , , , , , , , ˆ , , , , , , , , , , , , , , x x x x x xx x x x x x x x x x x x x x x ϕ ϕ ϕ      = =            u u x u u u u          (10) However, it is difficult to get the analytical expression of the inverse model (10).But in recent years, fuzzy neural network (FNN) combing the advantages of neural network and fuzzy logic system has become a very active subject in many scientific and engineering areas (Shah and Gopal, 2014; Chai, 2011), which utilize both powerful system identification ability of neural network and the linguistic, human-like reasoning of fuzzy systems (Wang et al., 2008). It has the properties of parallel computation scheme, easy to implement, fuzzy logic inference system, and parameters convergence. Therefore it is suitable for solving the identification problem of complicated non-linear systems. Based on this, this project uses FNN to identify the three non- linear function 1 2 3, ,ϕ ϕ ϕ in expression (10). As for FNN system identification, the optimization of the main parameters (center lia and width lib of the Gaussian membership function respectively, weight iw ) exert an important effect on the developing of inverse model. Traditional parameter optimization methods are mostly based on experience and trial-error methods, making it difficult to ensure precision and computing speed. In the recent years, Particle swarm optimization (PSO) has been applied for optimization of engineering field development planning (Zhang et al., 2013). Generally speaking, the PSO algorithm has a strong ability to find the most optimistic result. After suitably modulating the parameters for the PSO algorithm (Nie et al., 2011), the rate of convergence can be speeded up and the ability to find the global optimistic result can be enhanced (Hashemi and Meybodi, 2011). In order to obtain inverse model with relatively high prediction effect, this project applies PSO to make on-line optimization and adjustment of FNN. 4. Soft-sensing modeling The PSO-FNN is used to identify the inverse model (10) of the penicillin fermentation process, with specific steps of the identification process as follows: Firstly, samples obtaining and processing. In order to stimulate the non-linear characteristic within the penicillin fed-batch fermentation, we select the random signals in the field of practical work as input to real- time measure the response of the fermentation processes. From Eq(10) we can see, the training sample set of inverse model are 1 2 3{ , , }x x x and { }44 4 5 65, , , , , ,x x xx x x u u  . The former is the output of inverse model, i.e. desired output; and the latter is the input, where the direct measurable parameters 4 5 6{ , , }x x x and input parameters 1 2 3 4 5{ , , , , }u u u u u=u can be obtained by direct sampling; and the various-order derivative information of the direct measurable parameters { }4 4 5, , ,x x x u   is offline determined by using high-precision five-point numerical algorithm. The non-direct measurable parameters 1 2 3{ , , }x x x are determined by offline analysis and chemical test. The obtained data is differentially fitted using the least square method to obtain the training sample corresponding to the input. 1336 Secondly, offline fitting and online optimization. Based on the input/output data set, the FNN undergoes offline training and learning, and uses a clustering method to determine the corresponding initial parameters ( lia , l ib and iw ), thus developing the inverse model. According to the analysis value of the actual fed-batch fermentation process and deviation information output by FNN, go further to use PSO algorithm to online optimize FNN main parameters. After connecting developed PSO-FNN inverse model in serial with penicillin fermentation process, a unit compound pseudo-linear system is formed; make the compound system’s input/output to present an identical mapping relationship and realize online prediction of crucial parameters. 5. Simulation and analysis The penicillin fed-batch fermentation process is the object for experimental research. The experimental process is designed as follows to be close to practical productive process: Firstly, penicillin fed-batch fermentation period of each batch is 180h and the sampling period T is 30min. , pH, ,LC V u are collected by sensors, , ,X S P are sampled each 4h and offline analyzed. In which, X was measured by high-performance liquid chromatography (HPLC), S was measured by SBA-40C type multi- functional biosensor and P was measured using enzyme linked immunosorbent assay (ELISA). Secondly, the initial conditions of various batches are set to be different, the fed-batch strategies of various substrates varying correspondingly to enlarge batch differences. The pressure of the fermentation tank is controlled among 0~0.07Mpa and the pH of the fermentation liquor among 6.8~7.2, the temperature in early period and medium period is controlled at about 26℃ and in late period is controlled at about 24℃, the stirring speed is controlled at 150~250rpm, and the concentration of the precursor PAA <1kg/m3. FFN use four layers to quantify input states, and choose five fuzzy sets {NB, NS, ZO, PS, PB}. The input vector is { }44 4 5 65, , , , , ,x x xx x x u u  , the output vector is 1 2 3{ , , }x x x , and the structure of FNN is 16-80-5 16-3. PSO is utilized to optimize the main parameters of FNN. The training number is 10000, and the objective function is 2( ) ( ( ) ( )) k T i j k i N J k x k kξ = − =  , where the error function is defined as 2( ) [ ( ) ( )] / 2k y k d kξ = − , ( )y k and ( )d k are actual analysis value and estimated of the output of the FNN, Tix is the position of dimension d. The fermentation data of the first 6 batches are selected as training sampling set, which are offline trained to obtain FNN, then the data of the 7th batch and the 8th batch are used to online optimization the FNN, and the data of the 9th batch and the 10th batch are used to examine the identification precision of FNN. Fig.1 shows the comparisons of result predictions based on PSO-FNN inversion and FNN. Table 1 lists the maximum relative error MRE of the soft-sensing results of the two data batches. (a) (b) (c) Figure 1: Comparative of prediction result: Mycelia concentration (a); substrate concentration (b); product concentration (c) Table 1: MRE comparison by two models of the 10th batch Fermentation batch PSO-FNN Inversion FNN X/g·L-1 S/g·L-1 P /g·L-1 X /g·L-1 S/g·L-1 P /g·L-1 The 9th Batch The10th Batch 1.37% 1.62% 2.36% 4.13% 3.46% 3.27% 1.08% 1.26% 2.73% 2.72% 2.61% 6.05% As shown in Figure.1 and Table 1, in comparison with use of traditional FNN soft-sensing method, PSO-FNN inversion soft-sensing method produces prediction results that are closer to actual assay values; in particular, prediction effect of substrate concentration is very remarkable, adequately indicating that this work’s 0 20 40 60 80 100 120 140 160 180 0 2 4 6 8 10 12 14 time(h) M yc el ia c on ce nt ra tio n( g ⋅ L- 1 ) actual value PSO-FNN inversion FNN 0 20 40 60 80 100 120 140 160 180 11.5 12 12.5 13 13.5 14 14.5 15 15.5 time(h) Su bs tr at e co nc en tr at io n( g ⋅L -1 ) actual value PSO-FNN inversion FNN 0 20 40 60 80 100 120 140 160 180 0 0.2 0.4 0.6 0.8 1 1.2 1.4 Time(h) Pr od uc t c on ce nt ra tio n( g ⋅L -1 ) actual value PSO-FNN inversion FNN 1337 assumption that ( )det J is constantly not equal to zero in the penicillin fermentation process working area is totally reasonable. During the logarithmic phase and stationary stage (50h-160h) of penicillin fermentation, when FNN method is used, the RMSE average value of soft-sensing of mycelia concentration, substrate concentration, and product concentration are 0.0302, 0.0193 and 0.0468 respectively; while PSO-FNN inversion are 0.0124, 0.0106 and 0.0162 respectively. This shows applying PSO-FNN inversion soft-sensing method is effective and reliable with an ability to improve the soft-sensing precision of mycelia concentration, substrate concentration and product concentration, and reaching the expected goal relatively satisfactorily. 6. Conclusions In this work, by applying PSO-FNN inverse model identification and soft-sensing principle, the soft-sensing has been undertaken with respect to crucial parameters in a penicillin fed-batch fermentation process. The simulation experiment and comparison indicates that the approach needs not priori knowledge about penicillin fermentation process; it only needs relative order and input/output sample sets in the fermentation processes, to obtain ideal identification effect. That broke through the two limitations of traditional approaches.The above result can be developed to fit complex non-linear process modeling and high precision prediction such as biochemical reactions. PSO-FNN inverse system approach is also suitable to the modeling and soft-sensing of common non-linear reversible systems, and thus provides a new way for the soft-sensing of multi-variable non-linear systems. References Chai Y. L., 2011, Study of coal gas outburst prediction based on FNN, Lecture Notes in Electrical Engineering, 97(1), 687-693, DOI: 10.1007/978-3-642-21697-8_87. Chi Q. H., Zhang W. J., Fei Z. S., Liang J., 2015, A two- level measurement-based dynamic optimization strategy for a bioreactor in penicillin fermentation process, Chinese Journal of Chemical Engineering, 23(1), 112-120, DOI: 10.1016/j.cjche.2014.10.011. Dai X. Z., Wang W. C., Ding Y. H., 2006, Assumed “inherent sensor” inversion based ANN dynamic soft- sensing method and its application in erythromycin fermentation process, Computers and Chemical Engineering, 30(8), 1203 -1225, DOI: 10.1016/j.compchemeng.2006.02.001. Hashemi A. B., Meybodi M. R., 2011, A note on the learning automata based algorithms for adaptive parameter selection in PSO, Applied Soft Computing Journal, 11(1), 689-705, DOI: 10.1016/j.asoc.2009.12.030. Nestaas E., Wang D., 2006, Computer control of the penicillin fermentation using the filtration probe in conjunction with a structured process model, Biotechnology and Bioengineering, 95(2), 317-326, DOI: 10.1002/bit.21156. Nie P., Geng J., Qin Z. G., 2011, Self-adaptive inertia weight PSO test case generation algorithm considering prematurity restraining, International Journal of Digital Content Technology and its Applications, 5(9), 125- 133, DOI: 10.4156/jdcta.vol5.issue9.14. Qi X. Y., Yuan Z. H., Qi X. X., Zhang W. Q., 2011, Design of penicillin fermentation process simulation system, The International Society for Optical Engineering, 8205, 223-228, DOI: 10.1117/12.906106. Shah H., Gopal M., 2014, A reinforcement learning algorithm with evolving fuzzy neural networks, IFAC Proceedings Volumes, 3(1), 1161-1165, DOI: 10.3182/20140313-3-IN-3024.00058. Sun Y. K., He Y., Ji X. F., 2010, Soft sensor modeling of the penicillin fermentation based on FCM clustering and LS-SVM, ICCASM 2010,10, 1012-1016, DOI: 10.1109/ICCASM.2010.5622912. Wang X. Y., Dai G. Z., Zhang X. W., Zhang F. J., 2008, Recognition of complex dynamic gesture based on HMM-FNN model, Ruan Jian Xue Bao, 19(9), 2302-2312, DOI: 10.3724/SP.J.1001.2008.02302. Zhang B., Zhong S., Wen K. M., Li R. X., Gu X. W., 2013, Finding high-influence microblog users with an improved PSO algorithm, International Journal of Modelling, Identification and Control, 18(4), 349-356, DOI: 10.1504/IJMIC.2013.053540. 1338