A time series prediction method for potency index of fermentation tank in penicillin fermentation process

By using a Transformer-based time series prediction model, combined with online and offline detection variables, the time lag problem of real-time acquisition of potency indicators during penicillin fermentation was solved, enabling real-time prediction of potency indicators in fermenters and improving production control efficiency.

CN117494863BActive Publication Date: 2026-11-27EAST CHINA UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311009593.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-11
Publication Date
2026-11-27
Estimated Expiration
2043-08-11

AI Technical Summary

Technical Problem

In the existing technology, there is a time lag in the real-time acquisition of potency indicators in the fermenter during penicillin fermentation, which affects the efficiency of real-time control and lacks an effective time series prediction model.

Method used

A time-series prediction model for penicillin fermentation was constructed using a Transformer-based model, combining online and offline detection variables, and employing a multi-feature encoding module and one-dimensional convolution processing to predict future changes in the potency index of the fermenter.

Benefits of technology

It enables real-time prediction of potency indicators during penicillin fermentation, improving the efficiency of production process control and production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117494863B_ABST
    Figure CN117494863B_ABST
Patent Text Reader

Abstract

The application discloses a time series prediction method for potency index of a fermentation tank in a penicillin fermentation process, and the specific implementation steps are as follows: (1) obtaining historical data of a corresponding stage; (2) expanding the historical data into time series data and performing maximum minimum normalization processing; (3) performing one-dimensional convolution processing; (4) obtaining mycelium state; (5) sending the historical data obtained in the step (3) and the mycelium state information obtained in the step (4) into a multi-feature coding module to form modeling data; (6) constructing a regression prediction model based on a Transformer; (7) using penicillin three-stage fermentation process data to perform model training, and through the input of sequence variables in stages, the change of the potency index in n hours after the current time t hours in the penicillin fermentation process is predicted according to the known time series information in the current time t hours, wherein n is any natural number in 1-30.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent manufacturing in industrial biological fermentation processes, and particularly relates to a time series prediction method for the potency index of the fermenter in the penicillin fermentation process in industrial biological fermentation. Background Technology

[0002] Penicillin is a highly effective antibiotic with few side effects. Its discovery ushered in a new era of antibiotic treatment for diseases and greatly enhanced humanity's ability to treat infectious diseases. Therefore, intelligent control of the industrial process of penicillin fermentation is also a popular research direction in the pharmaceutical field.

[0003] The penicillin fermentation process consists of four physiological stages, which can be divided into four phases according to the bacterial growth cycle: lag phase, rapid growth phase, synthesis phase, and death phase. Each phase has different process characteristics. The lag phase and rapid growth phase are the cell growth stages. Under suitable culture conditions, by controlling fermentation conditions such as pH, temperature, ventilation, and stirring rate, bacteria, after a short period of adaptation following inoculation, begin to develop, grow, and reproduce until the critical concentration of the cell mass. This stage is also known as the logarithmic growth phase, during which the cell morphology is stable. The synthesis phase is mainly used for penicillin synthesis, where penicillin production reaches its maximum rate and continues until the penicillin synthesis capacity declines. During this period, the concentrations of nutrients such as carbon and nitrogen sources need to be strictly controlled within a certain range. During the synthesis phase, the cell morphology may change, becoming shorter, and spores may be produced. The death phase refers to the gradual aging of the cells, the beginning of cell autolysis, the decline in penicillin synthesis capacity, and a decrease in production efficiency.

[0004] In penicillin fermentation production, the fermenter potency index is a crucial quality variable that largely determines the final penicillin production efficiency. However, this index typically requires offline sampling analysis, meaning it is not acquired in real-time but rather with a time lag, which is detrimental to real-time control of the penicillin fermentation process. To address this issue, a time-series prediction model can be established that maps measured variables during production to the quality variable (penicillin potency index). With the use of distributed control systems, penicillin production plants retain a large amount of historical process data, containing time-series information about many features. For intermittent fermentation processes like penicillin, where the underlying mechanisms are not yet fully understood, using data-driven methods to extract valuable information from historical data and construct time-series prediction models for key quality variables is essential to assist plant operators in real-time adjustments to control strategies.

[0005] Among numerous data-driven time series prediction algorithms, Transformer-based models can effectively extract the deep correlation between detection variables and quality variables in the penicillin fermentation process, and the encoder-decoder model structure in Transformer can solve a variety of sequence prediction tasks. Summary of the Invention

[0006] The purpose of this invention is to predict the changes in key quality variables (potency indicators) of penicillin fermentation over a period of time in the penicillin fermentation process using a data-driven approach and online and offline monitoring variables from the start of fermentation to the present moment. This provides a reference for plant operators to regulate the penicillin fermentation process and ensure efficient penicillin production.

[0007] To achieve the above objectives, this invention provides a time-series prediction method for potency indicators in the penicillin fermentation process. Based on the known time-series information within hour t of the current moment in the penicillin fermentation process, the method predicts the changes in potency indicators within the next n hours. This invention establishes an online estimation model for potency indicators in the penicillin fermentation process. The specific steps are as follows:

[0008] (1) Obtain historical data for the corresponding stage;

[0009] (2) Expand the historical data into time series data and perform max-min normalization;

[0010] (3) Convert the data after the maximum-minimum normalization process obtained in step (2) into tensors and perform one-dimensional convolution processing;

[0011] (4) Input the image data into the pre-trained ResNet50 convolutional neural network image classifier to obtain the mycelial state;

[0012] (5) Input the historical data obtained in step (3) and the mycelial state information obtained in step (4) into the multi-feature coding module to form modeling data;

[0013] (6) Construct a regression prediction model based on Transformer, including an encoder, a decoder, and a linear regression layer;

[0014] (7) Model training was conducted using data from the three-stage fermentation process of penicillin. By inputting the sequence variables in stages, the changes in potency in the next n hours were predicted based on the known time-series information within the current hour t of the penicillin fermentation process.

[0015] In the time series prediction method for the potency index of the penicillin fermentation process described in this invention, the historical data, specifically the time series information known within t hours at the current moment of the penicillin fermentation process, refers to the online monitoring data and offline monitoring data within t hours after the start of fermentation.

[0016] Furthermore, in the time series prediction method for the potency index of the penicillin fermentation process described in this invention, the historical data of penicillin fermentation production at the corresponding stage, specifically for the start of fermentation, includes the following parameters in the fermenter: pH, mycelial concentration (%), glucose replenishment rate (g / L·hr), residual phenylacetic acid (mg / mL), residual sulfate (mg / mL), phenylacetic acid consumption rate (g / L·hr), ammonia nitrogen consumption rate (g / L·hr), glucose concentration (mg / L), ammonia nitrogen concentration (mg / mL), temperature (°C), flow rate (L / Hr), dissolved oxygen (%), volume (L), tail oxygen (%), tail carbon (%), rotation speed (rpm), cell biomass (g / L), cumulative ammonia water volume (kg), defoamer (kg), cumulative sugar water volume (kg), tank pressure (MPa), cumulative phenylacetic acid volume (kg), cumulative ammonium sulfate volume (kg), cumulative sodium sulfate volume (kg), and conductivity (S·m). -1 ), Oxygen uptake rate OUR (mmol / L·hr), carbon dioxide release rate CER (mmol / L·hr), respiratory entropy RQ, volumetric dissolved oxygen coefficient (h⁻¹) -1 ) and other variable data.

[0017] Furthermore, in the time series prediction method for the potency index of the penicillin fermentation process described in this invention, for each stage, the online monitoring and offline sampling variables in the obtained historical data are used as independent variables, and the potency index of the penicillin fermentation process is used as the dependent variable.

[0018] Furthermore, in the time series prediction method for the potency index of the fermenter in the above-mentioned penicillin fermentation process, step (2) performs maximum-minimum normalization on the historical data, transforming the original data linearized to the range of [0,1], and calculates it using the following two formulas:

[0019]

[0020]

[0021] in, Let x represent the value of the j-th independent variable in the i-th batch. ij The standardized value and Let represent the maximum and minimum values ​​of all batches of data for the j-th independent variable, respectively, where n represents the total number of batches and m represents the number of independent variables. Then, y represents the potency index of the i-th batch of penicillin fermentation tank. i The standardized value, y max and y min These represent the highest and lowest potency values ​​for all batches of penicillin fermentation tank potency data, respectively.

[0022] Furthermore, in the time series prediction method for the potency index of the fermenter in the above-mentioned penicillin fermentation process, step (3) converts the standardized data into tensors and performs one-dimensional convolution processing:

[0023] (1) Convert the data after maximum-min normalization into tensor form;

[0024] (2) Convert the tensor obtained in step (1) into time series data by expanding the tensor horizontally in time order.

[0025] (3) The tensor obtained in step (2) is transformed into a tensor with the number of features equal to the number of variables by a one-dimensional convolution function.

[0026] Furthermore, in the time series prediction method for the potency index of the fermenter in the above-mentioned penicillin fermentation process, step (4) involves inputting the mycelial image into a pre-trained ResNet50 convolutional neural network for mycelial state classification. The specific steps are as follows:

[0027] (1) First, convert the size of the input image to a 224×224 input feature map;

[0028] (2) Randomly flip the image obtained in step (1) horizontally;

[0029] (3) Randomly rotate the image obtained in step (2);

[0030] (4) Convert the image obtained in step (3) into a tensor and perform normalization;

[0031] (5) Input the tensor obtained in step (4) into the pre-trained ResNet50 convolutional neural network to classify mycelial state. Based on the monitoring time and image scale information, the mycelial state categories can be divided into six categories: n1, n2, n3, b1, b2, and b3, where n represents the normal state and b represents the abnormal state.

[0032] Furthermore, in the time series prediction method for the potency index of the fermenter in the above-mentioned penicillin fermentation process, in step (5), the historical data obtained in step (3) and the mycelial state information obtained in step (4) are sent to the multi-feature coding module to form modeling data. The multi-feature coding module includes a location coding module and a mycelial state coding module, and their construction steps are as follows:

[0033] ① Positional Encoding Information: By generating sine and cosine data of different frequencies, these are added to the input sequence data as positional codes. This allows the model to capture the relative and absolute positional relationships between input variables. Specifically, sine variables are added to even-numbered variable positions, and cosine variables are added to odd-numbered positions before being placed into the PE matrix, thus introducing positional encoding. The following two formulas are used for calculation:

[0034] PE (pos,2i) =sin(pos / len) 2i / d_model )

[0035] PE (pos,2i+1) =cos(pos / len) 2i / d_model )

[0036] Where pos refers to the absolute position in the sequence at that moment, i is the dimension, and PE is the position of the position in the sequence. (pos,2i) PE (pos,2i+1) and represent the 2i and 2i+1th components of the encoded vector at position pos, respectively. len is a constant, and its size can be adjusted according to the sequence length. In the time series prediction method for the potency index of penicillin fermentation tank, len = 100. d_model represents the dimension of the word vector.

[0037] ② Mycelial state coding information: According to claim 5, the classification results obtained in step (5) are coded, and the steps are as follows:

[0038] (1) According to claim 5, the classification result obtained in step (5) is converted into the form of a one-hot matrix;

[0039] (2) Input the one-hot matrix obtained in step (1) into the word embedding encoding function for feature encoding. Other parameter settings are the same as those for the positional encoding PE matrix.

[0040] ③ The tensor obtained by the method of converting the original data into word vector dimension as described in claim 5, the position encoding information tensor obtained in method ①, and the mycelial state tensor obtained in method ② are added together to obtain the model input tensor.

[0041] Furthermore, in the time series prediction method for the potency index of the fermenter in the above-mentioned penicillin fermentation process, step (6) constructs a regression prediction model based on the Transformer model, which includes an encoder, a decoder, and a linear regression layer. The steps are as follows:

[0042] (1) In the encoder, the tensor formed by the multi-feature encoding module is fed into the multi-head attention mechanism layer. In the multi-head attention mechanism, the input tensor is copied to form three matrices: Q (Query), K (Key), and V (Value). Attention allocation of the input tensor over time is achieved through scaling dot product operations, calculated using the following three formulas:

[0043]

[0044] in, The scaling factor is used to counteract the problem of excessively large dot product amplitude in long sequence problems. The softmax function is an exponential normalization function, and its calculation process can be obtained through the following formula.

[0045]

[0046] in zi Let be the output value of the i-th node, and n be the number of output nodes. The softmax function can be used to transform the output value into a probability distribution in the range [0,1] with a sum of 1.

[0047] MultiHead(Q,K,V)=Concat(head1,...,head h W O

[0048] Concat is a concatenation function used to concatenate h attention heads.

[0049] head i =Attention(QW i Q ,KW i K VW i V )

[0050] in, These are linear projection matrices corresponding to Q (Query), K (Key), and V (Value), respectively. These are the output projection matrices after scaling the dot product operation; these weight matrices can be iteratively updated during training. Multi-head attention simultaneously focuses on information from different representation subspaces at different locations, which can suppress the instability of single-head attention. In the time series prediction method for the potency index of the fermenter in the penicillin fermentation process, h = 4;

[0051] (2) The tensor obtained in step (1) is passed through an addition layer and a normalization layer to form an Add&Norm layer, and then connected by residuals so that the network can pay attention to the differences in the current results. The following two formulas are used for calculation:

[0052] LayerNorm(x+MultiHeadAttention(x));

[0053] (3) The tensor obtained in step (2) is passed through a forward-propagating fully connected network layer to enhance the ability to remember deep features and improve the stability of the model. The Add&Norm layer described in step (2) is used for residual connection, and the following formula is used for calculation:

[0054] LayerNorm(x+FeedForward(x));

[0055] (4) The tensor obtained in step (3) is fed into the decoder. The construction of the decoder also includes the multi-head attention mechanism in step (1), the residual connection layer of Add&Norm in step (2), and the forward propagation layer in step (3), thereby forming the decoder output tensor.

[0056] (5) Construct a linear fully connected layer as a regression model. The decoder output tensor obtained in step (4) is passed through the linear fully connected layer to form a time series output vector, which is calculated using the following formula:

[0057] y = W·x + b

[0058] Where x is the decoder output tensor obtained in step (4), W represents the weight matrix of the linear layer, b represents the bias term of the linear layer, and y represents the predicted output after regression.

[0059] Furthermore, in the above-mentioned time series prediction method for the potency index of the penicillin fermentation process, step (7) uses data from the three-stage penicillin fermentation process for model training. Based on the known time series information within the current hour t, the change in the potency index of the penicillin fermentation process within the next n hours is predicted, where n = any natural number from 1 to 30. The steps for phased model training and prediction are as follows:

[0060] (1) Set up the gradient descent optimization algorithm and MSELoss, where MSELoss is used to constrain the difference between the actual value and the predicted value of penicillin potency index within n hours after the phase. Its calculation formula is as follows:

[0061] MSELoss(x i ,y i )=(x i -y i ) 2

[0062] Where, x i y represents the model's predicted value. i x represents the true value during training. i With y i The dimensions are the same;

[0063] (2) The historical data of penicillin fermentation in stages were randomly divided into training set and test set in a ratio of 4:1, and epoch=64, batch_size=4 were set. The training set data was extracted for model training.

[0064] (3) After the model training is completed, the test set data is extracted, the prediction test is performed, and the prediction waveform, mean square error, coefficient of determination and other evaluation indicators are output.

[0065] The present invention provides a time-series prediction method for the potency index of the fermenter in the penicillin fermentation process. This method is based on multi-feature fusion modeling, which integrates online monitoring features, offline sampling features, and mycelial image features. Attached Figure Description

[0066] Figure 1 This is a flowchart of the time series prediction method for the potency index of the fermenter in the penicillin fermentation process of the present invention.

[0067] Figure 2 These are pictures of the mycelial state during the fermentation of penicillin batch #26a.

[0068] Figure 3 This is a comparison chart of the actual and predicted values ​​of penicillin fermentation potency during the 60-hour fermentation stage test.

[0069] Figure 4 This is a scatter plot of the actual and predicted values ​​of penicillin fermentation potency during the 60-hour fermentation stage test. Detailed Implementation

[0070] Example

[0071] Figure 1This is a flowchart of the time series prediction method for the potency index of penicillin fermentation tank in the penicillin fermentation process of the present invention. Taking the modeling of a penicillin fermentation tank with t=60h as an example, the time series changes of penicillin potency index within n=30h after prediction are shown below. The offline sampling frequency is once every 5h, so the length of the model input variable sequence is 12, and the model potency sequence prediction length is 6, further illustrating the technical solution of the present invention.

[0072] Step (1) Obtain the following parameters in the fermenter at the start of fermentation: pH, mycelial concentration (%), glucose replenishment rate (g / L·hr), residual phenylacetic acid (mg / mL), residual sulfate (mg / mL), phenylacetic acid consumption rate (g / L·hr), ammonia nitrogen consumption rate (g / L·hr), glucose concentration (mg / L), ammonia nitrogen concentration (mg / mL), temperature (°C), flow rate (L / Hr), dissolved oxygen (%), volume (L), tail oxygen (%), tail carbon (%), rotation speed (rpm), cell biomass (g / L), cumulative ammonia water volume (kg), defoamer (kg), cumulative sugar water volume (kg), tank pressure (MPa), cumulative phenylacetic acid volume (kg), cumulative ammonium sulfate volume (kg), cumulative sodium sulfate volume (kg), and conductivity (S·m). -1 ), Oxygen uptake rate OUR (mmol / L·hr), carbon dioxide release rate CER (mmol / L·hr), respiratory entropy RQ, volumetric dissolved oxygen coefficient (h⁻¹) -1 Data on variables such as (online monitoring and offline sampling) and penicillin potency in fermenters were collected. Online monitoring and offline sampling variables were used as independent variables, and penicillin potency was used as the dependent variable. The obtained historical data contained 29 independent variables, 1 dependent variable, and 72 data samples.

[0073] Step (2) performs min-max standardization on the independent and dependent variable data obtained in step (1). The standardization formula is as follows.

[0074]

[0075]

[0076] in, Let x represent the value of the j-th independent variable in the i-th batch. ij The standardized value, and Let $\mathbf{j}$ and $\mathbf{j}$ represent the maximum and minimum values ​​of all batches of data for the $j$-th independent variable, respectively. The total number of batches is 72, and the number of independent variables is 29. Then, y represents the potency index of the i-th batch of penicillin fermentation tank. i The standardized value, y max and y minThese represent the highest and lowest potency values ​​for all batches of penicillin fermentation tank potency data, respectively.

[0077] Step (3) performs one-dimensional convolution on the standardized data from step (2) using the nn.Conv1d() function, where in_channels = 29 is the number of independent variables, out_channels = d_model = 16 is the unified word vector dimension, kernel_size = 3, padding_mode = 'circular', and bias = False. After step (3), the tensor dimension changes from [batch_size, timestep, variables] = [4, 12, 29] to [batch_size, timestep, d_model] = [4, 12, 16].

[0078] Step (4) uses the pre-trained ResNet50 to perform image classification to obtain the mycelial state. The steps are as follows:

[0079] ①Illustrated with attached diagrams Figure 1 As shown, the original single 2048*1536 pixel mycelium photos are converted into 224×224 input feature maps in batches;

[0080] ② A method to randomly flip the image obtained in step ① horizontally: transforms.RandomHorizontalFlip();

[0081] ③ The method to randomly rotate the image obtained in step ② is: transforms.RandomRotation(15);

[0082] ④ Convert the image obtained in step ③ into a tensor using transforms.ToTensor(), and then normalize it, that is, transform the data from the range [0,224] to [0,1]. The normalization method is transforms.Normalize().

[0083] ⑤ The tensor obtained in step ④ is fed into the pre-trained ResNet50 convolutional neural network for mycelial state classification. (See attached diagram for details based on monitoring time and image scale information.) Figure 1 The states shown are n1, n2, n2, b1, b2, where n represents the normal state and b represents the abnormal state.

[0084] Step (5) inputs the historical data obtained in step (3) and the mycelial state information obtained in step (4) into the multi-feature coding module to form modeling data. The specific implementation steps are as follows:

[0085] ① The fermentation history data is a tensor processed in step (3), i.e., a tensor with dimensions [4, 12, 16], which is then fed into the position encoding module. The method is as follows:

[0086] position=torch.arange(0,c_in).float().unsqueeze(1)

[0087] div_term=(torch.arange(0,d_model,2).float()*-(math.log(100.0) / d_model)).exp()

[0088] w[:,0::2]=torch.sin(position*div_term)

[0089] w[:,1::2]=torch.cos(position*div_term)

[0090] self.emb=nn.Embedding(c_in,d_model)

[0091] self.emb.weight=nn.Parameter(w,requires_grad=False)

[0092] Here, `position` is used to define the input position of the model. By generating sine and cosine data of different frequencies, it is added to the input sequence data as position codes, so that the model can capture the relative positional relationship and absolute positional information between input variables. That is, sine variables are added to even-numbered variable positions, and cosine variables are added to odd-numbered positions. After position encoding, a position encoding tensor is generated with dimensions [4, 12, 16].

[0093] ② The mycelial image, after step (4), yields a mycelial state tensor, i.e., a tensor with dimensions [4, 12, 16]. This tensor is then fed into the mycelial state encoding module. The method is as follows:

[0094] mycelium_size = 2

[0095] self.mycelium_embed=nn.Embedding(mycelium_size,d_model)

[0096] Here, mycelium_size represents the mycelium state category, which can be divided into two categories: normal (n) and abnormal (b). Its encoding structure is the same as that of positional encoding. The mycelium state tensor generated after mycelium state encoding has dimensions [4, 12, 16].

[0097] ③ Add the historical data tensor obtained in step (3) to the position tensor obtained in step ① and the mycelial state tensor obtained in step ② to form the model input tensor with dimensions [4, 12, 16].

[0098] Step (6) Construct a Transformer-based regression prediction model, which includes an encoder, a decoder, and a linear regression layer. Given enc_in = 29, dec_in = 1, d_model = 16, n_heads = 4, activation = 'ReLu', dropout = 0.1, e_layers = 2, d_layers = 1.

[0099] Step (7) involves training the model using 60 hours of historical penicillin fermentation data. The Torch deep learning framework is used, with gradient descent as the optimization algorithm. The initial learning rate is set to 0.004, the training epoch is 64, and the batch size is 4. MSELoss is used to constrain the difference between the actual and predicted penicillin potency values ​​within 30 hours after the phased fermentation. The calculation formula is as follows:

[0100] MSELoss(x i ,y i )=(x i -y i ) 2

[0101] Where, x i y represents the model's predicted value. i x represents the true value during training. i With y i The dimension is 6.

[0102] Figure 2 These are pictures of the mycelial state during the fermentation of penicillin batch #26a. Figure 3 This is a comparison chart of the actual and predicted values ​​of penicillin fermentation potency during the 60-hour fermentation stage test. Figure 4 This is a scatter plot of the actual and predicted values ​​of penicillin fermentation potency during the 60-hour fermentation stage test.

[0103] This invention employs a data-driven method to predict the time series of potency indicators based on online monitoring and offline sampling data from penicillin fermenters. The method predicts the changes in potency indicators over the next n hours based on known time-series information within the current hour (t) of the penicillin fermentation process, where n = any natural number from 1 to 30. Furthermore, to integrate image features of the mycelium in the fermenter, this invention proposes a multi-feature encoding module.

[0104] This invention constructs a phased time series prediction model for penicillin fermentation by combining historical sampling data with image data. It innovatively adopts the Transformer architecture to fully explore the correlation information between dependent and independent variables, as well as the temporal information between the input and output sequences, ensuring the generalization performance of the model and enabling it to predict the changes in potency in the fermenter with relatively high accuracy.

Claims

1. A time-series prediction method for potency indicators in a fermenter during penicillin fermentation, characterized in that, Includes the following steps: (1) Obtain historical data for the corresponding stage; (2) Expand the historical data into time series data and perform max-min normalization; (3) Convert the data obtained in step (2) after the maximum-minimum normalization process into tensors and perform one-dimensional convolution processing; The specific steps to transform the raw data into word vector dimensions include: Step (31) converts the data after max-min normalization into tensor form; Step (32) converts the tensor obtained in step (31) into time series data by expanding the tensor horizontally in time order. Step (33) transforms the tensor obtained in step (32) into a word embedding tensor by using a one-dimensional convolution function, where the number of features is the number of variables. (4) Input the mycelial image data into the pre-trained ResNet50 convolutional neural network image classifier to obtain the mycelial state; (5) Construct a multi-feature coding module, which includes a word embedding coding module, a position coding module, and a mycelial state coding module. The process includes inputting a word embedding tensor, position coding, and mycelial state coding. (51) Positional encoding information: By generating sine and cosine data of different frequencies, these are added to the input sequence data as positional codes, enabling the model to capture the relative positional relationship and absolute positional information between input variables. That is, sine variables are added to even-numbered variable positions, and cosine variables are added to odd-numbered positions before being included in the input sequence data. In the matrix, positional encoding is introduced, and the following two formulas are used for calculation: in, This refers to the absolute position of that moment in the sequence. It is a dimension. , They represent The first position of the encoded vector at position , One component; It is a constant. The size can be adjusted according to the sequence length in time series prediction methods for potency indicators in penicillin fermentation tanks. , The dimension of the word vector; (52) Mycelial state coding information: The classification results obtained in step (4) are coded, and the steps are as follows: (521) Convert the classification results obtained in step (4) into the form of a one-hot matrix; (522) Input the one-hot matrix obtained in step (521) into the word vector encoding function for feature encoding; other parameter settings are the same as those for positional encoding. The matrices are the same; (53) The word embedding tensor obtained in step (3), the position encoding information tensor obtained in method (51), and the mycelial state tensor obtained in method (52) are added together to obtain the model input tensor. (6) Construct a regression prediction model based on Transformer, including a word embedding encoding module, a position encoding module, a mycelial state encoding module, an encoder, a decoder, and a linear regression layer; (7) Model training is performed using data from the three-stage fermentation process of penicillin. By inputting the sequence variables in stages, the changes in potency index in the next n hours are predicted based on the known time series information within the current hour t of the penicillin fermentation process, where n = any natural number from 1 to 30.

2. The time series prediction method for the potency index of a fermenter in a penicillin fermentation process according to claim 1, characterized in that, The historical production data of the penicillin fermenter in step (1), for the start of fermentation, includes online and offline monitored variables: pH, mycelial concentration%, glucose replenishment rate (g / L·hr), residual phenylacetic acid (mg / mL), residual sulfate (mg / mL), phenylacetic acid consumption rate (g / L·hr), ammonia nitrogen consumption rate (g / L·hr), glucose concentration (mg / L), ammonia nitrogen concentration (mg / mL), temperature (°C), flow rate (L / Hr), dissolved oxygen (%), volume (L), tail oxygen (%), tail carbon (%), rotation speed (rpm), cell biomass (g / L), cumulative ammonia volume (kg), defoamer (kg), cumulative sugar solution (kg), tank pressure (MPa), cumulative phenylacetic acid volume (kg), cumulative ammonium sulfate volume (kg), cumulative sodium sulfate volume (kg), conductivity (S·m). -1 Oxygen uptake rate (OUR mmol / L·hr), carbon dioxide release rate (CER mmol / L·hr), respiratory entropy (RQ), and dissolved oxygen coefficient (h⁻¹) -1 For the start of fermentation, the dependent variable is the potency index μ / ml.

3. The time series prediction method for the potency index of a fermenter in a penicillin fermentation process according to claim 2, characterized in that, In step (2), the historical data is expanded into time series data and subjected to max-min normalization. The original data is linearized to the range [0,1], and the following two formulas are used for calculation: ; ; in, This represents the value of the j-th independent variable in the i-th batch. The standardized value, and Let represent the maximum and minimum values ​​of all batches of data for the j-th independent variable, respectively; n represents the total number of batches; and m represents the number of independent variables. This represents the potency index of the i-th batch of penicillin fermentation tank. Standardized value and These represent the highest and lowest potency values ​​for all batches of penicillin fermentation tank potency data, respectively.

4. The time series prediction method for the potency index of a fermenter in a penicillin fermentation process according to claim 1, characterized in that, In step (4), the mycelial image data is input into a pre-trained ResNet50 convolutional neural network image classifier to obtain the mycelial state, specifically including: (41) First, convert the size of the input image to 224. 224 input feature maps; (42) Randomly flip the image obtained in step (41) horizontally; (43) Randomly rotate the image obtained in step (42); (44) Convert the image obtained in step (43) into a tensor and perform normalization; (45) Input the tensor obtained in step (44) into the pre-trained ResNet50 convolutional neural network to classify mycelial state; based on the monitoring time and image scale information, the mycelial state categories can be divided into six categories: n1, n2, n3, b1, b2, b3, where n represents the normal state and b represents the abnormal state.

5. The time series prediction method for the potency index of a fermenter in a penicillin fermentation process according to claim 4, characterized in that, In step (6), a Transformer-based regression prediction model is constructed, and the construction steps are as follows: (61) In the encoder, the obtained input tensor is fed into the multi-head attention mechanism layer. In the multi-head attention mechanism, the obtained input tensor is copied to form three matrices: Q (Query), K (Key), and V (Value). Attention allocation of the input tensor on the time series is achieved through scaling dot product operation, calculated using the following formula: ; in, This is a scaling factor, its function is to counteract the problem of excessively large dot product amplitudes in long sequence problems. The function is an exponentially normalized function, and its calculation process can be obtained through the following formula; ; in Let be the output value of the i-th node, and n be the number of output nodes. The function can transform the output value into a probability distribution in the range [0,1] that sums to 1; ; in, This is a concatenation function used to concatenate h attention heads; ; in, , , These are linear projection matrices corresponding to Q (Query), K (Key), and V (Value), respectively. These are the output projection matrices after scaling and dot product operations; these weight matrices can be iteratively updated during training. Multi-head attention simultaneously focuses on information from different representation subspaces at different locations, which can suppress the instability of single-head attention. In time-series prediction methods for the potency index of penicillin fermentation tanks... ; (62) The tensor obtained in step (61) is passed through an Add layer and a Normalization layer to form an Add&Norm layer, and residual connections are used to allow the network to focus on the differences in the current results. The following formula is used for calculation: ; (63) The tensor obtained in step (62) is passed through a forward-propagating fully connected network layer to enhance the ability to remember deep features and improve the stability of the model. The Add&Norm layer described in step (62) is used for residual connection, and the following formula is used for calculation: ; (64) The tensor obtained in step (63) is fed into the decoder. The construction of the decoder also includes the multi-head attention mechanism in step (61), the residual connection layer of Add&Norm in step (62), and the forward propagation layer in step (63), thereby forming the decoder output tensor. (65) Construct a linear fully connected layer as a regression model, and use the decoder output tensor obtained in step (64) to form a time series output vector through the linear fully connected layer, and calculate it using the following formula: ; in, The decoder output tensor obtained in step (64), This represents the weight matrix of the linear layer. This represents the bias term of the linear layer. This represents the predicted output after regression.