A digital twin–driven method for online quality control in process industry

To ensure the stability of product quality and production continuity, quality control is drawing increasing attention from the process industry. However, current methods cannot meet requirements with regard to time series data, high coupling parameters, delayed data acquisition, and ambiguous operation control. A digital twin–driven (DTD) method is proposed for real-time monitoring, evaluation, and optimization of process parameters that are strongly related to product quality. Based on a process simulation model, production status information and quality related data are obtained. Combined with an improved genetic algorithm (GA), a time sequential prediction model of bidirectional gated recurrent unit (bi-GRU) with attention mechanism (AM) is built to flexibly allocate parameter weights, accurately predict product quality, timely evaluate technical process, and rapidly generate optimized control plans. A typical case study and relevant field tests from the process industry are presented to prove the effectiveness of the method. Results indicate that the proposed method clearly outperforms its competitors.


Introduction
Process industries are those that add value to raw materials by mixing, separating, heating, molding, or chemical reactions. Production of process industries is generally continuous or in batch and requires strict process control as well as safety measures. Featuring relatively fixed process, high energy consuming, few product specifications, and large production scale, the process industry mainly covers petroleum, chemical, metallurgy, food, pharmaceutical, optical fiber, cement, etc. [1].
Product quality is one of the two most crucial issues in modern industry [2]. The process industry is even more urgently in need of research about product quality control than others. Technical processes in process industries are typically continuous and irreversible, inevitably leading to quality problem accumulation [3]. Given large-scale production, frequent quality issues can dramatically increase the total cost of a factory. In some extreme cases, there may be catastrophic losses such as equipment damage, environmental pollution or even casualties [4].
Compared to the discrete industry, main obstacles to achieving quality control in the process industry include the following: (1) Accompanied by multiple physical and chemical reactions, ingredients and attributes of raw materials during production are changeable and unpredictable. As a result, it is hard to describe the whole process with precise mathematical models. (2) Processing environment is often extreme conditions such as high temperature and high pressure [5]. It enhances the difficulty for existing sensors to timely and accurately measure quality data [6]. (3) Highly coupled technical parameters turn quality control into a multi-scale, multiprocess, and multi-objective dynamic conflicting optimization. (4) Setting and adjustment of parameters still heavily rely on past experience [7]. Different operator proficiency levels and unforeseen accidental errors may exert considerable influences on product quality consistency. (5) Quality problems tend to accumulate during continuous production, but technologists are impossible to conduct quality tests all the time. In summary, research on online quality control in the process industry is an important way to achieve goals of increasing yields, shortening processing time, reducing costs, ensuring high product quality, and protecting the safety of equipment and personnel.
With the deepening of quality control research, related models and processes have been improved. And yet, current methods are still poor in timeliness and intelligence, leading to a lack of predictability, instant feedback, and decision-making capability in quality data. Application and technical requirements of modern manufacturing technologies are constantly rising in various fields. In consequence, online control and effective improvement of product quality become a problem demanding prompt solution. A digital twin-driven method is proposed for online quality control, aiming to monitor technical process in real time, reduce human intervention, raise product quality, and ensure its stability.
In comparison with existing studies, main contributions of this paper are as follows: (1) Combining mechanism model and data model, the digital twin technology based on a process simulation model is applied in the process industry to effectively guarantee the product quality. (2) Widely used in natural language processing and image recognition, AM is herein transferred to industrial fields and incorporated with a bi-directional GRU model to simultaneously learn historical and future data, achieving product quality prediction in real time. (3) An improved GA with six improvements is proposed to adjust current operation conditions according to prediction results. Optimized process parameters are tested in the virtual space to prove the feasibility of control scheme. With the introduction of operation adjustment guidance into the physical space, the online product quality control is implemented.
The remainder of this paper is organized as follows. Research about quality control in process industries and applications of digital twin are reviewed in Sect. 2. Section 3 details the theoretical frame of the proposed DTD online quality control. Operation mechanism and implementation procedure of the proposed method are reported in Sect. 4. In Sect. 5, a case about optical fiber preform drawing process is presented for validation, and Sect. 6 draws concluding remarks.

Quality control in process industries
There are currently four main ideas for product quality control in the process industry: (1) to replace hardware instruments or assist in offline analysis with soft sensors [8], and use empirical control to obtain optimized process parameters; (2) to identify abnormal fluctuations in the production through various improved control charts to guarantee product quality [9]; (3) to acquire the relationship between process parameters and product quality [10] through association rule mining or field tests, use intelligent optimization algorithms to help compile or adjust rules, and achieve the optimization of product quality; and (4) the mixed use of above methods.
Universally used in process monitoring and fault diagnosis, a soft sensor is the association of a sensor with an estimation algorithm, which makes online measurements of certain process variables possible [11]. Soft sensors are generally divided into two types, model-driven and datadriven. The former is commonly derived from the first principle model. But it is hard to be extensively used on account of complicated processes and unquantifiable parametric relationships. The most popular modeling techniques for data-driven soft sensors include principal component regression (PCR) [12,13], partial least squares (PLS) [14,15], artificial neural networks (ANN) [16,17], and support vector machines (SVM) [18,19]. Wang et al. [20] integrated random forest with Bayesian optimization to predict and maintain product quality and validated model superiorities through semiconductor production line data. Li et al. [21] presented a distributed SVM-based soft sensor to online measure the digested slurry quality and optimized the raw material proportioning through expert knowledge. The drawback of soft sensor method is that optimization or adjustment of parameters is highly dependent on process background knowledge and universally short of effect verification.
Control charts are powerful tools by plotting statistics computed from a random process sample, frequently used to monitor production, detect unusual variation, and help technicists quickly response [22]. Chen and Yu [23] built a recurrent neural network model to characterize variables at time lags in process industries and developed a residual control chart to detect mean shifts in autocorrelated processes. For multi-stage manufacturing processes, Keshavarz et al. [24] proposed a cumulative sum control chart and an exponentially weighted moving average control chart to monitor quality variables in terms of effective covariates. Nonetheless, the establishment and various self-adaptive improvements of control charts are largely derived from process models and data features of specific industries. The strong particularity may result in the poor reproduction ability in other fields.
Intelligent optimization algorithm is a kind of random search evolution algorithm. Lee et al. [25] utilized the hybridization of fuzzy association rule mining and variablelength slippery GA to determine process parameter settings and improve finished quality of garment manufacturing.
Kramar and Cica [26] developed a particle swarm optimization based fuzzy expert system to predict mechanical properties of molded parts, obtained optimal process parameters, and effectively improved the injection molding quality. However, the association rules used to set relevant parameters in the optimization process are mostly on the strength of the historical data analysis, making it hard to guide quality prediction in time and later process decision-making.

Digital twin
The concept of digital twin was first introduced by Grieves around 2003 during his presentation, who regarded it as a conceptual idea for product lifecycle management [27]. Until 2010, the term "digital twin" was formally proposed in NASA's technical reports and the technology was intensively applied in aerospace fields thereafter. In recent years, with the advancement of big data processing and analysis capability, cloud computing technology [28], artificial intelligence technology [29], simulation modeling theory [30], optimization algorithm [31], as well as availability of massive industrial data, digital twin technology has been developed and widely used in both academia and industry [32].
Tao et al. [33] described digital twin as an interdisciplinary technique, which makes full use of models, data, and intelligence to serve as a bridge connecting physical world and information world, providing more real-time, efficient, and comprehensive services. It shows outstanding performances in condition monitoring [34,35], behavior evaluation [36,37], control guidance [38,39], and overall optimization during the entire life cycle [40,41] of a component, a product or a system. A digital twin system can realize parallel operation, realtime interaction, and iterative optimization of industrial entities and virtual twins. Accurate prediction and adjustment, self-organizing and optimized scheduling, equipment lifecycle management, product quality traceability, and control are achieved. It greatly improves production quality and efficiency, and further, promotes the rapid development of the process industry. With digital twin technology, He et al. [42] developed an adaptive subspace identification method to implement optimal control of process systems, thereby ensuring stability and controllability of product quality with device abnormalities. Lee et al. [43] studied cyber-physical production systems in metal castings, updated production status in real time through quality inspection model, and revised production plans according to a defect rate alarm. In the ore waste phosphorus processing, Dli et al. [44] combined process mechanism model and deep neural network model to construct a digital twin model for product quality control and energy consumption optimization.
To conclude, digital twin technology provides a new idea for the online control of product quality in the process industry, but there are few related studies at present. This paper combines digital twin and artificial neural network to online monitor production and predict product quality. Optimized parameters are obtained from the improved intelligent optimization algorithm, validated in simulation models and fed back to physical systems. Production process and product quality are therefore kept stable.

Theoretical framework for DTD online quality control
This research aims to apply digital twin technology to online product quality control in the process industry. The theoretical framework for DTD online quality control is established based on physical-virtual mapping, production information processing, and fused quality-related data. As shown in Fig. 1, the framework comprises physical production system, virtual production system, central control system, twin data, and mechanism library. Every system is equipped with multiple open interfaces for digitization, automation, and visualization. Good compatibility and scalability, along with a set of standard communication and conversion devices, facilitate perceptual access and efficient integration of multi-source heterogeneous data.

Physical production system
The physical production system is an on-site production center composed of equipment, operators, environment and processing objects, responsible for receiving production tasks from the central control system and executing production activities. Detailed production instructions are predefined according to the simulation and the optimization in the virtual production system. Benefit from the widespread intelligent perception system, mass data during the production can be collected in real time [45]. Working conditions, therefore, are monitored dynamically, evaluated timely and adjusted precisely. Compared with traditional production centered on human decision-making, the physical production system possesses a better flexibility, adaptability, robustness, and intelligence.

Virtual production system
The virtual production system is a vivid mapping of the physical production system according to physical description and behavioral expression of production elements. The mechanism model is used for decoupling analysis of the relationship between variables and indicators to guide the simulation model construction. The data model is built from filtered and stored historical processing data to support product quality control. Main functions of the system are as follows: reasonable abstraction of production process, conditions idealization of physical entity attributes, precise setting of process parameters, simulation and visualization of the physical production system, and verification and evaluation of process parameter combination provided by the central control system. In summary, before the production, the virtual production system simulates and analyzes production plans to identify potential risks. During the production, it realistically displays sequence, concurrency, and connectivity of production activities. At the end of the production, plenty of product quality-related data will be generated to feed back the central control system to decide whether to retain or revise production plans.

Central control system
As the core of the production digital twin, the central control system directly determines degree of intelligence and precision of quality control. The system involves four parts: (1) Data acquisition and processing system. With precise control of working conditions, timely transmission of production status data, and seamless connection of networks, an information center is constructed. It is composed of network facilities, terminal equipment, and application softwares, in support of production monitoring and management. (2) Two-way mapping physical-virtual production system. The virtual system simulates elements, behaviors, and rules in Fig. 1 Theoreticalframework for DTD online quality control the physical system so as to truly reproduce it. On the contrary, the physical system follows simulated and validated production plans in the virtual system. Two systems interact in real time to grasp changes and make responds dynamically, thereby continuously optimizing production process.
(3) Product quality prediction system. Historical data constitute a working condition library to make preliminary judgments of current status. The product quality is further predicted based on collected data from the past and the future. (4) Dynamic parameter optimization system. Adjustments are carried out in terms of the difference between predicted results and tolerance requirements. The data representing working condition at the previous moment are used as the input of optimization algorithm at the next moment. Sequentially, optimal results are verified iteratively in the virtual production system until suitable for actual operations. In general, the central control system is responsible for providing system support and services for real-time control driven by product quality twin data.

Quality control twin data
The quality control twin data is the collection of data generated and transferred in systems, which directly or indirectly determines final product quality. Twin data mainly include (1) design data, technological data, and process data predefined according to production plans before everything starts; (2) real-time collected data mainly about environmental conditions, object attributes, equipment status, and production progress; (3) virtual simulation data mainly including driving data, model data, prediction data, analysis data, and decision data; (4) fused data from integration, counting, correlation, clustering, evolution, regression, and generalization of real-time collected data and virtual simulation data; and (5) historical data acquired in past technical processes. Overall, twin data provide a data collection and sharing platform for the production [46], eliminating information islands. With integration and fusion, twin data keep updating and expanding, which serves as the driven force to achieve the normal operation of all constituent systems as well as pairwise interactions.

Mechanism library
The mechanism library is responsible for unified management, explanation, and adjustment of various trigger, interaction, and control modes during the system operation. Its main components include mapping rule, information communication mechanism, feedback transmission mode, and twin data fusion form between systems. The mechanism library formulates operating rules of the entire digital twin system according to actual needs and ensures its smooth and efficient operation.

System operation process
The flow chart of system operation is shown in Fig. 2. After production tasks are released, the central control system will automatically generate production plans. The virtual production system will simulate and evaluate the production plan in advance to ensure its feasibility and introduce it into the physical production system. Technicians operate equipment to launch the production. The physical and the virtual production systems come into operation and constantly interact with each other, while the data generated from systems keep flowing. Both real-time collected data and simulation data will be integrated and stored in the central control system. Before then, there is a filtering and verification step to precheck that these data are within normal parameter ranges. All the data related to quality control will be imported into the product quality prediction system to assist the central control system in prediction and decision-making. If predicted results meet tolerance requirements, it is decided on account of production progress data to end or continue the production. Otherwise, the dynamic optimization system is actuated. Similarly, optimized and adjusted parameters will be simulated and evaluated in the virtual production system beforehand, and, if feasible, imported into the physical production system to guide operations. The physical and the virtual production systems are still able to resume synchronization and keep interaction after adjustments. To update and optimize the working condition library, the adjusted data will be retained in place of the original.
During the whole process, aforementioned procedures will be implemented iteratively until the central control system declares that predicted results meet tolerance requirements and announces the completion of the production task.
Finally, the physical and the virtual production system will further perform the data processing with integration, supplement, replacement, and analysis so as to feed back the central control system to follow or amend production plans. The feedback can perfect the process design, thus enabling the digital twin system to maintain self-learning and self-optimization.

Real-time data acquisition
A huge amount of real-time industrial data related to product quality serve as a fundamental resource for evaluating the completion of processing tasks. Data perception and processing are critical steps to obtain effective product quality-related data [47].
As shown in Fig. 3, real-time data acquisition of industrial process contains four layers: physical entity, data transmission, data processing, and data sensing. First of all, a complete sensor system that matches production, monitoring, and logistics equipment is deployed. The sensor network provides hardware support for data collection. Through Wi-Fi, Bluetooth, mobile network, communication protocols (Modbus, TCP/IP), and industrial Internet (Ethernet, Passive Optical Network), the data transmission can be stable and efficient with a low loss. Multi-source heterogeneous data undergoes operations such as conversion, classification, analysis, calculation, and fusion, and will eventually transforms to effective and usable sources available for quality prediction and production decision-making. The information in the sensed data mainly contains size (length, width, height), material (solid, liquid, gas), state (deformation, phase change), and attribute (batch, number, requirement) of processed objects; operation-related information, such as process (sequence, position, time), parameter (velocity, current, voltage), and progress (start, downtime, abnormal); environment description, such as temperature, humidity, and pressure intensity; and energy consumption condition, such as electricity, coal, and water.

Process simulation model
As a basis of digital twin, a complete process simulation model should involve the following contents: qualitative analysis, parameter import, attribute configuration, and visual interface. Figure 4 shows system architecture of a finite element simulation model for glass hot forming, a typical technical process of the process industry.

Qualitative analysis
According to technical processes and simulation requirements, the first step is to determine whether to conduct stationary or time-dependent research, and model dimensionality. Then, boundary coordinate system, possible processing domains, and different deformation effects are to be defined. The most decisive step is to choose suitable physics interfaces required for the simulation and to solve cyclic coupling problems that may arise between different physical fields.

Parameter import
Parameters to import models mainly include geometric parameters, mainly consisting of original and expected object dimensions, main reaction areas, contact positions of machine and object, special monitoring points, and other elements; material parameters, such as density, dynamic viscosity, thermal conductivity, specific heat rate, constant pressure heat capacity, surface emission rate, surface tension coefficient, and Poisson's ratio; process parameters, mainly referred to time series of parameters that directly affect product quality; environment parameters, such as ambient temperature, humidity, and atmospheric pressure; and default parameters, defined according to different scenarios and process variables.

Attribute configuration
A basic idea of finite element simulation is to merge individual properties of many tiny elements to form overall object properties, which relies much on meshes. Division, attribute definition, and mutual coordination of meshes are the most significant guarantee for accuracy and timeliness of the entire simulation process. The design of simulation steps also plays a critical role. Besides, detailed solver configuration should be carried out, including equation compilations, dependent variable settings, and special parameter settings.

Visual interface
To control technical process and product quality in realtime, a complete visual interface is indispensable. For one thing, visual displays demand high-fidelity simulation of processes, which is used to assist technicists to observe processing, test the effectiveness of optimization control instructions, and obtain change trends of key technical indicators. For another, a user-friendly interface is required to quickly adjust process parameters, feedback simulation information timely, evaluate simulation results, and write other instructions. In order to support construction and operation of digital twin, the visual interface should also display the real-time processing status of the physical production system connected with a specific interface.

Gated recurrent unit
Continuous production of the process industry generates massive time series data. Recurrent neural network (RNN) is a deep model used to learn programs that mix sequential and parallel information [48]. Its basic recurrent units are chained and recursed according to sequence output time. Input parameters are shared, and historical data are memorized among units. Therefore, it is suitable to learn nonlinear features implicit in the input sequence.
However, an excessively deep network leads to problems like gradient explosion and gradient disappearance and thus has difficulty in accurately describing current state. To solve the problem, long short-term memory (LSTM) [49], as an improved algorithm of RNN, is proposed. A typical LSTM model is composed of input gate, output gate, and forget gate. Instead of updating weights with continuous multiplication in RNN, LSTM models adopt continuous addition, avoiding gradient disappearance theoretically. The gradient explosion problem is also settled with gradient clipping. Besides, with more computing units in hidden layers, the nonlinear feature processing capability of LSTM is greatly enhanced. Faced with time series characterized by long time spans, intervals, and delays, it is capable of collecting scattered feature information and compensating insufficient long-term memory ability of RNN.
Similarly, if the time span is too long or the network is too deep, LSTM also performs poorly with huge computation amount and time consuming. An improved variant of LSTM, gated recurrent unit (GRU) [50], is then studied and put into application. GRU model merges input gate and forget gate in original LSTM units into update gate, changes output gate to reset gate, and puts unit state into hidden layer state. It can not only selectively memorize the key information and periodically forget the useless, but also keep a simpler structure than LSTM models. When processing the same data, GRU models use fewer units and faster time under the premise of ensuring accuracy, which saves considerable resources especially when dealing with large-scale data. The structure of GRU is shown in Fig. 5.
where x t is input at time t, h t and h t−1 are hidden states at time t and t − 1, r t and z t are outputs of reset gate and update gate, and r t , z t ∈ [0, 1] D where D is input dimension; ∼ h t is candidate current state; red circle is sigmoid function; blue circle is hyperbolic tangent function; black circles are element-wise multiplication, element-wise addition, and subtraction of previous number from 1.
The reset gate determines how to combine new input information with previous memories, which comprises h t−1 and x t . The update gate controls how much information from the previous hidden state will carry over to the current hidden state.
Candidate current state is expressed as Hidden states at time t is expressed as where U and W are weight matrices and b is bias, which are parameters to be learned. When z t = 0 and r t = 1, GRU network degenerates to a simple RNN. When z t = 0 and r t = 0, current hidden state h t is only related to current input x t and irrelated to previous hidden state h t−1 . When z t = 1, current hidden state h t equals previous hidden state h t−1 and has nothing to do with current input x t .

Attention mechanism
In view of inherent characteristics of the process industry, unpredictable conditions, such as machine starting or shutdown, parameter adjustment, raw material changes, and plan reschedule, arise inevitably during the production. Under different circumstances, degree of parameter influences on product quality is not exactly the same. If influencing weights are not adaptively redistributed according to different sources of change, it is hard to accurately predict product quality. About this issue, attention mechanism (AM) is introduced [51].
Attention mechanism originates from human brain simulation. As a resource allocation method, it helps to utilize limited computing resources to process more important information, thereby improving efficiency of neural networks. Generally, input information can be expressed in a key-value pair format, where "key" is used to calculate attention distribution, namely, the probability of each input vector being selected, while "value" is used to calculate aggregate information. It is necessary to determine a prediction task-related representation called query vector, and use a scoring function to calculate the similarity between each input vector and query vector. Figure 6 shows steps for obtaining attention values.
The input information with N sets of key-value pair at time t is expressed as Step 1: Calculating the similarity between key k tn and query vector q through scoring function to obtain the correlation between input feature and product quality at the current moment. The attention score is based on input feature x tn at the current moment, hidden state h t−1 , and feature attention weight t−1,n at the previous moment. Scaled dot product model is used to solve large variance in high dimensional situations.
Step 2: Using softmax formula to convert the correlation into a probability form. The probability that the nth feature is selected at time t is Step 3: Each probability value is multiplied with the implicit representation of the corresponding feature to quantified its contribution to predicted product quality. The sum of contributions of all input features is the input of quality prediction. The predicted input after AM weight redistribution is where D is key dimension in the input information; z is attention variable, used to represent the index position of the selected feature.

Bidirectional gated recurrent unit with attention mechanism
The information in GRU network is transmitted in one direction from front to back, while Bi-GRU can consider both the past and the future data information. The same output is connected to two GRU networks with opposite time flow.

Fig. 5 GRU structure
The forward GRU is responsible for sequential training to obtain the past data information. The backward GRU performs reverse training to learn features in the future data. At each moment t, hidden state h t of bidirectional GRU is jointly determined by forward and backward hidden states. Forward and backward hidden states are respectively

Current hidden state is
where ������ ⃗ h t+1 , ⃖������ h t−1 are forward state output of moment t + 1 and backward state output of moment t − 1; �� ⃗ h t , ⃖�� h t are forward state output and backward state output at moment t of Bi-GRU network. The model structure of Bi-GRU with AM is shown in Fig. 7: Time sequential quality influencing features, as initial inputs, first go through a series of calculations in attention mechanism. New features, with weights redistributed, then enter Bi-GRU model after vectorization operation. The bidirectional network acquires both the past and the future information of input sequences. At each single moment, forward and backward hidden states are concatenated to form hidden state at the current moment. And further, the predicted quality value sequence is obtained.

Parameter optimization model
Genetic algorithm (GA) is an efficient heuristic search algorithm developed from genetic evolution of natural populations. Simulating evolutionary phenomenon of the survival of the fittest [52], it maps search space, namely, solution space of problems, into a genetic space, and encodes possible solutions into vectors called a chromosome group. More specifically, a series of initial code strings are randomly generated to form an initial group. Genetic operations are repeatedly performed on previous populations, thereby continuously generating new populations. Each chromosome is evaluated according to fitness value of objective function. The optimal solution that meets requirements under the global parallel search is selected. Genetic algorithm has universality to solve multi-domain problems, simplicity of avoiding derivation or differentiation of objective functions, parallelism for simultaneous comparison of multiple individuals, and scalability for combination with other algorithms.

Standard genetic algorithm
For the optimization of product quality related parameters in the process industry, the differences between actual results and target quality indicators are used as objective function values. Given some measurable parameters and empirical parameter ranges obtained from historical quality data, an optimized combination of process parameters is generated. Basic steps of genetic algorithm are shown below.
Step 1: Objective function and solution set determination. The objective function is preset according to actual needs. The form of solution sets and the effective range of parameters are obtained.
Step 2: Parameter set coding. The solution set to the problem is converted into a chromosome form with a certain coding scheme such as binary or real number coding.
Step 3: Control parameter setting and population initialization. Set key parameters (population size, genetic operation probability, maximum genetic generation, optimization operator, etc.) and randomly generate a series of initial code strings to form the initial population.
Step 4: Population evaluation. Parameter combination after bit string decoding is regarded as individual phenotype, from which objective function values are calculated and mapped to fitness values under certain rules. The fitness of individuals, that is, the ability to adapt to the environment, is then assessed according to the value.
Step 5: Selection operation. The fitness is used as evaluation index to select more adaptable individuals in populations. The greater the fitness value, the greater the probability of individuals being selected. Common selection operators include roulette wheel selection, stochastic tournament, excepted value selection, etc.
Step 6: Crossover operation. Two chromosomes are randomly selected from populations. With one or more crossover points chosen, corresponding genes are exchanged with a certain probability to form a new chromosome.
Step 7: Mutation operation. Caused by some accidental factors, one or a few genes are changed with a certain mutation probability, thus forming a new chromosome.
Step 8: Termination judgment. All populations will be judged by certain rules, on the basis of which it is decided whether the algorithm should stop.

Improved genetic algorithm
Standard genetic algorithm encounters problems in practical applications: (1) Limited by search ability to new spaces, it is easy to converge to a local optimal solution. (2) Related parameters of genetic operators are set fixed, which may cause a slow convergence. (3) Once best individuals are not inherited and genetic operations fail to produce better individuals, genetic degradation and global optimization ability deterioration tend to occur. (4) With the random optimization inherent, GA is often poor in stability and lacking in screening criteria when multiple optimizations are performed. In response to above problems, this paper proposes an improved genetic algorithm. The structure is shown in Fig. 8 below. Steps of standard genetic algorithm are in green box, while six improvements are in blue file box. Improvement 1: Adaptive crossover rules. The greater the crossover rate, the larger the search space of algorithm and the faster the rate of generating new individuals. At the same time, the possibility of good individuals being destroyed increases. If the crossover rate is too small, it is difficult to generate new individuals and the search process becomes slower. A sigmoid-type function is chosen to describe the adaptive crossover, purposefully imposing a rather high crossover rate to individuals with fitness lower than the average to provide a great search space, and gradually reducing the rate to maintain the inheritance of good individuals as the fitness tends to the maximum. The relevant formulas are as follows: where P c , P cmax , and P cmin are crossover rate, maximum crossover rate, and minimum crossover rate, respectively; f max and f avg are maximum individual fitness and average individual fitness of the population; f c is the larger fitness of two individuals to be crossed; 1 is a smoothing parameter that adjusts smoothness of the curve. The adaptive crossover rate curve is shown in Fig. 9. Improvement 2: Adaptive mutation rules. The purpose of introducing mutation in GA is twofold: to possess GA of local random search ability and to maintain group diversity. The greater the mutation rate, the higher the population diversity. But if the mutation rate is too large, the algorithm will become a completely random search algorithm that is unconstrained and difficult to converge. If the rate is too small, the population diversity is limited and the algorithm search space will shrink accordingly. In the early stage of population evolution and in the process of population individual fitness tending to the maximum, it should be ensured that the mutation rate is controlled at a low level but greater than 0 to avoid destroying good individuals. When the individual fitness of the population is close to the average, the rate should be adjusted to reach the maximum to avoid the algorithm falling into local optimal solutions. A function similar to the normal distribution is chosen to describe the adaptive mutation. The relevant formula is as follows: where P m , P mmax , and P mmin are mutation rate, maximum mutation rate, and minimum mutation rate, respectively; f m is fitness of individual to mutate; and 2 is a height parameter of the curve. The adaptive mutation rate curve is shown in Fig. 10. Adaptive crossover curve Fig. 10 Adaptive mutation curve Improvement 3: Mechanism of eliminating dead and replenishing new individuals. The probability of an individual being selected is positively related to its fitness value. But once the best fitness individual in parent populations is not inherited and crossover or mutation fails to produce a better individual, genetic degradation tends to appear. BestFitness is used to judge whether degradation occurs. Dead individuals are those whose fitness is lower than the average. If BestFitness( n + 1) < BestFitness(n), it indicates that contemporary genetic operations fail to produce better individuals. The elimination mechanism of dead individuals is activated to reduce the probability of genetic degradation. Furthermore, the same number of new individuals is randomly generated to supplement populations in the meanwhile. The replenishing mechanism not only retains current good individuals, but also increases population diversity, expanding search space and enhancing global optimization capability of GA. Improvement 4: Mechanism of genetic result monitoring. To ensure the optimal genetic result during the whole optimization process, best individuals and their fitness in generations, recorded as BestChrom and BestFitness, are monitored and updated specifically. Accordingly, genetic results are recorded as FinalChrom and FinalFitness. If final genetic individual is not optimal, that is, FinalFitness < BestFitness, then BestChrom will replace FinalChrom as the final result. Improvement 5: Mechanism of convergence rate management. In order to avoid slow convergence when optimal individuals appear, the algorithm convergence rate should be systematically controlled. On the one hand, with the increase of generations, the variation magnitude of component values in optimized parameter set should gradually decrease. On the other hand, a threshold for the number of optimal individuals should be set, which helps to flexibly reduce crossover rate and mutation rate when the number of good individuals in the population is significantly lower than expectation. Both measures make sure that good individuals are preserved and the algorithm converges as soon as possible. Improvement 6: Parameter set correlation degree calculation rules. When selecting parameter sets after multiple optimizations, a comprehensive judgment is made based on the correlation degree between each set and initial set, in combination with the change trend of each component value. The relevant formula is as follows: where P cd is correlation degree, N is input dimension of parameter set, � ⃗ P i is initial parameter set to be adjusted, and � ⃗ P i ′ is optimized set. Above improvements solve inherent problems of GA: (1) In each generation, when the individual fitness is close to the average, adaptive crossover and mutation rates tend to maximize, avoiding premature convergence and local stagnation.
(2) As generation increases, the variation magnitude of parameters and the rate of crossover and mutation are reduced to protect good individuals and prevent slow convergence, especially when there are few optimal individuals.
(3) The dead individual elimination mechanism increases the probability of good individuals being selected for inheritance. The genetic result monitoring mechanism ensures that the best individual in multiple generations is selected as the optimization result. The new individual replenishing mechanism keeps good individuals and improves the population diversity. The joint action avoids genetic degradation and global optimization ability deterioration. (4) The calculation and the comparison of parameter sets contribute to find the most suitable parameter combination for current state control and adjustment, settling the poor stability of GA for random optimization.

Case background
To validate the effectiveness of the proposed DTD online quality control method, the process data from optical fiber drawing process in an optical fiber manufacturer are obtained. Optical fiber preform is a high-purity silica glass rod with a specific refractive index profile, diameter ranging from tens of millimeters to hundreds of millimeters. The internal structure of optical fibers is formed in preforms. The drawing process of optical fiber preform is a heat rheology process in which quartz glass rod is elongated as a whole due to differential stretching of the top and the end in a high-temperature molten state. With characteristics of large batch, continuous and irreversible, it is typical of the process industry. The validation process of the DTD method includes three aspects: (1) Digital twin system. The process simulation model should be able to provide production status information, quality-related data and parameter adjustment results. A physical-virtual production system is required to assist technologists in production monitoring, parameter trial adjustment, and processing instruction evaluation. (2) Product quality prediction model. Based on the principle of control variates, the developed model, with the same data set, is compared with similar models in prediction accuracy and speed. The superiority of GRU, bidirectional model, and attention mechanism is thus demonstrated. (3) Parameter optimization algorithm. Field tests are carried out to compare the product quality. The average rod diameter after drawing, the smoothness of rod surfaces, and the utilization rate of raw materials are chosen to comprehensively illustrate the effect of the improved GA. Figure 11 shows the drawing process of optical fiber preform. The preform is clamped by rods and chucks on the top and the bottom. The upper end is fed into the hot zone at a feeding speed while the lower end is quickly pulled away at a drawing speed to prevent the material from being piled up. During the process, the preform in the hot zone will be elongated in a softened state. Since it is not resistant to high temperatures of thousands of degrees Celsius, the laser diameter gauge is placed in the lower position outside the hot zone. Inevitably, this also causes the rod diameter after drawing cannot be detected in time. The rod keeps rotating at a constant speed to ensure that the center of gravity does not deviate. Given the confidentiality of the process, related pictures are not the most updated.

Analysis of production process
In the practical production, initial preform diameter, temperature, feeding speed, and drawing speed are the four most crucial factors that determine final diameter of preform after drawing. The final diameter is a direct quantitative indicator of product quality. Therefore, establishing the nonlinear relationship between these factors and the final diameter is critical for product quality control.

Construction of simulation model
The drawing of optical fiber preform features considerably large size variation, temperature span, property change, and multiphysics coupling. Simulation modeling ideas are presented in Fig. 12. First of all, general idea of finite element analysis is to divide model into meshes. Properties of individuals accumulate to reflect overall properties. The large-scale deformation of preform brings about distortion of finite element model meshes, which can be resolved by moving mesh technology embedded in the simulation software, COMSOL Multiphysics. Secondly, material properties of preform also vary greatly, which are indicated by phase change behaviors. Among them, internal friction coefficient that characterizes viscosity of liquid or gas, dynamic viscosity, describes the special temperature-dependent viscoelasticity. It is foreseeable that there will be no excessive flow of material or obvious stratification, not to mention sliding or mixing between adjacent flow layers. Therefore, the laminar flow module is suitable. Combined with the flow field module coupled with moving mesh technology, the simulation process is included in the category of fluid dynamics. Finally, in view of the high-temperature reaction achieved by radioactive heat transfer of graphite furnace, the solid heat transfer module is chosen.
In summary, drawing process of preform is described as a multi-physics coupling non-isothermal fluid field, with laminar flow as structure field and heat transfer in fluids and solids as temperature field. In order to reduce simulation time, the originally three-dimensional process is simplified to a two-dimensional axisymmetric problem.

Two-way mapping physical-virtual production system
In order to facilitate practical application, based on the APP developer embedded in COMSOL Multiphysics software, a physical-virtual production system is built. Part of interface display is shown in Fig. 13. The system contains modules of home tab, parameter input, and result visualization. The home tab includes functions such as opening files, resetting all inputs, drawing and updating geometry, establishing meshes, calculating and drawing post-processing results, and viewing simulation process and help documents. Parameter input section involves edit boxes and table values, manual enter or file import, of material parameters (temperature independent/dependent) and technical parameters (dimension/processing). Result visualization consists of geometry/mesh, multidimensional plotting, real-time monitoring, and solution state.
In addition to real-time monitoring and comparison of physical production and virtual simulation processing, the system can also support functions such as viewing relevant plotting of selected items, dragging time progress bar to trace production details, checking property values of chosen points, and observing differences when adjusting parameters. So far, parameters available to online observation have covered necking comparison, tension change trends of feeding and drawing zones, cross section pressure, flow velocity and temperature distribution of preform, etc. After comparison with on-site production data, values and change trends of key process parameters are consistent with actual situations. The physical-virtual production system is capable of displaying the production process, evaluating the production status and providing the product quality related date.

Prediction performance
The experimental data contains the complete drawing process of 980 pieces (each corresponds to a data table) of preform at the production site. Each table contains 3000 to 4000 pieces of data recorded every second, and one single piece of data contains 15 dimensions of data including time, temperature, power, feeding speed, drawing speed, and rotation speed. The total amount of data exceeds 50 million. To obtain valid input data, raw data cleaning is necessary to address acquisition errors and insufficiency, and therefore influences the timely feedback. In this work, methods such as interpolation and normalization are adopted to ensure availability and accuracy of data. In the future, continuous improvement of industrial sensor systems and more efficient algorithms of data processing will be able to better solve such problems.
With partial data divided into the training set and the test set, the bi-GRU with AM model is constructed and evaluated. RNN, bi-RNN, LSTM, bi-LSTM, GRU, and bi-GRU are selected as comparison models. As for each model, mean square error (MSE), root-mean-square error(RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), R 2 , adjusted R 2 , and processing time are chosen to comprehensively judge its performance. Relevant formulas are as follows: where n is sample size, k is number of variables, and y i , ŷ i , y avg are test value, predicted value, and average value, respectively. The prediction performance comparison results are shown in Table 1.
According to the table, (1) under the premise of same conditions and data set, except for the time complexity, the proposed bi-GRU with AM model (No. 7) has better fitting and predictive capabilities than others. Specific indicators are MSE = 0.032, RMSE = 0.179, MAE = 0.095, MAPE = 0.171, R 2 = 0.952, adjusted R 2 = 0.913, and time = 16.535 s. In general, the proposed model achieves a quite small regression error (MSE, RMSE, MAE, MAPE) and a high interpretability of predicted dependent variables (R 2 ), which can also be described as the closeness to baseline models developed by mean values. Taken the number of variables into consideration (adjusted R 2 ), the overall trend keeps unchanged and the performance is maintained at a high level (0.913). (2) 6), although the time is obviously longer, bidirectional models outperform traditional ones in all other aspects, which apparently indicates that bidirectional models are able to gather information from the past and the future to assure the predictive accuracy. For models with or without AM (No. 6 and No. 7), it reveals a remarkable improvement with the weight redistribution by AM, and the increase in prediction time is also acceptable (1.224 s).

Optimization performance
To further validate the effect of parameter optimization algorithm, the DTD method for online quality control is compared with current control method, which empirically depends on rough assessment and adjustment of key parameters. Relevant field tests were carried out. Since it is impossible to apply two sets of processing plans on the same rod, six preform rods from the same batch which have very similar properties were selected and divided into two groups of three rods, with traditional and the proposed DTD processing plans applied respectively. Results are shown in Fig. 14.
The following conclusions can be drawn from processing curves of six preform rods to compare effects of the proposed DTD method and the traditional method: (1) The DTD method reaches available portion of meeting tolerance requirements earlier than the traditional method, which indicates that ratio of available rod length, that is, utilization after processing, is higher. (2) Although fluctuations exist in both conditions at the front part of rods, overall, the DTD method demonstrates a smaller fluctuation amplitude and diameter range. These parts, although not meeting tolerance requirements, are much more likely to be carried out further operations and then quickly reused as support rods or dragging rods in the later processes. (3) Average rod diameter obtained by the DTD method is closer to 55 mm, which displayed a better performance in meeting tolerance requirements. This conclusion is also easy to draw from areas of regions formed by error values and coordinate axes. (4) For available rod portion, diameter data after the processing of the DTD method shows significantly less noise and smaller amplitude, which means that the finished surface of rods are also smoother, thus making it more convenient and efficient for factories to proceed following operations with less measurement time and material usage.

Conclusion and prospect
For problems of untimely, inaccurate, unstable, and imperfect quality control in the process industry, this paper proposes a digital twin-driven method for online quality control. A digital twin consists of physical production system, virtual production system, central control system, twin data, and mechanism library. Under the joint action of the real-time data acquisition system, the two-way mapping physical-virtual production system, the quality prediction model based on Bi-GRU with AM and the improved GA, and problems arising from the process industry production can be predicted, analyzed, evaluated, adjusted, and optimized, thus improving product quality and ensuring its stability.
Data from production sites are collected from a powerful sensor system and integrated through industrial networks and protocols. After multiple data processing, effective data available for quality prediction and process decision-making are obtained.
Based on a high-fidelity and hyper-realistic simulation model, a two-way mapping physical-virtual production system is built. The production plan is verified and evaluated in advance, and relevant operations are implemented. The physical and the virtual systems work collaboratively and interact uninterruptedly. Data from both systems will keep integrating and fusing. Bi-GRU model simultaneously considers the past and the future data information of the input sequence to comprehensively judge current production status. Meanwhile, the introduction of AM reasonably redistributes weights of various influencing factors at different periods of time to help more accurately predict product quality.
The improved GA adaptively adjusts the crossover and the mutation rates; introduces the mechanism of eliminating, monitoring, and replenishing; and sets the state correlation calculation and evaluation standards. Defects of the traditional GA, such as local optimal, slow convergence, genetic degradation, and poor stability, are effectively avoided, which may offer new ideas for the process parameter optimization.
The case of the optical fiber preform drawing, as a typical process industry, is used for method verification. Results indicate that the prediction performance of the Bi-GRU with AM is significantly better than other network structures. The DTD method for online quality control based on quality prediction model and parameter optimization algorithm is able to timely manage and control quality problems during production and observably raise product quality.
The work developed still remains the following limitations: (1) During the practical production, data acquisition error and insufficiency are quite frequent, which brings difficulties to the optimization model initialization. The work of data correction and supplementation has an impact on the timeliness of parameter optimization. The development of more efficient data processing algorithms will be a direction worthy of effort. (2) To obtain more accurate simulation models, further attention should be paid to the research and incorporation of mechanism models that include process background knowledge and parameter characteristics.
(3) In other more complex industrial processes, it will be a challenge to select key features and build predictive models for multi-dimensional and highly coupled parameters. The research on the establishment and decoupling of parameter relationship will be a prospective direction to deal with such problems. Future research will focus on aforementioned research directions in order to provide a more comprehensive, timely and efficient method.
Author contribution Not applicable.