A method for detecting anomalies in penicillin production based on sliding autoregressive error generation model
By using sliding window technology and sliding autoregressive error generation model in the penicillin production process, penicillin production abnormalities are detected in real time, and the problem of difficulty in monitoring and detecting penicillin production abnormalities in the existing technology is solved, and efficient abnormal detection and production process control are achieved.
Patent Information
- Application Number
- CN202210650638.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-30
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2042-04-30
AI Technical Summary
It is difficult for the existing technology to use the sampling data of new penicillin production batches to establish an abnormality detection model in real time, and it is impossible to effectively monitor and detect abnormalities in the penicillin production process.
Sliding window technology is used to combine historical normal batch sampling data with new batch sampling data to establish a sliding autoregression error generation model. By monitoring the fluctuations of univariate errors, it can detect whether penicillin production is abnormal in real time.
Real-time abnormal detection of new batches of penicillin is realized, the monitoring sensitivity and pertinence of the production process is improved, abnormal situations can be discovered and dealt with in a timely manner, and product quality is ensured.
Smart Images

Figure CN114936790B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an industrial process anomaly detection method, in particular to a penicillin production anomaly detection method based on a sliding autoregressive error generation model. Background Art
[0002] As an important antibiotic widely used in clinical practice, the production and preparation process of penicillin is a typical intermittent process. The penicillin fermentation process is a process of batch fermentation of materials. The whole process can be divided into two stages, namely the initial fermentation stage and the feeding operation stage. The first stage produces most of the bacteria, and the second stage supplements glucose and other materials to ensure production efficiency. At the same time, the death of bacteria and the synthesis of penicillin will occur. It can be said that the penicillin production process is very complex, the process variables are highly coupled and correlated, and the process data presents strong high-dimensionality and multimodality. It is difficult to establish an accurate mechanism model to monitor its production status in real time and detect abnormalities in time. Factors such as dissolved oxygen saturation, pH value, mycelium concentration and morphology, substrate concentration, and temperature all affect penicillin productivity. Therefore, real-time detection of penicillin production anomalies has always been a technical difficulty.
[0003] In the penicillin fermentation model, there are 5 input variables to control the process parameters, 9 process variables in the bacterial synthesis and growth process, and the penicillin production is affected by 5 quality variables. Among them, the temperature variable can be controlled by controlling the flow rate of hot and cold water through the PID controller, and the pH value can be controlled by controlling the flow rate of acid and alkali solutions through the PID controller. In order to ensure that the final fermented penicillin product meets the product quality requirements, it is necessary to monitor the entire penicillin production process and detect abnormalities in the operation process in a timely manner. From the perspective of the penicillin fermentation process, its production has a very typical time sequence, and refers to a repetitive production method carried out in batches and fixed processing sequences. Compared with the continuous production process, the intermittent or batch process has different time characteristics and data distribution characteristics.
[0004] From the perspective of intermittent or batch process modeling, the non-steady state and uncertainty of production state switching lead to problems such as diversity in the distribution of sampled data and unequal length of batch data. Therefore, the use of sampled data to implement penicillin production anomaly detection requires facing irregular three-dimensional data, that is, each production batch has its corresponding set of batch data, and each set of batch data consists of multiple measurement data at multiple sampling time nodes. Analyzing and mining the change characteristics of multiple normal production batch data in the historical database to reflect whether the production of a new production batch of penicillin is abnormal is a commonly used technical means in this technical field. However, each production batch of penicillin has its own characteristics, and it is unknown what type of anomaly occurs. It is also unknown whether the normal change characteristics of offline analysis of historical data are useful for anomaly detection. Therefore, in order to effectively implement penicillin production anomaly detection, it is necessary to use the sampling data of new batches of penicillin production in real time to establish a corresponding anomaly detection model. Summary of the invention
[0005] The main technical problem to be solved by the present invention is: how to use the sampling data of the new production batch of penicillin in real time to instantly establish a corresponding data model that can describe abnormal changes, and on this basis, use the features that best reflect the abnormality to implement penicillin production abnormality detection. Specifically, the method of the present invention applies the sliding window technology to the historical normal batch sampling data and the new batch sampling data at the same time, and instantly establishes an autoregressive model to generate corresponding errors, and then completes the real-time detection task of whether the new batch of penicillin production is abnormal by monitoring the fluctuation of the single variable error.
[0006] The technical solution adopted by the method of the present invention to solve the above problem is: a method for detecting anomalies in penicillin production based on a sliding autoregressive error generation model, comprising the following steps:
[0007] Step (1): From the historical database of penicillin production batches, obtain batch data sets of J normal penicillin production batches, and form corresponding batch matrices X1, X2, ..., X3 according to the sampling time. J Then, set the length of the sliding window equal to L; where the batch matrix X corresponding to the jth normal production batch of penicillin j ∈R N×10 Specifically, it consists of N data vectors, and each data vector consists of 10 sample data, j∈{1, 2, …, J}, R N×10 represents an N×10 dimensional real number matrix, R represents a real number set, the length of the sliding window L is a positive integer, X j The first row of vectors in is the data vector of the first sampling time of the jth normal production batch of penicillin, X jThe Nth row vector in is the data vector of the Nth sampling moment of the jth normal production batch of penicillin.
[0008] It should be noted that the arrangement order of the 10 sample data of each data vector in the batch matrix is: ventilation rate, stirring power, bottom flow acceleration rate, bottom flow temperature, bottom flow concentration, dissolved oxygen concentration, reactor interior, carbon dioxide concentration, pH value, reactor internal temperature, and cooling water flow acceleration rate.
[0009] Step (2): Obtain the sample data of each sampling time of the latest batch of penicillin production, and combine the 10 sample data of each sampling time into a 1×10-dimensional data vector. When the data vectors x1, x2, …, x3 at L sampling times are obtained, L , then set k=1 and execute step (3).
[0010] Step (3): Substitute the batch matrices X1, X2, …, X J The row vectors from row k to row k+L-1 correspond to the training batch matrix After that, calculate the J training batch matrix The mean vector μ∈R of all row vectors in 1×10 and standard deviation vector δ∈R 1×10 ; Among them, the j-th training batch matrix Specifically, the j-th batch matrix X j It consists of row vectors from the kth row to the k+L-1th row in , j∈{1, 2,…, J}.
[0011] Step (4): When i is equal to 1, 2, ..., L, use the formula For the training batch matrix Perform normalization to obtain a reference batch matrix And use the formula For the data vector x i Implement standardization to obtain data vector in, express The row vector of the i-th row in , express The row vector of the i-th row in , j∈{1, 2,…, J}.
[0012] Step (5): L data vectors after standardization A corresponding sliding autoregressive error generation model is established to generate the corresponding error e. The specific implementation process is shown in steps (5.1) to (5.5).
[0013] Step (5.1): Composed sliding window matrix X t ∈R L×10 After that, initialize the load vector w t is equal to any 10×1 real vector.
[0014] Step (5.2): According to the formula and After calculating the matrices G and L, we solve the eigenvalue problem G = λLv and find the eigenvector v corresponding to the maximum eigenvalue λ. Then, according to the formula β t =v / v(1) to calculate the coefficient vector β t ∈R L×1 ; where v(1) represents the first element in the feature vector v.
[0015] Step (5.3): According to the formula and After updating the matrices G and L, we solve the eigenvalue problem G = λLv again and find the eigenvector v corresponding to the maximum eigenvalue λ. Then we use the formula w t =v / ||v||Calculate the load vector w t ;in, Indicates calculating the length of v.
[0016] Step (5.4): Determine w t Whether it converges, the convergence standard is w t The elements in no longer change; if not, return to step (5.2); if so, the final load vector w is obtained t ∈R 10×1 and coefficient vector β t ∈R L×1 Then proceed to step (5.5).
[0017] Step (5.5): According to the formula The corresponding error e is calculated.
[0018] Step (6): Determine whether condition C is met 下 ≤e≤C 上 ; If yes, the production of the latest batch of penicillin is running normally, and then execute step (7); if no, the production of the latest batch of penicillin is running abnormally, and the production of this batch of penicillin is stopped; where C 上 and C 下 Represent the upper and lower limits of the error change respectively.
[0019] Step (7): Determine whether the production of this batch of penicillin has ended; if not, obtain 10 sample data at the next sampling time and form them into a 1×10-dimensional data vector x newThen, execute step (8); if yes, the production of this batch of penicillin is running normally. After cleaning the penicillin production equipment, start the production of the next batch of penicillin and return to step (2).
[0020] Step (8): After setting k = k + 1, L data vectors x2, x3, ..., x L , x new Update and replace the original L data vectors x1, x2, ..., x L Then, return to step (3); wherein the update and replacement operation is to set x in order. L =x new , x L-1 =x t , x L-2 =x t-1 ,…,x1=x2.
[0021] It should be noted that the upper limit C is required in step (6). 上 and the lower limit C 下 To determine whether the error e generated in step (5) is within the normal range. 上 and C 下 The implementation process is as follows:
[0022] Step (A): When j is equal to 1, 2, ..., J respectively, repeat the step (B) shown below.
[0023] Step (B): Convert the batch matrix X j Each row vector in is regarded as the data vector corresponding to each sampling time of the latest batch of penicillin production, and steps (2) to (5) are repeated until N-L+1 errors are obtained, and they are marked as Among them, n=N-L+1.
[0024] Step (C): Calculate the average μ of all J×n errors e and standard deviation δ e Then calculate the upper limit C 上 =μ e +3.5δ e and the lower limit C 下 =μ e -3.5δ e .
[0025] In addition, the implementation process of establishing the sliding autoregressive error generation model in step 5 to generate the corresponding error is actually to generate the sliding window matrix X t L data vectors Determine the corresponding load vector w specifically t ∈R 10×1and L-1 autoregressive coefficients b1, b2, …, b L-1 , so that the corresponding autoregressive model error While maximizing, try to make the L row vectors in the J reference batch matrix The sum of the autoregressive model errors (i.e.: ). Since errors can be positive or negative, minimizing the square of the error is equivalent to minimizing the error. Therefore, the corresponding objective function can be defined as:
[0026]
[0027] If you set β t =[1, -b1, -b2, ..., -b L-1 ] T , then the above formula ① can be equivalently written in the matrix form as shown below:
[0028]
[0029] The maximization problem in equation ② above can be solved by the classic Lagrange multiplier method, that is, constructing the Lagrange function ζ as shown below:
[0030]
[0031] Set J relative to w t and When the partial derivative of is equal to 0, we can get the generalized eigenvalue problem as shown below:
[0032]
[0033] Two generalized eigenvalue problems are defined in the above formula ④, which correspond to the generalized eigenvalue problems in the above steps (5.2) and (5.3) respectively. In addition, since β t =[1, -b1, -b2, ..., -b L-1 ] T The first element in is equal to 1, so step (5.2) uses the first element v(1) in the eigenvector v to process v, so that the coefficient vector β t The first element in is equal to 1.
[0034] The above steps (5.2) and (5.3) are both solving the same type of generalized eigenvalue problem, which can be uniformly expressed as: Gv = λLv. The difference is that the way of calculating matrices G and L in steps (5.2) and (5.3) is different. Since the matrix L may not be invertible, when solving the maximum generalized eigenvalue problem, it is necessary to follow steps (i) to (iii) as shown below.
[0035] Step (a): Perform singular value decomposition on the matrix L, retain the non-zero singular values, and obtain the corresponding unitary matrix U and singular value diagonal matrix V, so that the matrix can be calculated
[0036] Step 2: According to the formula Calculating the Matrix Then solve the eigenvalue problem The eigenvector p corresponding to the maximum eigenvalue λ.
[0037] Step (three): Through the formula The generalized eigenvector v is calculated.
[0038] Through the above-described implementation steps, the advantages of the method of the present invention are introduced as follows.
[0039] The main advantage of the method of the present invention is that the autoregressive model established for multiple data vectors in the sliding window is specifically for the current sliding window matrix, and different autoregressive models can be established for different data vectors in a targeted manner, and the purpose of establishing the autoregressive model is to maximize the error of the data vector being detected for anomaly detection. Therefore, the error generated by the method of the present invention has high sensitivity and targeting. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a schematic diagram of the implementation process of the method of the present invention.
[0041] Figure 2 Schematic diagram of the apparatus used for penicillin production. DETAILED DESCRIPTION
[0042] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0043] The present invention discloses a method for detecting anomalies in penicillin production based on a sliding autoregressive error generation model. Figure 1 The schematic diagram of the implementation flow shown is used to illustrate the specific implementation of the method of the present invention.
[0044] Step (1): From the historical database of penicillin production batches, obtain batch data sets of J normal penicillin production batches, and form corresponding batch matrices X1, X2, ..., X3 according to the sampling time. J Then, the length of the sliding window is set to be equal to L; wherein L is set to a positive integer greater than or equal to 3.
[0045] like Figure 2The penicillin production device shown in the figure is equipped with a corresponding distributed control system (DCS) in actual operation. The DCS can acquire and store 10 sample data collected at each sampling moment in real time. For consistency, the 10 sample data can be arranged in the following order to form a 1×10-dimensional data vector: ventilation rate, stirring power, bottom flow acceleration rate, bottom flow temperature, bottom flow concentration, dissolved oxygen concentration, reactor interior, carbon dioxide concentration, pH value, reactor interior temperature, and cooling water flow acceleration rate.
[0046] Step (2): Obtain the sample data of each sampling time of the latest batch of penicillin production, and combine the 10 sample data of each sampling time into a 1×10-dimensional data vector. When the data vectors x1, x2, …, x3 at L sampling times are obtained, L , then set k=1 and execute step (3).
[0047] Step (3): Substitute the batch matrices X1, X2, …, X J The row vectors from row k to row k+L-1 correspond to the training batch matrix After that, calculate the J training batch matrix The mean vector μ∈R of all row vectors in 1×10 and standard deviation vector δ∈R 1×10 ;
[0048] Step (4): When i is equal to 1, 2, ..., L, use the formula For the training batch matrix Perform normalization to obtain a reference batch matrix And use the formula For the data vector x i Implement standardization to obtain data vector
[0049] Step (5): L data vectors after standardization A corresponding sliding autoregressive error generation model is established to generate the corresponding error e. The specific implementation process is shown in the above steps (5.1) to (5.5).
[0050] Step (6): Determine whether condition C is met 下 ≤e≤C 上 ; If yes, the production of the latest batch of penicillin is running normally, and then execute step (7); if no, the production of the latest batch of penicillin is running abnormally, and the production of this batch of penicillin is stopped; where C 上 and C 下 Represent the upper and lower limits of the error change respectively.
[0051] Step (7): Determine whether the production of this batch of penicillin has ended; if not, obtain 10 sample data at the next sampling time and form them into a 1×10-dimensional data vector x new Then, execute step (8); if yes, the production of this batch of penicillin is running normally. After cleaning the penicillin production equipment, start the production of the next batch of penicillin and return to step (2).
[0052] Step (8): After setting k = k + 1, set x1, x2, ..., x L-1 , x L are equal to x2, x3, …, x L , x new Then, return to step (3).
Claims
1. A method for detecting anomalies in penicillin production based on a sliding autoregressive error generation model, characterized in that: The specific steps include the following: Step (1): From the historical database of penicillin production batches, obtain batch data sets of J normal penicillin production batches, and form corresponding batch matrices X1, X2, …, X3 according to the sampling time. J Then, set the length of the sliding window equal to L; where the batch matrix X corresponding to the jth normal production batch of penicillin j ∈R N×10 Specifically, it consists of N data vectors, and each data vector consists of 10 sample data, j∈{1,2,…,J}, R N×10 represents an N×10-dimensional real matrix, and R represents a real number set; Step (2): Obtain the sample data of each sampling time of the latest batch of penicillin production, and combine the 10 sample data of each sampling time into a 1×10-dimensional data vector. When the data vectors x1, x2, …, x3 of L sampling times are obtained, L , then set k = 1 and execute step (3); Step (3): Substitute the batch matrices X1, X2, …, X J The row vectors from row k to row k+L-1 correspond to the training batch matrix After that, calculate the J training batch matrix The mean vector μ∈R of all row vectors in 1×10 and standard deviation vector δ∈R 1×10 ; Among them, the j-th training batch matrix Specifically, the j-th batch matrix X j The row vectors from the kth row to the k+L-1th row in are composed of j∈{1,2,…,J}; Step (4): When i is equal to 1, 2, …, L, use the formula For the training batch matrix Perform normalization to obtain a reference batch matrix And use the formula For the data vector x i Implement standardization to obtain data vector in, express The row vector of the i-th row in , express The row vector of the i-th row in , Represents the division of the elements at the same position in two vectors; Step (5): L data vectors after standardization Establish a corresponding sliding autoregressive error generation model to generate the corresponding error e. The specific implementation process is shown in steps (5.1) to (5.5); Step (5.1): Composed sliding window matrix X t ∈R L×10 After that, initialize the load vector w t is equal to any 10×1 dimensional real vector; Step (5.2): According to the formula and After calculating the matrices G and L, we solve the eigenvalue problem G = λLv and find the eigenvector v corresponding to the maximum eigenvalue λ. Then, according to the formula β t =v / v(1) to calculate the coefficient vector β t ∈R L×1 ; Where v(1) represents the first element in the feature vector v; Step (5.3): According to the formula and After updating the matrices G and L, we solve the eigenvalue problem G = λLv again and find the eigenvector v corresponding to the maximum eigenvalue λ. Then we use the formula w t =v / ||v||Calculate the load vector w t ;in, Indicates calculating the length of v; The specific implementation process of solving the eigenvector v corresponding to the maximum eigenvalue λ in the generalized eigenvalue problem G=λLv in step (5.2) and step (5.3) includes the following steps (i) to (iii): Step 1: Perform singular value decomposition on the matrix L, retain the non-zero singular values, and obtain the corresponding unitary matrix U and singular value diagonal matrix V, so that the matrix can be calculated Step 2: According to the formula Calculating the Matrix Then solve the eigenvalue problem The eigenvector p corresponding to the maximum eigenvalue λ; Step 3: Use the formula Calculate the generalized eigenvector v; Step (5.4): Determine w t Is it converged? If not, return to step (5.2); if so, get the final load vector w t ∈R 10×1 and the coefficient vector β t ∈R L×1 Then, execute step (5.5); Step (5.5): According to the formula Calculate the corresponding error e; Step (6): Determine whether condition C is met 下 ≤e≤C 上 ; If yes, the production of the latest batch of penicillin is running normally, and then execute step (7); if no, the production of the latest batch of penicillin is running abnormally, and the production of this batch of penicillin is stopped; where C 上 and C 下 Respectively represent the upper and lower limits of the error change; Step (7): Determine whether the production of this batch of penicillin has ended; if not, obtain 10 sample data at the next sampling time and form them into a 1×10-dimensional data vector x new Then, execute step (8); if yes, the production of this batch of penicillin is running normally, and after cleaning the penicillin production equipment, start the production of the next batch of penicillin and return to step (2); Step (8): After setting k = k + 1, set x1, x2, ..., x L-1 ,x L are equal to x2, x3, …, x L ,x new Then, return to step (3).
2. The method for detecting anomalies in penicillin production based on a sliding autoregressive error generation model according to claim 1, characterized in that: The order of arrangement of the 10 sample data in each data vector is: ventilation rate, stirring power, bottom flow acceleration rate, bottom flow temperature, bottom flow concentration, dissolved oxygen concentration, reactor interior, carbon dioxide concentration, pH value, reactor interior temperature, and cooling water flow acceleration rate.
3. The method for detecting anomalies in penicillin production based on a sliding autoregressive error generation model according to claim 1, characterized in that: The upper limit C used in step (6) 上 and the lower limit C 下 The specific process is as follows: Step (A): When j is equal to 1, 2, ..., J respectively, repeat the following step (B); Step (B): Convert the batch matrix X j Each row vector in is regarded as the data vector corresponding to each sampling time of the latest batch of penicillin production, and steps (2) to (5) are repeated until N-L+1 errors are obtained, and they are marked as Wherein, n = N-L+1; Step (C): Calculate the average μ of all J×n errors e and standard deviation δ e Then calculate the upper limit C 上 =μ e +3.5δ e and the lower limit C 下 =μ e -3.5δ e .
Citation Information
Patent Citations
Intermittent process online monitoring method based on tensor overall-local preserving projection
CN103576594A
Online and real-time batch process monitoring method based on k nearest neighbor
CN104808648A