Intelligent Generation of Evolutionary Series in a Time‐Variant Physical System via Series Pattern Recognition

Intelligent generation of time‐variant control series remains the critical challenge for acquiring the desired system evolution, due to the difficulties in perceiving temporal correlation and conducting appropriate feedback propagation. A machine learning (ML) algorithm named time‐series generative adversarial network (TSGAN) is developed to overcome the difficulties, by incorporating a long short‐term memory (LSTM) kernel for recognizing multirange temporal patterns beyond the Markovian approximation and an adversarial training mechanism for efficient optimization. A variety of time series are examined by temperature‐control experiments, and the results demonstrate an exceptional accuracy (>95%, 35% higher than prevalent ML methods) as well as strong transferability and stability of the TSGAN algorithm. The dependence of generation performance on underlying statistical mechanisms associated with different ML algorithms, including the deep neural network (DNN), hidden Markov model (HMM), LSTM, and TSGAN, is elucidated by analyzing the generation quality of characteristic temporal patterns. The capability of generating arbitrarily complex response series opens an opportunity for inverse design of time‐variant functionals as strenuously pursued in material science and modern technology.

Such temporal features require the simultaneous perception of both short-term and long-term correlations across the entire dataset, as well as the appropriate weights of these correlations for making predictions. The high-dimensional coupling within the physical system and the limited datasets attained by experiments make accurate generation even more formidable. [26][27][28] Recently, the family of deep generative models (DGMs), including the generative adversarial networks (GANs) and variational autoencoder, has received considerable attention given its powerful capabilities on unsupervised generation, pattern extraction, and feedback propagation. [29][30][31] It learns the evolution mechanism and generates arbitrary distribution samples based on deep learning algorithms to implement a recurrent optimization routine through an intelligent feedback mechanism. In the areas of material physics, DGMs have been used to inversely design molecular structures, to predict material performance, and to detect abnormal reactions by GAN-based algorithms, with the focus on static and spatial features. [32][33][34] We speculate the integration of a temporal correlation kernel and a DGM can pave an avenue to address the critical challenges in generating time series. While time series patterns with different ranges can be characterized by the temporal kernel, DGM algorithms are devoted to reorganizing these patterns and generating time series toward objective functions. Rationally designing the weight of temporal pattern information contributed to DGM optimization is the key to realizing such promise.
In this work, we developed a new DGM to capture multirange temporal correlations and to achieve the accurate generation of time series that govern the physical system evolution. Implementing simple training data and no preset conditions, our model successfully perceived and reconstructed temporal patterns with different ranges, which achieved an average generation precision of 95.2% in our prototype systems (compared to the 59.7%, 52.3, and 66.7% precision for the traditional DNN, HMM, and LSTM, respectively). The accuracy, generality, stability, and diversity of our approach were further demonstrated via generating representative functionals observed in realistic TV-P systems.

Statistical and Physical Inference of Time Series
In contrast to the self-evolution process widely explored in traditional time series, our dynamic model of a TV-P system consists of both the control sequence P(x t ) ¼ P(x 1:tÀ1 ), x t ∈ X ⊂ ℝ n x and the observed sequence P(y t ) ¼ P(y 1:tÀ1 ), y t ∈ Y ⊂ ℝ n y , with their joint distribution satisfying Equation (1) The evolution of the physical system is projected in the observed sequence affected by the control sequence, which manifests as a high-dimensional reaction space and deep time correlation over time. [35,36] To ensure the joint optimization of prediction precision and generation diversity in the learning process, we designed a two-step architecture as shown in Figure 1a: 1) to extract a high-dimensional coupled mapping f θ ð·Þ:X 1∶T !Y T focusing on pattern evolution with temporal and spatial dependencies; 2) to build a generative model for predicting the future patterns of the TV-P system.
For the first step, different series distribution modes lead to differences in constructing methods of mapping space. In case the marginal distribution is Gaussian and its variants, we can apply the expectation maximum (EM) method to solve the maximum likelihood function of θ. This has been achieved by ML techniques such as the HMM and Kalman algorithms within the categories of the DBM. [37][38][39][40] Although the DBM approaches Figure 1. Theoretical framework of our interpretation on time series in TV-P system based on machine learning (ML). a) Schematic illustration of twostage ML algorithm for systems comprising control and observed sequences, with the generative and extractive stages highlighted in yellow and green, respectively. The red and blue circles denote the projection of sequences on high-dimensional parameter space. b) Architecture of the TSGAN algorithm, with the color scheme-blue: recurrent experimental process; green: basic frameworks of LSTM; purple: basic frameworks of neural networks; orange: optimization process. The solid and dashed lines present the generated data and the real data flows, respectively. www.advancedsciencenews.com www.advintellsyst.com have been extended to address distributions other than multi-Gaussian, they come with the price of much higher complexity and lack the capability to be applied in general situations. [41][42][43][44][45] Therefore, to extract salient features and mappings from arbitrary distribution modes of high-dimensional systems, we developed a new algorithm structure, combining a statistical mechanism and deep learning, to appropriately interpret the hidden space of the TV-P system and to mine pattern propagation features. Consider a TV-P system with a control sequence X ¼ {x 1 , …, x T } and an observed sequence Y ¼ {y 1 , …, y T }, and let Θ be the model parameter space that satisfies a general mapping y t ¼ f θ ðx t , y 1∶tÀ1 Þ. The optimal parameters can be obtained by solving the equation for the maximum likelihood function Given the infeasibility of directly solving this equation, we introduced the evidence lower bound functional Lðx, θÞ (Equation (3)) where q θ ð·Þ is the approximate posterior distribution gradually approaching p θ ð·Þ. Lðx, θÞ is equal to Θ given the optimal parameter set θ, which makes q θ ð·Þ identical to p θ ð·Þ. The optimization proceeds via either maximizing E q θ ðyÞ ½lnð·Þ or equivalently minimizing KLð·Þ.
For the TV-P system, we introduced the joint distribution (Equation (4)) of input and output instead of the margin distribution to improve solution accuracy where ∫ p θ ðyÞKLðq θ ðxjyÞjjp θ ðxjyÞÞ is non-negative, and thus a stronger bound KL (q θ ðx, yÞjjp θ ðx, yÞ) is provided. In previous studies, numerical sampling (NS) methods, such as Markov chain Monte Carlo [46] and particle filter, [47,48] have been successfully implemented to numerically calculate the multidimensional integral. These approaches, though, cannot be applied to the TV-P system because 1) physical systems comprising both control sequence and observed sequence with different pattern time-scales may not obey the Markovian property, which is a prerequisite of the NS methods; 2) the description of complicated and discontinuous time evolution patterns characterizing physical systems driven by an external control sequence requires sampling with temporal correlation over tremendous pattern space, which may not be accessed by NS methods given the status generation based on detailed balance. To overcome the first challenge, we used the LSTM algorithm, [41] within the category of a recurrent neural network, to achieve extraction of non-Markovian multirange patterns embedded in time series. The time evolution is driven by where g σ ð·Þ is a deterministic nonlinear transition function, and W o and b o are the weight and bias of the output unit, respectively. The propagation of high-dimensional space is described by the evolution of hidden state h t passing through the synergy of three elements [24] where f t , i t , and C t are composed of different neural networks. The non-Markovian property is achieved by collaboration between the forget unit rationally preserving information accumulated in the past and the input unit incorporating instantaneous information at current time in Equation (6), which efficiently captures multirange patterns of time series. Nevertheless, the network updating in LSTM algorithm solely depends on accumulation of errors at independent temporal points, which inappropriately evaluates the similarity between series patterns and leads to abnormal generation and diversity collapse during deep learning.

Design of the TSGAN Algorithm
For addressing the challenge of insufficient sampling of pattern space and substantially enlarging the scope of time series analyses, we developed the TSGAN algorithm to analyze the complex distribution patterns over different temporal ranges and to further enhance the extraction and generation abilities for time series. Our model comprises generative (G) and discriminative (D) units, both of which are independent LSTM-based modules. The generative learning establishes maximum likelihood functions to train models based on distribution differences and to recurrently proceed via adversarial optimization between G and D. [29] where min G denotes minimization of error in G, max D denotes maximization of the capability of D to distinguish generative and real data, and V (G, D) is the cost function set of G and D for GAN optimization.
It is worth noting that traditional GAN architectures, which have been widely used in qualitative recognition and manipulation, cannot be directly applied to the TV-P systems requesting quantitative sequence prediction, because 1) at the time series generation stage, more accurate measurement of distance between low-dimensional manifolds of distribution patterns in high-dimensional hidden space is demanded to drive the generative sequence toward the target function; 2) at the training stage, the highly dispersed data of training sets lead to irregular gradient propagation and consequentially instable optimization within the hyperparametric space.
Accordingly, we introduced the Wasserstein distance (WD) to characterize the similarity of series distribution driven by Equation (8) [49] Wðp, qÞ ¼ inf γ∈Γ E ðx,yÞ$γ ½jjx À yjj |fflfflfflfflfflfflfflfflfflfflfflffl{zfflfflfflfflfflfflfflfflfflfflfflffl} distribution transport (8) where Γ ¼ Q ðp, qÞ is the set of all joint distributions γ (x, y) whose marginals are respectively p and q. Compared with the calculation strategy of the traditional KL divergence, the WD Wðp, qÞ can measure the pattern distribution differences of submanifolds between high-dimensional distributions even if no intersection exists between p and q and provide meaningful gradients for backpropagation in any situation. Additional tests have been conducted to elucidate the impact of the WD, and the results suggest that the WD mechanism is crucial for realizing the desired performance ( Figure S17 and Table S2, Supporting Information). In addition, we used an energy-based optimization method in the D unit by calculating the potential function of the TV-P system to fully integrate pattern information. Regarding algorithm stability, we took advantage of the spectral normalization regular (SNR) operation in Equation (9) that overcomes the unequal training of basic GAN and guarantees the satisfaction of the Lipschitz constraint to stably achieve the synchronized training and thus to generalize and transfer into different scenarios. [50] where W θ is the complete weights of GAN and σð·Þ indicates the largest singular value. In contrast to the prevalent methods for calculating gradients, such as weight clipping and gradient penalty, the SNR operationW SN ð·Þ performs on LSTM and full connection layers before backpropagation and intelligently adjusts the weights, which avoids the overlearning of iterative training and preserves the temporal correlation of the welldesigned weights. This results in feature protection of the highly dispersed weight matrix constructed by the G and D units, and thus ensures high stability of generating and training procedures. The workflow of our TSGAN algorithm incorporating LSTM, WD, and SNR to achieve precise and directional manipulation of time series is summarized in Figure 1b; it was developed on the platform of Python v3.6 and Tensorflow v1.12. [51] Detailed information regarding the algorithms can be found in section A of the Supporting Information.

Representative Physical System
To demonstrate our interpretation of the TV-P system based on different models, including DNN, HMM, LSTM, and TSGAN, as shown in Figure 2a Table S3, Supporting Information, we developed a temperature control system with the input power (w) serving as the control sequence and the temperature ( C) serving as the observed sequence. Given the exposure of equipment to ambient environment, the relation between temperature and power is too complicated to be analytically described. For elucidating the algorithm performances on diverse series distribution modes, we designed three complicated test sets, including multi-Gaussian data (MGD), complex Gaussian data (CGD), and complex uncertain data (CUD) as the dashed line show in Figure 2g. The accuracy of test results was directly verified through experiments without model judgment errors. Unified training sets were used in the training processes regardless of test sets and algorithms, which consist of three basic data sets attained in experiments driven by linear rising, natural decline, and linear periodic power inputs (Figure 2f ).
To optimize the performance of ML models, a recurrent experimental system (RES) was integrated with the TSGAN architecture to construct the cross-iterative optimization platform (Figure 1b), with the complete training process shown in Figure S3, Supporting Information. The reinforcement operation combining computations and experiments not only increases the training sets and reduces the dependence of the algorithm on data, but also guides the optimization algorithm toward convergence with the true generative pattern distribution. We indiscriminately implemented the RES to the four types of ML algorithms as documented in Figure S4-S9, Supporting Information. There is substantial improvement demonstrated with the TSGAN algorithm, but the DNN, HMM, and LSTM algorithms fused with the recurrent optimizations failed to converge as explained by their inappropriate evaluations of prediction errors. Therefore, the RES results associated with the first and converged steps are presented only for the TSGAN algorithm in the following discussions.

Learning, Prediction, and Generation of Time Series
The performances of the four algorithms were qualitatively assessed by comparing the target temperature series to those acquired from experiments with the input power series generated by ML calculations. Qualitative comparison among algorithms in the aspects of generation accuracy, time correlation, and pattern diversity is schematically shown in Figure 2e. As expected from their varying capabilities of manipulating temporal correlation, distinct generation results were obtained, as summarized in Figure 2g and section B, Supporting Information, with the corresponding power control sequences documented in Figure S10, Supporting Information. The DNN algorithm manages to generate temperature series with the basic trends roughly matching those of the target functions, yet it suffers from unacceptably low accuracy (34.8%, 39.4%, and 59.6% for MGD, CGD, and CUD) due to the lack of explicit description of the temporal correlation. Despite the introduction of first-order temporal correlation, the generation quality of the HMM algorithm is barely enhanced compared to that of the DNN algorithm for all samples with accuracies of 30.4%, 40.2%, and 14.9%. The LSTM algorithm shows noticeable improvement (accuracy: 41.7%, 44.1%, 62.6%) compared to HMM due to the recognition of multirange temporal patterns, yet it still suffers from the training instability and fails to quantitatively reproduce the target series. The TSGAN algorithm demonstrates its outstanding performance (accuracy: 93.3%, 93.7%, 94.9%) by accurately reproducing all the distribution patterns and periodicities of the target series, which can be attributed to its exclusive capability of extracting and generating temporal correlations. The results of www.advancedsciencenews.com www.advintellsyst.com the first generation with TSGAN are already much better than those of the other approaches, while the high stability and diversity of the algorithm enable further RES optimization with recurrent procedure to gradually approach excellent generation.  To elucidate the fundamental mechanisms responsible for the distinct performances of ML algorithms, we investigated the multirange patterns embedded in the temperature series as they can reflect the range, strength, and diversity of temporal correlation. The overall quality of generating patterns with varying lengths was probed by calculating the regional accuracy (RegAcc, Equation (10)), which is defined to evaluate the accumulated deviation of pairwise temperature difference with a certain time interval referred to that of the target series.
where Gen x is the generative sequence, Y x is the target sequence, r is the time interval, ΔT(x i ,r) is the temperature fluctuation within r, i is the index of data point, N is the number of data points obtained in the experiment, and n r is the number of data points associated with the time interval (i.e., pattern length).
The RegAcc results associated with the four algorithms for the MGD, CGD, and CUD samples are shown in Figure 3a. The RegAcc of the DNN algorithm is relatively low and shows a nonmonotonic trend with increasing pattern length, consistent with the absence of temporal correlation. Such behavior can be further understood by observing the replication of patterns within the target temperature series on the generated control power series ( Figure S11, Supporting Information), which arises from the independence and commutativity between data points of an observed sequence during the training process. In contrast, both the RegAcc results of the HMM and LSTM algorithms tend to decrease with increasing pattern length, reflecting their insufficiency in recognizing a long-range pattern.
The first-order Markovian attribute of the HMM algorithm poses an intrinsic disadvantage on perceiving continuous series, given that the artificial discretization leads to inappropriate weighting assignment on time correlation at different lengths. This results in the severe decay of RegAcc for long-length patterns, and thus explains the comparable generation performances of the HMM and DNN algorithms. Much slower decay of RegAcc is observed for the LSTM algorithm, as can be ascribed to the recognition of multirange patterns beyond the Markovian assumption. The RegAcc of LSTM, though, is still unsatisfactory because the discrete accumulation of generated error is inappropriate for measuring the distribution discrepancy between the generated series and the target series, which is even worsened by the optimization routine of gradient descent that is prone to get trapped in the local optimal space. The TSGAN algorithm shows the highest RegAcc (>90%) among the studied approaches, with no attenuation regarding the pattern length. This arises from the improved optimization scheme incorporating an adversarial generation procedure based on comparisons between multirange patterns and explains the superior generation performance of the TSGAN algorithm.
In addition to pattern length, the detailed features of patterns may affect the capability of the ML algorithm to perceive and generate temporal correlation. Accordingly, we decomposed the MGD, CGD, and CUD time series into basic building blocks and then extracted four representative patterns as shown in Figure 3b. The first pattern has local characteristics of linear changes and sharp turning, the second and third are single extreme patterns of different evolution directions, and the last is a complex periodic pattern with a multimodal feature. To evaluate the quality of pattern generation, we calculated the first derivative, median, fluctuation, and integral for all patterns extracted in our target series and their counterparts in generative series, which characterize the propagation trend, the average position, the fluctuation amplitude, and the shape of patterns, respectively, as shown in Figure 3c-f.
The recognition precision of the pattern propagation trend (defined as Prec ¼ N G N T , where N G is the number of generated patterns with correct trends and N T is the number of target patterns within a specific category) with different algorithms is summarized in Figure 3c. As expected, the DNN algorithm can barely generate the correct propagation trend for any type of pattern. The Markovian property makes the HMM algorithm perform much better than the DNN algorithm for both pattern-3 and pattern-4, which resemble the composition of Gaussian distributions, whereas little improvement is attained for pattern-1 and pattern-2. This can be explained by the assumption of marginal distribution as a Gaussian function within the statistical variational framework, based on which the HMM algorithm is originally derived. The deviation of the target pattern from Gaussian distribution causes intrinsic difficulties in optimizing transition and emission probabilities. The predictability of the pattern propagation trend is substantially enhanced by the LSTM algorithm, taking advantage of the collaboration among three gates within the temporal kernel. The generation accuracy for an irregular pattern is still limited by the inefficient backpropagation. Such a deficiency is remedied by the adversarial mechanism of the TSGAN algorithm. Within each recurrent loop, the generator (G) first produces an initial sequence, the discriminator (D) then extracts temporal correlations, and afterward the features between generative and target series are compared to optimize weights of the network until achieving the Nash balance between G and D, which enables the generation of complex and diverse patterns.
The generation quality of different algorithms regarding the position and scope of patterns is shown in Figure 3d-f. The generation errors of both the DNN and HMM algorithms are much higher than those of the LSTM and TSGAN algorithms, while HMM exhibits even lower quality compared to the DNN algorithm. One reason is that the single-value mapping between the input and output of the DNN algorithm guarantees the approach of generation values toward target values despite the incorrect pattern evolution trend. The other reason is that the necessary condition of discreteness in the initial state distribution and transition probability weakens the temporal sensitivity of the HMM algorithm for continuous changeable distribution, which is further demonstrated in Figure S12, Supporting Information. This in combination with its deficiency in manipulating non-Gaussian distribution explains the outliers of pattern-1 associated with the HMM algorithm. The generation errors for patterns are noticeably reduced with the LSTM algorithm by virtue of the improved temporal correlation. The remaining discrepancies stem from the inaccurate optimization methods associated with the serious overfitting phenomenon www.advancedsciencenews.com www.advintellsyst.com and the hysteretic anomaly of temporal correlation, as shown in Figure S13, Supporting Information. It is worth noting that the error distributions on various patterns within the same category obtained by the DNN and HMM algorithms are much broader than those obtained by the LSTM and TSGAN algorithms, implying the low transferability and generalization of the DNN and HMM algorithms. The TSGAN algorithm provides the narrowest error distributions, which indicates that distinct patterns can be precisely and stably generated given simple training sets, and thus confirms that the evolution mechanism has been successfully learned by the TSGAN algorithm. The exceptional accuracy www.advancedsciencenews.com www.advintellsyst.com and transferability of pattern generation with the TSGAN algorithm can be ascribed to the excellent mapping and extraction function contributed by flexibly leveraging and reorganizing LSTM kernels. More importantly, the cross-recurrent adversarial mechanism of the TSGAN algorithm keenly perceives the local features of the D contribution while robustly providing the data information from diverse time scales, which further improves the temporal kernel.

Generation of Time Series in Physical Systems
Although the previous analyses have revealed the potential of our developed TSGAN algorithm on recognizing and generating temporal patterns, further verification of transferability is necessary for implementation in realistic systems, which typically contain complex functionals with nonlinear and non-Gaussian characteristics. To this end, four types of prevalent functionals observed in evolutions of natural and artificial systems were used as target temperature series, with the generation procedure following that of the previous section. The four representative functionals include 1) logarithmic series (Figure 4a), observed in the scrambling process of quantum systems, which describes the operator entanglement entropy and the early growth regime of the squared commutator for the mixed-field Ising model; [11] 2) sigmoid series (Figure 4b), observed in quantum control systems of oscillators, which describes the variation of cavity population associated with oscillator decoherence; [52] 3) unimodal polynomial series (Figure 4c), observed in pyroelectric sensing and light-induced systems, which describes the intensity evolution of photovoltage impulse in response to laser excitation, and the charge density wave peaks on pump laser fluence, respectively; [8,10] and 4) sinusoidal series (Figure 4 d), observed in piezoelectric mimicry, Ramsey experiments, and flexoelectric microelectromechanical systems, which describes the variation of polarization under external force, [53] cavity population stimulated by two resonant pulses, [52] and the displacement evolution in experimental characterization of flexoelectricity. [8] The TSGAN algorithm successfully generates all the evolution functionals with the precisions of 95.4%, 97.1%, 96.2%, and 91.7%, respectively, demonstrating the high accuracy and transferability of our algorithm on generating temporal series. To comprehensively verify the generation ability of TSGAN, we added more complex distribution patterns to increase the diversity of the target data, and the experimental test accuracy has reached more than 93.9% ( Figure S16, Supporting Information).
In addition to its scientific merits discussed previously, the TSGAN algorithm possesses compelling technical value that may enable significant advances in existing control systems. We unveiled such potential by comparing the performance of the TSGAN algorithm and that of a proportional-integralderivative (PID) controller ( Figure S14, Supporting Information), which has been dominantly implemented for temperature management in industry. The results indicate that much higher www.advancedsciencenews.com www.advintellsyst.com precision of generation series, lower fluctuation of control series, and stronger capability to represent series with abrupt turning have been achieved by the TSGAN algorithm compared to a PID controller manipulated by a skillful worker ( Figure S15, Supporting Information). Implementing the TSGAN to common scenarios of time series is necessary to justify the generalization and transfer learning ability of TSGAN. To this end, we have performed two standard nature language processing (NLP) tasks using TSGAN, including semantic analysis and text generation. [54] Satisfactory performances compared with prevalent algorithms have been demonstrated for both NLP tasks ( Figure S18, 19, Supporting Information), implying that TSGAN possesses strong generalization and transferability to intelligently deal with distinct series objects.

Conclusion
We developed a new DGM algorithm named TSGAN to perceive temporal correlation and to accurately generate control time series for accomplishing desired evolution of a TV-P system. With the assistance of an experimental platform wherein the temperature variation is controlled by input power, exceptionally high precision (>95%), the transferability and stability of the TSGAN algorithm have been demonstrated in a range of series that are either representative mathematical structures or prevalently observed in physical systems. By investigating the temporal pattern quality generated by DNN, HMM, LSTM, and TSGAN algorithms, we found that the excellent performance of the TSGAN algorithm originates from the recognition of multirange temporal patterns beyond the Markovian assumption, the efficient generation of samples for assessing tremendous pattern space, and the reliable optimization guaranteed by the adversarial training mechanism.
Although the current discussions are limited to a relatively simple dataset, there is no intrinsic drawback that prevents the TSGAN algorithm from being extended to more complex physical systems. The fundamental relation between the generation performance and the underlying models of ML algorithms elucidated in this study not only determines their implementation scope, but also facilitates the development of novel ML algorithms. We envision that the TSGAN algorithm may generate desired response series driven by complicated time-dependent stimulation signals, and thus pave an avenue toward the intelligent inverse design of time-variant functionals in science and technology.

Supporting Information
Supporting Information is available from the Wiley Online Library or from the author.