Journal of Process Control 124 (2023) 36–53 Contents lists available at ScienceDirect Journal of Process Control journal homepage: www.elsevier.com/locate/jprocont Transfer Learning in wastewater treatment plants control: Measuring the transfer suitability ∗ Ivan Pisa a,b , , Antoni Morell a , Jose Lopez Vicario a , Ramon Vilanova b a Wireless Information Networking (WIN) Research Group, Escola d’Enginyeria, Universitat Autònoma de Barcelona, Bellaterra, 08193, Spain b Automation and Advanced Control Systems (ASAC) Research Group, Escola d’Enginyeria, Universitat Autònoma de Barcelona, Bellaterra, 08193, Spain article info a b s t r a c t Article history: The industrial sector is nowadays experiencing a digital transformation motivated by the Industry Received 27 October 2022 4.0 paradigm. Concepts such as data-driven models, Artificial Neural Networks (ANNs), and Transfer Received in revised form 23 December 2022 Learning (TL) are part of the current vocabulary in the industrial management and control topics. Accepted 13 February 2023 For that reason, in this paper the application of TL techniques is proposed to derive new ANN-based Available online 24 February 2023 control structures from pre-existing ones. Notice that if an ANN-based controller is transferred into a Keywords: new industrial environment, its appropriate behaviour must be ensured, and what it is more important, PID controllers this must be known a priori. Nevertheless, TL techniques do not always ensure this. That is why the Transfer Learning Transfer Suitability Metric (TSM) is proposed here. Determining the similarity among environments, Water management this metric tells if the controller can be transferred, transferred with certain limitations, or if it cannot be transferred at all. Here, the metric is applied over a Wastewater Treatment Plant (WWTP). The objective is to derive the control structure of one control loop, let us say the Dissolved Oxygen (DO), and then transfer it into another basic control loop in a WWTP, the Nitrate–nitrogen (NO), and vice- versa. Results show that with the help of the TSM, an improvement around a 68.54% and 80.53% in the Integrated Absolute Error (IAE) and the Integrated Squared Error (ISE) is obtained in the NO management, respectively. Moreover, a simplification and speed-up of the controller design process is achieved. © 2023 The Author(s). Published by Elsevier Ltd. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/). 1. Introduction determine whether the system is behaving correctly or not [1,3]. For instance, ANNs are considered to develop soft-sensors de- During the last years, the industrial sector has experienced voted to determining the deformation produced in the rotors of a digital transformation towards the Industry 4.0 paradigm. It air pre-heater systems [4]. Results there show that ANNs can has arisen as one of the most important advances where in- offer a much better performance than other data-driven meth- dustrial systems will be able to communicate among them by ods. Other recent use cases of ANNs show that Feed-forward means of exchanging huge amounts of information. Together Neural Networks (FFNN) and Bayesian ones are considered to di- with the massive adoption of such systems in most of the in- agnose failures. The formers, for instance, determine the damage dustrial scenarios, the amount of available information related of different structures, ranging from tiny composite plates to big- to industrial systems and their behaviour is expected to expo- ger ones such as a steel-concrete composite cantilever structure nentially increase [1,2]. This motivates the appearance of pro- [5–7]. The latter are adopted to determine different topologies of cesses and tasks where Artificial Neural Networks (ANNs) are failures of permanent magnet motors, to determine the fault di- considered as the crucial tool to carry out the desired activity. agnosis of multi-redundant closed-loop feedback control systems One clear example consists in the adoption of ANNs for main- or to estimate the performance degradation of the system model tenance and anomaly detection purposes, where they predict [8–10]. the correct behaviour of the processes under supervision and Nonetheless, ANNs are not only considered to detect anoma- lies and malfunctions of industrial systems, but also to develop ∗ Corresponding author at: Wireless Information Networking (WIN) and sensing tools devoted to measuring certain parameters from dif- Automation and Advanced Control Systems (ASAC) Research Groups, Escola ferent environments [11]. For instance, Convolutional Neural Net- d’Enginyeria, Universitat Autònoma de Barcelona, Bellaterra, 08193, Spain. E-mail addresses: ivan.pisa@uab.cat (I. Pisa), antoni.morell@uab.cat works (CNNs) are considered to develop a method to track the rail (A. Morell), jose.vicario@uab.cat (J.L. Vicario), ramon.vilanova@uab.cat head and waists by means of laser devices pointing at the desired (R. Vilanova). points of the rail structure. In that way, the proposed method https://doi.org/10.1016/j.jprocont.2023.02.006 0959-1524/© 2023 The Author(s). Published by Elsevier Ltd. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/). I. Pisa, A. Morell, J.L. Vicario et al. Journal of Process Control 124 (2023) 36–53 exploits the features of CNNs to provide an accurate and robust control loop being controlled. Consequently, their main benefit performance [12]. Other use cases of ANNs as sensing approaches cannot be completely exploited. Here is where Transfer Learning are widely observed in the petrochemical and wastewater treat- (TL) comes into action. It is in charge of getting an ANN, which ment sectors. For instance, a soft-sensor based on Adaptive Linear is consciously trained for a certain task in a given domain, the neurons is proposed to generate predictions of the densest con- source domain, and then transferring it into a new unseen task centration of the elements in a distillation column [13]. In [14], or scenario, the target domain. This approach has been widely a soft-sensor based on recurrent neural networks, and especially studied and adopted in classification tasks and, particularly, in Long Short–Term Memory (LSTM) cells, is proposed to determine image processing [27]. violations of effluent values in a Wastewater Treatment Plant Notwithstanding, in the industrial sector, most of the works (WWTP). where TL is involved are focused on the machine fault detec- ANNs are also considered to tackle control issues as though tion and diagnosis. For instance, convolutional neural networks they were conventional controllers. For instance, in [15], two and TL are considered to implement a system able to manage FFNNs are considered to implement the direct and inverse con- gearbox components to avoid their failure [28]. The same prin- troller of an oil well drilling machine. Results show that this ciple is also observed in [29]. There, authors present a TL and approach can regulate in real time the pressure of the drilling fine-tuning (FT) process devoted to implementing a machine machine. Another example consists in the adoption of ANNs to fault diagnosis system which will determine gearbox failures by implement an Internal Model Controller (IMC) based on Multi- means of time–frequency imaging of the gearbox system. The layer Perceptron (MLP) and FFNN networks [16]. Its main aim is to convolutional networks are trained with labelled data from the regulate the quantity of light present in an office environment. In [17], an ANN with a Proportional Integral (PI) ability is placed in source domain and then transferred into the target domain where the feedback loop of a control structure managing a buck DC/DC only unlabelled data is available. Finally, TL is also considered converter. In that manner, the ANN can consider a high number joint with the AlexNet, a neural network architecture, to ob- of gains rather than the usual number of conventional PI con- tain structures able to identify and classify different emulsion trollers. In [18], the power of ANNs is considered to implement a mechanisms for the oil sector [30]. Other examples considering Model Predictive Controller (MPC) devoted to controlling highly regression tasks mainly adopt TL to implement soft-sensors to complex multilevel power converters. be applied in scenarios presenting data-scarcity problems [31]. Focusing on the WWTP domain, ANNs are also considered as In there, an ANN-based soft-sensor is trained with data from the tools either supporting a control structure, or acting as the main source domain, the one where enough data are available, and controller. For instance, in [19], ANNs are proposed to perform then transferred into the target environment, the one showing predictions of future violations of the WWTP pollutant limits. data-scarcity issues. The same is applied in [32], where a CNN These predictions are considered to activate either a fuzzy, or is considered to forecast the WWTP power consumption. Here, a MPC control structure as a function of the predicted value. In TL is proposed to overcome the issues related to the WWTP data [20], ANNs are adopted in the identification process of a MPC scarcity by means of transferring pre-trained CNNs. in charge of controlling the effluent concentrations of a general Moreover, in the industrial domain, the benefits of TL can be purpose WWTP. Later, in [21], ANNs are considered to implement exploited to speed-up the design of control loops. For instance, TL an adaptive fuzzy controller able to track the optimal set-points techniques are considered in different ways to derive new control of the WWTP dissolved oxygen control loop. In that way, the ANN structures [33–36]. In [33], TL is applied to derive a new variable exploits its performance in the modelling of non-linear processes. speed limit control unit. The main point is that TL is applied to As a results, a better performance compared to a conventional introduce a reinforcement learning agent trained in the source fuzzy controller can be achieved. Finally, in [22], Recurrent Neural domain into the target ones. In that manner, an acceleration Networks (RNN) are considered to implement an IMC structure in in the training process and the control design is achieved. In charge of the same loop. Results there show that such structures [34], TL is considered to transfer a deep reinforcement learning can overcome the results of conventional PI structures. agent managing the heating system of a source building into a As it is observed, all these works rely on the performance target one. Thus, the new heating system can be obtained in an of the ANN on which they are based. However, ANNs must be easy manner. Later, in [35], TL accelerates the training process properly dimensioned and trained to offer a good performance. of a hybrid cloud and edge reinforcement learning based control The problem here lies in the fact that the training process of strategy. Finally, in [36], transfer learning is considered to derive an ANN can become a tedious and high time demanding and consuming task [23]. Indeed, ANNs are tools whose performance new reinforcement learning based controllers of heating pumps rely on the data considered in the training process. Consequently, by means of transferring the controllers of similar systems in the data scarcity problems can entail severe issues. If enough data is same environment. not considered, the ANN cannot be properly trained. For all these In terms of the WWTP management, a first assessment of reasons, these issues must be tackled somehow, especially in the the application of TL to derive new controllers was presented in industrial sector where ANNs are being more and more adopted. [37,38], where an ANN-based control structure is transferred Recent studies show that the most representative computa- among the different control loops. Results there show that a tional intelligence algorithms can be considered to alleviate these reduction of the ANN design and training time is achieved. How- issues. For instance, a self-adaptive extreme learning algorithm ever, the adoption of TL in such a way entails some issues that is considered to determine the optimal number of neurons in must be considered: an ANN structure [24]. The same algorithm is also proposed to reduce the computational requirements in the ANN training • TL is not always a workable solution, and, on some occa- process [25]. More complex algorithms like the Monarch Butterfly sions, the Negative Transfer effect can be suffered [39]. Optimization process can be adopted to optimise the ANN struc- • In industrial scenarios, TL cannot be evaluated a posteriori ture and therefore, derive an optimal network offering a good since a wrong actuation can entail the destruction of the performance without carrying out huge efforts [26]. The problem target industrial environment. of the application of these algorithms in the control domain relies • There exists a lack of metrics able to show the suitability of on the fact that they entail the derivation of a new ANN for each transferring the ANN-based control design approach. 37 I. Pisa, A. Morell, J.L. Vicario et al. Journal of Process Control 124 (2023) 36–53 the limits of transfer learning are studied from the theoretical point of view. From a practical one, in [43], TL suitability is determined training several convolutional neural networks in the source domain. Then, they are transferred into the target domain and ranked with data coming from the source environment. The best network is finally considered as the model to be used. In [44], the adoption of several metrics is evaluated to determine the TL effect a posteriori. Nine different non-intrusive load monitoring algorithms are tested with source and target data to classify and estimate the energy consumption. However, results are only proved on energy consumption datasets, which cannot assure Fig. 1. ANN-based Controller considering two LSTM cells and two MLP layers. Its main aim is to replicate the behaviour of a conventional control structure. their adoption in other environments. From the regression point of view, Boudabous et al. present a traffic flow estimation system where its transferability is assessed [45]. Another example is shown in [46], where the transferability and accuracy of ANNs For that reason, this paper tries to shed some light in this do- in charge of estimating the soil moisture is analysed. There, the main providing the industrial control developers with a new met- transferability analysis is performed to determine the best dataset ric measuring the transfer suitability of ANN-based controllers. to train an ANN able to perform the desired prediction task. Notice that this paper corresponds to an extension of the works Finally, in [47], a metric to quantify the separability of data classes shown in [37,38], where all the aforementioned issues were not in classification issues is presented. considered. In that sense, this work firstly proposes and defines Although these works present an attempt to measure the this metric conceptually and mathematically. Later, its behaviour transfer suitability of the different structures, all of them show is analysed considering four different academic examples. Fi- the same issues: nally, it is considered and applied in the development of new ANN-based control structures adopted in the same domain as in • Most of the measuring approaches are devoted to deter- [37,38], a WWTP environment. mining the transfer suitability of structures performing clas- The outline of the paper is as follows: Section 2 defines the sification tasks. However, here we are dealing with a re- problem being tackled in this paper. The proposed metric solving gression problem since we want to transfer an ANN-based the problem previously defined is presented in Section 3. Its controller dealing with time-series signals. Therefore, the validation is attained in Section 4 and its final application is approaches for classification problems are not valid since performed in Section 5. Finally, Section 6 concludes the paper. the time correlation, which is a common feature of industrial measurements, is broken. 2. Problem definition • The transferability of the structures dealing with regression tasks is usually computed a posteriori [37,38,46]. Thus, bad Industrial Environments are characterised by presenting huge actuations and performances cannot be avoided. amounts of control loops devoted to ensuring the correct be- haviour and functionality of the industrial plant. In that sense, Taking all this into account, this work is focused on provid- the amount of time required to implement and design each one ing a new measuring approach, the Transfer Suitability Metric of these controllers increases with the number of control loops to (TSM), which can a priori determine the transfer suitability of an manage. Notwithstanding, TL arises as an option able to reduce ANN-based control structure. Its main aim is to determine the this design and implementation time [38]. To exploit the benefits similarity of the control loops between environments. Thus, the of TL, an ANN-based Controller (see Fig. 1) must be designed and TSM metric, which is based on the idea presented in [47] and the properly trained so as to correctly manage an industrial process, correlations presented in [46], is computed to give a numerical the source environment. Later, this ANN-based controller will be value to this similarity and therefore, to decide if the ANN-based deployed on the remaining loops or target environments, not only structure is transferable or not. Fig. 2 depicts the idea behind the reducing the design complexity, but also the required time to de- problem that TSM is willing to solve. rive a control solution [38]. Here, it consists in two LSTM cells and A first approach to this behaviour is proposed in [48], where two MLP layers connected in series. The number of hidden units the first definition of the metric was proposed. However, it was per layer equals to 100, 50, 25 and 1, respectively. LSTM cells tested a posteriori over academic examples. Here, we provide a are considered here due to their power in the management of deeper understanding of the proposed metric. Besides, we pro- time-series signals such as the ones managed in control problems pose the adoption of the metric over academic examples and a [40]. digital version of a critical industrial environment, a WWTP. In Nevertheless, the ANN-based controller cannot be transferred both cases the metric is computed a priori considering two differ- without determining a priori its suitability and preventing a Neg- ent control configurations: (i) an open loop one where the envi- ative Transfer [39]. Its effects can entail the malfunction of the ronment is not being controlled and (ii) considering the historical control loop and therefore, the incorrect operation of the in- data of the closed loop. As a summary, the main contributions of dustrial process. The avoidance of this effect is required for any this work are: industrial scenario, but it is indispensable for critical industries such as WWTPs and petrochemistry environments, where a mal- • Reduce the complexity and speed-up the control design function or mismanagement can entail the destruction of the process by means of transferring ANN-based structures be- industrial plant or the environment. For that reason, the need of tween industrial environments. measuring the suitability of TL is obvious. Some works have ad- • Define and develop a metric able to compute the suitabil- dressed this in the last years. In [41], a first attempt to determine ity of transferring an ANN-based controller between critic how transferable are certain parts of neural networks has been source and target control loops. The key point here is that performed. In there, the effects of TL and fine-tuning processes this metric is computed a priori. This is crucial since one can performed to a set of neural networks dealing with the ImageNet determine the performance of the controller in the target dataset are assessed. Something similar is done in [42], where domain before performing the transference. 38 I. Pisa, A. Morell, J.L. Vicario et al. Journal of Process Control 124 (2023) 36–53 Fig. 2. TSM objective. The main idea is to determine if the ANN-based controller derived from the source domain can be transferred into the target domain or not. Notice that r(s), P(s), u(s) and y(s) are the reference signal, the process under control, and the actuation and controlled signals, respectively. • Assess the behaviour of the metric in a critical environment have been previously defined and deeply assessed in [51,52]: such as WWTP domain. K 1.4 Ps (s) = · e−Ls = · e−0.4s The fact that this metric is computed a priori opens a new Ts + 1 1.2s + 1 paradigm that can be highly beneficial in the industrial control K ωn2 1.521 design: industrial controllers can be implemented by means of Pt (s) = · e−Ls = · e−0.370s s2 + 2ζ ωn s + ω 2 n s2 + 0.338s + 1.59 ANNs which are able to replicate the behaviour of conventional (1) structures such as Proportional Integral Derivative (PID) con- trollers, MPCs or IMCs [19,20,22,49,50]. They will be designed for where K , T and L correspond to the gain, time constant, and delay the source scenario and then, tested with measurements from of the FOPDT process, respectively. In terms of the SOPDT, the the target one. Measurements of the source domain are already ωn equals to the natural frequency of the process and ζ to its obtained since they are considered in the training process of the damping coefficient. ANN-based controller. On the other hand, the ones coming from In such a context, Ps (s) is controlled by an ANN-based PID the target environment can be obtained directly from historical controller such as the one presented in Fig. 1. It is properly data. Hence, the transference suitability of the control struc- trained so as to replicate the PID controller defined in [51]. Then, ture can be assessed without disturbing the target environment it is proposed to be transferred into Pt (s). Hence, the similarity between industrial processes is computed to determine if Pt (s) performance. can be controlled by the same ANN-based controller. Consequently, two matrices are obtained for each one of the 3. Transfer suitability metric ANN-based layers when dealing with measurements from Ps (s) and Pt (s), respectively. These matrices are defined as Xi , Yi ∈ 3.1. TSM introduction RN ×D , where D is the output dimension of the ith layer of the ANN structure and N is the number of time instants (see Fig. 3). Thus, Xi and Yi can be understood[ as the set of outputs of the TSM is focused on computing the similarity between the ]T source and target environments where the transference of the ith layer sorted in time, i.e., Xi = xi (t0 ), . . . , xi (tN ) and Yi = ]T yi (t0 ), . . . , yi (tN ) , where xi (t), yi (t) ∈ R1×D are the outputs of [ ANN-based control structure will be performed. Since industrial measurements from both domains can be understood as time- the ith layer at a time instant t ∈ [t0 , tN ]. series signals, the computation of correlations is proposed to The first step to compute the proposed metric is to reduce determine these similarities [46]. The main idea is to obtain the the dimension of each ANN layer to a determined one. This outputs of the ANN-based controller when it is dealing with is performed to obtain an invariant metric with respect to the dimensions of each layer of the ANN-based controller and to measurements from the source and target domains, respectively. preserve their time correlation. The number of dimensions can Then, the correlations are computed to determine if the outputs be set to whatever dimension is desired, however, in this work are similar enough to consider the transference of the ANN- a 2-dimension matrix is proposed since it allows for a visual based controller. High correlation values will be obtained in interpretation. Here, the algorithm to perform this task consists those situations where the ANN is treating the measurements in the well-known Multidimensional Scaling (MDS) algorithm from both domains similarly and therefore, when the ANN-based [53,54]. While other possible methods such as Principal Com- controller is transferable. On the other hand, low values will ponent Analysis (PCA), Linear Discriminant Analysis (LDA), and be obtained in those situations where the ANN is performing Independent Component Analysis (ICA) reduce the dimension of different processes to the input measurements. Consequently, the data without preserving the relationships among measurements, control problems are different enough to not apply the ANN- the MDS algorithm is considered due to its ability to preserve based controller transference. In that sense, the autocorrelation these relationships once the dimensions are reduced [53]. It is and cross-correlation between measurements of both domains important to preserve them since later the correlation compu- are adopted here. tation will take them into account. In that sense, the following transformation is performed: MDS 3.2. TSM definition Xi ∈ RN ×D −−→ X′,i ∈ RN ×2 (2) MDS In order to derive the TSM metric, let us consider two different Yi ∈ RN ×D −−→ Y′,i ∈ RN ×2 processes, a First Order Plus Dead-Time (FOPDT) process, Ps (s), Visually, one can observe in Fig. 4 that the output of the layer and a Second Order Plus Dead-Time (SOPDT) process, Pt (s). Both is changed from a set of values in the form of a matrix, which 39 I. Pisa, A. Morell, J.L. Vicario et al. Journal of Process Control 124 (2023) 36–53 Fig. 3. Structure of matrices Xi and Yi for the ith layer of the ANN-based controller. Notice that a continuous time-delay block is added with a delay of Ts . In this case, Ts corresponds to the sampling time of measurements which holds the Nyquist Sampling Theorem. cannot be easily managed, to a situation where the output of the Once the normalised autocorrelation and cross-correlation layer can be easily interpreted as the evolution of a signal in a 2- matrices for the given layer of the ANN-based controller are dimensional space. For instance, we are going to take the outputs obtained, we proceed with the computation of the TSM for the of the second LSTM layer (LSTM 2) of the ANN-based controller ith layer: presented in [38], not only when it is controlling Ps (s), but also   2N −1 2 ( Pt (s). In this case, it can be clearly observed that the evolution of  1 ∑∑ [ ] [ ] )2 the dimensions of the ANN-based controller are not similar at all. TSMi = 1 − √ Rx′,i k,j − Rx′ y′,i k,j (5) 2(2N − 1) Since the correlation values highly depend on the input mea- k=1 j=1 surements, the time-correlation matrices consist in the Then the TSM value for the considered ANN-based controller normalised autocorrelation of the data coming from the source is computed as: control loop, Rx′,i ∈ R(2N −1)×2 , and the normalised cross-correlation between the data coming from the source and TSM = min(TSMi ) (6) the target control loops, Rx′ y′,i ∈ R(2N −1)×2 . Thus, they consist in: Taking all this into account, the TSM computation can be 1 performed following the Algorithm 1. ⎡ ⎤ max(r ′ i ) · r x′ i j=1 x j =1 Notice that TSM relies on data, which may come from SCADA Rx′,i = ⎣ (3) ⎢ ⎥ 1 · r x′ i ⎦ systems as well as physical sensors that might introduce noise max(r ′ i ) x j =2 j=2 to the measurements or return missing values. In such a context, ⎡ √ 1 · rx′ y′ i ⎤ prior to compute the TSM a data preprocessing stage should be max(r ′ i x ) max(r ′ ′ i x y ) j=1 performed to assure that measurements corrupted by noise are ⎢ j=1 j =1 ⎥ Rx′ y′,i = ⎢ ⎥ (4) cleaned and missing values are imputed. Data-based strategies 1 ⎣ √ · rx′ y′ i ⎦ such as the application of Autoencoders and Denoising Autoen- max(r ′ i ) max(r ′ ′ i ) j=2 x j=2 x y j =2 coders can be applied [22,55]. In addition, we have empirically proved that only a total amount equivalent to the 30% of the where rx′ i and rx′ y′ i ∈ R(2N −1)×1 are the sample autocorrelation j j [ ] [ ] required data to properly train the models is needed to safely and cross-correlation vectors for X′,i j,· and Y′,i j,· , respectively. compute the TSM value in the scenarios proposed in this work. 40 I. Pisa, A. Morell, J.L. Vicario et al. Journal of Process Control 124 (2023) 36–53 Algorithm 1 Algorithm to compute the TSM metric respectively. For that reason, values close to 1 mean that the autocorrelation and cross-correlation are remarkably similar and for i = 1 to M do ▷ M ← Number of layers therefore, that the ANN-based controller can behave similarly in Obtain the data: the source and the target domain. Otherwise, TSM values equal Xi = outputs of the i-th ANN layer controlling Ps (s) to 0 would be obtained in the hypothetical scenario where the ▷ Xi ∈ RN ×D autocorrelation matrix totally differs from the cross-correlation Yi = outputs of the i-th ANN layer controlling Pt (s) matrix. ▷ Yi ∈ RN ×D To clearly observe that, let us consider the case of transfer- Compute the MDS: ring the ANN-based controller of Ps (s) into Pt (s). TSM values are X′,i = MDS(Xi , 2) ▷ X′,i ∈ RN ×2 computed for each layer, showing that its maximum is given Y = MDS(Y , 2) ′,i i ▷ Y′,i ∈ RN ×2 for j = 1 to 2 do at the output of the ANN-based controller. It equals to 0.665. On the other hand, the lowest TSM, which equals to 0.5683, is ∆ ,i offered by the first MLP layer. Visually, Fig. 5 clearly shows that Define Xj : the transference of the ANN-based controlling Ps (s) into Pt (s) is not a suitable option. From this, it can be extrapolated that TSM ⎡ [ ′,i ] ⎤ X N ,j 0 ··· 0 ⎢[X′,i ] [ ′,i ] values closer to 0.6 or lower will be obtained in those cases X ··· 0 ⎥ ⎢ N −1,j N ,j ⎥ where the transfer of the ANN-based controller is not suitable. For ⎢ .. .. .. ⎥ ⎢ [ .] . . that reason, and to leave a certain margin, the transfer suitability ⎢ ⎥ ⎢ X′,i 1,j ⎢ [ ′,i ] [ ′,i ] ⎥ ⎥ limit is set to γsuitability = 0.7. Notice that this value is ad- ∆,i X ··· X [ ′,i ]2,j [ ′,i ] N ,j ⎥ hoc. Therefore, γsuitability should be computed for each domain, ⎥ Xj =⎢ ⎢ ⎢ 0 X 1,j ··· X N −1,j ⎥ ⎥ i.e., other control scenarios. However, a rule-of-thumb has been ⎢ .. .. .. ⎥ considered to set the value of γsuitability : it must be placed above ⎢ . . . ⎥ 0.7. TSM is based on the correlation concept and values higher ⎢ [ ′,i ] ⎥ 0 0 ··· X ⎢ ⎥ ⎣ [ ]2,j ⎦ than 0.7 are considered as strong correlations [56]. From that 0 0 ··· X′,i 1,j minimum value, the higher the value of γsuitability , the stronger the ,i ▷ X∆ j ∈ R(2N −1)×N required relationship between domains (which could be the case when addressing more complex and critical processes). Compute autocorrelation rx′ i and cross-correlation rx′ y′ i j j 4. TSM validation vectors: ∆,i [ ] rx′ i = Xj · X′,i ·,j ▷ rx′ i ∈ R (2N −1)×1 j j Before applying the TSM on the WWTP environment, its be- ∆,i [ ′,i ] rx′ y′ i = Xj · Y ·,j ▷ rx′ y′ i ∈ R(2N −1)×1 haviour is assessed considering four academic controlled pro- j j cesses (see Fig. 6). They consist in two FOPDT systems, Ps (s) [Normalise autocorrelation and cross-correlation: 1 and P2 (s), an over-damped SOPDT process, P3 (s), and a SOPDT ] Rx′,i ·,j = max(r · rx′ i i) x′ j j system with resonant frequencies, P4 (s). Ps (s) is considered as the 1 source domain while P2 (s), P3 (s), and P4 (s) are considered as the [ ] Rx′ y′,i ·,j = √ · rx′ y′ i max(r ′ i )·max(r ′ ′ i ) x x y j target ones. All these systems have been previously developed j j and deeply analysed by Kurokawa et al. [51,52]. end for Compute Transfer Suitability Metric for i-th ANN layer: 4.1. Source environment √ 2N −1 2 ∑ ∑ ([ ] )2 1 Ps (s) is defined in (1), where its gain, K , is equal to 1.4 and ] [ TSMi = 1 − 2(2N −1) Rx′,i k,j − Rx′ y′,i k,j k=1 j=1 its dead-time or delay to L = 0.4 s. The conventional one degree of freedom PID controller controlling this process is taken from end for Kurokawa et al. in [51]. It is defined as: Compute Transfer Suitability Metric as: TSM = min(TSMi ) 0.2367s [( ) ] 1 us (s) = 1.286 · 1+ · es (s) + · ys (s) 1.8109s α · 0.2367s + 1 (8) If lower amounts are considered, however, some dynamics of the ANN-based controller management can be lost since the slowest where es (s) corresponds to the mismatch between the reference dynamics could not be properly captured. Besides, the TSM could signal rs (s) and the output signal of Ps (s), ys (s). not converge efficiently due to the lack of this information and Taking all this into account, the signals of the Ps (s) control therefore, produce undesired outputs. system (ys (s) and us (s)) when it is controlled by the Kurokawa’s PID are considered in the training process of the ANN-based 3.3. TSM interpretation PID controller. It is trained considering a variable set-point, r(s), which is generated by means of a pseudo-random uniformly Once the minimum TSM value is computed, the rule to decide distributed sequence of values between 0 and 2. between transferring or not is the following one: The ANN-based PID structure is developed and trained in TensorFlow in its 1.14 version over Python 3.6 [57]. The most if TSM > γsuitability { Suitable Transfer = (7) common libraries of Python, such as Pandas, Numpy, Matplotlib, Unsuitable if TSM ≤ γsuitability Scikit-Learn and Scipy are also considered [58–62]. Finally, the where γsuitability corresponds to the transfer suitability limit. ANN is trained considering the ADAM optimiser and It is worth noting that, with the considered normalisation, the back-propagation training algorithm with a learning rate of 1 · maximum and minimum correlation values are set to 1 and 0, 10−3 and a L2 penalty of 1 · 10−4 to avoid overfitting issues [40, 41 I. Pisa, A. Morell, J.L. Vicario et al. Journal of Process Control 124 (2023) 36–53 Fig. 4. D-dimensional vs. 2-dimensional outputs of the ANN-based controller when it is managing the source and target control loops. ® Simulink v.10.2. For further details readers are referred to [38]. Results show a Root Mean Squared Error (RMSE) equal to 0.0630 units, a Mean Average Percentage Error (MAPE) of 8.57%, and a determination coefficient (R2 ) of 0.996. Details on the pre- diction performance metrics can be observed in [63, Performance evaluation]. Then, the ANN-based structure is tested as the Ps (s) controller to assess its control behaviour as well as to determine if it can be considered as a candidate to be transferred. This performance is evaluated by means of the usual Integrated Absolute Error (IAE) and Integrated Squared Error (ISE) indexes. Results show that the IAE and ISE values for Ps (s), when it is controlled by the conventional PID of (8) for a variable set-point during 365 s, are equal to 16.6027 and 6.8499, respectively. In terms of the ANN-based controller, these amounts are increased until 18.6457 and 7.0470, respectively, which are only deviated a 12.03% and a 2.88% with respect to the conventional PID results, respectively. Besides, it can be observed in Fig. 7 that the control performance and the manipulated signal of the proposed ANN-based controller Fig. 5. Control performance when Ps (s) and Pt (s) systems are managed with the almost match the conventional PID as it is expected. ANN-based controller. 4.2. Target environments Section 7.2]. This process is carried out considering an NVIDIA In terms of the target environments, the second FOPDT pro- GeForce RTX 2080 Ti GPU and an Intel Xeon CPU working at a cess, P2 (s), is defined as follows: maximum clock frequency of 3.60 GHz. Once trained, the ANN- 2.5 ® based PID controller is implemented over Matlab R2020b and P2 (s) = e−0.6s (9) 1.4s + 1 42 I. Pisa, A. Morell, J.L. Vicario et al. Journal of Process Control 124 (2023) 36–53 Fig. 6. TSM validation. The main idea is to determine if the ANN-based controller for the source domain can be transferred over the target domains. Fig. 7. Control performance when Ps (s) is managed with the conventional PID Fig. 8. Bode diagram for Ps (s), P2 (s), P3 (s) and P4 (s) processes. and the ANN-based controller. where K = 2.5, T = 1.4 and L = 0.6 s. As it is observed, the dynamics of P2 (s) differ from Ps (s) mainly in the introduced delay As it has been previously stated, the main objective of this as well as in the gain of the process. work is to compute the suitability of transferring an ANN-based The first SOPDT process, P3 (s), is described by the following controller between different domains. For that reason, the ANN- transfer function, based PID controlling Ps (s) is transferred into P2 (s), P3 (s) and 1.11 P4 (s) control loops. In that sense, one can face two different P3 (s) = · e−0.420s configurations of the target processes: s2 + 2.2200s + 1 (10) 1 1.11 = · · e−0.420s 1. The processes present an open-loop configuration and s + 1.5918 s + 0.6282 therefore, data from the target domain does not contem- which defines an over-damped process with ζ = 1.11. On the plate any kind of information regarding the control be- other hand, P4 (s) shows a resonance phenomenon at 1.14 rad/s. haviour. This phenomenon can be observed in the Bode Diagram where 2. Historical data from the target domain being managed by the gain of the process increases instead of decreasing or being default PID controllers are available. constant along the frequencies (see Fig. 8). Thus, P4 (s) equals to: 4.2.1. Open-loop data-generation scenario 3.3120 P4 (s) = · e−0.310s (11) The first configuration corresponds to the open-loop one, s2 + 0.5280s + 1.4400 where target processes are not being controlled. Therefore, infor- where ωn = 1.2, ζ = 0.22, and K = 2.3 [52]. mation regarding the control effects over the processes are not 43 I. Pisa, A. Morell, J.L. Vicario et al. Journal of Process Control 124 (2023) 36–53 Table 1 TSM between correlations when transferring the Ps (s) data-based controller to manage Pi,2 (s), Pi,3 (s) and Pi,4 (s) systems. TSM from Ps (s) to Pi,2 (s), Pi,3 (s) and Pi,4 (s) systems Layers Ps (s) to Pi,2 (s) Ps (s) to Pi,3 (s) Ps (s) to Pi,4 (s) Fix Variable Fix Variable Fix Variable Input 0.7823 0.9581 0.8803 0.9739 0.6954 0.7873 LSTM 1 0.8014 0.9475 0.9003 0.9718 0.7357 0.6889 LSTM 2 0.8300 0.9447 0.9334 0.9717 0.6084 0.6857 MLP 1 0.8486 0.9478 0.9345 0.9721 0.6289 0.6450 MLP 2 0.7143 0.9789 0.8850 0.9867 0.4713 0.5909 Minimum 0.7143 0.9447 0.8803 0.9717 0.4713 0.5909 Computation Time - (s) 33.28 161.77 37.02 166.01 33.85 162.82 available. One option tackling this could be to directly place the ANN-based PID over the desired target environment, but this is counterproductive, especially for critical infrastructures since no information about the control performance is known. To alleviate this, the identification of P2 (s), P3 (s) and P4 (s) is performed to estimate the ANN-based PID behaviour. Here, we opt for the 123c identification model [64]. Notice that SOPDT processes are identified by Double Pole Plus Dead-Time (DPPDT) models: K ωn2 K′ ′ P(s) = · e−Ls → P ′ (s) = e−L s (12) s2 + 2ζ ωn s + ωn2 (T ′ s + 1)2 Once identified, the models can be adopted to close the control loop and therefore, determine the behaviour of the ANN-based PID without testing it in the final industrial environment. In such a context, the identification process performed over the target scenarios provides the following process models: 2.5 Pi,2 (s) = · e−0.6s 1.399s + 1 Fig. 9. Target processes identified models. 1.11 Pi,3 (s) = · e−0.3240s (13) (1.1410s + 1)2 2.300 Pi,4 (s) = · e−1.3040s fix set-point, the lowest TSM is given by the input layer, where (0.3468s + 1)2 the ANN-based PID does not actuate over the measurements. TSM where Pi,2 (s), Pi,3 (s) and Pi,4 (s) stand for the identifications of values for the variable set-point increase until showing a mini- P2 (s), P3 (s) and P4 (s), respectively. P2 (s) and Pi,2 (s) are nearly equal mum TSM equal to 0.9717. Now, the highest value is obtained at since P2 (s) is a FOPDT system which can be easily identified. the output of the MLP2 layer, showing that the actuation signals The results of the identification process can be observed in for Ps (s) and Pi,3 (s) are really similar. Finally, TSM values regarding Fig. 9, where the identified processes are contrasted to the orig- the transference from Ps (s) to Pi,2 (s) show that this transference inal ones when a unitary step is considered as the input. As can be performed as well. The minimum TSM for a variable it is observed, the identified systems yield values really close set-point equals to 0.9447, clearly showing that the proposed to the ones from the original processes except for Pi,4 (s). This ANN-based PID can be transferred. However, the minimum TSM fact is motivated by the identification process as such. Since value for a fix set-point diminishes until a TSM equivalent to SOPDT processes are modelled by a DPPDT, the effects of resonant 0.7143. This shows that the control behaviour of the ANN-based frequencies are lost. Therefore, the transient state of the identified PID managing Pi,2 (s) and a fix set-point can be compromised (see model differs from the original one to later be as close as possible Fig. 10). in the steady state. Regarding the required time to compute the TSM, it is pro- Results concerning the transferability of the ANN-based PID vided as the Computation Time. In this case, for a total amount of into the target environments with an open-loop configuration 10 000 samples, it is observed that the highest Computation Time are observed in Table 1. TSM is computed for the outputs of is obtained when a variable set-point is considered. In average, each ANN-based PID’s layer when it is controlling the identified this time equals to 163.53 s. For a fix set-point, it is equivalent to versions of the target environments, i.e., Pi,2 (s), Pi,3 (s), and Pi,4 (s). 34.72 s in average, which represents a decrement of 128.82 s. This A fix set-point equal to one unit and a variable set-point are fact is motivated by the dynamics of the set-point. As its name considered in the evaluation of the ANN-based PID control per- indicates, the fix set-point consists in a constant value generating formance. Hence, it is clearly observed that the transference from a constant output, whereas the variable set-point considers dif- Ps (s) to Pi,4 (s) is not feasible at all since none of the considered ferent input and output dynamics. Consequently, these dynamics set-points provide a minimum TSM over the transference limit. are more difficult to process by the MDS algorithm and therefore, For instance, the minimum TSM for a variable set-point equals to require an extra computational time. 0.5909 whereas for a fixed one it equals to 0.4713. On the other hand, the transference from Ps (s) to Pi,3 (s) is 4.2.2. Closed-loop data-generation scenario recommendable. In this case, all the layers of the ANN-based PID The other configuration that one may face corresponds to return TSM values placed over the suitability limit. In terms of the the closed-loop one, where conventional control structures are 44 I. Pisa, A. Morell, J.L. Vicario et al. Journal of Process Control 124 (2023) 36–53 Fig. 10. Control performance when Ps (s) is transferred into Pi,2 (s), Pi,3 (s) and Pi,4 (s). Table 2 values show the same tendency as in the open-loop configuration. Parameters of the conventional PIDs for P2 (s), P3 (s) and P4 (s). For instance, the transference of the ANN-based PID from Ps (s) Controller KPID Ti,PID Td,PID into P2 (s) and into P3 (s) can be considered since all TSM values are u2 (s) 0.6371 1.8109 0.2367 over the suitability limit, i.e., over 0.7. The minimum TSM value u3 (s) 2.6200 3.3800 0.4400 u4 (s) 0.2780 0.6760 1.6200 for P2 (s) equals to 0.9472 and 0.9880 for the fix and variable set- points, respectively. These values change until 0.9499 for the fix set-point and 0.9872 for the variable one in case of being trans- ferred into P3 (s). These results clearly state that the ANN-based already controlling the target environments. In that sense, TSM PID can be adopted as the ANN-based structure controlling either cannot be computed by means of substituting the conventional P2 (s) or P3 (s), regardless of the considered set-point. Nevertheless, structures by the ANN-based PID. This could entail drastic issues the situation completely changes when P4 (s) is considered. The since the correct behaviour of the ANN-based structure is not minimum TSM value equals to 0.3926 and 0.5428 for the fix and ensured for the target domain. Instead, the adoption of historical variable set-points, respectively. data is considered. These data will be directly obtained from his- Regarding the time needed to compute the TSM, the same be- toric measurements without the necessity of generating neither new control structures, nor identifying the process under control. haviour as in the Open-loop Data-generation scenario is observed. Nevertheless, some deviations with respect to the real behaviour Now, the average time required for a variable set-point equals to of the ANN-based PID over the target scenario can appear. 156.14 s whereas it diminishes until 34.25 s for a fix set-point. Historical data consist in the input and output measurements As stated before, these times are motivated by the complexity obtained from the actuation of the conventional PID structures of the process being controlled as well as the topology of the defined in [51]. They consist in one-degree of freedom PID con- set-point. Taking this into account, the objective of speeding-up trollers designed to guarantee a target robustness (Ms ) of 1.4 for the control design process and achieve the scalability of it can servo purposes [51]: be fulfilled. The scalability is achieved since no extra controllers [( ) ] have to be designed nor trained. Moreover, in terms of the design 1 Td,PID s ux (s) = KPID · 1+ · ex (s) + · yx (s) (14) acceleration, the times involved in the design of a new control Ti,PID s α · Td,PID s + 1 structure are much higher than those required in transferring where ux (s) is the control signal, yx (s) the output signal of Px (s), a controller [38]. Besides, TSM could be computed periodically and ex (s) = rx (s) − yx (s) the error between the reference (rx (s)) and and therefore, determine when the control structure needs to yx (s) signals. α , which is devoted to making proper the derivative be updated (fine-tuned or retrained with new data) instead of part of the controller, equals to 0.1. The parameters of each deriving new solutions. conventional PID, i.e., their gain KPID , their integral time Ti,PID and their derivative time Td,PID can be observed in Table 2. Thus, data generated by these PID structures are considered to 4.2.3. Discussion determine the TSM values whenever a closed-loop configuration TSM metric has been validated on two different configurations is used. The output of the target process being controlled by the of the environment: (i) an open-loop and (ii) closed-loop data- conventional PID as well as the reference signal are then consid- generation configurations. In both cases, results show that the ered as the inputs of the ANN-based PID structure. The outputs TSM is behaving as it should. Large values are provided for those of each ANN layer are later adopted in the TSM computation. situations where the controller can be transferred whereas low Results regarding TSM values when the default PIDs are con- values are obtained otherwise. Nevertheless, results also show sidered are shown in Table 3. In this case, it is observed that TSM that there are some pros and cons that must be considered: 45 I. Pisa, A. Morell, J.L. Vicario et al. Journal of Process Control 124 (2023) 36–53 Table 3 TSM between correlations when transferring the Ps (s) data-based controller to manage P2 (s), P3 (s) and P4 (s) systems. TSM from Ps (s) to P2 (s), P3 (s) and P4 (s) systems Layers Ps (s) to P2 (s) Ps (s) to P3 (s) Ps (s) to P4 (s) Fix Variable Fix Variable Fix Variable Input 0.9867 0.9953 0.9789 0.9955 0.8067 0.9872 LSTM 1 0.9472 0.9902 0.9499 0.9895 0.8667 0.6667 LSTM 2 0.9477 0.9880 0.9504 0.9872 0.8298 0.6588 MLP 1 0.9476 0.9890 0.9504 0.9885 0.8019 0.6765 MLP 2 0.9473 0.9929 0.9500 0.9924 0.3926 0.5428 Minimum 0.9472 0.9880 0.9499 0.9872 0.3926 0.5428 Computation Time - (s) 34.32 153.28 34.41 161.09 34.02 154.06 • When TSM is applied over an open-loop data-generation scenario, the actuation of the controller cannot be consid- ered. This implies that the loop should be closed to deter- mine the ANN-based controller. This is performed consider- ing the identification of the target processes, allowing us to obtain the required data in an easy way by using the process model. • On the other hand, we can find that the target environ- ments are being managed by a default controller, i.e., PI, PID and so on. In this case, the metric can be computed considering historical measurements from the conventional controller behaviour. The problem here lies in the fact that Fig. 11. BSM1 model with its default PI controllers. KLa,5 , Qint , Qe and Qr are the actuation of the controller over the target environment the oxygen transfer coefficient, the internal recirculation flow, the effluent and the external recirculation flow, respectively. is present in the data and therefore, this can mask the simi- larity between source and target domains. Nevertheless, the identification of the system is not required and therefore, the process of designing a controller can be speed-up. Moreover, BSM1 also presents two default PI controllers man- aging the crucial WWTP control loops: (i) the dissolved oxygen In both cases, the pros we can obtain using the TSM metric (DO) and (ii) the nitrate–nitrogen (NO) [67]. Both of them are in are more beneficial. Moreover, the drawbacks can be considered charge of ensuring the correct performance of the nitrification as affordable since the deviations observed in the performance of and denitrification processes described by the Activated Sludge the transferred controllers are really small. Model No. 1 (ASM1) [68]. In that sense, the DO control loop is in It is worth noticing that one of the objectives of TSM is to charge of maintaining the dissolved oxygen in the fifth reactor of achieve the speed-up of the control design process. This speeding the plant (SO,5 ) at a fixed set-point of 2 mg/L. The NO one is in is achieved by means of the TL process itself and the adoption charge of maintaining the nitrate–nitrogen of the second reactor of TSM. The speeding achieved with the TL is clear: the amount tank (SNO,2 ) at a fixed value of 1 mg/L (see Fig. 11). of time involved in the training of an ANN-based controller from This is performed by means of manipulating the oxygen trans- scratch is much higher than the time involved in a probable fine- fer coefficient at the fifth tank (KLa,5 ) and the internal recircula- tuning process [38]. Moreover, the amount of time involved in tion flow rate (Qint ). In that sense, the control signals generated the TSM computation must be considered. In both cases, it is by the PI controllers consist in: observed that it depends on the topology of set-point as well as [ ] 1 on the complexity of the process under control. KLa,5 = KSO,5 1 + · eSO,5 (s) (15) TiSO,5 s [ ] 5. WWTP TSM application 1 Qint = KQint 1 + · eSNO,2 (s) (16) TiQint s 5.1. WWTP environment where eSO,5 (s) and eSNO,2 (s) are the errors between the desired set-points and the measured concentrations. KSO,5 is the PI pro- The industrial environment where the proposed metric is go- portional gain, which equals to 25, and TiSO,5 is the PI integral ing to be applied corresponds to a WWTP, but instead of comput- time, which is set to 1 · 10−3 days. In terms of the SNO,2 PI ing the TSM values over the real plant, the Benchmark Simulation controller, its gain, KQint , equals to 10 000 whilst its integral time, Model No. 1 (BSM1) is considered [65]. It corresponds to a general TiQint , is equal to 0.0150 days. As it can be observed in the PI ® purpose WWTP digital model implemented in Matlab R2020b integral time, both control loops differ in their dynamics. The ones ® and Simulink v.10.2. It consists of five reactor tanks connected of SO,5 are much faster than the dynamics of SNO,2 concentrations. in series. The first two, Tank 1 and Tank 2, correspond to anoxic This is also corroborated by the BSM1 simulation protocol. It tanks with a volume of 1000 m3 each. Its main objective is not only specifies how to perform a simulation, but also which to carry out the denitrification process where the amount of topology of sensors and the sampling times that should be con- nitrates present in the residual urban waters are transformed sidered. In that sense, the sensors in charge of measuring the SO,5 intro nitrogen products [66]. Later, these products are managed concentration return values every minute while the sensors of in the last three reactor tanks, Tank 3, Tank 4, and Tank 5, which SNO,2 return a value every 10 min [65,67]. Nevertheless, BSM1 also consist of aerated reactors with a volume of 1333 m3 each. They specifies that outputs from the benchmark should be obtained are in charge of transforming the nitrogen products, especially the every 15 min. In other words, among all the available measure- ammonia (SNH ) into nitrates, by means of the nitrification process ments, only those observed every 15 min must be considered [66]. [65]. 46 I. Pisa, A. Morell, J.L. Vicario et al. Journal of Process Control 124 (2023) 36–53 Fig. 12. Controllers designed to control the DO and NO control loops of a general purpose WWTP. BSM1 also presents its own performance metrics. Since a vice-versa. For that reason, two ANN-based PIs are considered. WWTP environment is in charge of cleaning polluted waters, Their structure is adopted from the work presented in [38] and BSM1 implements the Effluent Quality Index (EQI) and the Overall corresponds to the structure shown in Fig. 12. Cost Index (OCI) metrics to determine the environmental per- The ANN-based PI structures are trained again considering formance and the costs related to the cleaning procedure. In TensorFlow in its 1.14 version over Python 3.6 and the ADAM terms of the control performance, BSM1 proposes the IAE and optimiser with back-propagation training algorithm. The learning the ISE between the desired set-point and the obtained value as rate is initially set at 1 · 10−3 and the L2 penalty at 1 · 10−4 . ® the metric measuring this performance [67]. After simulating an Once trained, the controller is deployed over Matlab R2020b ® arbitrarily amount of time, they are computed as: and Simulink v.10.2. The prediction performance for the ANN- ∫ tf ∫ tf based PI managing the DO control loop returns a RMSE, MAPE IAE = |ri (t) − yi (t)| dt ISE = (ri (t) − yi (t))2 dt (17) and R2 equal to 0.0260, 1.3561% and 0.999, respectively. The tO tO structure in charge of the NO control loop shows a RMSE equal to where tO and tf are the initial and final time of the performed 0.0444, a MAPE to 5.2018% and a R2 to 0.997. In both cases, these metrics are computed contrasting the measurements provided by simulation. ri (t) and yi (t) correspond to the desired set-point and the ANN-based PIs with the ones provided by the default BSM1 the measured value of the concentration being controlled. If a controllers. whole year of the BSM1 behaviour is considered, for instance, the In terms of their control performance, it is computed substi- default PIs performance is as follows: (i) the SO,5 IAE and ISE are tuting the default PIs by the ANN-based PIs in the digital BSM1 equal to 12.1271 and 1.0378, and (ii) the IAE and ISE for the SNO,2 model. It is worth noting here that no transfer is performed yet. equal to 71.9769 and 30.0537, respectively. As a result, the IAE and ISE metrics for each BSM1 control loop are As it is observed, the performance of the SNO,2 control loop can equal to: (i) 0.5104 and 0.0014, respectively, for the DO control be improved. Different approaches and control structures could loop, and (ii) 53.0984 and 16.6730, for the NO one. When default be tested, however, in this work we propose the TSM metric BSM1 PI controllers are considered instead, the IAE and ISE for the in order to transfer a unique ANN-based controller performing DO equal to 12.1271 and 1.0378. For the NO, these values equal well between the WWTP control loops, i.e., the DO and NO. In to 71.9769 and 30.0537, respectively. Thereby, it is shown that that manner, this will also ease the design process of the WWTP both ANN-based structures can show a good control performance operation. when they are trained for managing their respective control loops (see Fig. 13). 5.2. Results Once the control performance is computed and the behaviour of both ANN-based controllers is determined, the TSM metric is After the validation of the TSM metric, it is applied over the computed considering the closed loop configuration, i.e., the his- WWTP environment, especially, over the BSM1 [65]. Thus, the toric data from the target domain. Results are shown in Table 4. main idea is to develop and implement an ANN-based PI for At first sight it is observed that in all cases the transference of the DO BSM1 control loop and then transfer it into the NO or the ANN-based controller is suitable whatever direction is chosen. 47 I. Pisa, A. Morell, J.L. Vicario et al. Journal of Process Control 124 (2023) 36–53 Fig. 13. Control Performance of the BSM1 scenario when the dedicated ANN-based controllers are considered. Table 4 TSM when transferring the BSM1 data-based controllers from one control loop to another. TSM between BSM1 control loops Layers From SO,5 to SNO,2 From SNO,2 to SO,5 Without transfer Input 0.8930 0.7320 0.8262 LSTM 1 0.9274 0.7718 0.9324 LSTM 2 0.9144 0.8910 0.9018 MLP 1 0.9148 0.8910 0.9078 MLP 2 0.9475 0.9246 0.9518 Minimum 0.8930 0.7320 0.8262 Computation Time - (s) 158.23 162.63 173.63 For instance, the minimum TSM regarding the transference from designer to not only obtain a new control structure from an the DO control loop to the NO one is equal to 0.8930. When the existing one, but also to speed-up the whole process. other direction is chosen, the TSM value is reduced until 0.7320. In terms of the IAE and ISE values, the transference of the ANN- This entails that the performance behaviour of the transferred based PI from the DO control loop to the NO produce a reduction version of the ANN-based controller is not as good as the one with respect to the IAE and ISE values given by the default BSM1 primarily obtained. Thus, it is corroborated that the more similar PI controllers. In this case, the IAE and ISE are reduced from the scenarios, the higher the transferability between ANN-based 12.1271 and 1.0378 to 0.5104 and 0.0014, respectively, for the controllers. DO control loop. In terms of the NO loop, these values are reduced If the values shown in Table 4 are considered, it is clearly from 71.9769 and 30.0537 to 42.2648 and 11.6644, respectively. observed that the best option is to develop an ANN-based con- The same principle is observed when transferring the ANN- troller for the DO control loop and then transfer it to the NO based controller from the NO control loop to the DO one. Here, one. If this is performed, all the TSM values between correlation TSM values between the autocorrelation and cross-correlation matrices are really close or even higher than 0.9, which tells matrices decrease motivated by the fact that now, the outputs us that transferring this controller is a very suitable option. The of the different layers conforming the ANN-based controllers, highest similarity is now observed in the output of the MLP 2 are less similar than before (see Fig. 15). Even though TSM tells layer (see Fig. 14). As it is observed, the same tendency in the that the ANN-based structure can be transferred from the DO to values is presented and therefore, the same shape (convex curve) NO control loop, the control performance can experience some is obtained as the temporal evolution of the outputs of the ANN- degradation (see Table 5). This is corroborated by the IAE and based controller’s layer. This means that at this point is where ISE values for both control loops. Experiencing improvements of the ANN-based controller considering measurements from the NO 15.37% and 67.71%, the IAE and ISE values for the DO control control loop is giving values much closer to the ones observed loop equal to 10.2629 and 0.3351, respectively. In terms of the when considering data from the DO loop. NO control loop, these values equal to 53.0984 and 16.6730, Regarding the time involved in the TSM computation, again respectively. one can observe that in average it equals to 164.83 s. In this case, As it has been previously observed, the control performance the set-point is a fixed value, but the process under control is of the transferred ANN-based controller is highly related to the much more complicated than the academic examples considered TSM value between domains. The higher the TSM, the better the before. Nevertheless, these amounts of time are small enough control behaviour. For that reason, the best option to derive the to determine that adopting the TSM metric allows the control WWTP control loops is to firstly train the ANN-based controller 48 I. Pisa, A. Morell, J.L. Vicario et al. Journal of Process Control 124 (2023) 36–53 Fig. 14. Output of the MDS algorithm when dimensions of the different layers are reduced into a 2-dimensional space. Fig. 15. Output of the LSTM 2 layer when the MDS algorithm is applied over the ANN-based controller managing SNO,2 and then transferred into SO,5 control loop. Table 5 many controllers as loops, the designer only needs to design a Control performance when ANN-based PI controllers are transferred between controller that can be transferred into the different control loops. BSM1 control loops. In that process, the TSM is of the utmost utility since it tells the Control performance suitability of transferring an ANN structure beforehand. DO control loop NO control loop IAE ISE IAE ISE 6. Conclusions Default BSM1 PI controllers 12.1271 1.0378 71.9769 30.0537 TL from DO to NO 0.5104 0.0014 42.2648 11.6644 TL from NO to DO 10.2629 0.3351 53.0984 16.6730 This work proposes a solution for a critical issue regarding the adoption of Transfer Learning methods to derive new industrial controllers. The transference of ANN-based controllers cannot to correctly manage the DO control loop and then transfer it be freely performed since the performance of the ANN-based into the NO. However, the performance yielded by this ANN- controller in the target control loop cannot be known a priori. For based controller is far from achieving its main objective. As it is that reason, the efforts of this work are focused on developing a observed in Fig. 16, the tracking process of the SNO,2 concentration new metric, the TSM. It bases its behaviour on the computation of is not fulfilled. the similarity between the source and target domains. To achieve To alleviate this, a fine-tuning process can be performed so this, the computation of correlations between the outputs of the as to adapt the behaviour of the ANN-based controller to the different layers of the ANN-based controller when it is dealing target domain and therefore, achieve the desired objective [38]. with measurements from the source and target domains is pro- For instance, the performance of the NO control loop is improved posed. Thus, the principle behind the TSM can be summarised until showing IAE and ISE values equal to 7.0930 and 0.4528, as follows: the more similar the correlation matrices, the more respectively. This entails that the fine-tuning of the ANN-based suitable the transfer. controller in the target domain can improve the default control Here, the validation of the TSM, and therefore its behaviour, is performance a 90.15% and a 98.49%, respectively. In such a con- tested considering four different controlled processes, two FOPDT text, the final control performance of the ANN-based structures and two SOPDT processes. Results show that: can be observed in Fig. 17. To summarise, the TSM tells if an ANN-based structure can be • TSM yields values close to the maximum transfer suitability transferred from a source environment to a target one offering a (maximum value equals to 1) between those environments reliable performance. This entails a great benefit for the control or processes where the ANN-based controller performs well designer since instead of focusing the efforts in designing as for the source and target domain. 49 I. Pisa, A. Morell, J.L. Vicario et al. Journal of Process Control 124 (2023) 36–53 Fig. 16. Control Performance of the BSM1 scenario when the ANN-based controllers are transferred. Fig. 17. Control Performance of the BSM1 scenario when the ANN-based controllers are transferred and fine-tuned. • TSM returns values far from the maximum suitability in • The highest transferability is the one concerning the trans- those scenarios where the transference of the ANN-based ference from the DO to the NO control loop. The minimum controller is not feasible at all. TSM value equals to 0.8930. • In terms of the control performance, the highest improve- Once the TSM behaviour is validated, it is applied over a ment in the IAE and ISE values is offered when the ANN- critical industrial environment, a WWTP, so as to determine if based controller is transferred from the DO to the NO control the transference of an ANN-based controller can be performed loops. IAE and ISE values are reduced in average a 68.54% without problems. Results show that: and an 80.53%, respectively. • ANN-based structures substituting the default controllers All this motivates us to conclude that TSM can be of utmost can be applied and transferred regardless the direction, interest to decide when to apply TL techniques and if it is suitable i.e., from the DO to the NO control loop and vice-versa. to consider ANN-based controllers instead of conventional ones. 50 I. Pisa, A. Morell, J.L. Vicario et al. Journal of Process Control 124 (2023) 36–53 Moreover, this can pave the way in the application of ANN-based SOPDT Second Order Plus Dead-time controllers and TL techniques in the industrial control domain, T Time constant of the process especially, in the design process. Td,PID Derivative action of the PID controller tf Final time of the performed simulation Abbreviations Ti,PID Integral action of the PID controller TL Transfer Learning The following abbreviations and notation are used in this TSM Transfer Suitability Metric manuscript: tO Initial time of the performed simulation u(s) Actuation signal α Parameter to make proper the derivative part of ωn Natural frequency of the process the controller WWTP Wastewater Treatment Plant ANN Artificial Neural Network xi Output of the ith layer of the ANN-based controller ASM1 Activated Sludge Model N.1 form the source domain at time instant t BSM1 Benchmark Simulation Model No. 1 Xi Output of the ith layer of the ANN-based controller CNN Convolutional Neural Network form the source domain D Number of dimensions of an ANN layer X′,i Xi after the application of the MDS algorithm DO Dissolved Oxygen control loop [ ′,i ] X ·,j Column j of X′,i EQI Effluent Quality Index ∆,i Xj Auxiliary matrix to compute the correlations eSO,5 Error between the desired SO,5 set-point and the measured concentration yi Output of the ith layer of the ANN-based controller eSNO,2 Error between the desired SNO,2 set-point and the form the target domain at time instant t measured concentration Yi Output of the ith layer of the ANN-based controller FFNN Feed-forward Neural Network form the target domain ′,i FOPDT First Order Plus Dead-time Y [ ′,i ] Yi after the application of the MDS algorithm FT Fine-tuning Y ·,j Column j of Y′,i IAE Integrated Absolute Error y(s) Measured output signal ICA Independent Component Analysis ζ Damping coefficient IMC Internal Model Controller γsuitability Transfer Suitability limit ISE Integrated Squared Error K Gain of the process CRediT authorship contribution statement KLa,5 Oxygen Transfer Coefficient of the 5th reactor tank KPID Proportional action of the PID controller Ivan Pisa: Conceptualization, Methodology, Software, Valida- L Delay of the process tion, Formal analysis, Investigation, Writing – original draft, Vi- L2 L2 Norm sualization, Writing – review & editing. Antoni Morell: Investi- LDA Linear Discriminant Analysis gation, Writing – review & editing, Supervision, Project admin- LSTM Long Short–Term Memory istration, Funding acquisition. Jose Lopez Vicario: Investigation, M Number of layers of the ANN-based controller Writing – review & editing, Supervision, Project administration, MAPE Mean Average Percentage Error Funding acquisition. Ramon Vilanova: Investigation, Writing – MDS Multidimensional Scaling Algorithm review & editing, Supervision, Project administration, Funding MLP Multilayer Perceptron acquisition. MPC Model Predictive Controller N Number of considered time instants Declaration of competing interest NO Nitrate and nitrite nitrogen control loop OCI Overall Cost Index The authors declare that they have no known competing finan- P(s) Process under control cial interests or personal relationships that could have appeared Pi,x Identified process of Px (s) to influence the work reported in this paper. Ps (s) Source domain process Pt (s) Target domain process Data availability PCA Principal Components Analysis PI Proportional Integral controller Data will be made available on request. PID Proportional Integral Derivative controller Qint Internal recirculation flow rate Acknowledgements r(s) Reference signal [ ] r x′ i Sample autocorrelation vector for X′,i This work has received support from the Catalan Government j under Project 2021 SGR 00197, and also by the Spanish Gov- [ ′,i ] rx′ y′ i Sample cross-correlation vector for Y 2 j ernment under MICIN project PID2019-105434RB-C33 co-funded [R ] Determination coefficient with the European Union ERDF funds and under MCIN/AEI/10.13039 Rx′,i k,j Element from k row and j column of Rx′,i /501100011033 project TED2021-129134B-I00 co-funded with [ ] Rx′ y′,i Element from k row and j column of Rx′ y′,i the European Union ‘‘NextGenerationEU’’/PRTR funds. k,j RMSE Root Mean Squared Error RNN Recurrent Neural Network References SNO,2 Nitrate and nitrite nitrogen in the 2th reactor tank [1] A. Ustundag, E. Cevikcan, Industry 4.0: Managing the Digital Transforma- SNH Ammonium concentration tion, Springer, Cham, Switzerland, 2017. SO,5 Dissolved oxygen concentration in the 5th reactor [2] M. Wollschlaeger, T. Sauter, J. Jasperneite, The future of industrial com- tank munication: Automation networks in the era of the internet of things and industry 4.0, IEEE Ind. Electron. Mag. 11 (2017). 51 I. Pisa, A. Morell, J.L. Vicario et al. Journal of Process Control 124 (2023) 36–53 [3] A.A. Cook, G. Mısırlı, Z. Fan, Anomaly detection for IoT time-series data: A [30] T. Lu, F. Yu, C. Xue, B. Han, Identification, classification, and quantification survey, IEEE Internet Things J. 7 (2019) 6481–6494. of three physical mechanisms in oil-in-water emulsions using AlexNet with [4] X. Wang, H. Liu, Soft sensor based on stacked auto-encoder deep neural transfer learning, J. Food Eng. 288 (2021) 110220. network for air preheater rotor deformation prediction, Adv. Eng. Inform. [31] F. Curreri, L. Patanè, M.G. Xibilia, RNN-and LSTM-based soft sensors 36 (2018) 112–119. transferability for an industrial process, Sensors 21 (2021) 823. [5] S. Khatir, S. Tiachacht, C.L. Thanh, E. Ghandourah, S. Mirjalili, M.A. Wahab, [32] P. Oliveira, B. Fernandes, C. Analide, P. Novais, Forecasting energy An improved artificial neural network using arithmetic optimization algo- consumption of wastewater treatment plants with a transfer learning rithm for damage assessment in FGM composite plates, Compos. Struct. approach for sustainable cities, Electronics 10 (2021) 1149. 273 (2021) 114287. [33] Z. Ke, Z. Li, Z. Cao, P. Liu, Enhancing transferability of deep reinforcement [6] L.V. Ho, D.H. Nguyen, M. Mousavi, G.D. Roeck, T. Bui-Tien, A.H. Gandomi, learning-based variable speed limit control using transfer learning, IEEE M.A. Wahab, A hybrid computational intelligence approach for structural Trans. Intell. Transp. Syst. 22 (7) (2020) 4684–4695. damage detection using marine predator algorithm and feedforward neural [34] S. Xu, Y. Wang, Y. Wang, Z. O’Neill, Q. Zhu, One for many: Transfer networks, Comput. Struct. 252 (2021) 106568. learning for building hvac control, in: Proceedings of the 7th ACM Inter- [7] L.V. Ho, T.T. Trinh, G.D. Roeck, T. Bui-Tien, L. Nguyen-Ngoc, M.A. Wahab, national Conference on Systems for Energy-Efficient Buildings, Cities, and An efficient stochastic-based coupled model for damage identification in Transportation, 2020, pp. 230–239. plate structures, Eng. Fail. Anal. 131 (2022) 105866. [35] Y. Tao, J. Qiu, S. Lai, A hybrid cloud and edge control strategy for demand [8] B. Cai, K. Hao, Z. Wang, C. Yang, X. Kong, Z. Liu, R. Ji, Y. Liu, Data-driven responses using deep reinforcement learning and transfer learning, IEEE early fault diagnostic methodology of permanent magnet synchronous Trans. Cloud Comput. 10 (1) (2021) 56–71. motor, Expert Syst. Appl. 177 (2021). [36] P. Lissa, M. Schukat, M. Keane, E. Barrett, Transfer learning applied to DRL- [9] X. Kong, B. Cai, Y. Liu, H. Zhu, C. Yang, C. Gao, Y. Liu, Z. Liu, R. Ji, Fault based heat pump control to leverage microgrid energy efficiency, Smart diagnosis methodology of redundant closed-loop feedback control systems: Energy 3 (2021). Subsea blowout preventer system as a case study, IEEE Trans. Syst. Man [37] I. Pisa, A. Morell, J.L. Vicario, R. Vilanova, Transfer learning approach for Cybern.: Syst. (2022). the design of basic control loops in wastewater treatment plants, in: 2021 [10] B. Cai, H. Fan, X. Shao, Y. Liu, G. Liu, Z. Liu, R. Ji, Remaining useful life re- 26th IEEE International Conference on Emerging Technologies and Factory prediction methodology based on Wiener process: Subsea christmas tree Automation (ETFA), IEEE, 2021, pp. 1–8. system as a case study, Comput. Ind. Eng. 151 (2021). [38] I. Pisa, A. Morell, R. Vilanova, J.L. Vicario, Transfer learning in wastewater [11] F.A. Souza, R. Araújo, J. Mendes, Review of soft sensor methods for treatment plant control design: From conventional to long short-term regression applications, Chemometr. Intell. Lab. Syst. 152 (2016) 69–79. memory-based controllers, Sensors 21 (2021) 6315. [12] S. Wang, H. Wang, Y. Zhou, J. Liu, P. Dai, X. Du, M.A. Wahab, Automatic [39] Z. Wang, Z. Dai, B. Póczos, J. Carbonell, Characterizing and avoiding laser profile recognition and fast tracking for structured light measurement negative transfer, in: Proceedings of the IEEE/CVF Conference on Computer using deep learning and template matching, Measurement 169 (2021) Vision and Pattern Recognition, 2019, pp. 11293–11302. 108362. [40] I. Goodfellow, Y. Bengio, A. Courville, Deep Learning, Cambridge, MA, USA, [13] A. Rani, V. Singh, J. Gupta, Development of soft sensor for neural network MIT Press, 2016. [41] J. Yosinski, J. Clune, Y. Bengio, H. Lipson, How transferable are features in based control of distillation column, ISA Trans. 52 (2013) 438–449. deep neural networks? Adv. Neural Inf. Process. Syst. 27 (2014). [14] I. Pisa, I. Santín, J.L. Vicario, A. Morell, R. Vilanova, ANN-based soft sensor [42] J. Williams, A. Tadesse, T. Sam, H. Sun, G.D. Montanez, Limits of transfer to predict effluent violations in wastewater treatment plants, Sensors 19 learning, in: International Conference on Machine Learning, Optimization, (2019) 1280. and Data Science, Springer, 2020, pp. 382–393. [15] V.d.J. da Silva Ribeiro, G.F. de Moraes Oliveira, M. Cristian, A.L. Martins, [43] M.J. Afridi, A. Ross, E.M. Shapiro, On automated source selection for transfer L.D. Fernandes, M.P. Vega, Neural network based controllers for the oil learning in convolutional neural networks, Pattern Recognit. 73 (2018) well drilling process, J. Pet. Sci. Eng. 176 (2019) 573–583. 65–75. [16] N.K. Kandasamy, G. Karunagaran, C. Spanos, K.J. Tseng, B.-H. Soong, Smart [44] C. Klemenjak, A. Faustine, S. Makonin, W. Elmenreich, On metrics to lighting system using ANN-IMC for personalized lighting control and assess the transferability of machine learning models in non-intrusive load daylight harvesting, Build. Environ. 139 (2018) 170–180. monitoring, 2019, arXiv preprint arXiv:1912.06200. [17] W. Dong, S. Li, X. Fu, Z. Li, M. Fairbank, Y. Gao, Control of a buck DC/DC [45] S. Boudabous, S. Clémençon, H. Labiod, J. Garbiso, Dynamic graph con- converter using approximate dynamic programming and artificial neural volutional LSTM application for traffic flow estimation from error-prone networks, IEEE Trans. Circuits Syst. I. Regul. Pap. 68 (4) (2021) 1760–1768. measurements: results and transferability analysis, in: 2021 IEEE 8th [18] D. Wang, Z.J. Shen, X. Yin, S. Tang, X. Liu, C. Zhang, J. Wang, J. Rodriguez, International Conference on Data Science and Advanced Analytics (DSAA), M. Norambuena, Model predictive control using artificial neural network IEEE, 2021, pp. 1–10. for power converters, IEEE Trans. Ind. Electron. 69 (4) (2021) 3689–3699. [46] R. Souissi, A. Al Bitar, M. Zribi, Accuracy and transferability of artificial [19] I. Santín, C. Pedret, R. Vilanova, M. Meneses, Advanced decision control neural networks in predicting in situ root-zone soil moisture for various system for effluent violations removal in wastewater treatment plants, regions across the globe, Water 12 (2020) 3109. Control Eng. Pract. 49 (2016). [47] A. Schilling, A. Maier, R. Gerum, C. Metzner, P. Krauss, Quantifying the [20] C. Foscoliano, S. Del Vigo, M. Mulas, S. Tronci, Predictive control of an separability of data classes in neural networks, Neural Netw. 139 (2021) activated sludge process for long term operation, Chem. Eng. J. 304 (2016) 278–293. 1031–1044. [48] I. Pisa, A. Morell, J.L. Vicario, R. Vilanova, Transfer learning suitability metric [21] J.-F. Qiao, Y. Hou, L. Zhang, H.-G. Han, Adaptive fuzzy neural network for ANN-based industrial controllers, in: 2022 27th IEEE International control of wastewater treatment process with multiobjective operation, Conference on Emerging Technologies and Factory Automation (ETFA), Neurocomputing 275 (2018) 383–393. IEEE, 2022, pp. 1–8. [22] I. Pisa, A. Morell, J.L. Vicario, R. Vilanova, Denoising autoencoders and [49] R. Vilanova, A. Visioli, PID Control in the Third Millennium - Lessons LSTM-based artificial neural networks data processing for its application Learned and News Approaches, Springer, 2012. to internal model control in industrial environments—The wastewater [50] N. Lanzetti, Y.Z. Lian, A. Cortinovis, L. Dominguez, M. Mercangöz, C. Jones, treatment plant control case, Sensors 20 (2020) 3743. Recurrent neural network based MPC for process industries, in: 2019 18th [23] M.A. Amirabadi, M.H. Kahaei, S.A. Nezamalhosseini, Novel suboptimal European Control Conference (ECC), IEEE, 2019, pp. 1005–1010. approaches for hyperparameter tuning of deep neural network [under the [51] R. Kurokawa, T. Sato, R. Vilanova, Y. Konishi, Discrete-time first-order plus shelf of optical communication], Phys. Commun. 41 (2020) 101057. dead-time model-reference trade-off PID control design, Appl. Sci. 9 (2019) [24] G.G. Wang, M. Lu, Y.Q. Dong, X.J. Zhao, Self-adaptive extreme learning 3220. machine, Neural Comput. Appl. 27 (2016) 291–303. [52] R. Kurokawa, T. Sato, R. Vilanova, Y. Konishi, Design of optimal PID [25] J.H. Yi, J. Wang, G.G. Wang, Improved probabilistic neural networks with control with a sensitivity function for resonance phenomenon-involved self-adaptive strategies for transformer fault diagnosis problem, Adv. Mech. second-order plus dead-time system, J. Franklin Inst. B 357 (2020) Eng. 8 (2016) 1–13. 4187–4211. [26] Y. Wang, X. Qiao, G.G. Wang, Architecture evolution of convolutional neural [53] J.D. Carroll, P. Arabie, Multidimensional scaling, Meas., Judgm. Decis. Mak. network using monarch butterfly optimization, J. Ambient Intell. Humaniz. (1998) 179–250. Comput. 1 (2022) 1–15. [54] M.C. Hout, M.H. Papesh, S.D. Goldinger, Multidimensional scaling, Wiley [27] F. Zhuang, Z. Qi, K. Duan, D. Xi, Y. Zhu, H. Zhu, H. Xiong, Q. He, A Interdiscip. Rev.: Cogn. Sci. 4 (2013) 93–103. comprehensive survey on transfer learning, Proc. IEEE 109 (2020) 43–76. [55] G. Boquet, A. Morell, J. Serrano, J.L. Vicario, A variational autoencoder [28] T. Han, C. Liu, W. Yang, D. Jiang, Deep transfer network with joint solution for road traffic forecasting systems: Missing data imputation, distribution adaptation: A new intelligent fault diagnosis framework for dimension reduction, model selection and anomaly detection, Transp. Res. industry application, ISA Trans. 97 (2020) 269–281. C: Emerg. Technol. 115 (2020) 102622. [29] S. Shao, S. McAleer, R. Yan, P. Baldi, Highly accurate machine fault diagnosis [56] B. Ratner, The correlation coefficient: Its values range between+ 1/- 1, or using deep transfer learning, IEEE Trans. Ind. Inform. 15 (2018) 2446–2455. do they? J. Targeting Meas. Anal. Mark. 17 (2) (2009) 139–142. 52 I. Pisa, A. Morell, J.L. Vicario et al. Journal of Process Control 124 (2023) 36–53 [57] M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, G.S. Corrado, [63] D.S. Manu, A.K. Thalla, Artificial intelligence models for predicting the A. Davis, J. Dean, M. Devin, et al., TensorFlow: Large-scale machine performance of biological wastewater treatment plant in the removal of learning on heterogeneous systems, 2015, Available online: https://www. Kjeldahl Nitrogen from wastewater, Appl. Water Sci. 7 (2017) 3783–3791. tensorflow.org/ (accessed on October 2020). [64] V.M. Alfaro, R. Vilanova, Control of high-order processes: repeated-pole [58] W. McKinney, et al., Data structures for statistical computing in python, plus dead-time models’ identification, Int. J. Control (2021) 1–11. in: Proceedings of the 9th Python in Science Conference, Vol. 445, 2010, [65] J.B. Copp, The Cost Simulation Benchmark: Description and Simulator pp. 51–56. Manual (Cost Action 624 and Action 682), Office for Official Publications [59] T.E. Oliphant, A Guide to NumPy, Vol. 1, Trelgol Publishing, Spanish Fork, of the European Union, Luxembourg, 2002. UT, USA, 2006. [66] B. Halling-Sørensen, S.E. Jorgensen, The Removal of Nitrogen Compounds [60] J.D. Hunter, Matplotlib: A 2D graphics environment, Comput. Sci. Eng. 9 from Wastewater, Elsevier, Amsterdam, The Netherlands, 1993. (2007) 90–95. [67] J. Alex, L. Benedetti, J. Copp, K.-V. Gernaey, U. Jeppsson, I. Nopens, M.- [61] F. Pedregosa, et al., Scikit-learn: Machine learning in Python, J. Mach. Learn. N. Pons, L. Rieger, C. Rosen, J.-P. Steyer, P. Vanrolleghem, Benchmark Res. 12 (2011) 2825–2830. Simulation Model No. 1 (BSM1), Tech. Rep., Department of Industrial [62] P. Virtanen, R. Gommers, T.E. Oliphant, M. Haberland, T. Reddy, D. Courna- Electrical Engineering and Automation, Lund University, 2008. peau, E. Burovski, P. Peterson, W. Weckesser, et al., SciPy 1.0: Fundamental [68] M. Henze, W. Gujer, T. Mino, M.C.M. van Loosdrecht, Activated sludge algorithms for scientific computing in python, Nature Methods 17 (2020) models ASM1, ASM2, ASM2d and ASM3, IWA Publishing, London, UK, 2000. 261–272. 53