Batch or semi-batch processes have been utilized to produce high-value-added products in the biological, food, semi-conductor industries. Batch process, such as fermentation, polymerization, and pharmacy, is highly sensitive to the abnormal changes in operating condition. Monitoring of such processes is extremely important in order to get higher productivity. However, it is more difficult to develop an exact monitoring model of batch processes than that of continuous processes, due to the common natures of batch process: non-steady, time-varying, finite duration, and nonlinear behaviors. The lack of exact monitoring model in most batch processes leads that an operator cannot identify the faults when they occurred. Therefore, effective techniques for monitoring batch process exactly are necessary in order to remind the operator to take some corrective actions before the situation becomes more dangerous.

Generally, many batch processes are carried out in a sequence of steps, which are called multi-stage or multi-phase batch processes. Different phases have different inherent natures, so it is desirable to develop stage-based models that each model represents a specific stage and focuses on a local behavior of the batch process. This chapter focuses on the monitoring method based on multi-phase models. An improved online sub-PCA method for multi-phase batch process is proposed. A two-step stage dividing algorithm based on support vector data description (SVDD) technique is given to divide the multi-phase batch process into several operation stages reflecting their inherent process correlation nature. Mechanism knowledge is considered firstly by introducing the sampling time into the loading matrices of PCA model, which can avoid segmentation mistake caused by the fault data. Then SVDD method is used to strictly refine the initial division and obtain the soft-transition sub-stage between the stable and transition periods. The idea of soft-transition is helpful for further improving the division accuracy. Then a representative model is built for each sub-stage, and an online fault monitoring algorithm is given based on the division techniques above. This method can detect fault earlier and avoid false alarm because of more precise stage division, comparing with the conventional sub-PCA method.

Fig. 5.1
figure 1

Batch-wise unfolding

5.1 What Is Phase-Based Sub-PCA

The general monitoring for batch process is phase/stage-based sub-PCA method, which divides the process into several phases (Yao and Gao 2009). The phase-based sub-PCA consists of three steps: data matrix unfloding, phase division, and sub-PCA modeling. Now the details of them are introduced.

  1. 1.

    Data Matrix Unfolding

    Different from the continuous process, the historical data of batch process are composed of a three-dimensional array \({\boldsymbol{X}}(I\times J\times K)\), where I is the number of batches, J is the number of variables, and K is the number of sampling times. The original data \({\boldsymbol{X}}\) should be conveniently rearranged into two-dimensional matrices prior to developing statistical models. Two traditional methods are widely applied: the batch-wise unfolding and the variable-wise unfolding, with the most used method is batch-wise unfolding. The three-dimensional matrix \({\boldsymbol{X}}\) should be cut into K time-slice matrix after the batch-wise unfolding is completed.

    The three-dimensional process data \({\boldsymbol{X}}(I\times J\times K)\) is batch-wise unfolded into two-dimensional forms \({\boldsymbol{X}}_k(I\times J), (k= 1,2,\ldots ,K)\). Then a time-slice matrix is placed beneath one another, but not beside as shown in Fig. 5.1 (Westerhuis et al. 1999; Wold et al. 1998). Sometimes batches have different lengths, i.e. the sampling number K are different. The process data need to be aligned before unfolding. There are many data alignment methods raised by former researchers, such as directly filling zeros to missing sampling time (Arteaga and Ferrer 2002), dynamic time warping (Kassida et al. 1998). These unfolding approaches do not require any estimation of unknown future data for online monitoring.

  2. 2.

    Phase Division

    The traditional multivariate statistical analysis methods are valid in the continuous process, since all variables are supposed to stay around certain stable state and the correlation between these variables remains relatively stable. Non-steady-state operating conditions, such as time-varying and multi-phase behavior, are the typical characteristics in a batch process. The process correlation structure might change due to process dynamics and time-varying factors. The statistical model may be ill-suited if it takes the entire batch data as a single object, and the process correlation among different stages are not captured effectively. So multi-phase statistic analysis aims at employing the separate model for the forthcoming period, instead of using a single model for the entire process. The phase division plays a key role in batch process monitoring.

    Many literature divided the process into multi-phase based on mechanism knowledge. For example, the division is based on different processing units or distinguishable operational phases within each unit (Dong and McAvoy 1996; Reinikainen and Hoskuldsson 2007). It is suggested that process data can be naturally divided into groups prior to modelling and analysis. This stage division directly reflects the operational state of the process. However, the known prior knowledge usually are not sufficient to divide processes into phases reasonably.

    Besides, Muthuswamy and Srinivasan identified several division points according to the process variable features described in the form of multivariate rules (Muthuswamy and Srinivasan 2003). Undey and Cinar used an indicator variable that contained significant landmarks to detect the completion of each phase (Undey and Cinar 2002). Doan and Srinivasan divided the phases based on the singular points in some known key variables (Doan and Srinivasan 2008). Kosanovich, Dahl, and Piovoso pointed out that the changes in the process variance information explained by principal components could indicate the division points between the process stages (Kosanovich and Dahl 1996). There are many results in this area but not give a clear strategy to distinct the steady phase and transition phase (Camacho and Pico 2006; Camacho et al. 2008; Yao and Gao 2009).

  3. 3.

    Sub-PCA Modeling

    The statistical models are constructed for all the phases after the phase division and are not limited to PCA methods. Here, sub-PCA is representatively one of these sub-statistical monitoring methods. The final sub-PCA model of each phase is calculated by taking the average of the time-slice PCA models in the corresponding phase. The number of principal components of each phase are determined based on the relative cumulative variance.

    The \( T^2\), SPE statistics and their corresponding control limits are calculated according to the sub-PCA model. Check the Euclidean distance of the new data from the center of each stage of clustering and determine at which stage the new data is located. Then, the corresponding sub-PCA model is used to monitor the new data. Fault warning is pointed according to the control limits of \(\mathrm{T^2}\) or SPE.

5.2 SVDD-Based Soft-Transition Sub-PCA

Industrial batch process operates in a variety of status, including grade changes, startup, shutdown, and maintenance operations. Transitional region between neighboring stages is very common in multistage process, which shows the gradual changeover from one operation pattern to another. Usually the transitional phases first show basic characteristic that are more similar to the previous stable phase and then more similar to the next stable phase at the end of the transition. The different transition phases undergo different trajectories from one stable mode to another, with change in characteristics that are more pronounced in sampling time and more complex than those within a phase. Therefore, valid process monitoring during transitions is very important. Up to now, few investigations about transition modeling and monitoring have been reported (Zhao et al. 2007). Here, a new transition identification and monitoring method base on the SVDD division method is proposed.

5.2.1 Rough Stage-Division Based on Extended Loading Matrix

The original three-dimensional array \(\boldsymbol{X}(I\,\times \,J\,\times \,K)\) is first batch-wise unfolded into two-dimensional form \(\boldsymbol{X}_k\). By subtracting the grand mean of each variable over all time and all batches, unfolding matrix \({\boldsymbol{X}}_k\) is centered and scaled.

$$\begin{aligned} {{\boldsymbol{X}}_k} = \frac{{\left[ {{{\boldsymbol{X}}_k} - \mathrm{{mean}}\left( {{{\boldsymbol{X}}_k}} \right) } \right] }}{{{{\sigma }}\left( {{{\boldsymbol{X}}_k}} \right) }}, \end{aligned}$$
(5.1)

where mean (\({\boldsymbol{X}}_k\) ) and \({{\sigma }}({\boldsymbol{X}}_k)\) represent the mean value and the standard variance of matrix \({\boldsymbol{X}}_k\), respectively. The main nonlinear and dynamic components of every variable are still left in the scaled matrix.

Suppose the unfolding matrix at each time-slice is \({\boldsymbol{X}}_k\). Project it into the principle component subspace by loading matrix \({\boldsymbol{P}}_k\) to obtain the scores matrix \({\boldsymbol{T}}_k\):

$$\begin{aligned} {\boldsymbol{X}}_k={\boldsymbol{T}}_k {\boldsymbol{P}}_k^\mathrm {T}+{\boldsymbol{E}}_k, \end{aligned}$$
(5.2)

where \({\boldsymbol{E}}_k\) is the residual. The first few components in PCA which represent major variation of original data set \({\boldsymbol{X}}_k\) are chosen. The original data set \({\boldsymbol{X}}_k\) is divided into the score matrix \({\boldsymbol{\hat{X}}}_k={\boldsymbol{T}}_k {\boldsymbol{P}}_k^\mathrm {T}\) and the residual matrix \({\boldsymbol{E}}_k\). Here, \({\boldsymbol{\hat{X}}}_k\) is PCA model prediction. Some useful techniques, such as the cross-validation, have been used to determine the most appropriate retained numbers of principal components. Then the loading matrix \({\boldsymbol{P}}_k\) and singular value matrix \({\boldsymbol{S}}_k\) of each time-slice matrix \({\boldsymbol{X}}_k\) can be obtained.

As the loading matrix \({\boldsymbol{P}}_k\) reflects the correlations of process variables, it usually is used to identify the process stage. Sometimes disturbances brought by measurement noise or other reasons will lead wrong division, because the loading matrix just obtained from process data is hard to distinguish between wrong data and transition phase data. Generally, different phases in the batch process could be firstly distinguished according to the mechanism knowledge.

The sampling time is added to the loading matrix on order to divide the process exactly. The sampling time is a continuously increasing data set, so it must also be centered and scaled before added to the loading matrix. Generally, the sampling time is centered and scaled not along the batch dimension like process data \({\boldsymbol{X}}\), but along the time dimension in one batch. Then the scaling time \({\boldsymbol{t}}_k\) is changed into a vector \({\boldsymbol{t}}_k\) by multiplying unit column vector. So the new time-slice matrix is written as \({{\boldsymbol{\hat{P}}}_k} = \left[ {{{\boldsymbol{P}}_k},\;{{\boldsymbol{t}}_k}} \right] \), in which \({\boldsymbol{t}}_k\) is a \(1\times J\) column vector with repeated value of current sampling time. The sampling time will not change too much with the ongoing of batch process, but have an obvious effect on the phase separation. Define the Euclidean distance of extended loading matrix \({\boldsymbol{\hat{P}}}_k\) as

$$\begin{aligned} \begin{aligned} \left\| {\boldsymbol{\hat{P}}}_i - {\boldsymbol{\hat{P}}}_j \right\| ^2 =&\left[ {\boldsymbol{P}}_i - {\boldsymbol{P}}_j,\;{\boldsymbol{t}}_i - {\boldsymbol{t}}_j \right] \left[ {\boldsymbol{P}}_i - {\boldsymbol{P}}_j,\;{\boldsymbol{t}}_i - {\boldsymbol{t}}_j \right] ^\mathrm {T}\\ =&\left\| {\boldsymbol{P}}_i - {\boldsymbol{P}}_j \right\| ^2 + {\left\| {\boldsymbol{t}}_i - {\boldsymbol{t}}_j \right\| ^2}. \end{aligned} \end{aligned}$$
(5.3)

Then the batch process can be divided into \(S_1\) stages using K-means clustering method to cluster the extended loading matrices \({\boldsymbol{\hat{P}}}_k\).

Clearly, the Euclidean distance of the extended loading matrix \({\boldsymbol{\hat{P}}}_i\) includes both data differences and sampling time differences. The data at different stages differ significantly in sampling time. Therefore, when noise interference makes the data at different stages present the same or similar characteristics, the large differences in sampling times will keep the final Euclidean distance at a large value. This is because the erroneous division data is very different in sampling time from the data from the other stages, while the data from the transition stage has very little variation in sampling time. We can easily distinguish erroneous divisions in the transition phase from those caused by noise.

5.2.2 Detailed Stage-Division Based on SVDD

The extended time-slice loading matrices \({\boldsymbol{\hat{P}}}_k\) represent the local covariance information and underlying process behavior as mentioned before, so they are used in determining the operation stages by proper analyzing and clustering procedures. The process is divided into different stages and each separated process stage contains a series of successive samples. Moreover, the transition stage is unsuitable to be forcibly incorporated into one steady stage because of its variation complexity of process characteristics. The transiting alteration of process characteristics imposes disadvantageous effects on the accuracy of stage-based sub-PCA monitoring models. Furthermore, it deteriorates fault detecting performance if just a steady transition sub-PCA model is employed to monitor the transition stage. Consequently, a new method based on SVDD is proposed to separate the transition regions after the rough stage-division which is determined by the K-means clustering.

SVDD is a relatively new data description method, which is originally proposed by Tax and Duin for the one-class classification problem (Tax and Duin 1999, 2004). SVDD has been employed for damage detection, image classification, one-class pattern recognition, etc. Recently, it has also been applied in the monitoring of continuous processes. However, SVDD has not been used for batch process phase separating and recognition up to now.

The loading matrix of each stage is used to train the SVDD model of transition process. SVDD model first maps the data from original space to feature space by a nonlinear transformation function, which is called as kernel function. Then a hypersphere with minimum volume can be found in the feature space. To construct such a minimum volume hypersphere, the following optimization problem is obtained:

$$\begin{aligned} \begin{aligned}&\min {{\varepsilon }}\left( R,A,\xi \right) = R^2 + C \sum \limits _{i} \xi _i\\&\mathrm{{s}}.\mathrm{{t}}.\; \left\| {\boldsymbol{\hat{P}}}_i - \boldsymbol{A} \right\| ^2 \le R^2 + \xi _i,\xi _i \ge 0,\forall \; i, \end{aligned} \end{aligned}$$
(5.4)

where R and A are the radius and center of hypersphere, respectively, C gives the trade-off between the volume of the hypersphere and the number of error divides. \(\xi _i\) is a slack variable which allows a probability that some of the training samples can be wrongly classified. Dual form of the optimization problem (5.4) can be rewritten as

$$\begin{aligned} \begin{aligned}&\min \sum _i \alpha _i K\left( {\boldsymbol{\hat{P}}}_i,{\boldsymbol{\hat{P}}}_i\right) -\sum _{i,j}\alpha _i,\alpha _jK\left( {\boldsymbol{\hat{P}}}_i,{\boldsymbol{\hat{P}}}_j\right) \\&\mathrm{s}.\mathrm{t}.\; 0 \le \alpha _i \le C_i, \end{aligned} \end{aligned}$$
(5.5)

where \(K\left( {\boldsymbol{\hat{P}}}_i,{\boldsymbol{\hat{P}}}_j\right) \) is the kernel function, and \(\alpha _i\) is the Lagrange multiplier. Here, Gaussian kernel function is selected as kernel function. General quadratic programming method is used to solve the optimization question (5.5). The hypersphere radius R can be calculated according to the optimal solution \(\alpha _i\):

$$\begin{aligned} R^2= 1- 2 \sum _{i=1}^n \alpha _i K\left( {\boldsymbol{\hat{P}}}_i,{\boldsymbol{\hat{P}}}_i\right) +\sum _{i=1,j=1}^n \alpha _i,\alpha _j K\left( {\boldsymbol{\hat{P}}}_i,{\boldsymbol{\hat{P}}}_j\right) \end{aligned}$$
(5.6)

Here, the loading matrices \({\boldsymbol{\hat{P}}}_k\) are corresponding to nonzero parameter \(\alpha _k\). It means that they have effect on the SVDD model. Then the transition phase can be distinguished from the steady phase by inputting all the time-slice matrices \({\boldsymbol{\hat{P}}}_k\) into SVDD model. When a new data \({\boldsymbol{\hat{P}}}_{new}\) is available, the hyperspace distance from the new data to the hypersphere center should be calculated firstly

$$\begin{aligned} D^2= \left\| {\boldsymbol{\hat{P}}}_{new}-{\boldsymbol{\alpha }}\right\| ^2=1- 2 \sum _{i=1}^n \alpha _i K\left( {\boldsymbol{\hat{P}}}_{new},{\boldsymbol{\hat{P}}}_i\right) +\sum _{i=1,j=1}^n \alpha _i,\alpha _j K\left( {\boldsymbol{\hat{P}}}_i,{\boldsymbol{\hat{P}}}_j\right) . \end{aligned}$$
(5.7)

If the hyperspace distance is less than the hypersphere radius, i.e., \(D^2 \le R^2\), the process data \({\boldsymbol{\hat{P}}}_{new}\) belongs to steady stages; else (that is \(D^2 > R^2\)), the data will be assigned to transition stages. The whole batch is divided into \(S_2\) stages at the detailed division, which includes \(S_1\) steady stages and \(S_2 \rightarrow S_1\) transition stages.

The mean loading matrix \({\boldsymbol{\bar{P}}}_s\) can be adopted to get sub-PCA model of sth stage because the time-slice loading matrices in one stage are similar. \({{\boldsymbol{\bar{P}}}_s}\) is the mean matrix of the loading matrices \({\boldsymbol{ P}}_k\) in sth stage. The principal components number \(a_s\) can be obtained by calculating the relative cumulative variance of each principal component until it reaches 85%. Then the mean loading matrix is modified according to the obtained principal components. The sub-PCA model can be described as

$$\begin{aligned} \left\{ \begin{aligned} {\boldsymbol{T}}_k&={\boldsymbol{X}}_k {\bar{\boldsymbol{P}}}_s\\ {\bar{\boldsymbol{X}}}_k&={\boldsymbol{T}}_k {\bar{\boldsymbol{P}}}_s^\mathrm {T}\\ {\bar{\boldsymbol{E}}}_k&= {\boldsymbol{X}}_k- { \bar{\boldsymbol{X}}}_k. \end{aligned}\right. \end{aligned}$$
(5.8)

The \(\mathrm{T^2}\) and SPE statistic control limits are calculated:

$$\begin{aligned} \begin{aligned} \mathrm{{T}}_{\alpha ,s,i} ^2&\sim ~ \frac{a_{s,i}(I - 1)}{(I - a_{s,i})}F_{a_{s,i},I - a_{s,i},\alpha } \\ \mathrm{SPE}_{k,\alpha }&= g_k \Xi ^2_{h_k,\alpha },\;g_k=\frac{v_k}{2m_k},\;h_k=\frac{2m_k^2}{v_k}, \end{aligned} \end{aligned}$$
(5.9)

where \(m_k\) and \(v_k\) are the mean and variance of all batches data at time k, respectively, \(a_{s,i}\) is the number of retained principal components in batch \(i (i=1,2,\ldots ,I)\), and stage s. I is the number of batches, \(\alpha \) is the significant level.

5.2.3 PCA Modeling for Transition Stage

Now a soft-transition multi-phase PCA modeling method based on SVDD is presented according to the mentioned above. It uses the SVDD hypersphere radius to determine the range of transition region between two different stages. Meanwhile, it introduces a concept of membership grades to evaluate quantitatively the similarity between current sampling time data and transition (or steady) stage models. The sub-PCA models for steady phases and transition phases are established respectively which greatly improve the accuracy of models. Moreover, they reflect the characteristic changing during the different neighboring stages. Time-varying monitoring models in transition regions are established relying on the concept of membership grades, which are the weighted sum of nearby steady phase and transition phase sub-models. Membership grade values are used to describe the partition problem with ambiguous boundary, which can objectively reflect the process correlations changing from one stage to another.

Here, the hyperspace distance \(D_{k,s}\) is defined from the sampling data at time k to the center of the sth SVDD sub-model. It is used as dissimilarity index to evaluate quantitatively the changing trend of process characteristics. Correlation coefficients \({\lambda _{l,k}}\) are given as the weight of soft-transition sub-model, which are defined, respectively, as

$$\begin{aligned} \left\{ \begin{aligned} \lambda _{s - 1,k}&= \frac{{D}_{k,s}+{D}_{k,s + 1}}{2\left( {D}_{k,s - 1} + {D}_{k,s} + {D}_{k,s + 1}\right) }\\ \lambda _{s ,k}&= \frac{{D}_{k,s-1}+{D}_{k,s + 1}}{2\left( {D}_{k,s - 1} + {D}_{k,s} + {D}_{k,s + 1}\right) }\\ \lambda _{s + 1,k}&= \frac{{D}_{k,s-1}+{D}_{k,s}}{2\left( {D}_{k,s - 1} + {D}_{k,s} + {D}_{k,s + 1}\right) }, \end{aligned}\right. \end{aligned}$$
(5.10)

where \(l=s-1\), s, and \(s+1\) is the stage number, which represent the last steady stage, current transition stage, and next steady stage, respectively. The correlation coefficient is inverse proportional to hyperspace distance. The greater the distance, the smaller the effect of the hyperspatial distance. The monitoring model for the transition phase of each time interval can be obtained from the weighted sum of the sub-PCA models, i.e.,

$$\begin{aligned} {\boldsymbol{P}}'_k = \sum \limits _{l = s - 1}^{s + 1} \lambda _{l,k}{\boldsymbol{\bar{P}}}_l. \end{aligned}$$
(5.11)

The soft-transition PCA model in (5.11) properly reflects the time-varying transiting development. The score matrix \({\boldsymbol{T}}'_k\) and the covariance matrix \({\boldsymbol{S}}'_k \) can be obtained at each time instance. The SPE statistic control limit is still calculated by (5.9). Different batches have some differences in transition stages. The average \(\mathrm{T^2}\) limits for all batches are used to monitor the process in order to improve the robustness of the proposed method. The \(\mathrm{T^2}\) statistical control limits can be calculated from historical batch data and correlation coefficients.

$$\begin{aligned} {\mathrm{T}_\alpha ^2}' = \sum \limits _{l = s - 1}^{s + 1} \sum \limits _{i = 1}^I \lambda _{l,i,k}\frac{\mathrm{T}^2_{\alpha _{s,i}}}{I}, \end{aligned}$$
(5.12)

where \(i\; (i=1,2,\ldots ,I)\) is the batch number, \(\mathrm{T}^2_{\alpha _{s,i}}\) is the sub-stage \(\mathrm{T^2}\) statistic control limit of each batch which is calculated by (5.9) for sub-stage s.

Now the soft-transition model of each time interval in transition stages is obtained. The batch process can be monitored efficiently by combining with the steady stage model given in Sect. 5.2.2.

5.2.4 Monitoring Procedure of Soft-Transition Sub-PCA

The whole batch process has been divided into several steady stages and transition stage after the two steps stage-dividing, shown in Sects. 5.2.1 and 5.2.2. The new soft-transition sub-PCA method is applied to get detailed sub-model shown Sect. 5.2.3. The details of modeling steps are given as follows:

  1. (1)

    Get normal process data of I batches, unfold them into two-dimensional time-slice matrix, then center and scale each time-slice data as (5.1).

  2. (2)

    Perform PCA on the normalized matrix of each time-slice and get the loading matrices \({\boldsymbol{P}}_k \), which represent the process correlation at each time interval. Add sampling time t into the loading matrix to get the extended matrices \({\boldsymbol{\hat{P}}}_k \).

  3. (3)

    Divide the process into \(S_1\) stages roughly using k-means clustering on extended loading matrices \({\boldsymbol{\hat{P}}}_k \). Train the SVDD classifier for the original \(S_1\) steady process stages.

  4. (4)

    Input again the extended loading matrices \({\boldsymbol{\hat{P}}}_k \) into the original SVDD model to divide explicitly the process into \(S_2\) stages: the steady stage and the transition stage. Then retrain the SVDD classifier for these new \(S_2\) stages. The mean loading matrix \({\boldsymbol{\bar{P}}}_s \) of each new steady stage should be calculated and the sub-PCA model is built in (5.8). The correlation coefficients \(\lambda _{l,k}\) are calculated to get the soft-transition stage model \({\boldsymbol{S}}'_k \) in (5.11) for transition stage t.

  5. (5)

    Calculate the control limits of SPE and \(\mathrm{T^2}\) to monitor new process data.

The whole flowchart of improved sub-PCA modeling based on SVDD soft-transition is shown in Fig. 5.2. The modeling process is offline, which is depending on the historical data of I batches.

Fig. 5.2
figure 2

Illustration of soft-transition sub-PCA modeling

The following steps should be adopted during online process monitoring.

  1. (1)

    Get a new sampling time-slice data \({\boldsymbol{x}}_{new}\), center and scale it based on the mean and standard deviation of prior normal I batches data.

  2. (2)

    Calculate the covariance matrix \({\boldsymbol{x}}_{new}^\mathrm {T}{\boldsymbol{x}}_{new}\), the loading matrix \({\boldsymbol{P}}_{new}\) can be obtained based on singular value decomposition. Then add sampling time \({t}_{new}\) into it to obtain the extended matrix \({\boldsymbol{\hat{P}}}_{new}\). Input the new matrix \({\boldsymbol{\hat{P}}}_{new}\) into the SVDD model to identify which stages the new data belongs to.

  3. (3)

    If current time-slice data belongs to a transition stage, the weighted sum loading matrix \({\boldsymbol{P}}'_{new}\) is employed to calculate the score vector \({\boldsymbol{t}}_{new}\) and error vector \({\boldsymbol{e}}_{new}\),

    $$\begin{aligned} \begin{aligned} {\boldsymbol{t}}_{new}&= {\boldsymbol{x}}_{new} {\boldsymbol{P}}'_{new}\\ {\boldsymbol{e}}_{new}&={\boldsymbol{x}}_{new}-{\boldsymbol{\bar{x}}}_{new}={\boldsymbol{x}}_{new}\left( {\boldsymbol{I}}-{\boldsymbol{P}}'_{new}{\boldsymbol{P}'}_{new}^\mathrm {T}\right) \end{aligned} \end{aligned}$$
    (5.13)

    Or if it belongs to a steady one, the mean loading matrix \({\boldsymbol{\bar{P}}}_{s}\) would be used to calculate the score vector \({\boldsymbol{t}}_{new}\) and error vector \({\boldsymbol{e}}_{new}\),

    $$\begin{aligned} \begin{aligned} {\boldsymbol{t}}_{new}&= {\boldsymbol{x}}_{new} {\boldsymbol{\bar{P}}}_{s}\\ {\boldsymbol{e}}_{new}&={\boldsymbol{x}}_{new}-{\boldsymbol{\bar{x}}}_{new}={\boldsymbol{x}}_{new}\left( {\boldsymbol{I}}-{\boldsymbol{\bar{P}}}_{s}{\boldsymbol{\bar{P}}}_{s}^\mathrm {T}\right) . \end{aligned} \end{aligned}$$
    (5.14)
  4. (4)

    Calculate the SPE and \(\mathrm{T^2}\) statistics of current data as follows:

    $$\begin{aligned} \begin{aligned} \mathrm{T}_{new}^2&= {\boldsymbol{t}}_{new} {\boldsymbol{\bar{S}}}_{s}{\boldsymbol{t}}_{new}^\mathrm {T}\\ \mathrm{SPE}_{new}&= {\boldsymbol{e}}_{new} {\boldsymbol{e}}_{new}^\mathrm {T}. \end{aligned} \end{aligned}$$
    (5.15)
  5. (5)

    Judge whether the SPE and \(\mathrm{T^2}\) statistics of current data exceed the control limits. If one of them exceeds the control limit, alarm abnormal; if none of them does, the current data is normal.

5.3 Case Study

5.3.1 Stage Identification and Modeling

The Fed-Batch Penicillin Fermentation Process is used as a simulation case in this section. A detailed description of the Fed-Batch Penicillin Fermentation Process is available in Chap. 4. A reference data set of 10 batches is simulated under nominal conditions with small perturbations. The completion time is 400 h. All variables are sampled every 1 h so that one batch will offer 400 sampling data.

The rough division result based on \(\mathrm K\)-mean method is shown in Fig. 5.3. Originally, the batch process is classified into 3 steady stage, i.e. \(S_1=3\). Then SVDD classifier with Gaussian kernel function is used here for detailed division. The hypersphere radius of original 3 stages is calculated, and the distances from each sampling data to the hypersphere center are shown in Fig. 5.4.

Fig. 5.3
figure 3

Rough division result based on K-mean clustering

Fig. 5.4
figure 4

SVDD stage classification result

As can be seen from the Fig. 5.4, the sampling data between two stages, such as the data during the time interval 28–42 and 109–200, are obviously out of the hypersphere. That means the data at this two time regions have significant difference from that of other steady stage. Therefore, these two stages are considered as transition stage. The process was further divided into 5 stages according to the detailed SVDD division, shown in Fig. 5.5

It is obviously that the stages during the time interval 1–27, 43–109 and 202–400 are steady stages. The hyperspace distance of stage 28–42, 109–200 exceeded the radius of hypersphere obviously, so the two stages are separated as transition stage. Then the new SVDD classifier model is rebuilt. The whole batch process data set is divided into five stages using the phase identification method proposed in this chapter, that is \(S_2=5\).

Fig. 5.5
figure 5

Detailed process division result based on SVDD

5.3.2 Monitoring of Normal Batch

Monitoring results of the improved sub-PCA methods for the normal batch are presented in Fig. 5.6. The blue line is the statistic corresponding to online data and the red line is control limit with 99% confidence, which is calculated based on the normal historical data. It can be seen that as a result of great change of hyperspace distance at about 30 h in Fig. 5.4, the \(\mathrm{T^2}\) control limit drops sharply. The \(\mathrm{T^2}\) statistic of this batch still stays below the confidence limits. Both of the monitoring systems (\(\mathrm{T^2}\) and SPE) do not yield any false alarms. It means that this batch behaves normally during the running.

Fig. 5.6
figure 6

Monitoring plots for a normal batch

Fig. 5.7
figure 7

The proposed soft-transition monitoring for fault 1

Fig. 5.8
figure 8

The traditional Sub-PCA monitoring for fault 1

Fig. 5.9
figure 9

Projection in principal components space of the proposed method

Fig. 5.10
figure 10

Projection in principal components space of the traditional sub-PCA

5.3.3 Monitoring of Fault Batch

Monitoring results of the proposed method are compared with that of traditional sub-PCA method in order to illustrate the effectiveness. Here two kinds of faults are used to test the monitoring system. Fault 1 is the agitator power variable with a decreasing 10% step at the time interval 20–100. They are shown in Figs. 5.7 and 5.8 that SPE statistic increases sharply beyond the control limit in both methods, while \(\mathrm{T^2}\) statistic which in fact reflects the changing of sub-PCA model did not beyond the control limit in traditional sub-PCA method. That means the proposed soft-transition method made a more exact model than traditional sub-PCA method.

The differences between these two methods can be seen directly at the projection map, i.e. Figs. 5.9 and 5.10. The blue dot is the projection of data in the time interval 50–100 to the first two principal components space, and the red line is control limit. Figure 5.10 shows that none of the data out of control limit using the traditional sub-PCA method. The reason is that the traditional sub-PCA does not divide transition stage. The proposed soft-transition sub-PCA can effectively diagnose the abnormal or fault data, shown in Fig. 5.9.

Fig. 5.11
figure 11

Proposed Soft-transition monitoring results for fault 2

Fig. 5.12
figure 12

The traditional Sub-PCA monitoring for fault 2

Fault 2 is a ramp decreasing with 0.1 slopes which is added to the substrate feed rate at the time interval 20–100. Online monitoring result of the traditional sub-PCA and proposed method are shown in Figs. 5.11 and Fig. 5.12. It can be seen that this fault is detected by both two methods. The SPE statistic of the proposed method is out of the limit about at 50 h and the \(\mathrm{T^2}\) values alarms at 45 h. Then both of them increase slightly and continuously until the end of fault.

It is clearly shown in Fig. 5.12 that the SPE statistic of traditional sub-PCA did not alarm until about 75 h, which lags far behind that of the proposed method. Meanwhile, the \(\mathrm{T^2}\) statistic has a fault alarm at the beginning of the process. It is a false alarm caused by the changing of process initial state. In comparison, the proposed method has fewer false alarms, and the fault alarm time of the proposed method is obviously ahead of the traditional sub-PCA.

The monitoring results for other 12 different faults are presented in Table 5.1. The fault variable No. (1, 2, 3) represents the aeration rate, agitator power and substrate feed rate, respectively, as shown in Chap. 4. Here \(\mathrm FA\) is the number of false alarm during the operation life.

Table 5.1 Monitoring results of FA for other faults

It can be seen that the false alarms of the conventional sub-PCA method is obviously higher than that of the proposed method. In comparisons, the proposed method shows good robustness. The false alarms here are caused by the little change of the process initial state. The initial states are usually different in real situation, which will lead to the changes in monitoring model. Many false alarms are caused by these little changes. The conventional sub-PCA method shows poor monitor performance in some transition stage and even can’t detect these faults because of the inaccurate stage division.

5.4 Conclusions

In a multi-stage batch process, the correlation between process variables changes as the stages are shifted. It makes MPCA and traditional sub-PCA methods inadequate for process monitoring and fault diagnosis. This chapter proposes a new phase identification method to explicitly identify stable and transitional phases. Each phase usually has its own dynamic characteristics and deserves to be treated separately. In particular, the transition phase between two stable phases has its own dynamic transition characteristics and it is difficult to identify.

Two techniques are adopted in this chapter to overcome the above problems. Firstly, inaccurate phase delineation caused by fault data is avoided in the rough division by introducing sampling times in the loading matrix. Then, based on the distance of the process data to the center of the SVDD hypersphere, transition phases can be identified from nearby stable phases. Separate sub-PCA models are given for these stable and transitional phases. In particular, the soft transition sub-PCA model is a weighted sum of the previous stable stage, the current transition stage and the next stable stage. It can reflect the dynamic characteristic changes of the transition phase.

Finally, the proposed method is applied to the penicillin fermentation process. The simulation results show the effectiveness of the proposed method. Furthermore, the method can be applied to the problem of monitoring any batch or semi-batch process for which detailed process information is not available. It is helpful when identifying the dynamic transitions of unknown batch or semi-batch processes.