Recurrent Neural Network-based Model Predictive Control for Continuous Pharmaceutical Manufacturing

Wee Chin Wong, Jiali Li, Xiaonan Wang · DOI

Abstract

The pharmaceutical industry has witnessed exponential growth in transforming operations towards continuous manufacturing to effectively achieve increased profitability, reduced waste, and extended product range. Model Predictive Control (MPC) can be applied for enabling this vision, in providing superior regulation of critical quality attributes. For MPC, obtaining a workable model is of fundamental importance, especially in the presence of complex reaction kinetics and process dynamics. Whilst physics-based models are desirable, it is not always practical to obtain one effective and fit-for-purpose model. Instead, within industry, data-driven system-identification approaches have been found to be useful and widely deployed in MPC solutions. In this work, we demonstrated the applicability of Recurrent Neural Networks (RNNs) for MPC applications in continuous pharmaceutical manufacturing. We have shown that RNNs are especially well-suited for modeling dynamical systems due to their mathematical structure and satisfactory closed-loop control performance can be yielded for MPC in continuous pharmaceutical manufacturing.

Introduction

The pharmaceutical industry is currently undergoing a significant paradigm shift from traditional batch processing to continuous manufacturing. This transition is driven by the need for higher efficiency, reduced waste, and more consistent product quality. However, continuous processes introduce complex dynamic behaviors that are notoriously difficult to regulate.

Model Predictive Control (MPC) has emerged as a primary solution for managing these complexities. MPC operates by using a mathematical model of the process to predict future behavior and optimize control actions accordingly. The bottleneck for MPC implementation, however, lies in the model itself. Physics-based "first principles" models are often too complex to derive or too computationally intensive for real-time applications. Meanwhile, standard linear models often fail to capture the non-linearities—such as input multiplicity—common in chemical reactions. This paper explores the use of Recurrent Neural Networks (RNNs) to bridge this gap, providing a data-driven modeling approach that captures complex dynamics without the need for exhaustive physical derivations.

Methodology

RNN Architecture and System Identification

The researchers utilized Long Short-Term Memory (LSTM) networks, a specific type of RNN designed to capture long-term temporal dependencies. Unlike standard feed-forward networks, LSTMs possess a "memory" that makes them uniquely suited for modeling the time-varying nature of chemical reactions.

To identify the system, the researchers trained various RNN configurations, varying the number of layers and nodes. The models were trained to predict the concentrations of chemical species within a reactor based on input variables such as feed flow rate and temperature. The training data was generated by perturbing a simulated system to capture a wide range of operating conditions, including non-linear inflection points.

Control Strategy

The trained RNN was integrated into a Non-linear MPC (NMPC) framework. At each control interval, the system solves a Non-Linear Programming (NLP) problem using Sequential Quadratic Programming (SQP). The goal is to find the optimal sequence of actuator movements that minimizes the deviation between the predicted output and the target set-point. To evaluate the effectiveness of the RNN-MPC, it was benchmarked against a "perfect" NMPC that utilized the actual differential equations of the plant.

Experimental Setup: The CSTR Model

The study focused on a simulated Continuous-Stirred Tank Reactor (CSTR), a staple of chemical engineering. The simulation modeled a reversible reaction chain:

$$A \leftrightarrow R \leftrightarrow S$$

In this system, $R$ is the desired pharmaceutical product, while $S$ is an unwanted byproduct. This specific reaction exhibits "input multiplicity," where the relationship between temperature and yield is non-monotonic (i.e., there is an optimal temperature peak, beyond which yield decreases). This characteristic serves as a rigorous test for any controller's ability to handle non-linear gain changes.

Results and Discussion

Optimal Model Configuration

The study found that the depth of the neural network significantly impacted performance. A 2-layer RNN with 1,000 nodes provided the best balance of accuracy and generalizability, achieving a Root Mean Square Error (RMSE) of 0.0083 on unseen test data. Interestingly, increasing the complexity to three layers led to a decrease in performance, likely due to overfitting and the vanishing gradient problem during training.

Control Performance and Robustness

The 1,000-node RNN-MPC achieved a performance index of 100.0, indicating that its control performance was virtually identical to the benchmark model using the "true" physics of the system. Key observations included:

  • Navigation of Multiplicity: The RNN-MPC successfully navigated the "peak" of the reaction curve, demonstrating an ability to understand when the system's gain changed sign.
  • Upset Recovery: The controller handled "Startup" and "Upset Recovery" scenarios (recovering from sudden system shocks) with rapid, smooth transitions and minimal oscillation.
  • Stability: Even under-fitted models (e.g., 250 nodes) remained stable and reached the target set-point, though they exhibited a slight steady-state offset compared to the larger models.

Conclusion

This research demonstrates that RNNs, specifically LSTMs, are highly effective for modeling and controlling non-linear processes in continuous pharmaceutical manufacturing. By learning directly from process data, these models can match the performance of ideal physics-based controllers while remaining computationally efficient enough for real-time MPC applications.

Future work will focus on scaling this approach to plant-wide control involving multiple interconnected units and testing the framework against more complex, multi-step reaction kinetics. Additionally, investigating methods to reduce the amount of perturbation data required for training will be essential for real-world industrial implementation.

Summary updated

BibTeX
@inproceedings{wong2018recurrent,
  author = {Wee Chin Wong and Jiali Li and Xiaonan Wang},
  title = {{Recurrent Neural Network-based Model Predictive Control for Continuous Pharmaceutical Manufacturing}},
  booktitle = {Mathematics},
  year = {2018},
  doi = {10.3390/math6110242},
}
Figure