Abstract
Manufacturing digitalisation is a critical part of the transition towards Industry 4.0. Digital twin plays a significant role as the instrument that enables digital access to precise real-time information about physical objects and supports the optimisation of the related processes through conversion of the big data associated with them into actionable information. A number of frameworks and conceptual models has been proposed in the research literature that addresses the requirements and benefits of digital twins, yet their applications are explored to a lesser extent.
A time-domain machining vibration model based on a generative adversarial network (GAN) is proposed as a digital twin component in this paper. The developed conditional StyleGAN architecture enables (1) the extraction of knowledge from existing models and (2) a data-driven simulation applicable for production process optimisation. A novel solution to the challenges in GAN analysis is then developed, where the comparison of maps of generative accuracy and sensitivity reveals patterns of similarity between these metrics. The sensitivity analysis is also extended to the mid-layer network level, identifying the sources of abnormal generative behaviour. This provides a sensitivity-based simulation uncertainty estimate, which is important for validation of the optimal process conditions derived from the proposed model.
Introduction
Digitalisation in industry 4.0
The 4th industrial revolution, i.e. the strategic vision of transition to Industry 4.0, draws a path to a totally customisable production with viable single-item batch production, just-in-time execution and high resource-efficiency. Advances along this path are believed to be feasible as a result of pervasive digitalisation throughout the industry, spanning from the shop-floor to the whole supply chain and to the users of the end-products [1].
Total factory digitalisation is being made possible by the technologies emerging from the research fields of big data, cyber-physical systems (CPS) and industrial internet of things (IIoT). The implementation of these technologies is becoming increasingly accessible as the big data technology stack has matured over the last couple of decades, offering many open-source and proprietary software tools supporting its deployment on commodity hardware [2]. As a result, IIoT implementation became feasible [3] and one anticipates seeing the industry shift rapidly towards widespread adoption of IIoT technologies as companies compete to disrupt the market or to maintain their position on it by reaping the performance and efficiency benefits. This would be a significant step in the evolution towards complete CPS integrated end-to-end through the value chain. Despite notable progress in development of the strategic vision of Industry 4.0 and increasing affordability of hardware and software solutions, actual implementation of smart factory technologies on manufacturing shop-floors remains relatively low, especially among small and medium enterprises [4]. Researchers and industry experts attribute this fact to the high complexity of execution, long return on investment periods and high investment costs [4, 5].
Precise representation of physical objects or processes in the digital realm is researched within the digital twin domain. Definition of the digital twin has varied throughout its existence: from the aircraft-oriented definition originally introduced in the aerospace domain research [6] to the modern concept of digital twin as a complete digital recreation of whole ecosystems [7]. The main aspect common to all the proposed scales is the absolute information equivalence between the perfect digital and the physical twins, implying that any interaction with one is mirrored in another [8]. Development of digital twins is an important step of the digitalisation process, as the unification of digital and physical data within a single virtual object enables significant efficiency improvements across multiple stages of the object’s life cycle [9].
A holistic digital twin requires integration of multiple interconnected models and metrology tools that capture the different aspects of the complete system. The progress towards this goal would thus be followed in stages with gradual development of digital twin components, including infrastructure, monitoring and predictive systems. Only after significant research advancement in these directions would the digital twin become usable as a decision-making tool capable of delivering the robust efficiency improvements promised by technology visionaries [8, 10].
Simulation and data-driven modelling
Simulation modelling is a widely used technique employed in the verification of engineering designs and evaluation of their functionality and performance. By utilising the known information about the product geometry, its material characteristics and operating conditions, the virtual recreation of its operation environment enables analysis of the product’s behaviour. A product can be similarly studied during a manufacturing process, and its feature characteristics both after and during processing can be predicted [11].
The enhanced efficiency is going to be increasingly attractive to the manufacturers of high-value products, as simulations enable a shifting of the physical experimentation costs to virtual analysis. And the increased flexibility shall enable agile product design, which is a prerequisite for agile manufacturing. In both cases a significant reduction of waste, cost and lead times is to be expected [12].
The computational constraints limiting the usefulness of simulation modelling in previous decades is significantly compensated for by the modern hardware and software advances. Thus, simulations have become a critical tool utilised in the analysis of the various aspects related to the machining processes, such as process stability [13], surface finish [14], cutting forces [15] or tool stress and temperature [16] and in the validation of physics-based models [17, 18, 19] over the last several decades [20]. Their further refinement with hybrid data-driven and knowledge-based approaches is an ongoing research topic [21].
The variety of error sources and their dynamic nature significantly distort the model predictions and present a considerable challenge that has been and still is thoroughly studied by manufacturing researchers [22, 23, 24, 25, 26]. These sources include the material uncertainties (such as its workability, shear stress or deviations from material specifications) and machining uncertainties (for example, tool wear and run-out, machine geometry and thermal errors). These production process-related uncertainties are propagated and magnified throughout the potential measurement errors arising from the measurement strategy choice, fixturing and environment variability, as well as from measurement tool and software errors [27, 11].
Physics-based analytics models tend to achieve high accuracy rates, but have several drawbacks that can become blocking factors for implementation of a digital twin. On one hand, in an interconnected CPS environment interactions between the components introduce very high complexity of the modelled phenomena. On the other hand, the incremental character of module development and the fluid module composition cause an almost constant stream of changes in the system [28]. This and the utilisation of empirically estimated parameters that approximate some of the unobserved factors in physics-based models implies that a given model has to be manually adapted to every new environment or scenario it is deployed in. Data-driven modelling addresses this issue by making use of the big data produced by the various manufacturer’s CPSs and automating the modelling process, thus aligning the digital twin state with the evolutionary changes in the modelled systems. Therefore, despite the wide success of physics-based simulation models for prediction of abnormal conditions during milling and turning processes, data-driven simulation methods offer greater flexibility at adapting to a broader range of conditions, including dynamically changing ones [29].
Artificial neural networks in manufacturing
Development of efficient and flexible data-driven simulation models of physical manufacturing processes is an important step towards CPS digitalisation in general, and particularly to wide adoption of digital twins throughout the industry. Artificial neural network (ANN) is a machine learning model inspired by the information flow structure of a brain’s neurons. Scaled versions of these networks labelled as deep learning models [30] have shown increasingly impressive state-of-art results on many data-driven problems (e.g., [31, 32, 33, 34, 35]) and have attracted a lot of attention from the manufacturing research community for their wide applicability to problems from different domains and of different scopes [36]. ANNs have been utilised in manufacturing applications ranging from conventional machine health monitoring [37, 38, 25] to product quality monitoring in additive manufacturing [39]. The proposed applications of ANNs to machining domain problems include chatter prediction [40, 41], fault diagnosis [42], surface defect detection [43] and several others [44].
Generative adversarial network (GAN) is a type of ANN architecture based on a competitive minimax game between two ANNs: the generator that learns to produce artificial data samples and the discriminator that learns to identify fake data samples [45]. The data distribution produced by the generator network thus approaches a representation of the true data which can be directly utilised for simulation of the process underlying the data. The approach was extended in multiple directions, including but not limited to research on various neural network architectures for the generator and the discriminator (e.g., Deep Convolutional GAN [46], BigGAN [47], StackGAN [48], WaveGAN [49], SeqGAN [50], Bayesian GAN [51]), reviews of the GAN training approaches and the networks’ loss functions (notably, the application of Earth Mover distance as the loss metric in Wasserstein GAN [52], its extension with gradient penalty in WGAN-GP [53] and progressive GAN growing [54]) and experiments with the conditioning of the GAN by additional inputs or outputs, as proposed in Conditional GAN [55], InfoGAN [56] and ss-InfoGAN [57].
Recently GANs have advanced the state of the art results in various domains, including generation of music [58], speech [49, 59, 60], text [50, 61] and, most notable, in simulation of realistic high-resolution images of human faces [62]. With most of GAN studies focussed on image-generation, the generation of time-domain signals with GANs remains a very narrow field of research. Some examples can be found within the publications on healthcare [63, 64], energy [65], music [66] and manufacturing [67].
Data augmentation aimed at the support of a primary classification model [68, 69, 70] currently dominates the research agenda on GANs in manufacturing. This is also evidenced by the review papers touching on ANN and GAN applications in manufacturing, where the only identified use case for GAN models is data augmentation [71, 37, 72, 73]. Adoption of a GAN’s generator as a primary instrument for manufacturing problems are discussed within image-generation GAN research considering generative material design [74] and sample super-resolution [75]. Additionally, a very recent anomaly detection approach was proposed in [76] via inversion of the generator, i.e. the authors considered the optimisation of the generator input with the rest of the network fixed for a given data sample. The generative accuracy of the sample produced by the GAN this way is suggested as a measure of the abnormality of the given data sample.
At the current stage of industrial digitalisation it is likely that a data-driven method would lack the range of empirical data variability necessary for capturing the underlying process behaviour. It is thus likely that a training regime based on hybrid dataset comprised of the experimental data and the data obtained from an existing model would be employed at first. The reuse of large pre-trained models and their adaptation to the real world conditions is discussed within the field of transfer learning [77].
Paper novelty and outline
An unexplored area of research of GAN applications in the manufacturing field is the potential use of controllable generative features of a GAN for analysis of the manufacturing processes. Research in this direction can potentially uncover ANN-based data-driven simulation techniques that could significantly augment the decision-making process pipelines in a manufacturing enterprise. This work focusses on simulation via data-driven generation as a component of a future digital twin. GAN is a suitable candidate for digital twin development due to its efficiency at inference time and the generative nature of the model, in addition to the flexibility benefits of a data-driven method that reduce the expected cost of implementation of the model for highly variable processes.
This paper proposes the first StyleGAN-based digital twin machining simulation component. A conditional StyleGAN architecture is developed that captures the conditional distribution of a vibration signal. The process signal generation is controllable via manipulation of the input machining process parameters. The model may thus act as a vibration simulation tool that maps process parameter inputs to vibration signal outputs. This makes the proposed GAN usable as a process optimisation instrument. An optimisation process loop would search for the best process parameters by interrogating the model to obtain parameters-signal pairs and determining the process quality based on the obtained signals. This paper also introduces a method of uncertainty analysis that is applicable to the optimised process state. To this end, a novel generation sensitivity analysis technique is proposed that aims to estimate the conditions under which the simulation yields reliable results.
The following paper describes the data and the neural network model in Section 2, followed by the methodology and the experimental analysis in Sections 3 and 4 and concluded with a discussion of the implications of the analysis results for potential applications and future research in Section 5.
GAN model as a machining digital twin
Dataset: Machining tool vibration
Manufacturing process data is a scarce resource at the current moment due to its acquisition cost. Commercial confidentiality of such data adds an additional impediment to its use in public research. It can be expected that actual implementations of data-driven digital twins would be initially trained on the existing and proven physics-based models, due to the experimental data scarcity mentioned above, and fine-tuned using a mixture of simulated and empirical data. The simulation that produced the dataset used in this work represents a surrogate of a real operational data-generating process. On one hand, this allows for a rigorous analysis of the digital twin component performance due to the full control over data generation. On the other hand, the proposed approach approximates a real world scenario of transition from a pure physics-based modelling to a scenario with mixed physics-based and experimental data.
Geometrical representation of the forces simulated by the physics-based model. 
Workpiece geometry produced by the simulation model. 
The GAN model described in this work is trained on a synthetic dataset produced by a physics-based time-domain simulation model adopted from [78]. The simulation iteratively calculates the forces produced by the interaction between the cutting teeth of a non-rigid machining tool and a rigid workpiece (Fig. 1). These forces are used in the derivation of the acceleration, velocity and displacement, i.e. the vibration, of the cutting tool. Vibration is selected as the analysed signal type based on the low expected cost of its acquisition and potential usefulness in the analysis of the machining process. The simulation tracks the position of each cutting tooth and the workpiece geometry produced by material removal (Fig. 2) to identify which cutting teeth are performing the cut at each time step. The operation considered in this paper is a linear non-slotting milling cut performed with a straight-teeth cutting tool on a metal workpiece.
Conditional GAN architecture. G denotes the generator network, D – the discriminator.
The physics-based model accepts several variables that control the deterministic simulation, including the machining parameters controllable during the configuration of the metal cutting process and the parameters dependent on the characteristics of the workpiece material, the machining tool and the manufactured product. These variables are detailed in Table 1 followed by the values used for generation of the training data. The parameter values are constant throughout each cutting operation, and the parameters varied across the samples in the produced dataset are chip width and spindle speed in ranges from 0.004 to 0.005 mm and 3000 to 4000 rpm respectively. The generated signals represent the displacement of the cutting tool along the
Milling time-domain simulation parameters
[t!] Physics-based simulation algorithm
A signal sample is obtained for each combination of 200 linearly spaced chip width and 200 spindle speed parameter values in the specified ranges, resulting in 40 000 signal samples within the dataset. The only pre-processing applied to this data is the mean and standard deviation normalisation that is applied to each of the process parameters separately and to the time-domain signals. The validation dataset containing 40 000 samples is produced using the same approach, but with the process parameters values shifted a half of the step, i.e. chip width from 0.004025 to 0.005025 and spindle speed 3002.5 to 4002.5. Both training and validation datasets are publicly available at
The digital twin component architecture discussed in this paper is inspired by StyleGAN [62], an image generation model based on two-dimensional deep convolutional networks with the enhancement of the generator by style-injection adopted from style transfer research works. Elements of StyleGAN are repurposed for the 1D case of a time-domain signal [79]. The noise inputs and the mixing regularisation (regularisation applied during training that randomly mixes the disentangled latent with another one to produce a sample from the generator
Architecture of the GAN generator network. “A” denotes learned affine transformations of style components 
The mapping network
where
The last layer of the synthesis network
The GAN loss function is based on Wasserstein GAN with gradient penalty (WGAN-GP) [53]. WGAN-GP losses for the generator and the discriminator are
respectively, where
is the gradient penalty,
where
Comparison of generated time-series samples and validation data samples. 
The generator network learns the conditional distribution of the time-domain vibration signal with respect to the machining process parameters that control the basic milling conditions. The use of style-based architecture of the generator enables a reduction of a trained model’s complexity via inspection of its style-level components. This and the degree of control provided by the conditional component of the generator increases the model’s potential interpretability and enables a reductionist approach to the analysis of its black-box inner mechanisms.
The models are trained using the Adam optimiser for both the generator and the discriminator with learning rates of 0.00001 and 0.0001 respectively. The network losses are parametrised with
The paper shows that the generator successfully learns to capture the relationship between the process parameters and the time-domain signal and performs well both on training and validation data. Figure 5 depicts several samples of generated time-series against the signals from training data produced using the same process parameters.
The metrics used in the analysis of the generator network performance are aimed at capturing the accuracy of the model conditional on the input parameters. The potential mode collapse (i.e. the inability of the generator to produce parts of the target distribution) inevitably affects the accuracy of the generator due to the deterministic nature of the experimental data coupled with the conditional generation. Therefore, the discussed experimental setting permits less attention on the variety of the generated samples, and this paper focusses on the analysis of the generator accuracy. The true accuracy value for some labels
where
The generative performance of the neural network is investigated via analysis of metrics mapped across machining process parameter values, chip width and spindle speed. This is visualised by calculating the inspected metric for a range of the process parameter pairs and plotting the values on a two-dimensional figure with spindle speed varied across the horizontal axis and chip width across the vertical axis. The training data exhibits high variability, especially across the spindle speed parameter values range, visible on the plot of standard deviations of the training data signals (Fig. 6). Figure 7 depicts the error
Standard deviation of training data samples for each set of process parameters values (log scale).
Error 
In contrast to the high accuracy of the generator in the areas of the parameter space characterised by low dispersion in the training data, the generative performance is suboptimal in some regions of high training data variance. Closer inspection of a region between 3450 and 3550 spindle speed reveals that the generator experiences a local mode collapse at high chip widths (for an example refer to Fig. 8). The trough visible on the error map in this region represent a parameter space where the generator successfully learnt the mode of the target signal, while the peaks to the sides along the
Generator sensitivity
Example of a path in labels space where the transition between the signal modes is smooth in the training data, but abrupt in the signals produced by the generator. The blue dot on the error maps (left) indicates the parameter values used to compare the two signals (right), real signal in yellow and generated signal in blue. The differences between the fake signals along the labels transition paths shown on the two top figures and the two bottom figures are much lower than for the real signal. The opposite is true for the transition captured by the two middle figures.
The metric discussed in the following sections is the sensitivity of the generator output to the input parameters
where
Error 
The generator sensitivity
The discussed relationship between the generative accuracy and sensitivity to input labels implies that the cause of the modes of failure of the generator originates from the parameters inputs and consequently from their style representation. This link is studied in the following section.
Comparison of the interpolations over high- and low-level styles on the top and the bottom figures respectively. The dashed line represents the initial signal 
The style-based neural network architecture enables a reduction of the model analysis complexity via the inspection of the influence of the disentangled input parameter vectors
Distributions of activation clusters that are the input (top plot) and the output (bottom plot) of a high-level style modulation layer of the generator network. Solid line is the cluster activations’ mean and the shaded areas show the cluster activations’ distribution covering the whole range of activation values in a cluster. Style injection at this layer changes neither the cluster sizes nor the activation distribution significantly.
The variation of the generated signals produced as a result of gradual changes to one or several style components reveals the features that the style components at the respective levels control. By performing a linear interpolation between
An analogous inspection of the style-level interpolation effects is performed at the layer level of the generator, i.e. the variation of the activations produced by the intermediary convolutional layers of the model is observed as a result of changes in the style parameters. Empirical analysis reveals that the sensitivity of the layer activations to the changes in the high-level style components exhibits the irregular non-smoothness similar to the sharp gradients notable in
One of the possible ways of further reduction of the complexity of the analysed chaotic system is an additional refinement of the analysed object’s scale. Thus, the sensitivity of individual activation nodes within the generator layers relative to the sensitivities of other nodes in the same layer is of interest. This sensitivity
Distribution of the activation node sensitivity metric 
Therefore,
The conditional neural network architecture described in the paper allows a significant degree of control over the generator via controllable input process parameters, thus enhancing the flexibility of the model and creating the potential for exploratory analysis of the modelled process. Such analysis could serve the purpose of CNC machining process planning and optimisation. Researchers have shown how signal data can be utilised to predict product conformity to quality standards [81, 82], therefore enabling the prediction of manufacturing errors and product quality prior to manufacturing when coupled with signal simulation proposed in this paper. Additionally, the machining process stability estimation can be enhanced with a generative model substitution for some of the physical measurements, which is a future research direction also proposed by machining stability experts [21].
In a real-world scenario a physics-based model would be the same for a fleet of machines, but each machine would be operated in different conditions and have slightly varying characteristics. The calibration of such physics-based models is time-consuming and difficult to perform on a large scale. Therefore, while a physics-based model might act as a digital twin simulation component, it would inevitably have made simplifications and idealisations about the process, likely omitting individual variations of environmental and dynamic factors that influence the manufacturing process due to their modelling complexity or computational cost. These complex phenomena are nevertheless reflected in the real process data and can thus be captured via data-driven training of a GAN model. The physics-based model used in the presented paper acts to prepare a surrogate for the real-world data that a digital twin is likely to have access to, as well as a mechanism to incorporate the knowledge contained within the physics-based model into the data-driven modelling process.
The validation of the proposed GAN model using an almost raw vibration signal data, pre-processed only by domain-agnostic mean and standard deviation normalisation, implies that the findings discussed in this paper are generalisable and relevant for other time-domain signal generation applications. The neural network architecture at the base of the proposed model is computationally cheap at inference time. This and the generative nature of GAN enable the development of a machining digital twin component that simulates the underlying physical process in real-time, which is an important step towards implementation of data-driven simulation models in the development of digital twins for Industry 4.0. The proposed analysis methodology utilising the style-based input disentanglement enables a reductionist approach to the model’s performance analysis, and the generative uncertainty metrics based on the generator sensitivity presented in this paper increase the model’s transparency and interpretability. Both are important barriers to the widespread adoption of complex models in the industrial context [5].
The conditional component of the proposed GAN is naturally extensible to simulation of longer signals via auto-regressive model based generation, i.e. the inclusion of signal history as a conditioning input to the generator. The use of recurrent neural network layers might also prove beneficial for this extension of the generator network. Conditioning can additionally be applied for adoption of the proposed model to a signal transformation problem, e.g. for prediction of cutting forces from the vibration signals, similar to the image style transfer idea [80].
A real world implementation would likely be limited in terms of available data due to the relatively high cost of acquisition of non-production experimental data. With the lack of data for creation of a complete map across the various operating conditions, the approach would have to be implemented using a limited subset of these conditions. An attentive consideration of the sampling efficiency of true data would thus be important in the optimisation of the model’s ability to learn with less data. This could also be remedied by a hybrid data generation approach that assembles the training and validation datasets using any existing expert- or physics-based models complemented with the real world data.
Conclusion
This paper presents the first application of a style-based GAN for machining process simulation. The work uses both the style and conditional components of the GAN architecture for attainment of deeper insights into the generative function of the GAN. A novel sensitivity analysis approach for conditional GANs is presented and applied to the proposed model, establishing a link between the true accuracy and the label sensitivity of the generator network. The style component of the GAN architecture is utilised to further advance this analysis to the level of intermediate neural network layers, resulting in the identification of the activation nodes that produce abnormal generative behaviour.
Being one of the first few papers in the manufacturing domain that focus on the generator of GAN, as opposed to the purely support role of GAN considered in most relevant works in the field, this work aims to promote the use of GANs in manufacturing past simple data augmentation for imbalanced datasets towards more sophisticated simulation applicable to a wider range of use cases.
The current work considers a conditional GAN with only continuous inputs, but an adaptation of the described sensitivity analysis method to the conditional GAN models with categorical inputs would make the proposed technique universally applicable in GAN performance analysis. Altering the neural network architecture could also make further insights available by further shifting the complexity of the multi-layer convolutional interactions to other operations, such as via skip connections [83] or residual connections [84].
Future research directions include comparative evaluation of different neural network architectures and validation of the proposed model on real manufacturing data, as well as broadening of the scope of the digital twin simulation with inclusion of multiple data sources and simultaneously modelled processes.
Footnotes
Acknowledgments
Professor Kadirkamanathan acknowledges the support from EPSRC funded Advanced Metrology Hub project (Reference EP\P006930\1).
Professor Tiwari acknowledges the support of the Royal Academy of Engineering under the Research Chairs and Senior Research Fellowships scheme (RCSRF1718\5\41).
