Classification method, device, equipment and storage medium for multi-source time series

By calculating the pairwise distances and importance scores between domains, constructing a loss function, and using kernel density estimation and importance sampling techniques to adjust the learning rate, the multi-source time series classification model is adaptively trained, which solves the adaptability problem of the multi-source time series classification model in the transfer learning process and improves the classification accuracy.

CN113920365BActive Publication Date: 2025-09-19JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111177207.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-09
Publication Date
2025-09-19
Estimated Expiration
2041-10-09

AI Technical Summary

Technical Problem

Multi-source time series classification models in existing technologies are difficult to achieve good classification results in industrial applications, especially in the classification of sensor time series from multiple data sources. Existing deep learning models lack adaptability in the transfer learning process, resulting in low classification accuracy.

Method used

By calculating the inter-domain pairwise distance between the source and target domains, quantifying the inter-domain importance scores, constructing a loss function, and using kernel density estimation and importance sampling techniques to adjust the learning rate, we adaptively perform transfer learning and train a multi-source time series classification model.

Benefits of technology

The accuracy of multi-source time series classification is improved, showing strong adaptability in the process of knowledge transfer from multiple source domains to target domains, and can achieve more efficient classification results under conditions of limited data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113920365B_ABST
    Figure CN113920365B_ABST
Patent Text Reader

Abstract

The present disclosure provides a multi-source time series classification method, apparatus, device, and storage medium. The method comprises: obtaining a first time series in a target domain; inputting the first time series into a preset multi-source time series classification model to obtain a classification result for the first time series; wherein the multi-source time series classification model is trained using time series from multiple source domains and the target domain based on pairwise distances between the source domains and the target domain. The technical solution of the present disclosure can achieve relatively accurate classification of multi-source time series.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer network technology, and in particular to a multi-source time series classification method, device, electronic device, and non-transitory computer-readable storage medium. Background Art

[0002] A time series is an ordered sequence formed by arranging the various values ​​of a phenomenon or statistical indicator at different time nodes in chronological order.

[0003] Deep learning-based models have made great progress in time series classification compared to traditional algorithms. However, when dealing with time series classification problems in industrial applications, especially the classification of sensor time series from multiple data sources, most deep learning-based time series classification models find it difficult to achieve good classification results due to the different data characteristics of actual scenarios. Summary of the Invention

[0004] The present disclosure provides a multi-source time series classification method, device, electronic device and non-transitory computer-readable storage medium, which are used to solve the defect of inaccurate multi-source time series classification in the prior art and improve the accuracy of multi-source time series classification.

[0005] The present disclosure provides a multi-source time series classification method, comprising: obtaining a first time series in a target domain; inputting the first time series into a preset multi-source time series classification model to obtain a classification result of the first time series; wherein the multi-source time series classification model is trained using time series of multiple source domains and the target domain based on pairwise distances between the source domains and the target domain.

[0006] According to a multi-source time series classification method provided by the present disclosure, the training method of the multi-source time series classification model includes: obtaining the inter-domain pairwise distance between the source domain and the target domain; obtaining the inter-domain importance score between the source domain and the target domain based on the inter-domain pairwise distance; constructing a loss function based on the inter-domain importance score; using the source domain to train the initial neural network model according to the loss function to obtain an intermediate neural network model; and using the target domain to adjust the intermediate neural network model to obtain the multi-source time series classification model.

[0007] According to a multi-source time series classification method provided by the present disclosure, the inter-domain importance score between the source domain and the target domain is obtained based on the inter-domain pairwise distance, including: constructing a posterior distribution of the inter-domain pairwise distance through kernel density estimation based on the inter-domain pairwise distance; sampling in the posterior distribution to obtain a sampling matrix; and obtaining the inter-domain importance score based on the matrix norm of the sampling matrix.

[0008] According to a multi-source time series classification method provided by the present disclosure, constructing a loss function based on the inter-domain importance score includes: constructing the loss function based on an iteration parameter, a learning rate, and a batch size of the source domain, wherein the iteration parameter and the learning rate are obtained based on the inter-domain importance score.

[0009] According to a classification method for multi-source time series provided by the present disclosure, the time series of the source domain and the target domain are single-dimensional time series, and obtaining the pairwise distance between the source domain and the target domain includes: calculating the distance between the single-dimensional time series of the source domain and the target domain and splicing them.

[0010] According to a classification method for multi-source time series provided by the present disclosure, the time series of the source domain and the target domain are K-dimensional time series, where K is a natural number and K≥2, and obtaining the inter-domain pairwise distance between the source domain and the target domain includes: decomposing the time series into K-dimensional univariate time series groups; calculating the distance of the univariate time series groups by dimension and performing K-dimensional splicing.

[0011] According to a classification method for multi-source time series provided by the present disclosure, the kernel of the posterior distribution is a multivariate normal kernel.

[0012] The present disclosure also provides a multi-source time series classification device, which includes: an acquisition unit, used to acquire a first time series in a target domain; a classification unit, used to input the first time series into a preset multi-source time series classification model to obtain a classification result of the first time series; wherein the multi-source time series classification model is trained using time series of multiple source domains and the target domain according to the pairwise distance between the source domain and the target domain.

[0013] According to a multi-source time series classification device provided by the present disclosure, the device also includes a training unit for training the multi-source time series classification model, and the training unit includes: a distance acquisition subunit for acquiring the inter-domain pairwise distance between the source domain and the target domain; an importance acquisition subunit for acquiring the inter-domain importance score between the source domain and the target domain based on the inter-domain pairwise distance; a construction subunit for constructing a loss function based on the inter-domain importance score; a first training subunit for training the initial neural network model using the source domain according to the loss function to obtain an intermediate neural network model; and a second training subunit for adjusting the intermediate neural network model using the target domain to obtain the multi-source time series classification model.

[0014] According to a multi-source time series classification device provided by the present disclosure, the importance acquisition subunit is also used to: construct the posterior distribution of the inter-domain pairwise distances through kernel density estimation based on the inter-domain pairwise distances; perform sampling in the posterior distribution to obtain a sampling matrix; and obtain the inter-domain importance score based on the matrix norm of the sampling matrix.

[0015] According to a multi-source time series classification device provided by the present disclosure, the construction subunit is further used to: construct the loss function according to the iteration parameter, the learning rate and the batch size of the source domain, wherein the iteration parameter and the learning rate are obtained according to the inter-domain importance score.

[0016] According to a multi-source time series classification device provided by the present disclosure, the time series of the source domain and the target domain are single-dimensional time series, and the distance acquisition subunit is further used to: calculate the distance between the single-dimensional time series of the source domain and the target domain and splice them.

[0017] According to a multi-source time series classification device provided by the present disclosure, the time series of the source domain and the target domain are K-dimensional time series, wherein K is a natural number and K≥2, and the distance acquisition subunit is further used to: decompose the time series into K-dimensional univariate time series groups; calculate the distance of the univariate time series groups by dimension and perform K-dimensional splicing.

[0018] According to a multi-source time series classification device provided by the present disclosure, the kernel of the posterior distribution is a multivariate normal kernel.

[0019] The present disclosure also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-described multi-source time series classification methods are implemented.

[0020] The present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described multi-source time series classification methods.

[0021] The multi-source time series classification method, device, electronic device and non-transitory computer-readable storage medium provided by the present disclosure can improve the accuracy of time series classification by using the multi-source time series classification model to classify the time series of the target domain after training the multi-source time series classification model using the inter-domain pairwise distance between the source domain and the target domain.

[0022] The algorithm framework proposed in the embodiment of the present disclosure consists of pairwise distances between domains, importance density estimation, importance score sampling, and knowledge transfer degree control. All source domains need to calculate the importance scores and knowledge transfer degrees through the above process. The pre-training process is guided by the importance of the source domain by controlling the learning rate, and then the pre-trained model will be fine-tuned on the target domain to achieve good performance. The algorithm framework is able to integrate multi-source information into the process of knowledge transfer. The framework shows a strong adaptability of knowledge transfer from multiple source domains to the target domain, and shows high superiority and effectiveness in the process of time series classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the present disclosure or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0024] Figure 1 It is a flowchart of the multi-source time series classification method provided by the present disclosure;

[0025] Figure 2 This is one of the flowcharts of the training method for the multi-source time series classification model provided by the present disclosure;

[0026] Figure 3 This is the second flowchart of the training method of the multi-source time series classification model provided by the present disclosure;

[0027] Figure 4 It is a structural diagram of a multi-source time series classification device provided by the present disclosure;

[0028] Figure 5 is a schematic structural diagram of a training unit provided by the present disclosure;

[0029] Figure 6 It is a structural diagram of the electronic device provided by the present disclosure. DETAILED DESCRIPTION

[0030] To make the objectives, technical solutions, and advantages of this disclosure more clear, the technical solutions of this disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of this disclosure, not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of this disclosure without creative effort shall fall within the scope of protection of this disclosure.

[0031] The terms used in one or more embodiments of the present disclosure are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of the present disclosure. The singular forms "a", "the", and "the" used in one or more embodiments of the present disclosure and the appended claims are also intended to include plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present disclosure refers to and includes any or all possible combinations of one or more associated listed items.

[0032] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present disclosure, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of one or more embodiments of the present disclosure, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0033] Time-Series Classification (TSC), a branch of sequence classification, has garnered widespread attention in the field of time series mining. Time series classification problems exist in numerous real-life domains and scenarios, including weather forecasting, stock data classification and prediction, electrocardiogram (ECG) or electroencephalogram (EEG) classification, and the classification of household appliances based on power consumption.

[0034] Time series classification is an important and challenging task in data mining, covering scenarios such as healthcare, human activity recognition, and security.

[0035] Deep learning models used for time series classification on multi-source datasets are typically obtained through transfer learning between multiple source and target domains. Transfer learning refers to the learning process of pre-training in the source domain and then fine-tuning parameters in the target domain. Naive transfer learning treats each source domain as equally important and performs indiscriminate pre-training on each.

[0036] Transfer learning techniques for TSC tasks can improve the generalization ability of deep neural networks. However, many TSC scenarios consist of multiple domains, making the transfer learning setting more complex when performing knowledge transfer.

[0037] In related technologies, the classification effect of the deep learning model obtained through transfer learning is poor.

[0038] In a transfer learning framework, intelligent transfer learning is performed based on experience from a source domain, but the source domain and target domain are considered to be completely different application scenarios. This results in the trained deep learning models being of limited practical value. In many scenarios, when considering the use of transfer learning frameworks, the dataset or source domain used is physically related to or identical to the current target domain.

[0039] Another transfer learning framework considers time series regression in a multi-source domain transfer learning framework for industrial sensor applications. However, due to the significant differences between time series regression and time series classification, and the lack of adaptive features, this transfer learning framework leads to negative knowledge transfer to a certain extent. Therefore, for multi-source time series classification, there is currently no universal transfer learning framework that can adaptively train deep learning models, making it difficult to obtain accurate classification results using deep learning models.

[0040] To solve this problem, embodiments of the present disclosure provide a multi-source time series classification method, apparatus, electronic device, and non-transitory computer-readable storage medium.

[0041] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.

[0042] like Figure 1 The flowchart of the multi-source time series classification method of the embodiment of the present disclosure is shown. The method provided by the embodiment of the present disclosure can be executed by any electronic device with computer processing capabilities, such as a terminal device and / or a server. Figure 1 As shown in Figure 2, the classification methods for this multi-source time series include:

[0043] Step 102: Acquire a first time series in the target domain.

[0044] Specifically, the first time series is a time series in the target domain.

[0045] In step 104, the first time series is input into a preset multi-source time series classification model to obtain a classification result of the first time series; wherein the multi-source time series classification model is trained using time series of multiple source domains and target domains based on the pairwise distance between the source domains and the target domains.

[0046] Specifically, the inter-domain pairwise distance refers to the distance between the pairwise corresponding data between the source domain and the learning domain.

[0047] In the embodiments of the present disclosure, the transfer learning framework proposed for time series classification fully considers the adaptive characteristics, can mine and quantify the similarities between multiple source domains and target domains, and then perform adaptive transfer learning, thereby maximizing the accuracy of the multi-source time series classification model under limited data conditions.

[0048] like Figure 2 As shown in Figure 2, the training method for the multi-source time series classification model includes:

[0049] Step 202: Obtain the inter-domain pairwise distance between the source domain and the target domain.

[0050] Step 204: Obtain an inter-domain importance score between the source domain and the target domain based on the inter-domain pairwise distance.

[0051] Step 206: construct a loss function based on the inter-domain importance scores.

[0052] Step 208: The initial neural network model is trained using the source domain according to the loss function to obtain an intermediate neural network model.

[0053] Step 210 , using the target domain to adjust the intermediate neural network model to obtain a multi-source time series classification model.

[0054] In the embodiments of the present disclosure, the specific characteristics of the problem of multi-source time series classification can be standardized, especially for some scenarios where there is a physical connection between the source domain and the target domain, such as motion behavior detection, medical signal detection, environmental detection signal processing, etc. The algorithm framework of the embodiments of the present disclosure can be deployed in a wide range of industrial scenarios for multi-source time series classification, providing more possibilities for the practical application of time series classification in devices with limited computing power and data volume. This framework does not involve the specific type of neural network for the time series classification model, so it has very high flexibility and can achieve better results as more efficient and accurate models are embedded.

[0055] In the embodiment of the present disclosure, X={X i,v |i=1,…,N,v=1,…,V} represents a set of multi-source multivariate time series, where N is the number of multivariate time series in each domain. In the disclosed embodiment, the last domain V can be defined as the target domain, domains 1,…,V-1 are multiple source domains, and both N and V are natural numbers.

[0056] In the multi-source multi-TSC task based on transfer learning, we first learn a classifier X\{X i,V |i=1,…,N}, and then transfer the learned knowledge and features to the target domain {X i,V |i=1,…,N} and tasks. For any set X={X (1),…,X (J)}, indicating that the set X does not have the jth element as X\{X (j)}.

[0057] In the embodiments of the present disclosure, in order to adaptively implement transfer learning on multi-source time series data, it is necessary to quantify the importance between different domains. Specifically, the importance between different domains can be quantified by calculating the pairwise distance between domains, that is, the time series distance algorithm in the prior art is used to calibrate the importance between domains.

[0058] When calculating the pairwise distance between two domains, let the source domain be S = {X j,S |j=1,…,N}, the target domain is T={X j,T |j=1,…,N}, where N is the number of samples, X j Represents the j-th multi-domain time series.

[0059] In the disclosed embodiment, the time series of the source domain and the target domain may also be K-dimensional time series, where K is a natural number and K ≥ 2. In this case, in step 202, the time series is decomposed into K-dimensional univariate time series groups; the distance of the univariate time series groups is calculated by dimension and K-dimensional concatenation is performed.

[0060] Specifically, X j Divided into two domains X j,s , X j,T If X j,s , X j,T It is a multivariate time series. In order to maintain the dimension information, the multivariate time series X can be decomposed when calculating the similarity. j,S , X j,T To a univariate time series:

[0061] X j,S ={X k,j,S |k=1,…,K},X j,T ={X k,j,T |k=1,…,K}, where k represents the k-dimensional multivariate time series in the two domains, K is the number of dimensions, and K is a natural number. k,j,S , X k,j,T The inter-domain pairwise distance calculation between the two is correspondingly decomposed into the inter-domain pairwise distance calculation of the univariate time series. For example, the calculation formula of dynamic time warping is: S k,j =dist(X k,j,S , X k,j,T ).

[0062] At the data level, the distance between pairs of corresponding data in the source and target domains is a quantitative representation of how similar they are. In the embodiments of the present disclosure, a time series distance algorithm in the prior art can be used to calculate the similarity of pairwise data in each source and target domain pair.

[0063] In one embodiment of the present disclosure, given a source domain S q , target domain T, where the source domain and target domain are T={X j,T |j=1,…,N}, all time series are K-dimensional. Set j=1, 2,…,N in sequence and execute the following loop:

[0064] Paired source domain S q , the corresponding sequence in the target domain T (X j,S , X j,T ), decompose the corresponding sequence group into a K-dimensional univariate time series group X j,T ={X k,j , T|k=1,…,K}, calculate the distance by dimension for the univariate time series group Afterwards, a matrix S is formed by splicing K dimensions and N samples q ={S 1 ,…,S j ,…,S N}, where S j =(S 1,j ,…,S K,j ).

[0065] In the embodiment of the present disclosure, the time series of the source domain and the target domain can be single-dimensional time series. In this case, in step 202, the distance between the single-dimensional time series of the source domain and the target domain is calculated and spliced. Specifically, the distance between the single-variable time series group is directly calculated. And spliced ​​into matrix S q ={S 1 ,…,S j ,…,S N}.

[0066] In step 204, a posterior distribution of the inter-domain pairwise distances can be constructed based on the inter-domain pairwise distances using kernel density estimation. Sampling is performed in the posterior distribution to obtain a sampling matrix, and the inter-domain importance scores are then obtained based on the matrix norm of the sampling matrix. Here, the kernel of the posterior distribution can be a multivariate normal kernel.

[0067] Specifically, in the disclosed embodiments, density estimation can be applied to approximate the posterior distribution of all pairwise similarities in the latent space. Simultaneously, importance sampling techniques are employed to extract mini-batches of samples from the approximate posterior distribution and calculate importance scores over the samples to control the degree of knowledge transfer during the pre-training setting.

[0068] Among them, by connecting the distances in all K dimensions, we can get S j =(S 1,j ,…,S K,j ). The calculated pairwise distances of all instances will be obtained from S1 to S N , and put them into the observation set, that is, sample S = {S1, S2, ..., S N By kernel density estimation, we can approximate the posterior distribution Q(S) of the sample.

[0069] Based on the sample {S1, ..., S N The univariate kernel density estimator for a continuous variable can be expressed as Where w(·) is the kernel function, which is a symmetric weight, and h is the smoothing parameter or bandwidth. For multivariate kernel density estimation, let {S1, S2, ..., S N} is a sample of a random vector of d-dimensional variables drawn from a public distribution generated by the density function f.

[0070] The kernel density estimate is Here, H is the bandwidth or smoothness, a symmetric and positive definite d·d matrix. Furthermore, the kernel function K can be written with respect to S as H (S)=|H| -1 / 2 K(H -1 / 2 S). The kernel function is a symmetric multivariate density. To simplify the calculation process, the kernel of the posterior distribution can be a multivariate normal kernel, that is,

[0071] After obtaining the kernel density estimate, we can draw a small batch of samples from the posterior distribution and then use the matrix norm to construct reasonable importance scores for the source domain to the target domain.

[0072] Specifically, we can sample similarity scores in mini-batches and draw m samples from the approximate kernel distribution. In this way, we can obtain the inter-domain importance scores of the approximate distribution. Put all the sampled vectors into a matrix, Expand to:

[0073]

[0074] This matrix from sampling Contains the similarity information between the source domain and the target domain. The norm of this matrix is ​​used to perform importance scoring, which is

[0075] Intuitively, from a probability perspective, g q Is the source domain and target domain T = {X i,T |i=1,…,N} between domain importance values. For each source-target domain pair, the output importance score g is just a scalar. In the case of Q source domains and a single target domain, g can be a vector g∈R Q , where the variable g q Corresponding source domain S q and the importance score of the target domain T. Therefore, g can be used for importance score ranking and to guide the degree of knowledge transfer of each source domain in transfer learning.

[0076] When adjusting the learning rate based on the calculated inter-domain importance scores, a larger learning rate leads to a higher degree of knowledge transfer because more information about the current domain / source can be learned in the same number of training epochs. Similarly, a smaller learning rate leads to a lower degree of knowledge transfer. By setting an adaptive learning rate, the importance scores of multiple source domains can be used to control the pre-training process in transfer learning.

[0077] In step 206 , a loss function may be constructed according to an iteration parameter, a learning rate, and a batch size of the source domain, wherein the iteration parameter and the learning rate are obtained according to the inter-domain importance score.

[0078] Set parameters and In the source domain data j during training of deep neural networks th Iteration parameters and learning rate of iteration, batch size B i represents the i-th batch size from the data.

[0079] Specifically, the loss function can be:

[0080]

[0081] The updated rules are:

[0082]

[0083]

[0084]

[0085] In another embodiment of the present disclosure, given a multi-source domain {S q|q=1,…,Q}, target domain T, each source domain is The target domain is T = {X j,T |j=1,…,N}, the initial learning rate is Calculate the output matrix S q , approximating the posterior distribution Q(S q ), from Q(S q ) and sample m samples to obtain calculate

[0086] Afterwards, q=1, 2, ..., Q is set in sequence, and the following loop is executed: Parameter updates are calculated according to the update rule.

[0087] The algorithmic framework proposed in this disclosure consists of pairwise distances between domains, importance density estimation, importance score sampling, and knowledge transfer degree control. All source domains are required to go through this process to calculate importance scores and knowledge transfer degrees. The pre-training process is guided by source domain importance by controlling the learning rate. The pre-trained model is then fine-tuned on the target domain to achieve good performance.

[0088] This algorithmic framework can integrate multi-source information into the knowledge transfer process. The framework shows strong adaptability in knowledge transfer from multiple source domains to the target domain and demonstrates high superiority and effectiveness in the time series classification process.

[0089] Specifically, such as Figure 3 As shown, a training method for a multi-source time series classification model in an embodiment of the present disclosure includes:

[0090] Step 321 : Calculate the inter-domain pairwise distance based on the data of the source domain 311 and the target domain 312 .

[0091] Step 322: Estimate the distribution of inter-domain pairwise distances based on the inter-domain pairwise distances.

[0092] Step 323 : Sampling and importance calculation are performed based on the distribution of pairwise distances between domains.

[0093] In step 324 , the initial neural network model is trained based on the source domain and the inter-domain importance scores obtained by importance calculation to obtain an intermediate neural network model.

[0094] Step 325 : Train the intermediate neural network model according to the target domain to obtain a multi-source time series model.

[0095] In order to verify the adaptive algorithm in the embodiments of the present disclosure, UCI DSA, Movements, SRSCPs, NATOPS and AWR datasets can be used for testing, and MLP, LSTM, Encoder, FCN, ResNet and TapNet are used as benchmark models respectively, implementing non-transfer learning, naive transfer learning and adaptive transfer learning modes.

[0096] Experimental results show that the adaptive transfer learning model in this solution outperforms both non-transfer learning and naive transfer learning models across all tested datasets and all baseline models. Therefore, this technical solution can be applied to multi-source time series classification tasks, ensuring relatively accurate classification results.

[0097] The technical solution disclosed in this paper proposes a new adaptive multi-source time series classification algorithm. When data is limited, the algorithm can fully utilize the information in the source domain to perform adaptive transfer learning on the time series classification task.

[0098] Specifically, for multi-source, multi-domain time series classification, this algorithm measures inter-domain similarity by calculating inter-domain pairwise distances, approximating the posterior distribution using density estimation, and then performing importance sampling to obtain inter-domain importance scores. This achieves adaptive control of the degree of knowledge transfer between different source domains. Furthermore, the algorithm achieves algorithmic adaptability by controlling the learning rate to guide the degree of knowledge transfer. In this algorithm, the importance scores calculated for different source and target domains are used as a factor to control the learning rate, thereby controlling the degree of knowledge transfer from the trained source domain within the same training cycle. This results in better adaptability and improved time series classification accuracy.

[0099] The multi-source time series classification method provided by the present disclosure uses the inter-domain pairwise distance between the source domain and the target domain to train a multi-source time series classification model, and then uses the multi-source time series classification model to classify the time series of the target domain, thereby improving the accuracy of time series classification.

[0100] The multi-source time series classification device provided by the present disclosure is described below. The multi-source time series classification device described below and the multi-source time series classification method described above can be referenced to each other.

[0101] like Figure 4 As shown, the multi-source time series classification device of the embodiment of the present disclosure includes:

[0102] The acquisition unit 402 is configured to acquire a first time series in the target domain.

[0103] The classification unit 404 is used to input the first time series into a preset multi-source time series classification model to obtain a classification result of the first time series; wherein the multi-source time series classification model is trained using time series of multiple source domains and target domains based on the pairwise distance between the source domains and the target domains.

[0104] In an embodiment of the present disclosure, the apparatus further includes a training unit for training a multi-source time series classification model, the training unit including:

[0105] The distance acquisition subunit 502 is configured to acquire the inter-domain pairwise distance between the source domain and the target domain.

[0106] The importance acquisition subunit 504 is configured to acquire an inter-domain importance score between the source domain and the target domain based on the inter-domain pairwise distance.

[0107] The construction subunit 506 is used to construct a loss function according to the inter-domain importance scores.

[0108] The first training subunit 508 is used to train the initial neural network model using the source domain according to the loss function to obtain an intermediate neural network model.

[0109] The second training subunit 510 is used to adjust the intermediate neural network model using the target domain to obtain a multi-source time series classification model.

[0110] In the disclosed embodiment, the importance acquisition subunit may further be configured to: construct a posterior distribution of inter-domain pairwise distances based on the inter-domain pairwise distances using kernel density estimation; perform sampling in the posterior distribution to obtain a sampling matrix; and obtain an inter-domain importance score based on the matrix norm of the sampling matrix. The kernel of the posterior distribution may be a multivariate normal kernel.

[0111] In an embodiment of the present disclosure, the construction subunit may further be used to construct a loss function according to an iteration parameter, a learning rate, and a batch size of a source domain, wherein the iteration parameter and the learning rate are obtained according to an inter-domain importance score.

[0112] In the embodiment of the present disclosure, the time series of the source domain and the target domain are single-dimensional time series, and the distance acquisition subunit can also be used to calculate the distance between the single-dimensional time series of the source domain and the target domain and splice them.

[0113] In an embodiment of the present disclosure, the time series of the source domain and the target domain are K-dimensional time series, where K is a natural number and K≥2. The distance acquisition subunit can also be used to: decompose the time series into K-dimensional univariate time series groups; calculate the distance of the univariate time series groups by dimension and perform K-dimensional splicing.

[0114] Since the various functional modules of the multi-source time series classification device of the example embodiment of the present disclosure correspond to the steps of the example embodiment of the multi-source time series classification method described above, for details not disclosed in the embodiment of the device of the present disclosure, please refer to the embodiment of the multi-source time series classification method described above in the present disclosure.

[0115] The technical solution disclosed in this paper proposes a new adaptive multi-source time series classification algorithm. When data is limited, the algorithm can fully utilize the information in the source domain to perform adaptive transfer learning on the time series classification task.

[0116] Specifically, for multi-source, multi-domain time series classification, this algorithm measures inter-domain similarity by calculating inter-domain pairwise distances, approximating the posterior distribution using density estimation, and then performing importance sampling to obtain inter-domain importance scores. This achieves adaptive control of the degree of knowledge transfer between different source domains. Furthermore, the algorithm achieves algorithmic adaptability by controlling the learning rate to guide the degree of knowledge transfer. In this algorithm, the importance scores calculated for different source and target domains are used as a factor to control the learning rate, thereby controlling the degree of knowledge transfer from the trained source domain within the same training cycle. This results in better adaptability and improved time series classification accuracy.

[0117] The multi-source time series classification device provided by the present disclosure uses the inter-domain pairwise distance between the source domain and the target domain to train a multi-source time series classification model, and then uses the multi-source time series classification model to classify the time series of the target domain, thereby improving the accuracy of time series classification.

[0118] Figure 6 An example of a physical structure diagram of an electronic device is shown below. Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630, and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other via the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute a multi-source time series classification method, which includes: obtaining a first time series in a target domain; inputting the first time series into a preset multi-source time series classification model to obtain a classification result of the first time series; wherein the multi-source time series classification model is trained using time series from multiple source domains and the target domain according to the pairwise distance between the source domain and the target domain.

[0119] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0120] On the other hand, the present disclosure also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the multi-source time series classification method provided by the above methods, and the method includes: obtaining a first time series in a target domain; inputting the first time series into a preset multi-source time series classification model to obtain a classification result of the first time series; wherein the multi-source time series classification model is trained using time series of multiple source domains and the target domain according to the pairwise distance between the source domain and the target domain.

[0121] On the other hand, the present disclosure also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the above-mentioned multi-source time series classification method, the method comprising: obtaining a first time series in a target domain; inputting the first time series into a preset multi-source time series classification model to obtain a classification result of the first time series; wherein the multi-source time series classification model is trained using time series of multiple source domains and the target domain according to the pairwise distance between the source domain and the target domain.

[0122] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0123] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present disclosure.

Claims

1. A classification method for multi-source time series, characterized in that: The method comprises: Obtaining a first time series in a target domain of power consumption of each household appliance; Inputting the first time series into a preset multi-source time series classification model to obtain a household appliance classification result corresponding to the first time series; Among them, the multi-source time series classification model is obtained by training based on the inter-domain pairwise distance between the source domain and the target domain of the power consumption of each household appliance using multiple source domains and the target domain; the multi-source time series classification model refers to a model for classifying the first time series of the power consumption of the household appliance; the training method of the multi-source time series classification model includes: obtaining the inter-domain pairwise distance between the source domain and the target domain of the power consumption of each household appliance; obtaining the inter-domain importance score between the source domain and the target domain according to the inter-domain pairwise distance; obtaining the inter-domain importance score between the source domain and the target domain according to the inter-domain pairwise distance; obtaining the inter-domain pairwise distance .... A loss function is constructed based on the inter-domain importance score; the source domain is used to train the initial neural network model according to the loss function to obtain an intermediate neural network model; the target domain is used to adjust the intermediate neural network model to obtain the multi-source time series classification model; the inter-domain importance score between the source domain and the target domain is obtained based on the inter-domain pairwise distance, including: constructing the posterior distribution of the inter-domain pairwise distance through kernel density estimation based on the inter-domain pairwise distance; sampling is performed in the posterior distribution to obtain a sampling matrix; and the inter-domain importance score is obtained based on the matrix norm of the sampling matrix.

2. The method according to claim 1, characterized in that The constructing a loss function according to the inter-domain importance scores includes: The loss function is constructed according to an iteration parameter, a learning rate, and a batch size of the source domain, wherein the iteration parameter and the learning rate are obtained according to the inter-domain importance score.

3. The method according to claim 1, characterized in that The time series of the source domain and the target domain are single-dimensional time series, and obtaining the inter-domain pairwise distance between the source domain and the target domain includes: The distance between the single-dimensional time series of the source domain and the target domain is calculated and concatenated.

4. The method according to claim 1, wherein The time series of the source domain and the target domain are K-dimensional time series, where K is a natural number and K≥2, and obtaining the inter-domain pairwise distance between the source domain and the target domain includes: Decomposing the time series into K-dimensional univariate time series groups; The distance of the univariate time series group is calculated by dimension and K-dimensional splicing is performed.

5. The method according to claim 1, characterized in that The kernel of the posterior distribution is a multivariate normal kernel.

6. A multi-source time series classification device, characterized in that: The device comprises: an acquiring unit, configured to acquire a first time series in a target domain of power consumption of each household appliance; a classification unit, configured to input the first time series into a preset multi-source time series classification model to obtain a classification result of household appliances corresponding to the first time series; Wherein, the multi-source time series classification model is obtained by training based on the time series of multiple source domains and the target domain of the power consumption of each household appliance according to the inter-domain pairwise distance between the source domain and the target domain of the power consumption of each household appliance; the multi-source time series classification model refers to a model for classifying the first time series of the power consumption of the household appliance; the device also includes a training unit for training the multi-source time series classification model, and the training unit includes: a distance acquisition subunit for acquiring the inter-domain pairwise distance between the source domain and the target domain of the power consumption of each household appliance; an importance acquisition subunit for acquiring the inter-domain pairwise distance between the source domain and the target domain according to the inter-domain pairwise distance An inter-domain importance score between target domains; a construction subunit for constructing a loss function according to the inter-domain importance score; a first training subunit for training the initial neural network model using the source domain according to the loss function to obtain an intermediate neural network model; a second training subunit for adjusting the intermediate neural network model using the target domain to obtain the multi-source time series classification model; an importance acquisition subunit for constructing the posterior distribution of the inter-domain pairwise distances through kernel density estimation according to the inter-domain pairwise distances; sampling in the posterior distribution to obtain a sampling matrix; and obtaining the inter-domain importance score according to the matrix norm of the sampling matrix.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Industrial time sequence domain adaptive classification method based on target prior distribution

    CN113205132A