Method for training time series data classification model, data classification method and related equipment
By embedding causal association information into the time series data classification model, the problem of not fully utilizing association information in multimodal time series classification is solved, achieving higher classification accuracy and training efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AIMENG SMART HOME (ZHUHAI) CO LTD
- Filing Date
- 2025-12-15
- Publication Date
- 2026-06-05
AI Technical Summary
Existing time series classification methods fail to fully utilize the correlation information between different modalities when processing multimodal time series, resulting in limited classification performance.
By acquiring the training set and a pre-set large language model, the causal relationship information between each modality is determined using a causal inference algorithm and embedded into the time-series vector sequence to generate a causal-enhanced time-series vector sequence. This sequence is then trained in conjunction with the large language model, and the layer normalization parameters are adjusted to improve classification accuracy.
It improves the accuracy and training efficiency of multimodal temporal classification tasks, avoids overfitting, and enhances the model's classification performance under small sample conditions.
Smart Images

Figure CN121301942B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence, and in particular to a training method for a time-series data classification model, a data classification method, and related equipment. Background Technology
[0002] With the development of multimodal sensor technology, time series data from different sensors are widely used in tasks such as sleep staging, human motion recognition, physiological signal analysis, and industrial process monitoring. Existing time series classification methods typically rely on deep learning models to extract features and classify the input sequence data, such as convolutional neural networks, recurrent neural networks, and Transformer-based sequence models.
[0003] However, different modalities may have mutual influence and interdependence. Traditional methods, when modeling multimodal time series, often only process each modality independently, failing to fully utilize the correlation information between multimodalities, thus limiting classification performance.
[0004] Therefore, how to effectively utilize the correlation structure between multimodal time series during model training to improve the accuracy of time series classification tasks has become a key issue of current technical focus. Summary of the Invention
[0005] Therefore, it is necessary to provide a training method, a data classification method, and related equipment for a time series data classification model to address the aforementioned technical problems, thereby solving the problem of low classification accuracy of models trained by traditional time series data classification model training methods.
[0006] A method for training a time-series data classification model, the method comprising:
[0007] Obtain a training set and a preset large language model. The training set includes time-series vector sequences of multiple modalities and category labels corresponding to each time-series vector sequence.
[0008] Based on a pre-defined causal inference algorithm, the causal relationship information between each modality is determined;
[0009] The causal association information is embedded into the time-series vector sequence to obtain a causal-enhanced time-series vector sequence;
[0010] The causal-enhanced temporal vector sequence is provided to the large language model to obtain the classification result;
[0011] Calculate the loss value between the classification result and the category label, and adjust the layer normalization parameters of the large language model based on the loss value to obtain the trained large language model.
[0012] Optionally, obtaining the training set includes:
[0013] Acquire raw time-series data of multiple modalities, wherein the raw time-series data includes raw time series of multiple variables changing over time;
[0014] The original time series is normalized to obtain a normalized time series.
[0015] The normalized time series is divided into blocks according to a preset time length to obtain multiple time blocks;
[0016] Each time block is mapped to a vector representation of a preset dimension, and a time-series vector sequence of the multiple modalities is formed in chronological order. The training set is constructed based on the time-series vector sequence and its corresponding category label.
[0017] Optionally, the determination of causal association information between modalities based on a preset causal inference algorithm includes:
[0018] Based on the preset causal inference algorithm, the causal relationship between any two variables in a time-series vector sequence of multiple modalities is determined;
[0019] Aggregation is performed based on the causal relationships between all variables to obtain causal association information between each modality.
[0020] Optionally, embedding the causal association information into the time-series vector sequence to obtain the causally enhanced time-series vector sequence includes:
[0021] Attention weights are generated based on the causal correlation information, and the temporal vector sequences of multiple modalities are weighted based on the attention weights to obtain a weighted intermediate vector sequence.
[0022] Perform convolution operation on the weighted intermediate vector sequence to obtain a causal embedding vector sequence;
[0023] The causal embedding vector sequence and the temporal vector sequence are combined to obtain the causal-enhanced temporal vector sequence.
[0024] Optionally, the step of combining the causal embedding vector sequence and the temporal vector sequence to obtain the causally enhanced temporal vector sequence includes:
[0025] Convolution is performed on the temporal vector sequence to map the temporal vector sequence into a preset dimensional space, thereby obtaining a word embedding vector sequence.
[0026] Determine the word position embedding of the preset large language model and generate a sequence of position embedding vectors;
[0027] The causal embedding vector sequence, the lexical embedding vector sequence, and the positional embedding vector sequence are combined to obtain the causal-enhanced temporal vector sequence.
[0028] Optionally, calculating the loss value between the classification result and the category label, and adjusting the layer normalization parameters of the large language model based on the loss value to obtain the trained large language model includes:
[0029] The loss value is calculated based on a preset cross-entropy loss function, which includes a regularization term;
[0030] Freeze all model parameters in the preset large language model except for the layer normalization parameters, and adjust the layer normalization parameters of the large language model based on the loss value to obtain the trained large language model.
[0031] A data classification method, the method comprising:
[0032] The trained large language model and the time series data to be classified are obtained. The trained large language model is trained by the training method of the time series data classification model.
[0033] The time-series data to be classified is provided to the trained large language model so that the trained large language model outputs the classification result corresponding to the time-series data to be classified.
[0034] A training device for a time-series data classification model, the device comprising:
[0035] The first acquisition module is used to acquire a training set and a preset large language model. The training set includes time-series vector sequences of multiple modalities and category labels corresponding to each time-series vector sequence.
[0036] The first determining module is used to determine the causal relationship information between each modality based on a preset causal inference algorithm;
[0037] The first embedding module is used to embed the causal association information into the time-series vector sequence to obtain a causal-enhanced time-series vector sequence;
[0038] The first classification module is used to provide the causal-enhanced temporal vector sequence to the large language model to obtain the classification result;
[0039] The first adjustment module is used to calculate the loss value between the classification result and the category label, and adjust the layer normalization parameters of the large language model based on the loss value to obtain the trained large language model.
[0040] A data classification device, the device comprising:
[0041] The second acquisition module is used to acquire the trained large language model and the time series data to be classified. The trained large language model is obtained by training the time series data classification model.
[0042] The second classification module is used to provide the time series data to be classified to the trained large language model, so that the trained large language model outputs the classification result corresponding to the time series data to be classified.
[0043] A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor, when executing the computer-readable instructions, implements the training method or data classification method of the aforementioned time-series data classification model.
[0044] To achieve the above objectives, embodiments of the present invention also provide a readable storage medium storing computer-readable instructions thereon, which, when executed by a processor, implement the training method or data classification method of the time-series data classification model described above.
[0045] The training method for the aforementioned time-series data classification model involves obtaining a training set and a pre-defined large language model. The training set includes time-series vector sequences of multiple modalities and category labels corresponding to each time-series vector sequence. Based on a pre-defined causal inference algorithm, causal association information between each modality is determined. The causal association information is embedded into the time-series vector sequences to obtain causally enhanced time-series vector sequences. The causally enhanced time-series vector sequences are provided to the large language model to obtain classification results. The loss value between the classification results and the category labels is calculated, and the layer normalization parameters of the large language model are adjusted based on the loss value to obtain a trained large language model. By embedding causal correlation information generated based on the relationships between different modalities into the time-series vector sequence, the input sequence can explicitly reflect the mutual influence of different modalities, thereby improving the model's ability to discriminate multimodal time-series data. Simultaneously, during training, only the layer normalization parameters in the pre-defined large language model are adjusted. This reduces training overhead while maintaining the stability of the main parameters of the large language model, avoiding overfitting and improving the model's classification performance under small sample conditions. Overall, this achieves a simultaneous improvement in the accuracy and training efficiency of multimodal time-series classification tasks. The resulting model can be deployed as artificial intelligence middleware or a time-series analysis function library, serving as part of an AI optimization operating system. It can also be applied to the development of computer vision and audiovisual software, biometric recognition software, and other AI applications to achieve efficient time-series data classification and intelligent analysis. Attached Figure Description
[0046] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 This is a flowchart illustrating the training method of a time-series data classification model in one embodiment of the present invention;
[0048] Figure 2 This is a schematic diagram of the structure of a training system for a time-series data classification model according to an embodiment of the present invention;
[0049] Figure 3 This is one of the performance experiment graphs of a time-series data classification model in one embodiment of the present invention;
[0050] Figure 4 This is the second performance experiment diagram of a time-series data classification model in one embodiment of the present invention;
[0051] Figure 5 This is a schematic diagram of the structure of causal association information in one embodiment of the present invention;
[0052] Figure 6 This is a schematic diagram of the structure of causal attention in one embodiment of the present invention;
[0053] Figure 7 This is a flowchart illustrating a data classification method in one embodiment of the present invention;
[0054] Figure 8 This is a schematic diagram of the structure of a training device for a time-series data classification model in one embodiment of the present invention;
[0055] Figure 9 This is a schematic diagram of the structure of a data classification device in one embodiment of the present invention;
[0056] Figure 10 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation
[0057] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0058] In one embodiment, such as Figure 1As shown, a training method for a time-series data classification model is provided, including the following steps:
[0059] 101. Obtain the training set and the preset large language model.
[0060] In this embodiment of the invention, the training set includes a sequence of time vectors for multiple modalities and a category label corresponding to each time vector sequence.
[0061] Modalities can be understood as data types from different sources or with different physical meanings, such as accelerometer signals, electrophysiological signals, and environmental monitoring signals. Data from each modality is recorded separately within the same time period, thus forming a multimodal input. A temporal vector sequence can be a fixed-dimensional vector sequence obtained by processing the time series of each modality through partitioning, projection, etc. Each vector typically corresponds to a time segment, and the numerical values within the vector represent the statistical characteristics or local patterns within that time segment. Category labels are used to indicate the target category to which each temporal vector sequence belongs; for example, a sensor sequence may belong to a certain type of motion, a certain behavioral state, or a certain event type. The pre-defined large language model can be a sequence model with a multi-layered attention structure capable of receiving vector sequence inputs, such as a Transformer-based language model, which internally contains multiple self-attention layers, a feedforward network, and a normalization unit for learning representations of the input sequence.
[0062] In practical applications, a training set can be constructed by collecting raw time-series data of different modalities and adding category labels according to annotation rules. The pre-set large language model can be obtained by loading the parameters of a pre-trained model from an existing model library, or by using an open-source model as the initial model. This preparation process can provide a foundation for subsequent causal embedding and model training.
[0063] 102. Based on a preset causal inference algorithm, determine the causal relationship information between each modality.
[0064] In this embodiment of the invention, the preset causal inference algorithm can be a type of algorithm used to identify causal dependencies from time series data, such as a causal discovery algorithm based on conditional independence, a causal inference algorithm based on prediction residuals, or other inference methods capable of determining whether different time series have causal influence. This algorithm determines whether the change in one mode has an identifiable influence on the change in the other mode by statistically analyzing the historical changes of the time series vector sequences corresponding to any two modes.
[0065] Causal association information can be understood as numerical information that characterizes the strength or direction of causal influence between different modes. For example, by performing pairwise analysis on multiple modes, weight values reflecting the causal relationship between each mode can be obtained, which are used to characterize the association strength between different modes.
[0066] Based on this pre-defined causal inference algorithm, these causal relationships can be derived from the time-series vector sequences of all modalities, thereby determining the causal association information for subsequent processing.
[0067] Simply put, causal relationship information is obtained by analyzing the temporal changes between different modes, and is used to quantify whether a mode affects other modes and the degree of influence.
[0068] 103. Embed causal relationship information into the time series vector sequence to obtain the causal-enhanced time series vector sequence.
[0069] In this embodiment of the invention, the causal-enhanced temporal vector sequence can be understood as follows: based on the original temporal vector sequence, causal correlation information between various modalities is further incorporated, enabling the influence relationships between different modalities to be explicitly utilized in the subsequent training of the large language model. Since the training set contains temporal vector sequences of multiple modalities, there may be important correlations between different modalities. For example, the changing trend of one modality may affect another modality. The causal-enhanced sequence can reflect these influence relationships at the data level.
[0070] In practical implementation, based on the aforementioned causal relationship information, the time-series vector sequences of multiple modalities can be weighted, fused, or biased to adjust, thereby enabling the vectors in the sequence to reflect the strength of causality between modalities. For example, when one modality has a strong causal influence on another, the time-series vector corresponding to the target modality can be adjusted accordingly to include more information from the source modality in the vector space; conversely, when the causal relationship is weak, the vector adjustment amplitude can be reduced accordingly.
[0071] The above embedding method preserves the original temporal vector sequence structure, but the overall representation includes additional information reflecting the causal relationships between modes.
[0072] Finally, the causal-enhanced temporal vector sequence obtained after the above embedding process can be used as input for subsequent training steps, enabling the large language model to automatically utilize the causal relationships between different modalities during classification learning, thereby improving the accuracy of temporal classification tasks.
[0073] 104. The time-series vector sequence after causal enhancement is provided to the large language model to obtain the classification results.
[0074] In this embodiment of the invention, the causal-enhanced temporal vector sequence is provided as input data to a preset large language model for forward inference. The large language model processes the input vector based on its internal neural network structure, thereby outputting the corresponding classification result.
[0075] Specifically, the large language model performs layer-by-layer feature transformation and information extraction on the input temporal vector sequence. Through its internal multi-layer neural computation structure, it comprehensively analyzes the temporal patterns, modal structures, and relationships between different vectors in the input data. Based on the classification ability learned during training, it outputs a vector representing the category probability or category prediction result. The classification result output by the large language model is used to characterize the category to which the input temporal vector sequence belongs, such as a specific behavioral category, physiological state, or event type.
[0076] 105. Calculate the loss value between the classification result and the category label, and adjust the layer normalization parameters of the large language model based on the loss value to obtain the trained large language model.
[0077] In this embodiment of the invention, after the large language model outputs the classification result, the loss value can be calculated based on the difference between the classification result and the corresponding category label. This loss value is usually measured using the cross-entropy loss function, or a regularization term can be added to the cross-entropy to suppress model overfitting.
[0078] Subsequently, after obtaining the loss value, the layer normalization parameters in the large language model were adjusted only through backpropagation to gradually improve the classification performance of the model, while other main parameters in the large language model, except for the layer normalization parameters, remained unchanged.
[0079] Through the above training process, a well-trained large language model that can accurately perform temporal classification tasks can be obtained.
[0080] In this embodiment of the invention, a training set and a preset large language model are obtained. The training set includes time-series vector sequences of multiple modalities and category labels corresponding to each time-series vector sequence. Based on a preset causal inference algorithm, causal association information between each modality is determined. The causal association information is embedded into the time-series vector sequences to obtain causally enhanced time-series vector sequences. The causally enhanced time-series vector sequences are provided to the large language model to obtain classification results. The loss value between the classification results and the category labels is calculated, and the layer normalization parameters of the large language model are adjusted based on the loss value to obtain a trained large language model. By embedding causal association information generated based on the correlation between each modality into the time-series vector sequences, the input sequences can explicitly reflect the mutual influence of different modalities, thereby improving the model's ability to discriminate multimodal time-series data. At the same time, only the layer normalization parameters in the preset large language model are adjusted during training, reducing training overhead while maintaining the stability of the main parameters of the large language model, avoiding overfitting, and improving the model's classification performance under small sample conditions. Overall, the accuracy and training efficiency of the multimodal time-series classification task are improved simultaneously.
[0081] It is understood that in the specific implementation of this application, data such as training sets are involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required. Furthermore, the collection, use and processing of related data, as well as the construction, use and training of large language models, must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0082] Optionally, in the step of acquiring the training set, the original time series data of multiple modalities can also be acquired. The original time series data includes the original time series of multiple variables changing over time. The original time series are normalized to obtain a normalized time series. The normalized time series is divided into blocks according to a preset time length to obtain multiple time blocks. Each time block is mapped to a vector representation of a preset dimension and formed into a time series vector sequence of multiple modalities in chronological order. The training set is constructed based on the time series vector sequence and its corresponding category label.
[0083] In this embodiment of the invention, the raw time series data of multiple modalities can be obtained first.
[0084] Let Γ be the multimodal time series dataset, which consists of k modalities, each of which contains a multivariate time series of length L:
[0085]
[0086] in, Representing modes In time A variable vector at time t, whose dimension can be represented as For ease of description, the number of variables for all modalities can be summed as follows:
[0087]
[0088] Where m represents the total number of variables in all modalities.
[0089] Furthermore, to ensure consistent data scaling across different modalities, each variable in each modality is first normalized. For each modality... and time The normalized variable is represented as:
[0090]
[0091] in:
[0092] and Representing modes Mean and variance over time To avoid division by zero constants.
[0093] Furthermore, the normalized time series Further segmented by time period.
[0094] Let the length of each block be P and the step size be S, then we can obtain:
[0095]
[0096] Each time block can be represented as: That is, each patch captures local time window information within a modality.
[0097] The time segments of all variables under the same patch index are concatenated into the following matrix:
[0098]
[0099] Each row corresponds to a time block, and each column corresponds to a variable in that modality.
[0100] Furthermore, in order to map the patch features obtained from different modalities to a unified embedding dimension d, a linear projection is performed on each modality: Each row represents the embedding vector of the nth patch.
[0101] Finally, the projected features of all modalities are concatenated according to the patch index to obtain the total tensor:
[0102]
[0103] Indicates the first A patch provides a unified representation across all modalities.
[0104] Ultimately, all patches constitute a tensor: This tensor is the final input representation (i.e., the sequence of ordered vectors) for each modality and each time window.
[0105] Understandably, normalization, temporal partitioning, and linear projection processes enable the unified vectorization of the original multimodal time series. Normalization ensures the scale consistency of data from different variables; partitioning utilizes local time windows to extract dynamic features; and linear projection maps data from different modalities to a consistent vector dimension, which is then concatenated to form a complete modality-time structured tensor. This provides a unified and learnable representation for subsequent causal-based augmentation processing and as input to large language models.
[0106] Optionally, in the step of determining the causal association information between each modality based on a preset causal inference algorithm, the causal relationship between any two variables in the time-series vector sequence of multiple modalities can also be determined based on the preset causal inference algorithm; and the causal relationship between all variables can be aggregated to obtain the causal association information between each modality.
[0107] In this embodiment of the invention, a "variable" refers to an atomic dimension that changes over time in a multimodal time series, such as a sensor channel, electrophysiological signal lead, behavioral feature dimension, or other independently measurable physical quantity. For ease of unified description, a unique index is first assigned to all variables in all modalities, and the variable set is represented as follows: ,in This represents the total number of variables across all modes. For any given mode... This modality contains only a subset of the variables, denoted as the variable subset. ,in For modality The number of variables.
[0108] Based on the above set of variables, for a given dataset Define a variable-level causal function to measure the causal relationship between any two variables. Its mathematical form can be written as: ,in, Indicates in the dataset variable For variables The degree of causal influence, among which As a potential reason, As a potential outcome, specific causal inference algorithms can include Granger causality tests, causal scoring derived from structural causal models (SCM), or other time-series-based causal inference methods. The outputs constitute the numerical values of the causal relationships between variables.
[0109] To generalize from variable-level causal relationships to modal-level causal relationships, it is necessary to aggregate the variable-level causal functions based on the set of variables contained in each modality. For any two modalities... and The modal-level causal weighting value can be obtained by summing the causal relationships between all variables belonging to these two modalities. Its mathematical form is as follows:
[0110]
[0111] In the formula, The modal-level causal weighting matrix (i.e., the aforementioned causal association information) has elements... Used to characterize modes For modes The overall causal influence strength. When the number of modes When this happens, the modal-level causal matrix degenerates into a variable-level causal matrix in the single-modal case.
[0112] Through the above aggregation process based on variable-level causal relationships, causal association information between different modalities can be obtained from a global perspective, so that this causal dependency can be reflected in subsequent cross-modal information fusion.
[0113] Optionally, in the step of embedding causal association information into the temporal vector sequence to obtain the causal-enhanced temporal vector sequence, attention weights can be generated based on the causal association information, and the temporal vector sequences of multiple modalities can be weighted based on the attention weights to obtain a weighted intermediate vector sequence; convolution operation can be performed on the weighted intermediate vector sequence to obtain the causal embedding vector sequence; and the causal embedding vector sequence and the temporal vector sequence can be combined to obtain the causal-enhanced temporal vector sequence.
[0114] In this embodiment of the invention, in order to further highlight the causal relationships between different modalities before providing input to a large language model, a causal embedding vector sequence can be generated based on causal association information. This process includes three main steps: generating attention weights based on causal association information, weighting the temporal vector sequence, and generating causal embedding representations through convolution.
[0115] First, based on the obtained causal relationship information between the various modalities, attention weights reflecting the importance of different modal features can be generated. This causal relationship information can be represented as a modality-level causal weighting matrix. ,in, Represents the number of modes, the nth mode in the matrix Line number The elements of the column represent modalities. For modes The causal strength. To apply this causal weighting matrix to the input representation of the time series, it can be multiplied by the projection vectors corresponding to different time blocks. Assume the projected feature tensor is... ,in Indicates the first Each time block, To embed the dimension, intermediate features that are reweighted for each modality can be generated based on the following formula:
[0116]
[0117] in, This indicates that the operation is stacked in chronological order, resulting in... It is a three-dimensional tensor with dimension . This operation is essentially a causal attention mechanism that weights features of different modalities by causal strength, so that features of modalities with stronger causal influence can be highlighted in subsequent classification tasks.
[0118] Subsequently, the aforementioned intermediate features can be analyzed. A one-dimensional convolution operation is performed to extract contextual associations along the time dimension, resulting in a final sequence of causal embedding vectors. This convolution operation can be represented as: ,in, For a one-dimensional convolution operation, the output is This is a causal embedding vector sequence, which is used to combine with the original temporal vector sequence to form a causal-enhanced input representation.
[0119] Through the above processing, the causal embedding vector sequence can effectively integrate cross-modal causal strength information, so that the final time-series vector sequence used for model training not only contains the dynamic features of each modality itself, but also the feature enhancement effect brought about by the causal influence relationship, thereby improving the model's learning ability and generalization performance in classification tasks.
[0120] Optionally, in the step of combining the causal embedding vector sequence and the temporal vector sequence to obtain the causal-enhanced temporal vector sequence, convolution calculation can also be performed on the temporal vector sequence to map the temporal vector sequence to a preset dimensional space to obtain a word embedding vector sequence; the word position embedding of the preset large language model is determined to generate a position embedding vector sequence; and the causal embedding vector sequence, word embedding vector sequence and position embedding vector sequence are combined to obtain the causal-enhanced temporal vector sequence.
[0121] In this embodiment of the invention, word embedding and position embedding can be introduced during the process of combining causal embedding vector sequences and temporal vector sequences to obtain causal-enhanced temporal vector sequences, so as to further improve the model's ability to represent features at different time locations.
[0122] First, convolution can be performed on the temporal vector sequence to map the original temporal vector sequence to a preset dimensional space, generating a word embedding vector sequence. For example, one-dimensional convolutions can be used to combine time-block vectors from different modalities. Perform concatenation and then convolution operation:
[0123]
[0124] The above convolution operation is used to convert the input channels into a single channel. The sequence is mapped to the output channel. The vector sequence is used to maintain consistency with the input dimension of subsequent models.
[0125] Secondly, word position embedding vectors in a pre-defined large language model can be determined to construct a sequence of position embedding vectors. The position embedding vector sequence can be derived from the existing position encoding in a pre-trained large language model (such as the position encoding parameters in the GPT-2 model), and further trained according to the features of the time series classification task during the model fine-tuning process to represent the relationship between different time positions in the time series.
[0126] After obtaining the causal embedding vector sequence, the word embedding vector sequence, and the positional embedding vector sequence, these three can be combined in a preset manner, such as element-wise summation or vector concatenation, to form the final causally enhanced temporal vector sequence. By uniformly injecting causal information, local temporal features, and positional information into the sequence representation, the model can more fully utilize cross-modal key dependencies and temporal structures, improving the accuracy of subsequent classification stages.
[0127] Optionally, in the step of calculating the loss value between the classification result and the category label, and adjusting the layer normalization parameters of the large language model based on the loss value to obtain the trained large language model, the loss value can also be calculated based on a preset cross-entropy loss function, which includes a regularization term; the remaining model parameters in the preset large language model except for the layer normalization parameters are frozen, and the layer normalization parameters of the large language model are adjusted based on the loss value to obtain the trained large language model.
[0128] In this embodiment of the invention, in the process of calculating the loss value between the classification result and the category label, and adjusting the layer normalization parameters of the large language model based on the loss value to obtain a trained large language model, a cross-entropy loss function containing a regularization term can be used. Specifically, suppose that each batch of model training contains For the nth sample, for the nth The probability distribution of the true class of each sample is as follows: The probability distribution predicted by the model is Based on this, this embodiment can adopt the following form of cross-entropy loss function:
[0129]
[0130] in, This is a regularization term used to limit the size of model weights, which helps reduce the risk of overfitting.
[0131] Regarding parameter updates, this embodiment can freeze the parameters of a pre-defined large language model, retaining only the layer normalization parameters (LayerNorm parameters) as trainable, while keeping the other weight parameters fixed. This approach allows the model to perform more targeted adaptive learning based on the features of time-series data, while maintaining the knowledge and structural stability of the original large language model. Subsequently, backpropagation and gradient updates can be performed on the layer normalization parameters based on the loss value, resulting in the trained large language model.
[0132] Furthermore, such as Figure 2 As shown, Figure 2 This diagram illustrates the structure of a training system for a time-series data classification model according to an embodiment of the present invention. The structure mainly includes six functional components: a training data preprocessing component, a causal association information extraction component, a causal embedding generation component, a time-series vector embedding component, a large language model body, and a classification output component. The functions of each component are as follows:
[0133] (1) Training data preprocessing component (Instance Norm + Patching)
[0134] This section is used to perform model usability processing on the original multimodal time series, including:
[0135] Normalization (Instance Norm):
[0136] The original time series of each modality is normalized according to the variable dimension to make the variables comparable in scale.
[0137] Time-block processing (Patching):
[0138] The continuous time series is sliced into multiple time blocks by sliding or non-sliding slices according to a preset time length, and each time block corresponds to a local time segment.
[0139] The result after preprocessing is:
[0140] The time block sequence of multiple modalities is mapped into a vector representation in the projection unit after each time block, which is used as the model input.
[0141] (2) Causal correlation information extraction component (Causal Graph / Causal Discovery)
[0142] This section performs causal inference operations on all variables in the multimodal time series, including:
[0143] The causal relationship between any two variables (i.e., causal graph) is determined using a pre-defined causal inference algorithm (i.e., causal discovery).
[0144] Aggregate the causal relationships between all variables to form modal-level causal association information;
[0145] A causal weight matrix is formed for subsequent causal attention calculation.
[0146] The output of this component is called causal correlation information, which is used in this invention to represent the strength of influence between different modalities.
[0147] (3) Causal Attention and Causal Embedding Generation Components
[0148] This section processes "causal association information" to generate causal enhancement features for subsequent large language models, including:
[0149] Causal attention:
[0150] Attention weights are constructed based on causal relationship information, so that the attention mechanism no longer relies solely on similarity, but instead weights the block vectors of different modalities according to the causal strength.
[0151] Convolution operation (Conv):
[0152] The weighted intermediate vector sequence is input into the convolutional network to generate local context-dependent vector representations.
[0153] Through the above steps, the causal embedding vector sequence (E_cau) is finally obtained, which is used to improve the model's ability to understand cross-modal dependencies.
[0154] (4) Temporal vector embedding components (Token Embedding, Positional Embedding)
[0155] This section is used to convert the causal augmentation of time-series vector sequences into an input format acceptable to large language models, including:
[0156] Token Embedding:
[0157] The vector corresponding to each time block is mapped to a fixed-dimensional word vector.
[0158] Positional Embedding:
[0159] Used to represent the chronological order of time blocks in the original sequence, enabling the model to identify temporal relationships.
[0160] Finally, the causal embedding vector sequence, the word embedding vector sequence, and the position embedding vector sequence are combined to obtain the final temporal vector sequence used as input to the Transformer.
[0161] (5) The main body of the large language model (Transformer Blocks, i.e., Transformer modules)
[0162] This section includes multiple Transformer hierarchical structures, each of which includes:
[0163] Multi-Head Attention, Feed Forward Network, Layer Normalization Unit, and Add & Layer Normalization.
[0164] In this invention, the main parameters of the Transformer are kept frozen during training, and only its layer normalization parameters are adjusted to reduce training costs and improve generalization ability.
[0165] (6) Classification output component (Linear + Softmax)
[0166] It includes: a fully connected classification layer (Linear) and a probability normalization layer (Softmax), which are used to map the Transformer output to the final class prediction result.
[0167] Finally, to verify the effectiveness of the proposed causal enhancement large model fine-tuning method, this embodiment conducts experimental evaluations on multiple public benchmark datasets and systematically analyzes the performance of the model under different components and configurations.
[0168] 1. Experimental setup
[0169] (a) Dataset
[0170] This experiment selects two publicly available benchmark datasets:
[0171] (1) UEA Multivariate Time Series Dataset: This dataset contains 30 multivariate time series subsets, which broadly cover multiple application areas such as human activity, action recognition, physiological signals, and audio spectrum. In this embodiment, four subsets related to bioinformatics are selected: SelfRegulationSCP1, SelfRegulationSCP2, UWaveGestureLibrary, and BasicMotions. The first three are single-modal multivariate time series data, while BasicMotions is multimodal data containing accelerometer and gyroscope signals.
[0172] (2) ISRUC-Sleep polysomnography dataset: This dataset contains multimodal physiological signal records from healthy individuals and patients with sleep disorders, including 19 channels such as EEG, EOG, EMG, and ECG, labeled in 30-second increments. According to the AASM standard, sleep stages include five categories: Wake, N1, N2, N3, and REM. This experiment used two subsets, ISRUC-S1 (100 subjects) and ISRUC-S3 (10 subjects), and divided them into training and test sets according to the subjects to ensure the independence of the evaluation.
[0173] (b) Comparison method
[0174] The time series data classification models selected from representative data with different structural types include:
[0175] Traditional method: XGBoost;
[0176] Transformer methods: Autoformer, FEDformer, PatchTST;
[0177] MLP structural methods: DLinear, LightTS;
[0178] CNN method: TimesNet;
[0179] Large model fine-tuning methods: UniTS-ST, GPT4TS.
[0180] Model performance is evaluated using classification accuracy as the metric.
[0181] (c) Parameter settings
[0182] All experiments were conducted in a dual NVIDIA RTX A5000 GPU environment.
[0183] Causality is calculated using mature PC algorithms;
[0184] The patch size and step size are fixed at 8;
[0185] Batch size is 32; initial learning rate is 1e-3;
[0186] A 6-layer GPT-2 Transformer structure is used as the backbone network;
[0187] The optimizer uses RAdam;
[0188] All comparison methods are configured consistently to ensure fairness.
[0189] (2) Comparison Results and Analysis
[0190] The experimental results are shown in Table 1. On all six datasets, our method achieved the best or tied-best performance, with an average accuracy 2.7% higher than the second-best method.
[0191] Especially on multimodal datasets (such as the ISRUC series), the method of this invention can further improve the accuracy by 1.9% to 2.6% compared to GPT4TS, indicating that the causal enhancement mechanism can effectively model the dependencies between different modalities and improve the classification results.
[0192] Furthermore, some methods that perform well only in single-modal scenarios (such as DLinear and UniTS-ST) show a significant performance drop on the multimodal ISRUC dataset, verifying the applicability and robustness of the method of this invention in complex multimodal scenarios.
[0193] In summary, the method of this invention achieves optimal or near-optimal results on various datasets, demonstrating that improving the fine-tuning efficiency of large models through causal relationship modeling has significant advantages.
[0194] Table 1
[0195]
[0196] Table 1 above lists the classification accuracy of different benchmark methods on six publicly available time series datasets. "SelfRegulationSCP1", "SelfRegulationSCP2", "UWaveGestureLibrary", "BasicMotions", "ISRUC-S3", and "ISRUC-S1" represent single-modal or multimodal time series datasets from different sources; "Average" is the average accuracy across the six datasets. "XGBoost", "Autoformer", "FEDformer", "PatchTST", "DLinear", "LightTS", "TimesNet", "UniTS-ST", and "GPT4TS" in the row names are all existing representative time series classification models; "Ours" indicates the method proposed in this invention. All values are expressed as a percentage of classification accuracy.
[0197] (3) Ablation research
[0198] (a) Dissolution of causal attention mechanisms
[0199] In this experiment, the complete model was compared with a variant model that removed the causal attention mechanism. The experimental results are shown in Table 2:
[0200] Table 2
[0201]
[0202] Table 2 above lists the classification accuracy comparison between the proposed method (Ours) and a variant model with causal attention removed (w / ocausal attention) on six public datasets. Column names represent different unimodal or multimodal time series datasets; in the row names, "Ours" represents the complete model proposed in this invention that includes the causal attention mechanism, and "w / o causal attention" represents the control model that removes the causal attention mechanism but retains only the remaining structure. The percentages in the table represent classification accuracy, and the values in parentheses represent the performance change relative to the complete model (in percentage points).
[0203] Removing causal attention leads to performance degradation across all datasets;
[0204] The decrease is more pronounced on multimodal datasets (such as BasicMotions and ISRUC-S3), reaching up to 7.5%.
[0205] The results show that causal attention can effectively capture the structural relationships between variables and modalities, and is a key component in improving model performance.
[0206] (b) Fine-tuning strategy ablation
[0207] Six different fine-tuning strategies were tested, including full parameter fine-tuning, partial parameter freezing, and random initialization. The results show that:
[0208] Table 3
[0209]
[0210] Table 3 compares the classification accuracy of different fine-tuning strategies on multiple public datasets, and the number of trainable parameters (in millions of parameters M) for each strategy is given in parentheses. "Ours" indicates the proposed fine-tuning strategy, which updates only the layer normalization parameter (ln) and positional encoding weights (wpe); "-ln" indicates removing layer normalization fine-tuning; "-wpe" indicates removing positional encoding weight fine-tuning; "-ln-wpe" indicates freezing all pre-trained Transformer modules; "NoFreeze" indicates fine-tuning all model parameters; "NoPT+NoFreeze" indicates random model initialization and full parameter training; "NoPT+Freeze" indicates fine-tuning only the ln and wpe parameters without a pre-trained model. The percentage values in the table represent classification accuracy, and the values in parentheses represent the number of trainable parameters.
[0211] The strategy of only fine-tuning the layer normalization parameter (ln) and the positional encoding weight (wpe) achieved the best results on all five datasets;
[0212] Compared to full parameter fine-tuning, this method requires very few trainable parameters (approximately 1.4M to 3.4M), significantly reducing the risk of overfitting.
[0213] This invention demonstrates that it achieves the best balance between training efficiency, generalization ability, and model size.
[0214] (c) Layer configuration ablation
[0215] Tested different Transformer layer numbers {0, 1, 3, 6, 9, 12}. Results are as follows. Figure 3 As shown: Figure 3 This is one of the performance test graphs for a time series data classification model. Figure 3 On the SelfRegulationSCP1 dataset, the performance gradually improves with the number of layers, reaching its best at 6 layers.
[0216] On the BasicMotions dataset, performance initially decreased with increasing the number of layers (0→3 layers), improved significantly with 6 layers, and decreased again with 9 and 12 layers.
[0217] This indicates that the number of Transformer layers is not linearly related to performance, and the 6-layer structure can achieve optimal performance on different datasets, making it a relatively stable architecture configuration.
[0218] (d) Ablation of pre-trained models
[0219] The performance of GPT-2, BERT, and T5 as backbone networks is compared, and the results are as follows: Figure 4 As shown. Figure 4 This is the second performance experiment graph for a time-series data classification model. Observations show that:
[0220] GPT-2 achieved the best results in both SelfRegulationSCP1 and BasicMotions;
[0221] Both BERT and T5 performed worse than GPT-2, and even lagged behind the simpler LightTS in some metrics.
[0222] Note: GPT-2, with its autoregressive structure, is more suitable for time series modeling tasks and is a more appropriate pre-trained model for the backbone network of this method.
[0223] (4) Robustness to causal graph noise
[0224] To verify the impact of causal noise on model performance, 10% and 20% of the edges of the causal graph were randomly flipped in the SelfRegulationSCP1 and ISRUC-S3 datasets, respectively. Experimental results show that:
[0225] Table 4
[0226]
[0227] Table 4 above shows the classification performance variations of the method of this invention under different causal edge noise conditions. Here, "ratio" represents the proportion of random flipping of causal relationship edges in the causal graph, used to simulate noise that may be generated by the causal discovery algorithm; "SelfRegulationSCP1" and "ISRUC-S3" correspond to two publicly available time series datasets, respectively. The percentages in the table represent classification accuracy, and the values in parentheses represent the change in accuracy (in percentage points) relative to the noise-free condition (ratio=0%).
[0228] On SelfRegulationSCP1, 20% noise results in only a 2.3% performance decrease; on ISRUC-S3, performance is almost unaffected.
[0229] This demonstrates that the proposed method is robust to causal noise, and the model can still stably learn an effective modal dependency structure even if the causal graph is imperfect.
[0230] (5) Visualization analysis
[0231] To further understand the role of causal mechanisms, the causal weight matrix (i.e., causal association information) and causal attention are visualized respectively.
[0232] Figure 5 This is a schematic diagram of the structure of causal association information in one embodiment of the present invention. Figure 5 The data shows that in the BasicMotions (bimodal) dataset, the causal relationships between variables of different modalities exhibit a clear block structure.
[0233] In SelfRegulationSCP1 (multivariate), the causal relationships exhibit a sparse checkerboard pattern, indicating fine-grained differences in dependencies between different variables.
[0234] Figure 6 This is a schematic diagram of the structure of causal attention in one embodiment of the present invention. Figure 6 This indicates that there are significant differences in the attention values of the same variable across different trait dimensions; and that different variables also have different levels of attention on the same dimension.
[0235] This demonstrates that causal mechanisms can not only characterize the autocorrelation patterns within variables, but also reveal the differentiated contributions of variables in classification decisions.
[0236] In one embodiment, such as Figure 7 As shown, a data classification method is provided, including the following steps:
[0237] 701. Obtain the trained large language model and the time series data to be classified;
[0238] 702. Provide the time series data to be classified to the trained large language model so that the trained large language model can output the classification result corresponding to the time series data to be classified.
[0239] In this embodiment of the invention, the trained large language model is obtained by training a time-series data classification model. The trained large language model is a model with optimized parameters obtained through the time-series data classification model training method, and its layer normalization parameters have been fine-tuned according to the distribution characteristics of the training set.
[0240] The time series data to be classified can be a single-modal or multi-modal time series, specifically including physiological signals, motion sensor data, environmental monitoring data, speech spectrum features, industrial sensor sampling sequences, etc. Its data structure is consistent with the data structure used in the training phase to ensure feature space compatibility.
[0241] The aforementioned time-series data to be classified is input into a pre-trained large language model. Based on its fine-tuned layer normalization parameters and internal context modeling capabilities, the model performs inference calculations on the input time-series data and generates corresponding classification results. These classification results can be output as classification labels, category probability distributions, or other forms of category indication information. Since the pre-trained large language model has already learned the mapping relationship between time-series data and target labels during the training phase, the model can accurately classify new time-series data.
[0242] It is understandable that the trained large language model directly inherits the training method of the aforementioned time series data classification model, that is: the model training is completed by acquiring the training set, calculating causal relationship information, constructing a causal-enhanced time series vector sequence, inputting it into the preset large language model, and adjusting the layer normalization parameters.
[0243] Therefore, the trained large language model used in this embodiment naturally possesses the ability to adapt to temporal input structures and capture the correlation characteristics between multimodal or multivariate data, thereby enabling classification inference of actual time-series data.
[0244] It should be noted that the time-series data classification model training method proposed in this invention can be used not only for general multimodal time-series data analysis, but also for building intelligent service modules, artificial intelligence middleware, and time-series analysis function libraries for artificial intelligence operating systems. By encapsulating the time-series data classification model trained by the method of this invention into a standardized interface, it can be called by upper-layer computer vision and audiovisual software, biometric recognition software, medical and health monitoring software, industrial IoT monitoring software, and other application software to achieve automatic classification and intelligent decision-making of multi-source time-series signals such as electroencephalograms, electrocardiograms, electromyograms, motion sensor data, and environmental sensor data. This aligns with the industrial direction of developing key basic software and application software for artificial intelligence and has high engineering application value.
[0245] Specifically, the aforementioned time-series classification model and its training method can be provided as a software product, serving as a middleware component or function library module running on an AI-optimized operating system, and providing time-series data classification services through a pre-defined programming interface (API). Application developers can call this middleware or function library in computer vision software, biometric recognition software, health monitoring applications, and smart security applications to automatically analyze and classify collected EEG, ECG, EMG, EOG, motion sensor data, and other physiological signals. The descriptions of deployment configurations and application scenarios in these embodiments do not constitute a limitation on the scope of protection of this invention.
[0246] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0247] In one embodiment, a training apparatus for a time-series data classification model is provided, which corresponds one-to-one with the training method for the time-series data classification model in the above embodiments. For example... Figure 8 As shown, the training device for this time-series data classification model includes a first acquisition module 801, a first determination module 802, a first embedding module 803, a first classification module 804, and a first adjustment module 805. Detailed descriptions of each functional module are as follows:
[0248] The first acquisition module 801 is used to acquire a training set and a preset large language model. The training set includes time-series vector sequences of multiple modalities and category labels corresponding to each time-series vector sequence.
[0249] The first determining module 802 is used to determine the causal relationship information between each mode based on a preset causal inference algorithm;
[0250] The first embedding module 803 is used to embed the causal association information into the time-series vector sequence to obtain a causal-enhanced time-series vector sequence;
[0251] The first classification module 804 is used to provide the causal-enhanced temporal vector sequence to the large language model to obtain a classification result.
[0252] The first adjustment module 805 is used to calculate the loss value between the classification result and the category label, and adjust the layer normalization parameters of the large language model based on the loss value to obtain the trained large language model.
[0253] Optionally, the first acquisition module 801 is further configured to:
[0254] Acquire raw time-series data of multiple modalities, wherein the raw time-series data includes raw time series of multiple variables changing over time;
[0255] The original time series is normalized to obtain a normalized time series.
[0256] The normalized time series is divided into blocks according to a preset time length to obtain multiple time blocks;
[0257] Each time block is mapped to a vector representation of a preset dimension, and a time-series vector sequence of the multiple modalities is formed in chronological order. The training set is constructed based on the time-series vector sequence and its corresponding category label.
[0258] Optionally, the first determining module 802 is further configured to:
[0259] Based on the preset causal inference algorithm, the causal relationship between any two variables in a time-series vector sequence of multiple modalities is determined;
[0260] Aggregation is performed based on the causal relationships between all variables to obtain causal association information between each modality.
[0261] Optionally, the first embedding module 803 is further configured to:
[0262] Attention weights are generated based on the causal correlation information, and the temporal vector sequences of multiple modalities are weighted based on the attention weights to obtain a weighted intermediate vector sequence.
[0263] Perform convolution operation on the weighted intermediate vector sequence to obtain a causal embedding vector sequence;
[0264] The causal embedding vector sequence and the temporal vector sequence are combined to obtain the causal-enhanced temporal vector sequence.
[0265] Optionally, the first embedding module 803 is further configured to:
[0266] Convolution is performed on the temporal vector sequence to map the temporal vector sequence into a preset dimensional space, thereby obtaining a word embedding vector sequence.
[0267] Determine the word position embedding of the preset large language model and generate a sequence of position embedding vectors;
[0268] The causal embedding vector sequence, the word embedding vector sequence, and the position embedding vector sequence are combined to obtain the causal-enhanced temporal vector sequence.
[0269] Optionally, the first adjustment module 805 is further configured to:
[0270] The loss value is calculated based on a preset cross-entropy loss function, which includes a regularization term;
[0271] Freeze all model parameters in the preset large language model except for the layer normalization parameters, and adjust the layer normalization parameters of the large language model based on the loss value to obtain the trained large language model.
[0272] Specific limitations regarding the training device for the time series data classification model can be found in the limitations on the training method for the time series data classification model described above, and will not be repeated here. Each module in the training device for the aforementioned time series data classification model can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0273] In one embodiment, a data classification device is provided, which corresponds one-to-one with the data classification methods described in the above embodiments. For example... Figure 9 As shown, the data classification device includes a second acquisition module 901 and a second classification module 902. Detailed descriptions of each functional module are as follows:
[0274] The second acquisition module 901 is used to acquire the trained large language model and the time series data to be classified. The trained large language model is obtained by training the time series data classification model using a training method.
[0275] The second classification module 902 is used to provide the time series data to be classified to the trained large language model so that the trained large language model outputs the classification result corresponding to the time series data to be classified.
[0276] Specific limitations regarding the data classification device can be found in the limitations of the data classification method above, and will not be repeated here. Each module in the aforementioned data classification device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0277] In one embodiment, a computer device is provided, which may be a terminal device, and its internal structure diagram may be as follows: Figure 10As shown, the computer device includes a processor, memory, and network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes a readable storage medium storing computer-readable instructions. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer-readable instructions implement a training method for a time-series data classification model or a data classification method. The readable storage medium provided in this embodiment includes both non-volatile and volatile readable storage media.
[0278] In this application embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, it implements the steps of the training method or data classification method of the time series data classification model as described above.
[0279] In one embodiment of the application, a readable storage medium is provided, which stores computer-readable instructions. When executed by a processor, the computer-readable instructions implement the steps of the training method or data classification method of the time-series data classification model described above.
[0280] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When executed, these computer-readable instructions can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0281] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0282] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A training method for a time-series data classification model, characterized in that, The method includes: Obtain a training set and a preset large language model. The training set includes time-series vector sequences of multiple modalities and category labels corresponding to each time-series vector sequence. Based on a pre-defined causal inference algorithm, causal relationship information between modes is determined. The pre-defined causal inference algorithm includes a causal discovery algorithm based on conditional independence or a causal inference algorithm based on prediction residuals. The pre-defined causal inference algorithm performs statistical analysis on the historical changes of time-series vector sequences corresponding to any two modes to determine whether the change of one mode has an identifiable impact on the change of the other mode. The causal relationship information is numerical information that characterizes the strength or direction of causal influence between different modes, and is used to describe the quantitative results of whether one mode affects other modes and the degree of influence. The causal association information is embedded into the time-series vector sequence to obtain a causal-enhanced time-series vector sequence; The causal-enhanced temporal vector sequence is provided to the large language model to obtain the classification result; Calculate the loss value between the classification result and the category label, and adjust the layer normalization parameters of the large language model based on the loss value to obtain the trained large language model; The step of embedding the causal association information into the time-series vector sequence to obtain the causally enhanced time-series vector sequence includes: Attention weights are generated based on the causal correlation information, and the temporal vector sequences of multiple modalities are weighted based on the attention weights to obtain a weighted intermediate vector sequence. Perform convolution operation on the weighted intermediate vector sequence to obtain a causal embedding vector sequence; The causal embedding vector sequence and the temporal vector sequence are combined to obtain the causal-enhanced temporal vector sequence. The algorithm based on a preset causal inference determines the causal relationship information between each modality, including: Based on the preset causal inference algorithm, the causal relationship between any two variables in a time-series vector sequence of multiple modalities is determined; Aggregation processing is performed based on the causal relationships between all variables to obtain causal association information between each modality; The process of combining the causal embedding vector sequence and the temporal vector sequence to obtain the causal-enhanced temporal vector sequence includes: Convolution is performed on the temporal vector sequence to map the temporal vector sequence into a preset dimensional space, thereby obtaining a word embedding vector sequence. Determine the word position embedding of the preset large language model and generate a sequence of position embedding vectors; The causal embedding vector sequence, the lexical embedding vector sequence, and the positional embedding vector sequence are combined to obtain the causal-enhanced temporal vector sequence.
2. The training method for the time-series data classification model as described in claim 1, characterized in that, The acquisition of the training set includes: Acquire raw time-series data of multiple modalities, wherein the raw time-series data includes raw time series of multiple variables changing over time; The original time series is normalized to obtain a normalized time series. The normalized time series is divided into blocks according to a preset time length to obtain multiple time blocks; Each time block is mapped to a vector representation of a preset dimension, and a time-series vector sequence of the multiple modalities is formed in chronological order. The training set is constructed based on the time-series vector sequence and its corresponding category label.
3. The training method for the time-series data classification model as described in claim 1, characterized in that, The process of calculating the loss value between the classification result and the category label, and adjusting the layer normalization parameters of the large language model based on the loss value to obtain the trained large language model includes: The loss value is calculated based on a preset cross-entropy loss function, which includes a regularization term; Freeze all model parameters in the preset large language model except for the layer normalization parameters, and adjust the layer normalization parameters of the large language model based on the loss value to obtain the trained large language model.
4. A data classification method, characterized in that, The method includes: A trained large language model and time series data to be classified are obtained, wherein the trained large language model is trained by the training method of the time series data classification model according to any one of claims 1 to 3; The time-series data to be classified is provided to the trained large language model so that the trained large language model outputs the classification result corresponding to the time-series data to be classified.
5. A training device for a time-series data classification model, characterized in that, The device includes: The first acquisition module is used to acquire a training set and a preset large language model. The training set includes time-series vector sequences of multiple modalities and category labels corresponding to each time-series vector sequence. The first determining module is used to determine the causal relationship information between modes based on a preset causal inference algorithm. The preset causal inference algorithm includes a causal discovery algorithm based on conditional independence or a causal inference algorithm based on prediction residuals. The preset causal inference algorithm performs statistical analysis on the historical changes of the time series vector sequences corresponding to any two modes to determine whether the change of one mode has an identifiable impact on the change of the other mode. The causal relationship information is numerical information that characterizes the strength or direction of causal influence between different modes and is used to describe the quantitative results of whether one mode will affect other modes and the degree of influence. The first embedding module is used to embed the causal association information into the time-series vector sequence to obtain a causal-enhanced time-series vector sequence; The first classification module is used to provide the causal-enhanced temporal vector sequence to the large language model to obtain the classification result; The first adjustment module is used to calculate the loss value between the classification result and the category label, and adjust the layer normalization parameters of the large language model based on the loss value to obtain the trained large language model. The first embedding module is further configured to: Attention weights are generated based on the causal correlation information, and the temporal vector sequences of multiple modalities are weighted based on the attention weights to obtain a weighted intermediate vector sequence. Perform convolution operation on the weighted intermediate vector sequence to obtain a causal embedding vector sequence; The causal embedding vector sequence and the temporal vector sequence are combined to obtain the causal-enhanced temporal vector sequence. The first determining module is further configured to: Based on the preset causal inference algorithm, the causal relationship between any two variables in a time-series vector sequence of multiple modalities is determined; Aggregation processing is performed based on the causal relationships between all variables to obtain causal association information between each modality; The first embedding module is further configured to: Convolution is performed on the temporal vector sequence to map the temporal vector sequence into a preset dimensional space, thereby obtaining a word embedding vector sequence. Determine the word position embedding of the preset large language model and generate a sequence of position embedding vectors; The causal embedding vector sequence, the lexical embedding vector sequence, and the positional embedding vector sequence are combined to obtain the causal-enhanced temporal vector sequence.
6. A data classification device, characterized in that, The device includes: The second acquisition module is used to acquire the trained large language model and the time series data to be classified. The trained large language model is obtained by training the time series data classification model according to any one of claims 1 to 3. The second classification module is used to provide the time series data to be classified to the trained large language model, so that the trained large language model outputs the classification result corresponding to the time series data to be classified.
7. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and running on the processor, characterized in that, When the processor executes the computer-readable instructions, it implements the training method for the time-series data classification model as described in any one of claims 1 to 3 or the data classification method as described in claim 4.