## 3 Methods  
This section describes CoTD-VAE, which is designed to learn separate representations of complex time series data and apply them to classification [42]. We start by explaining the overall structure of the model. Then, we look at its different parts, such as the encoder structure, decoder design, time limits, and training strategies. CoTD-VAE comprises three parallel encoders, a decoder, and classifier module. CoTD-VAE Disentangled time series features are divided into three different latent variables: static features (\(z_{\text{static}}\)), trend features (\(z_{\text{trend}}\)), and event features (\(z_{\text{event}}\)). Given a time series \(\mathbf{x}\in\mathbb{R}^{C\times L}\), where \(C\) is the number of feature channels and \(L\) is the length of the series, the three encoders of CoTD-VAE map it to three independent latent distributions:  
\[q(z_{\text{static}}\mid\mathbf{x}) =\mathcal{N}\Big{(}\mu_{\text{static}}(\mathbf{x}),\,\text{diag }\Big{(}\sigma_{\text{static}}^{2}(\mathbf{x})\Big{)}\Big{)}, \tag{1}\] \[q(z_{\text{trend}}\mid\mathbf{x}) =\mathcal{N}\Big{(}\mu_{\text{trend}}(\mathbf{x}),\,\text{diag} \Big{(}\sigma_{\text{trend}}^{2}(\mathbf{x})\Big{)}\Big{)},\] (2) \[q(z_{\text{event}}\mid\mathbf{x}) =\mathcal{N}\Big{(}\mu_{\text{event}}(\mathbf{x}),\,\text{diag} \Big{(}\sigma_{\text{event}}^{2}(\mathbf{x})\Big{)}\Big{)} \tag{3}\]  
where \(\mu\) and \(\sigma\) denote the mean and standard deviation functions, respectively, and diag denotes the diagonal covariance matrix. Encoder design. CoTD-VAE uses three different encoder designs, each focusing on different types of time series features [43; 44]. The static feature encoder uses a Temporal Encoder (TEC) architecture and supports either RNN or CNN implementations. The RNN mode uses a bidirectional LSTM to capture global sequence information. The CNN mode uses a convolutional layer and average pooling to extract the overall features of the sequence. The encoder shows the fixed dimensional latent variables that represent the static characteristics of the whole sequence. The trend feature encoder uses a one-dimensional convolutional network structure, which contains multilayer convolution, batch normalization, and Dropout layers. The output of this structure is a sequence of latent variables that is the same length as the sequence. This means that the time dimension information is retained, and the structure is suitable for capturing long-term change trends. The Event Feature Encoder is similar to the Trend Encoder, but it uses a special process called \"sparsity regularization\" to capture patterns that emerge or last for a short time. All encoders output mean \(\mu\) and log-variance \(\log\sigma^{2}\). Latent variables are sampled from the posterior distribution by a reparameterization trick: \(z=\mu+\sigma\odot\epsilon,\epsilon\sim\mathcal{N}(0,\mathbf{I})\)[45], where \(\odot\) denotes element-level multiplication, a trick that allows gradients to be back-propagated through a stochastic sampling process for end-to-end training. Decoder design. The decoder receives a combined representation of the three latent variables and reconstructs the original time series. The specific implementation includes expanding the static latent variables to the same dimension as the length of the sequence, splicing the expanded static latent variables with the trend latent variables and the event latent variables in the feature dimension, averaging along the sequence dimensions, and finally reconstructing the original sequence by a Temporal Decoder (TD), which also supports RNN or CNN implementations. Temporal constraints. We introduce temporal constraints [46] to guide different latent variables to learn specific types of features. Trend Smoothness Loss (\(\mathcal{L}_{\text{smooth}}\)). The purpose of the trend smoothness loss is to ensure that the latent variable \(z_{\text{trend}}\) captures the low-frequency, slowly varying dynamics of the time series. This is achieved by penalizing large variations in the latent trend over time.