# Optimized Dissolved Oxygen Fuzzy Control for Recombinant _Escherichia coli_ Cultivations
## 3 Material and Methods
### Simulator  
Although the fuzzy controller parameters were adjusted by ANFIS tool, QairVar and QO\({}_{2}\)Var still missed a fine tuning. In order to test and fine tune the fuzzy controller, a simulator was coded in MATLAB. Figure 4 illustrates the concept of the simulator. From previous values of microorganism concentration (CX), dissolved oxygen concentration (DOC), agitation speed (AgitSp), air and oxygen flow rates (Qair, QO\({}_{2}\)), and specific growth rate (Mi), the fuzzy controller provided updated air and oxygen flow rates. These values were passed on to the first neural network (DO_net) in order to estimate the dissolved oxygen concentration. With the updated DOC, the PID controller determined the agitation speed. The newly corrected values of gas flow rates, dissolved oxygen concentration, and agitation speed were used by the second neural network (CX_net) in order to estimate the microorganism concentration. By applying material balance for cells in a fed-batch operation, it was possible to estimate the specific growth rate. At last, the updated values were fed back into the fuzzy controller to start the next time-step. Figure 3: Delta, Princ1, and Princ2 Sugeno-type fuzzy inference systems input variables (with their linguistic values and membership functions) adjusted by ANFIS. Both neural networks were created using the Neural Network Time Series application (MATLAB). Due to presence of memory, dynamic neural networks (nonlinear problem with single input and single output vectors) were chosen. To model CX_net, two matrices were loaded into the application: an input matrix with air and oxygen flow rates, agitation speed, and DOC and an output matrix with target microorganism concentration. The application randomly divided the dataset based on the default percentages of 70, 15, and 15% (training, validation, and test) for each training phase. With multiple inputs and a smooth target output, the correlation coefficient was 1 in every training phase. Contrarily, DO_net training had opposite characteristics: with few input variables (air and oxygen flow rates) and an oscillatory behaviour of the target output, the datasets had to be reduced to about 6% of its original size. By balancing smaller correlation coefficients (about 0.65), it was possible to obtain a more generic network (avoiding overfitting). This strategy was applied to both A16 and A12 datasets, and the training results are illustrated in Table 3.  
During training, a heuristic search was conducted in order to determine the best architectures for the networks. For CX_net, the architecture chosen was one hidden layer of 4 sigmoid neurons with 4 delays, followed by an output layer of a single linear neuron. On the other hand, for DO_net, the architecture chosen was one hidden layer of 15 sigmoid neurons with 4 delays, followed by an output layer of a single linear neuron. The larger number of neurons in DO_net reflects its complexity compared to CX_net. Figure 4: Simulator scheme comprised of the fuzzy controller, neural network model of the process, PID controller, and specific growth rate equation. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Dataset** & **Phase** & \multicolumn{2}{c}{**DO\_net**} & \multicolumn{2}{c}{**CX\_net**} \\ \hline \hline  & & **Samples** & **R 1** & **Samples** & **R 1** \\ \hline \multirow{4}{*}{A16} & Training & 216 & 0.68 & 3681 & 1.00 \\  & Validation & 47 & 0.59 & 789 & 1.00 \\  & Testing & 47 & 0.66 & 789 & 1.00 \\  & Training & 290 & 0.77 & 5160 & 0.98 \\ A12 & Validation & 62 & 0.72 & 1106 & 0.98 \\  & Testing & 62 & 0.63 & 1106 & 0.98 \\ \hline \hline \end{tabular}  
* Where R is the correlation coefficient between the neural network output and its target output value. R value close to 1 indicates total correspondence, whereas a R value close to 0 indicates random correlation.  
\end{table} 
Table 3: Results for the neural networks building phases (training, validation, and test).