Modelling of anaerobic digestion using self-organizing maps and ...

11 downloads 0 Views 142KB Size Report
The aim was to model the anaerobic digestion process. To produce data ... Keywords Anaerobic fermentation; control; modelling; neural networks; optimization.
N22

20/7/00

3:04 pm

Page 149

P. Holubar, L. Zani, M. Hager, W. Fröschl, Z. Radak* and R. Braun Institute of Applied Microbiology, University of Agricultural Sciences, Muthgasse 18, A-1190 Vienna, Austria. (Tel.: ++43-1-360 06-6212); (Fax: ++43-1-369 76 15);(E-mail: [email protected]) *Biotechnologie Forschungs- und Entwicklungsges.m.b.H., Heuberggasse 56, A-1170 Vienna, Austria Abstract In this work the training of a self-organizing map and a feed-forward back-propagation neural network was made. The aim was to model the anaerobic digestion process. To produce data for the training of the neural nets an anaerobic digester was operated at steady state and disturbed by pulsing the organic loading rate. Measured parameters were: gas composition, gas production rate, volatile fatty acid concentration, pH, redox potential, volatile suspended solids and chemical oxygen demand of feed and effluent. It could be shown that both types of self-learning networks in principle could be used to model the process of anaerobic digestion. Using the unsupervised Kohonen self-organizing map, the model’s predictions could not follow the measurements in all details. This resulted in an unsatisfactory regression coefficient of R2= 0.69 for the gas composition and R2= 0.76 for the gas production rate. When the supervised FFBP neural net was used the training resulted in more precise predictions. The regression coefficient was found to be R2= 0.74 for the gas composition and R2= 0.92 for the gas production rate. Keywords Anaerobic fermentation; control; modelling; neural networks; optimization

Introduction

In environmental biotechnology reactors are normally designed with reference to a nominal operating condition in which the loading rate is assumed to be relatively constant in time. In practice this steady-state assumption is seldom met. In fact, the process is subject to wide fluctuations, both in flow and organic loading, which often results in a performance drop or even plant failure. The successful management of these critical situations is of high relevance for industrial applications (Müller et al., 1997). In the special case of anaerobic digestion it is important to optimize the methane yield under different loading conditions. Very often plant operators reject valuable wastes (e.g. food wastes, lecithin, vegetable oil and fat), because they fear an overshooting production of fatty acids, and subsequently serious damage to the biological system. If a model of the anaerobic system was available the operators could predict the behaviour of the system in case of increased loading rate and decide whether or not they should accept new wastes on the results of the system simulation instead of subjective feeling. The necessary supervision and control of bio-processes can be realized by means of mathematical models. Despite several attempts to control the process, anaerobic digestion remains a kind of black-box (Dochain, 1995; Steyer et al., 1995). Up to now classical mathematical modeling was only possible when severe simplifications of the process representation were performed. The main reason for this situation is that the mechanisms ruling these processes are not adequately understood to formulate reliable nonlinear mathematical models (Schubert et al., 1994). As an alternative artificial neural networks are claimed to have a distinctive advantage over some other nonlinear estimation methods used for bio-processes, because they do not require any prior knowledge about the structure of the relationships that exist between important variables. All that is needed, is to specify the architecture of the net, and to feed it with sufficient and consistent information. Subsequently it can learn the input-output relationships. The net can be used inside a DSS (Decision Support System)

Water Science and Technology Vol 41 No 12 pp 149–156 © IWA Publishing 2000

Modelling of anaerobic digestion using self-organizing maps and artificial neural networks

149

N22

20/7/00

3:04 pm

Page 150

used to optimize the system operation in order to prevent instabiliy and to increase the methane procuction. Methods Reactor setup and analytic

P. Holubar et al. 150

To gain data for feeding the neural net, four 20 l lab-scale anaerobic continuous stirred tank reactors (CSTR) were operated (Figure 1). The process control software Labview 5.1 (National Instruments, Austria) was used for monitoring and controlling the laboratory reactors. All devices used were connected to Field-point modules (National Instruments, Austria), and via a RS232 interface to the controlling PC. The reactors’ feed was based on a mixture of primary and surplus sludge from a local municipal waste water treatment plant. Also the inoculum was taken from this plant. To increase the possible organic loading rate the sludge was supplemented with flour, sucrose or 1,2-diethylene glycol. All chemicals used were provided by Merck (Germany) or Fluka (Germany). The pH was measured with a Sensolyt SE pH-electrode (WTW, Germany). Redox potential was measured with a Sensolyt Pt redox-electrode (WTW, Germany). The reactors’ temperature was maintained at 3ºC. Two Verdercor CR70 peristaltic pumps (Verder, Germany) were used as feed- and circulation pumps. Measurement of the amount of produced biogas was made by a self constructed liquid-displacement counter. The gas volume was corrected to the ambient pressure by an electronic barometer (Fischer, Germany). Concentration of methane and carbon dioxide in the biogas was measured by industrial near-infrared detectors (Sensor Devices, Germany). Volatile fatty acids (VFA) were measured by gas chromatography as follows: 5 ml of sludge was homogenized for 30 s using an Ultraturrax T8 (IKA, Germany). After adding 1 ml of 3,3-dimethylbutyric acid (concentration 600 mg.l–1) as an internal standard, the sludge samples were centrifuged in a Beckman J2-21 centrifuge for 15 minutes at 17.700×g, cooled at 4ºC. The supernatant was acidified by adding 50 µl of 1 M oxalic acid. Using a HP 6890 auto-injector 1 µl of the samples was injected into a HP 5890 gas chromatograph (Hewlett Packard, Austria), which was equipped with a flame

Figure 1 Scheme of the anaerobic continuous stirred tank reactor

N22

20/7/00

3:04 pm

Page 151

P. Holubar et al.

ionization detector. A HP-FFAP column (30 m×0.53 mm×1 µm) was used for separation. The temperature program used was: injector temperature 218ºC; detector temperature 240ºC; initial temperature 70ºC for 7 minutes; heating rate 5ºC.min–1 up to 80ºC, followed by 10ºC · min–1 up to the final temperature of 185ºC, which was held for 1.5 minutes. Data acquisition was made by the ChemStation A 7.01 software (Hewlett Packard, Austria). The chemical oxygen demand (COD) of the feed and the effluent was made by diluting 1.5 g, respectively 2.5 g of sludge to 250 ml with de-ionized water. Using LCK 114 testkits (Dr. Lange, Austria) containing potassium dichromate and sulfuric acid, 2 ml of the samples were heated for 2 hours at 148ºC in a LT1W thermostat (Dr. Lange, Austria). After cooling the adsorption was measured at 605 nm in a LKT photometer (Dr. Lange, Austria). Models

Artificial neural networks consist of a large number of simple interconnected processing elements. Each of them can process some piece of information at the same time as other units. The processing unit receives some number of input signals, x1,. . .,xn, through weighted links, sums the weighted inputs, and then passes the resulting sum through an output function f. The knowledge of an artificial neural network is encoded in the values of its weights. In many artificial neural networks the processing units are arranged in layers. The first layer receives a number of input signals and produces some output which is then fed to the next layer of processing elements and so on. The cascade of layers can be thought of as a black box which maps input vectors to output vectors (Katz et al., 1992). Two kinds of neural networks were used to model the anaerobic system: feed-forward back-propagation net and self organizing maps. Feed-forward back-propagation net. The name for the feed-forward back propagation net (FFBP) comes from the algorithm used to correct the weights. The equations used for this correction are applied throughout the layers, beginning with the correction of the weights in the last (output) layer, and then continuing backward to the input layer. This is called supervised learning, and means that the weights are corrected in a way to produce pre-specified, correct, target values for as many inputs as possible (Zupan and Gasteiger, 1993). During learning the input vector X is presented to the neural network and the output vector O is compared with the target vector Y which is the correct output for X. When the actual error produced by the network is known the following formula can be applied:

∆w1ij = ηδ 1j O1–1 + µ∆w1(previous) i ji

(1)

where l is the index of the current layer, j identifies the current neuron, i is the index of the input source (index of the neuron in the upper layer), δ the error, η the learning rate and µ the momentum constant. δ is calculated in two ways depending on whether the last layer or one of the hidden layers is under consideration. The number of neurons in the hidden layer(s) is related to the converging performance of the output error function during the training process. An increase in the number of hidden neurons up to a point usually results in a better learning performance. Too few hidden neurons limit the ability of the neural network to model the process, and too many may allow too much freedom for the weights to adjust and to result in learning the noise present in the database used in training (Linko et al., 1997). To dimension the FFBP neural net as a first trial the following formula (Kasabov, 1996) had been used: Training set dimension = 2 ∗ W ∗ Log10 N where N = number of neurons in the neural net, and W = number of weights.

( 2) 151

N22

20/7/00

3:04 pm

Page 152

Table 1 Minimum estimation of training set dimension for a given network’s structure Input variables number

Hidden neurons

Output neurons

Training set dimension

5

4

2

48

7

6

2

74

8

8

2

100

P. Holubar et al.

According to this formula the minimum number of data for the training set can be calculated knowing the structure of the network. Examples are given in Table 1. This estimation of the dimension is extremely low: in a 8-8-2 FFBP neural net there are 80 weights. If the training set is composed of 100 data each parameter (weight) will be estimated on the basis of only more or less 1 data. The generalization capability of such a network can not be expected to be very good. Statistically the number of data used to calibrate a model should be from 5 to 10 times the number of parameters. For programming the neural network toolbox of Matlab® 5.2 (Mathworks Inc., USA) was used. Self organizing maps. Self organizing maps (SOM, or Kohonen-maps, from the name of their inventor) learn to classify input vectors according to how they are grouped in the input space; neighboring neurons in the self organizing maps learn to recognize neighboring sections of the input space. Thus SOM learn both the distribution and the topology of the input vectors. Kohonen-networks are composed of a single layer of neurons arranged in a twodimensional plane having a well defined topology. This network implements only a local feedback that is: the output of each neuron is not connected to all other neurons in the plane but only to a small number that are topologically close to it. The Kohonen-learning procedure is unsupervised. Self organizing maps are mainly used for input classification but, as Kohonen (1997) explains they can also be used for modeling: the input vector x to the SOM is composed of unconditioned input signals i1, i2,..., iq as well as a number of wanted output signals o1, o2,. . ., oq given in conjunction with the i signals. The input vector to the SOM is defined as x=[in out]T , where in = [i1, i2,. . .,iq]T and out = [o1, o2,. . ., oq]T . A number of such x vectors is applied as training inputs to a SOM. The weight vectors of this SOM have components corresponding to the unconditioned and wanted input signals, respectively: mi=[mi(in) mi(out)]T. After convergence, the mi are fixed to their asymptotic values. If now an unknown unconditioned input vector is given, and the winner unit c is defined on the basis of the in part only, only the mi(in) components are compared with the corresponding components of the new x vector, an estimate of the output in the sense of the SOM mapping is obtained as the vector mc(out). For computing the SOMine lite® soft ware (Eudaptics, Austria) was used. Results and discussions

152

The reactors were operated in steady-state conditions at organic loading rates (BR) of about 2 kg CODm–3 · d–1, and disturbed by pulse-like increases of BR. For the pulses additional carbon sources like flour, sucrose, 1,2-diethylene glycol or vegetable oil were added to increase the COD. The course of the experiment is shown in Figure 2. The most important parameter, the concentration of volatile fatty acids, did not show any significant reactions at BR-pulses up to 6 kg COD · m–3 · d–1. When BR was increased to the 6-fold level of 12 kg COD · m–3 · d–1, the VFA concentration increased drastically to 9 g.l–1, resulting in a toxification of the reactor and a pH-drop to 5.7. After increasing the pH to 7.0 and seven days of complete shut off, the reactor was started to be fed with the basic mixture of primary and surplus sludge, without any further supplements. After a further 10 days the reactor had

N22

20/7/00

3:04 pm

Page 153

Table 2a Determination coefficients for model prediction and measures for the FFBP-neural networks found according to Eq. 1 NET

R2-train GP

R2-train GC

R2-val GP

R2-val GC

5×4×2 7×6×2 8×8×2

0.91 ± 0.01 0.94 ± 0.01 0.95 ± 0.01

0.90 ± 0.02 0.94 ± 0.01 0.96 ± 0.01

0.72 ± 0.03 0.67 ± 0.06 0.69 ± 0.06

0.84 ± 0.02 0.80 ± 0.02 0.71 ± 0.06

NET

R2-train GP

R2-train GC

R2-val GP

R2-val GC

8×3×2

0.95 ± 0.00

0.89 ± 0.01

0.92 ± 0.02

0.74 ± 0.06

P. Holubar et al.

Table 2b Determination coefficients for model prediction and measures for the FFBP-neural network found due to optimization procedure

Figure 2 Course of the pulse-experiments and development of volatile fatty acids concentration

completely recovered. All available data of this experiment were transferred into a single Excel®-table, which is used as input for the FFBP-net and the Kohonen-SOM. Feed-forward back-propagation networks

The calculated networks of Table 1 were used to estimate the biogas production rate (GP) and the biogas composition (GC). Results are reported in Table 2a. The determination coefficients (R2) in this table show, that the network has learned the relation between input and output quite well (the R-train between model output and measures is above 0.9 for the training set data), but the net has not very good generalization capability (low R-val = correlation coefficient between validation set and measures). Several networks had then been trained with an amount of data 10 times bigger than the number of weights. The network, that at the moment better simulates the system, is a 8×3×2 FFBP, whose inputs are pH, organic loading rate, org loading ratet–1, GPt–1, GCt–1, Acetic ac.t–1, Prop.ac.t–1. Results are summarized in Table 2b. The gas composition prediction is still quite poor. Networks with 1 output and the same inputs had been tested but the R2-val GC did not improve. New networks with different inputs will be tested in the future. For instance a good correlation between the COD in the

153

N22

20/7/00

3:04 pm

Page 154

influent and the gas production had been found, when there is no poisoning of the anaerobic biocoenose. Self organizing maps

P. Holubar et al.

Several SOM had been built to map different input matrices in a 2 elements output vector, containing the biogas production rate and biogas composition. Subsequently the maps were used to predict the output, when new data were presented to the network. The results of this prediction were always worse than those obtained with FFBP neural networks, which were trained with the same input matrices and used to simulate the same validation data. An example of the different predictions, when the previously mentioned 8 inputs were used is given in Figure 3 and 4. Comparison with other controlling strategies and outlook

The neural network trained and validated in the first part of this work will be used as predictive model inside a DSS whose aim is to find a value for the organic loading rate which leads to a production of biogas higher or equal to a certain desired level without risking the system stability. Until now, to improve the performances of biological processes in environmental technologies, mainly control action had been applied. One interesting example of

Figure 3 Simulation of gas production rate GP and gas composition GC with a FFBP neural net

154

Figure 4 Simulation of gas production rate GP and gas composition GC with a Kohonen SOM

N22

20/7/00

3:04 pm

Page 155

P. Holubar et al.

control of anaerobic digestion had been reported by Steyer et al., (1999). The basic idea of their study was to add disturbances on the input flow rate and analyze the response of some key parameters in order to determine whether or not it is possible to increase the loading rate. In the case of negative effect of the disturbance the loading rate is decreased. The increasing and decreasing amount is calculated on the basis of the ratio between the expected gas volume and real gas volume by a fixed maximal percentage of variation. The only two measurements used in the control strategy were biogas flow rate and pH. Hawkes et al. (1995) applied a control to an anaerobic fluidized bed reactor during overloads using as control variable the bicarbonate alkalinity. Other control studies can be found in Heinzle et al. (1993). These control actions (which differ in the measurements used in the control strategy) allow the system to be kept close to a desired performance preventing at the same time overloads. With an optimization algorithm the behavior of the process can be further improved. To optimize the anaerobic fermentation, predicting the VFAs concentration a few time steps forward would be very important. When the VFAs can be estimated, the feeding rate pattern can be set for multiple-steps forward not only on the basis of the gas production and composition, which could be dangerous, but also on the basis of the expected VFAs. In this way the feeding rate pattern will be the one that optimizes a certain objective function (for instance which maximises the gas production) without risking the system stability. Conclusions

It could be shown that both types of self-learning networks in principle could be used to model the process of anaerobic digestion. Using the unsupervised Kohonen-self-organizing map, the model’s predictions could not follow the measurements in all details. This resulted in an unsatisfactory regression coefficient of R2= 0.69 for the gas composition and R2= 0.76 for the gas production rate. When the supervised FFBP neural net was used the training resulted in more precise predictions. The regression coefficient was found to be R2= 0.74 for the gas composition and R2= 0.92 for the gas production rate. Up to now it is not clear why the prediction of the gas composition is not as good as for gas production rate. Further investigations will be necessary. If the model had been used to control the lab-scale reactor the effects of the shock loading would have been predicted and therefore avoided. Measurement of fatty acids or pH would not allow the same control of the reactor. In the near future the control software will be installed at a technical scale plant and trained there to gain a more stable network. References Dochain, D. (1995). Recent approaches for the modeling, monitoring and control of anaerobic digestion processes. Proceedings of the International Workshop on Monitoring and Control of Anaerobic Digestion Processes, Dec. 6–7, 1995, Laboratoire de Biotechnologie de L’environnement INRA, France, pp. 23–29. Hawkes, D.L., Wilcox, S.J., Guwy, A.J., Hawkes, F.R. and Rozzi, A.G. (1995). Use of an on-line bicarbonate sensor to monitor and control organic overloads in an anaerobic fluidised bed reactor. Proceedings of the International Workshop on Monitoring and Control of Anaerobic Digestion Processes, Dec. 6–7, 1995, Laboratoire de Biotechnologie de L’environnement INRA, France, pp. 13–17. Heinzel, E., Dunn, I., and Ryhiner, G. (1993). Modelling and control for anaerobic wastewater treatment. Advances in Biochemical Engineering/Biotechnology, 48, 79–114. Kasabov, N.K. (1998). Foundations of Neural Networks, Fuzzy Systems, and Knowledge Engineering. MIT Press, Cambridge, Massachusetts. Katz, W.T., Snell, J.W. and Merickel, M.B. (1992). Artificial neural networks. Meth.Enzym. 210, 610–636. Kohonen, T. (1997). Self-organizing Maps. 2nd Edition, Springer, Heidelberg. Linko, S., Loupa, J., and Zhu, X.H. (1997). Neural networks as “software sensors” in enzyme production, J. Biotechnol. 52, 257–266.

155

N22

20/7/00

P. Holubar et al. 156

3:04 pm

Page 156

Müller, A., Marsili-Libelli, S., Aivasidis, A., Lloyd, T., Kroner, S., and Wandrey, C. (1997). Fuzzy control of disturbance in a wastewater treatment process. Wat. Res., 31, 3157–3167. Schubert, J., Simutis, R., Dors, M., Havlik, I. and Lübbert, A. (1994). Bioprocess optimization and control: application of hybrid modelling. J. Biotechnol., 35, 51–68. Steyer, J.P., Buffière, P., Rolland, D. and Moletta, R. (1999). Advanced control of anaerobic digestion process through disturbances monitoring. Wat. Res., 33, 2059–2068. Steyer, J.P., Amouroux, M. and Moletta, R. (1995). Process modeling and control to improve stable operation and optimization of anaerobic digestion processes. Proceedings of the International Workshop on Monitoring and Control of Anaerobic Digestion Processes, Dec. 6–7, 1995, Laboratoire de Biotechnologie de L’environnement INRA, France, pp. 30–35. Zupan, J. and Gasteiger, J. (1993). Neural Networks for Chemists. VCH, Weinheim.