Cross-domain time series classification model training method and related device
By constructing a cross-domain sample pair set through a unified feature generation and dynamic weighting mechanism, the domain offset problem of time series classification models in cross-domain scenarios is solved, achieving stable and efficient knowledge transfer and classification performance improvement.
Patent Information
- Application Number
- CN202610666651.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-14
- Publication Date
- 2026-11-03
AI Technical Summary
Existing time series classification models suffer from domain bias in cross-device or cross-condition scenarios, leading to a decline in model performance. Traditional methods also struggle to generalize effectively in the case of unlabeled target domain data.
By using a unified feature generation, clustering, and dynamic weighting mechanism, a cross-domain positive and negative sample feature pair set is constructed. The feature space is aligned using source domain labels and target domain pseudo-labels, and sample discrimination difficulty weights are introduced to train the target classification model.
It achieves stable and efficient knowledge transfer under the condition of no real labels in the target domain, and improves the model's classification performance and generalization ability in the target domain.
Smart Images

Figure CN123031014A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to a method and related equipment for training a cross-domain time series classification model. Background Technology
[0002] In practical scenarios such as industrial equipment fault diagnosis and medical health monitoring, classification models based on time series data often face the problem of domain bias. That is, the source domain data used in the model training phase (such as data collected from specific equipment or populations) differs in statistical distribution from the target domain data encountered during actual deployment (such as data from new equipment or different populations), leading to a significant decrease in model performance. Traditional methods typically assume that training and test data are independent and identically distributed, or rely on a large amount of labeled target domain data for fine-tuning. This is difficult to apply in scenarios where labeling costs are high or target domain data is scarce.
[0003] Unsupervised domain adaptation techniques aim to leverage the rich labeled data in the source domain to help models achieve good performance in the unlabeled target domain. Some existing methods attempt to align the overall feature distributions of the source and target domains through adversarial training, or to utilize target domain data through pseudo-labeling techniques. However, these methods often suffer from the following shortcomings: 1) Global distribution alignment may blur class boundaries, impairing the model's discriminative ability; 2) Pseudo-label noise easily accumulates during training, leading to negative transfer; 3) The lack of fine-grained modeling of the time-series data structure and semantic relationships between samples limits cross-domain generalization performance.
[0004] It is evident that the generalization stability of existing time series classification tasks in complex application scenarios such as cross-device and cross-working conditions still needs to be improved. Summary of the Invention
[0005] In view of this, the purpose of this disclosure is to provide a method and related equipment for training a cross-domain time series classification model, so as to achieve stable and efficient knowledge transfer under the condition of no real label in the target domain.
[0006] In a first aspect, embodiments of this disclosure provide a method for training a cross-domain time series classification model. The method includes: acquiring a source domain time series dataset and a target domain time series dataset; generating features for the source domain time series dataset and the target domain time series dataset respectively using a unified feature generation method to obtain a source domain sample feature set and a target domain sample feature set, wherein the source domain time series dataset contains category labels for source domain samples, and the source domain samples are time series of the source domain; clustering the target domain sample feature set based on the category labels of the source domain samples to obtain predicted labels for target domain samples in the target domain time series dataset, wherein the target domain samples are time series of the target domain; and constructing a cross-domain time series classification model based on the category labels of the source domain samples and the predicted labels of the target domain samples. A set of positive sample feature pairs and a set of cross-domain negative sample feature pairs are defined. In the cross-domain positive sample feature pair set, sample pairs have the same class label and / or predicted label, while sample pairs have different class labels and / or predicted labels. Similarity calculations are performed on the sample pairs in both the cross-domain positive and negative sample feature pair sets to obtain similarity calculation results. Based on the similarity calculation results, target weight coefficients for the sample pairs are determined. These target weight coefficients indicate the difficulty of distinguishing the sample pairs in the feature space. Based on the sample pairs in the cross-domain positive and negative sample feature pair sets containing the target weight coefficients, a preset source domain time series classification model is trained to obtain a target classification model capable of classifying target domain time series.
[0007] Secondly, embodiments of this disclosure provide a cross-domain time series classification model training apparatus. The apparatus includes: an acquisition module, configured to acquire a source domain time series dataset and a target domain time series dataset, and generate features for the source domain time series dataset and the target domain time series dataset respectively using a unified feature generation method to obtain a source domain sample feature set and a target domain sample feature set, wherein the source domain time series dataset contains category labels of source domain samples, and the source domain samples are time series of the source domain; a clustering module, configured to cluster the target domain sample feature set based on the category labels of the source domain samples to obtain predicted labels of target domain samples in the target domain time series dataset, wherein the target domain samples are time series of the target domain; and a construction module, configured to construct a cross-domain time series classification model based on the category labels of the source domain samples and the predicted labels of the target domain samples. The system comprises: a positive sample feature pair set and a cross-domain negative sample feature pair set; wherein, sample pairs in the cross-domain positive sample feature pair set have the same class label and / or predicted label, and sample pairs in the cross-domain positive sample feature pair set have different class labels and / or predicted labels; a calculation module for calculating the similarity of sample pairs in the cross-domain positive sample feature pair set and the cross-domain negative sample feature pair set, and obtaining the similarity calculation result for the sample pairs; a determination module for determining the target weight coefficient of the sample pairs based on the similarity calculation result; wherein, the target weight coefficient is used to indicate the distinguishing difficulty of the sample pairs in the feature space; and a training module for training a preset source domain time series classification model based on the sample pairs in the cross-domain positive sample feature pair set and the cross-domain negative sample feature pair set containing the target weight coefficient, and obtaining a target classification model with the ability to classify target domain time series.
[0008] Thirdly, embodiments of this disclosure provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-described cross-domain time series classification model training method.
[0009] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the aforementioned cross-domain time series classification model training method.
[0010] The embodiments disclosed herein bring the following beneficial effects: The aforementioned cross-domain time series classification model training method and related equipment achieve stable and efficient knowledge transfer under the condition of no real label in the target domain by aligning the fine-grained sample relationship between the source domain and the target domain in the feature space and introducing a dynamic weighting mechanism based on the difficulty of sample discrimination.
[0011] Other features and advantages of this disclosure will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the disclosure. The objects and other advantages of this disclosure are realized and obtained through the structures particularly pointed out in the description, claims and drawings.
[0012] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0014] Figure 1 This is a flowchart of one embodiment of the cross-domain time series classification model training method in this disclosure; Figure 2 A schematic diagram of a cross-domain time series classification model training device provided in an embodiment of this disclosure; Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation
[0015] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0016] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in this disclosure, claims, and accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0017] For ease of understanding, the specific process of the embodiments of this disclosure is described below. Please refer to [link / reference]. Figure 1 One embodiment of the cross-domain time series classification model training method in this disclosure includes: Step S10: Obtain the source domain time series dataset and the target domain time series dataset. Use a unified feature generation method to generate features for the source domain time series dataset and the target domain time series dataset respectively, to obtain the source domain sample feature set and the target domain sample feature set. The source domain time series dataset contains the category labels of the source domain samples, and the source domain samples are the time series of the source domain. A source domain time series dataset is a time series sample from a source domain with class labels. The class labels of the source domain samples are real class labels, which can be manually labeled or verified class labels. The class labels of the source domain samples can be labels based on any classification task, such as industrial fault diagnosis, ECG signal anomaly recognition, financial fraud detection, etc. When the time series acquisition conditions change, causing the data used in the training phase (i.e., source domain samples) to have statistical distribution differences exceeding the standard between the data received in the actual deployment phase (i.e., target domain time series dataset), a domain shift problem is formed. It can be considered that the time series has crossed the domain, changing from the source domain to the target domain.
[0018] When the cross-domain time series classification model training method provided in this embodiment is applied to a medical and health monitoring scenario, the changes in the above-mentioned acquisition conditions may be caused by factors such as changes in equipment operating conditions, differences in sensor models and sampling parameters, and physiological differences between individuals, which are not limited here.
[0019] In this step, we obtain the source domain time series dataset with category labels. and target domain time series datasets without category labels ,in, Include A sample, represented as:
[0020] Include A sample, represented as:
[0021] in, and All are time series with dimension T×K, where T is the time length and K is the number of variables. Let C represent the category label of the i-th sample in the source domain, and C be the total number of category labels.
[0022] In one implementation, a unified feature generation network is employed. Feature generation is performed on the source and target time series datasets to obtain feature sets for the source and target domain samples. Specifically, the feature generation network F can be a deep network containing one-dimensional convolutional layers, recurrent neural network layers, or a Transformer encoder. Through feature generation network F, the time series data in the source and target time series datasets are mapped into fixed-dimensional feature vectors.
[0023] in, Do not use source domain samples and target domain samples The d-dimensional feature representation, The set of trainable parameters for the feature generation network F can be iteratively updated during model training using the backpropagation algorithm. All features constitute the feature set of the source domain samples. and target domain sample feature set The aforementioned feature generation network F can eliminate dimensional differences and extract transferable semantic features.
[0024] Step S20: Based on the category labels of the source domain samples, cluster the feature set of the target domain samples to obtain the predicted labels of the target domain samples in the target domain time series dataset, where the target domain samples are the time series of the target domain. Since the target domain data lacks real labels, this embodiment utilizes the known number of categories C in the source domain as a priori in the target domain feature space. Clustering is performed to generate a preliminary category division of the target domain samples. Specifically, clustering algorithms such as K-Means can be used to... Divide the data into C clusters, and calculate the center of each cluster as the cluster center:
[0025] For each target domain sample feature The index of the cluster to which it belongs can be used as its corresponding prediction label. The predicted labels can serve as pseudo-supervisory signals for the target domain samples, participating in subsequent cross-domain relationship construction. This clustering process can be performed periodically during the training of the classification model to generate more accurate predicted labels using updated features.
[0026] For example, in a healthcare monitoring scenario, when applying the classification task of abnormal heart rhythms across patient electrocardiograms (ECG), the source domain samples can be dynamic ECGs from multiple diagnosed and labeled patients. The category labels of the source domain samples can include "Normal," "Ventricular premature beats" (PVC), "Atrial premature beats" (APC), etc. The target domain samples can be from a newly admitted target patient whose monitoring data is not labeled. Since there are individual physiological differences in the ECG waveforms of different patients (which can be regarded as a kind of domain shift), the performance of directly using the classification model trained on the source domain data to diagnose the target patient may be reduced.
[0027] After feature generation in step S10, the target domain sample feature set is obtained from the dynamic electrocardiograms monitored by the target patient. It can be a set containing all heartbeat features during the period, where each It is a d-dimensional vector that can represent deep features such as the morphology and rhythm of a single heartbeat of the target patient.
[0028] Assuming that, based on prior knowledge of the source domain data, the number of heartbeat categories to be identified is known to be C=5 (e.g., including: normal, PVC, APC, right bundle branch block (RBBB), and left bundle branch block (LBBB)), then 5 is the cluster number in the clustering algorithm. The K-Means algorithm can be used to analyze the heartbeat feature set of the target patient. The algorithm automatically finds 5 cluster centers during clustering. Each of the centers It can be regarded as the "prototype" or "average pattern" of a certain type of heartbeat in the heartbeat feature space of the target patient.
[0029] For each heartbeat characteristic of the target patient The clustering result can indicate the cluster number c to which it belongs (assuming it is ). As the predicted label for the heartbeat, the model will learn the correspondence between "Category 2" and the source domain label "PVC" in subsequent semantic alignment, thereby enabling the target classification model trained in the embodiments of this disclosure to be used for unsupervised cross-patient heart rhythm classification.
[0030] Step S30: Based on the category labels of the source domain samples and the predicted labels of the target domain samples, construct a cross-domain positive sample feature pair set and a cross-domain negative sample feature pair set; wherein, the category labels and / or predicted labels of the sample pairs in the cross-domain positive sample feature pair set are the same, and the category labels and / or predicted labels of the sample pairs in the cross-domain positive sample feature pair set are different. This implementation method is based on the source domain real label. and the predicted label of the target domain This involves constructing sample pair-level constraints in the feature space to establish fine-grained semantic relationships between the source and target domains. Specifically, the cross-domain positive sample feature pair set... The sample pairs in the data contain samples with the same two labels (class label and / or predicted label). The mathematical representation of is:
[0031] in, and Representing samples respectively and The true labels (i.e., the category labels of the source domain samples). and Representing samples respectively and Predicted labels, It can cover similar sample pairs in three cases: source domain-source domain, source domain-target domain, and target domain-target domain.
[0032] Correspondingly, cross-domain negative sample feature pairs The sample pairs in the data contain two samples with different labels (class label and / or predicted label). The mathematical representation of is:
[0033] It can cover different types of sample pairs in three cases: source domain-source domain, source domain-target domain, and target domain-target domain.
[0034] Step S40: Calculate the similarity of sample pairs in the cross-domain positive sample feature pair set and the cross-domain negative sample feature pair set to obtain the similarity calculation results of the sample pairs; For sets and Each sample pair in Calculate their similarity in this feature space. Any algorithm used to quantify the closeness or approximation of two feature vectors in the feature space can be used to calculate the similarity of sample pairs in the cross-domain positive sample feature pair set and the cross-domain negative sample feature pair set, thereby obtaining the similarity calculation results for the corresponding sample pairs. Examples include cosine similarity algorithms, Euclidean distance algorithms, dot product similarity algorithms, negative exponential Manhattan distance algorithms, Pearson correlation coefficient algorithms, and negative exponential Mahalanobis distance algorithms, etc., but specific algorithms are not limited here.
[0035] Taking the negative exponential algorithm of Manhattan distance as an example, this paper explains how to calculate the similarity of sample pairs in the cross-domain positive sample feature pair set and the cross-domain negative sample feature pair set using the negative exponential algorithm of Manhattan distance, thereby obtaining the sample pairs. Corresponding similarity calculation results for:
[0036] in, Representing vectors and The Manhattan distance between them (i.e., the sum of the absolute differences in each dimension). is the scale parameter. Similarity is calculated using the negative exponential algorithm of Manhattan distance, which is more robust to outliers or noise in the feature dimension.
[0037] Step S50: Determine the target weight coefficient of the sample pair based on the similarity calculation results; wherein, the target weight coefficient is used to indicate the difficulty of distinguishing the sample pair in the feature space; The target weight coefficient is used to indicate the difficulty of distinguishing sample pairs in the feature space. It enables the model training process to pay more attention to key sample pairs near the decision boundary. It is used to instruct the model to apply stronger closing constraints to sample pairs that are "of the same kind but far apart" and stronger pushing constraints to sample pairs that are "different kind but close apart". This improves the inter-class margin while aligning across domains, reduces the risk of "alignment but confusion", and enhances the discriminative power of target domain classification and training stability.
[0038] In one implementation, a preset, differentiable weighting function can be used. Map the similarity calculation results to a weight scalar. This can be used as the target weight coefficient for the corresponding sample pair. Specifically, the weight function can be a weight allocation function based on a piecewise linear function, an exponential function, or a sigmoid function. The weight function is configured such that: for cross-domain positive sample feature pairs, the lower the similarity calculation result, the higher the output target weight coefficient; for cross-domain negative sample feature pairs, the higher the similarity calculation result, the higher the output weight coefficient.
[0039] Step S60: Based on the sample pairs in the cross-domain positive sample feature pair set and the cross-domain negative sample feature pair set containing the target weight coefficient, train the preset source domain time series classification model to obtain a target classification model with the ability to classify target domain time series.
[0040] The preset source domain time series classification model is a classification model trained on the source domain time series. In this embodiment, the preset source domain time series classification model is trained based on sample pairs in the cross-domain positive sample feature pair set and the cross-domain negative sample feature pair set containing the target weight coefficient, until the preset loss function converges, thereby obtaining a target classification model with the ability to classify time series in the target domain. The target classification model can be used to classify time series in the source domain or the target domain.
[0041] In one implementation, the preset loss function can be a joint loss function, which is used to weightedly fuse the function values of at least two loss functions, enabling the trained model to have stronger cross-domain classification capabilities. Specifically, the joint loss function may include a classification loss value calculated based on the probability of the class label of the source domain sample in the sample pair and the corresponding class label predicted by the classification model. Contrast loss function value within the source domain and cross-domain comparison loss value The function values of different loss functions can be weighted and fused using a preset loss balance coefficient, which is not specified here.
[0042] The following is a method for calculating the joint loss function value. Example:
[0043]
[0044]
[0045] in, It is the standard classification loss of the source domain (such as cross-entropy loss). The model is feature-based Predicted to be a true label The probability, This is a cross-domain contrastive loss value, where B represents the current training batch. Indicates that in batch B and The other sample set that constitutes the negative pair, It is a temperature hyperparameter in comparative learning. The preset loss balance coefficient, Sample pairs The similarity calculation results.
[0046] When training a classification model for a predefined source domain time series, the backpropagation algorithm can be used to minimize... The parameters of the feature generation network F and the classifier are iteratively updated until the model converges, which is considered as the training is complete. The resulting target classification model can then be used to classify new target domain time series data.
[0047] The cross-domain time series classification model training method provided by the above implementation method achieves stable and efficient knowledge transfer under the condition of no real label in the target domain by aligning the fine-grained sample relationship between the source domain and the target domain in the feature space and introducing a dynamic weighting mechanism based on the difficulty of sample discrimination.
[0048] Next, we will explain the specific training method for the cross-domain time series classification model.
[0049] In one implementation, the steps of acquiring a source domain time series dataset and a target domain time series dataset, and generating features for the source domain time series dataset and the target domain time series dataset respectively using a unified feature generation method to obtain a source domain sample feature set and a target domain sample feature set include: acquiring the source domain time series dataset and the target domain time series dataset; for both source domain samples and target domain samples in the source domain time series dataset and the target domain time series dataset, processing them using the following feature generation method: dividing the samples into multiple subsequences arranged in chronological order, encoding each subsequence using a time-series encoder with preset shared parameters to obtain a sub-feature vector corresponding to each subsequence; combining the sub-feature vectors in chronological order using a preset order-preserving combination function to obtain the feature data corresponding to the samples; determining the feature data corresponding to all samples in the source domain time series dataset as the source domain sample feature set, and determining the feature data corresponding to all samples in the target domain time series dataset as the target domain sample feature set.
[0050] In this embodiment, each time series (i.e., sample) in both the source domain time series dataset and the target domain time series dataset is processed using the aforementioned unified feature generation method. The processing procedure for each sample specifically includes: Source domain time series dataset and target domain time series dataset The sample x in the figure is a multivariate time series, represented as Where T is the time length of sample x and K is the number of variables, the input sample x is divided into L continuous or overlapping subsequence segments along the time dimension, denoted as: Each of them T' is the length of the subsequence (T' ≤ T); Next, the timing encoder with preset shared parameters For each subsequence Encode, One-dimensional convolutional neural networks (1D-CNN), recurrent neural networks (RNN), or temporal Transformers can be used, with their parameters... Data is shared between the source and target domains to maintain consistency in the feature space. The encoding process generates a sub-feature vector corresponding to each sub-sequence. :
[0051] in, The dimension of the sub-feature vector; Then, all sub-feature vectors are obtained. Then, through the preset order-preserving combination function Arrange the sub-feature vectors according to their original time order The global feature representation v of this sample is composed of:
[0052] in, This indicates a vector concatenation operation performed in sequence. This represents the dimension of the concatenated feature vector. This concludes the unified feature generation process for this sample. This was achieved by analyzing the source domain time series dataset. All samples in the dataset undergo the above processing to obtain the source domain sample feature set. By analyzing the target domain time series dataset All samples in the target domain are processed using the above method to obtain the target domain sample feature set.
[0053] This implementation method uses the same feature generation network and process for both the source and target domains, fundamentally ensuring that the data from both domains are mapped to the same feature semantic space. This provides the possibility for subsequent cross-domain comparison and alignment. Compared to compressing the entire time series into a single vector, it can contain richer temporal dynamics information. Furthermore, subsequence-level encoding allows the model to capture change patterns at different time scales. For example, in ECG signal analysis, it can simultaneously capture morphological details within a single heartbeat (short subsequences) and rhythmic changes between consecutive heartbeats (long subsequences or combination relationships), thereby forming a more discriminative feature representation that helps improve the accuracy of subsequent classification and alignment.
[0054] In one implementation, during the training of a preset source domain time series classification model, the steps of periodically performing clustering of the target domain sample feature set based on the category labels of the source domain samples to obtain the predicted labels of the target domain samples in the target domain time series dataset are executed. The steps of clustering the feature set of target domain samples based on the category labels of source domain samples to obtain the predicted labels of target domain samples in the target domain time series dataset include: clustering the feature set of target domain samples in the feature space. Execute the preset clustering algorithm to obtain clustering results where the number of clusters C is the same as the number of class labels of the source domain samples.
[0055] This represents the feature of the j-th target domain sample. This represents the total number of features of the target domain samples, and the C cluster centers in the clustering result are... ;against The predicted label of the corresponding target domain sample The following methods shall be used to determine:
[0056] in, The L2 norm of a vector, i.e., the Euclidean distance, express The category index corresponding to the cluster center with the smallest Euclidean distance among the C cluster centers in the clustering results. Indicates the distance to make The minimum corresponding cluster center index c is reached.
[0057] In this embodiment, periodic execution means that clustering is not performed at every step during the iterative process of model training. Instead, the predicted labels of the target domain samples are recalculated according to a preset periodic strategy. The specific period can be set as a fixed iteration interval or adaptive triggering. The fixed iteration interval means that it is executed once every E iterations (epochs) or S training steps (steps). The adaptive triggering can be triggered when the distribution of the model's prediction confidence for the target domain samples tends to be stable (meeting the preset document conditions) or when the change in the target domain feature space is lower than a certain threshold.
[0058] The following describes the specific steps involved in periodic clustering: Each time clustering is performed, the latest set of target domain sample features is used. As clustering objects, among which It is the d-dimensional feature vector obtained by mapping the j-th target domain sample through the latest feature generation network; then, a preset clustering algorithm is used to... The data is divided into groups, resulting in a clustering result with C cluster centers. The C cluster centers are... .
[0059] Next, for each target domain sample feature By calculating the Euclidean distance from the cluster to all cluster centers, the index corresponding to the nearest center is selected as its corresponding predicted label. .
[0060] This implementation uses clustering to assign initial pseudo-labels to target domain samples by utilizing the inherent distribution structure of the data. This provides a crucial "anchor point" for subsequent cross-domain comparative learning, enabling the training process to begin. Periodic execution allows the feature generation network to continuously optimize as the model is trained, thereby overcoming the problem of pseudo-label noise accumulation. Furthermore, the consistency between the number of clusters and the number of source domain categories allows comparative learning to drive true semantic alignment rather than blind distribution matching.
[0061] In one implementation, the step of calculating the similarity of sample pairs in the cross-domain positive sample feature pair set and the cross-domain negative sample feature pair set to obtain the similarity calculation result corresponding to the sample pair includes: for any sample pair in the cross-domain positive sample feature pair set or the cross-domain negative sample feature pair set... The algorithm for calculating the similarity results is as follows:
[0062] in, This represents the features of samples in the source domain or the target domain. Representing the eigenvector transpose, This represents the features of samples in the source domain or the target domain. Representing vectors with vector dot product, Indicates sample pairs The corresponding similarity calculation results.
[0063] In this embodiment, the cosine similarity algorithm is used to calculate sample pairs. The similarity between two samples is used to obtain the corresponding similarity calculation results. ,in, and All are d-dimensional vectors, which can all come from the source domain, all from the target domain, or from both the source and target domains respectively. In this embodiment, the similarity calculation results... The range of its value is [-1, 1].
[0064] Cosine similarity is a differentiable scalar operation that can be seamlessly embedded into gradient-based optimization frameworks. It involves only basic vector operations, has low computational complexity, and is suitable for large-scale data processing. In addition, its invariance to feature scale can also increase the numerical stability of training.
[0065] In one implementation, the step of determining the target weight coefficient of a sample pair based on the similarity calculation result includes: for a sample pair in the cross-domain positive sample feature pair set, if the corresponding similarity calculation result is less than a preset positive sample pair threshold, then a first weight coefficient is determined as the target weight coefficient of the corresponding sample pair; otherwise, a second weight coefficient is determined as the target weight coefficient of the corresponding sample pair, wherein the first weight coefficient is greater than the second weight coefficient; for a sample pair in the cross-domain negative sample feature pair set, if the corresponding similarity calculation result is greater than a preset negative sample pair threshold, then a first weight coefficient is determined as the target weight coefficient of the corresponding sample pair; otherwise, a second weight coefficient is determined as the target weight coefficient of the corresponding sample pair.
[0066] Preset positive sample pair threshold It is used to distinguish between positive sample pairs that are easier to distinguish from those that are harder to distinguish. For positive sample pairs belonging to the same category... If the corresponding cosine similarity If they are close enough in the feature space, they are considered to be "easy sample pairs"; if they are close enough in the feature space, they are considered to be easy sample pairs. If the two are too far apart, the model will have difficulty bridging them, classifying them as "difficult sample pairs".
[0067] Preset negative sample pair threshold It is used to distinguish between negative sample pairs that are relatively easy to distinguish and those that are difficult to distinguish. For negative sample pairs belonging to different categories... If the corresponding cosine similarity If they are sufficiently far apart in the feature space, they are considered to be a relatively easy-to-distinguish sample pair; if If the two are too close together, the model will have difficulty in separating them, making them difficult to distinguish.
[0068] First weighting coefficient They are assigned to sample pairs that are considered difficult to distinguish, i.e., positive sample pairs. Those, or negative sample pairs The first weight coefficient Greater than the second weighting coefficient This means that when calculating the loss, the gradient generated by the hard sample pairs will be amplified, and the model parameters will be updated more in the direction of optimizing these hard pairs.
[0069] Second weighting coefficient They are assigned to sample pairs that are considered easier to distinguish, i.e., positive sample pairs. Those, or negative sample pairs This implementation method automatically identifies and strengthens the contribution of difficult-to-distinguish sample pairs located near the decision boundary and that the model currently cannot handle well by using threshold judgment and weight allocation. This is equivalent to adding an attention mechanism to the optimization process, concentrating the limited model capacity on overcoming the difficulties in the classification task, thereby significantly improving training efficiency and final performance.
[0070] In one implementation, the step of training a predefined source domain time series classification model based on sample pairs from a cross-domain positive sample feature pair set containing target weight coefficients and a cross-domain negative sample feature pair set to obtain a target classification model capable of classifying target domain time series includes: training the predefined source domain time series classification model using sample pairs from the cross-domain positive sample feature pair set containing target weight coefficients and the cross-domain negative sample feature pair set; during the training process, using a backpropagation algorithm to iteratively update the classification model end-to-end until the following joint loss function value is reached. Minimum:
[0071]
[0072]
[0073] in, The classification loss is calculated based on the probability of the class labels of source domain samples in a sample pair and the corresponding class labels predicted by the classification model. C represents the total number of features of the source domain samples, and C represents the number of class labels of the source domain samples. This is used to indicate whether the category label of the i-th source domain sample belongs to the c-th category label. If it does, then... ,otherwise, , This represents the probability value of the c-th class label of the corresponding source domain sample predicted by the classification model; For comparison loss within the source domain, This represents a set of cross-domain positive sample feature pairs where the source domain samples have the same class label. Indicates sample pairs The corresponding similarity calculation results This represents a set of sample pairs in the source domain that have different class labels compared to cross-domain negative sample feature pairs. Indicates sample pairs The corresponding target weight coefficient, This represents a set of cross-domain positive sample feature pairs where the source domain samples have the same class label. This represents a set of sample pairs in the source domain that have different class labels compared to cross-domain negative sample feature pairs. It is the temperature hyperparameter in comparative learning; For cross-domain comparison loss, This represents a set of positive cross-domain feature pairs where the class label of the source domain sample is the same as the predicted label of the target domain sample. This represents a set of cross-domain negative sample feature pairs where the class label of the source domain sample differs from the predicted label of the target domain sample. Indicates sample pairs The target weight coefficient, Indicates sample pairs The target weight coefficient, and This is the preset loss balance coefficient.
[0074] In this implementation, a joint loss function is used. By unifying source domain supervision signals, source domain internal structural constraints, and cross-domain semantic alignment constraints in the end-to-end training process, the model gains stronger discriminative and generalization capabilities.
[0075] It is a source domain classification loss function used to enable the model to have basic class discrimination ability. It is calculated based on the cross-entropy between the true label of the source domain sample and the model prediction. It is a source domain in-domain contrastive loss function. This loss term performs contrastive learning within the source domain, aiming to learn a feature space with a good internal structure (such as compactness within classes and separation between classes) in the source domain before seeing the target domain data. It is a cross-domain contrastive loss function that drives fine-grained semantic alignment between the source and target domains in the feature space based on predicted labels and target weight coefficients.
[0076] This implementation integrates time series feature generation, dynamic clustering pseudo-labels, and difficulty-aware weights into a unified and optimizable mathematical framework, working together to achieve stable and efficient unsupervised cross-domain time series classification.
[0077] In one implementation, the method is applied to a medical and health monitoring scenario, where the time series of the source domain includes at least one of electrocardiogram (ECG), electroencephalogram (EEG), respiratory signal, or blood oxygenation signal, and the time series of the target domain is of a different type than the time series of the source domain.
[0078] The embodiments disclosed herein can be applied to medical and health monitoring scenarios such as smart healthcare and remote monitoring. Whether the data input to the classification model crosses from the source domain to the target domain can be identified by factors such as changes in the subject, monitoring equipment, or parameters. It is applicable to classification tasks of continuous physiological time series such as ECG signals, EEG signals, respiratory signals, or blood oxygen signals, such as ECG arrhythmia classification, EEG sleep staging, and respiratory signal pause detection, etc., and is not limited here.
[0079] For example, the source domain can be an electrocardiogram signal (used for heart rhythm classification), and the target domain can be a pulse wave signal (used for initial heart rhythm screening). Both reflect cardiac activity, but their modes are different. The source domain can be a multi-lead EEG (used for epileptic focus localization), and the target domain can be a signal from a wearable EEG device (used for seizure early warning). The two signals have different dimensions and quality.
[0080] For the corresponding method embodiments described above, see [link to relevant documentation]. Figure 2 The diagram illustrates a training device for a cross-domain time series classification model. The device includes: an acquisition module 20, used to acquire a source domain time series dataset and a target domain time series dataset, and to generate features for both datasets using a unified feature generation method, obtaining a source domain sample feature set and a target domain sample feature set, wherein the source domain time series dataset contains category labels for the source domain samples, and the source domain samples are time series from the source domain; a clustering module 21, used to cluster the target domain sample feature set based on the category labels of the source domain samples, obtaining predicted labels for the target domain samples in the target domain time series dataset, wherein the target domain samples are time series from the target domain; and a construction module 22, used to construct cross-domain positive samples based on the category labels of the source domain samples and the predicted labels of the target domain samples. The system comprises a feature pair set and a cross-domain negative sample feature pair set; wherein, sample pairs in the cross-domain positive sample feature pair set have the same class label and / or predicted label, and sample pairs in the cross-domain positive sample feature pair set have different class labels and / or predicted labels; a calculation module 23 is used to calculate the similarity of sample pairs in the cross-domain positive sample feature pair set and the cross-domain negative sample feature pair set to obtain the similarity calculation result corresponding to the sample pair; a determination module 24 is used to determine the target weight coefficient of the sample pair based on the similarity calculation result; wherein, the target weight coefficient is used to indicate the difficulty of distinguishing the sample pair in the feature space; and a training module 25 is used to train a preset source domain time series classification model based on the sample pairs in the cross-domain positive sample feature pair set and the cross-domain negative sample feature pair set containing the target weight coefficient to obtain a target classification model with the ability to classify target domain time series.
[0081] The aforementioned cross-domain time series classification model training device achieves stable and efficient knowledge transfer under the condition of no real label in the target domain by aligning the fine-grained sample relationship between the source domain and the target domain in the feature space and introducing a dynamic weighting mechanism based on the difficulty of sample discrimination.
[0082] Optionally, the acquisition module 20 is specifically used to: acquire a source domain time series dataset and a target domain time series dataset; for both source domain samples and target domain samples in the source domain time series dataset and the target domain time series dataset, the following feature generation method is used for processing: the samples are divided into multiple subsequences arranged in chronological order, each subsequence is encoded by a time-series encoder with preset shared parameters to obtain a sub-feature vector corresponding to each subsequence; the sub-feature vectors are combined according to the chronological order by a preset order-preserving combination function to obtain the feature data corresponding to the samples; the feature data corresponding to all samples in the source domain time series dataset is determined as the source domain sample feature set, and the feature data corresponding to all samples in the target domain time series dataset is determined as the target domain sample feature set.
[0083] Optionally, during the training of the preset source domain time series classification model, the clustering module 21 is periodically invoked. Specifically, the clustering module 21 is used to: perform feature analysis on the target domain sample feature set in the feature space. A preset clustering algorithm is executed to obtain clustering results where the number of clusters C is the same as the number of category labels of the source domain samples, wherein,
[0084] This represents the feature of the j-th target domain sample. This represents the total number of features of the target domain samples, and the C cluster centers in the clustering result are... ; Regarding the above The predicted label of the corresponding target domain sample The following methods shall be used to determine:
[0085] in, The L2 norm of a vector, i.e., the Euclidean distance, Indicates the The category index corresponding to the cluster center with the smallest Euclidean distance among the C cluster centers in the clustering results. Indicates the distance to make The minimum corresponding cluster center index c is reached.
[0086] Optionally, the above calculation module 23 is specifically used for: targeting any one sample pair in the cross-domain positive sample feature pair set or the cross-domain negative sample feature pair set. The algorithm for calculating the similarity results is as follows:
[0087] in, This represents the features of samples in the source domain or the target domain. Representing the eigenvector transpose, This represents the features of samples in the source domain or the target domain. Representing vectors with vector dot product, Indicates sample pairs The corresponding similarity calculation results.
[0088] Optionally, the determining module 24 is specifically used for: for sample pairs in the cross-domain positive sample feature pair set, if the corresponding similarity calculation result is less than a preset positive sample pair threshold, then the first weight coefficient is determined as the target weight coefficient of the corresponding sample pair; otherwise, the second weight coefficient is determined as the target weight coefficient of the corresponding sample pair, wherein the first weight coefficient is greater than the second weight coefficient; for sample pairs in the cross-domain negative sample feature pair set, if the corresponding similarity calculation result is greater than a preset negative sample pair threshold, then the first weight coefficient is determined as the target weight coefficient of the corresponding sample pair; otherwise, the second weight coefficient is determined as the target weight coefficient of the corresponding sample pair.
[0089] Optionally, the training module 25 is specifically used to: train a preset source domain time series classification model using sample pairs from the cross-domain positive sample feature pair set and the cross-domain negative sample feature pair set containing the target weight coefficients; during the training process, the classification model is iteratively updated end-to-end using a backpropagation algorithm until the following joint loss function is obtained. Minimum value:
[0090]
[0091]
[0092] in, The classification loss is calculated based on the probability of the class label of the source domain sample in the sample pair and the corresponding class label predicted by the classification model. C represents the total number of features of the source domain samples, and C represents the number of category labels of the source domain samples. This is used to indicate whether the category label of the i-th source domain sample belongs to the c-th category label. If it does, then... ,otherwise, , This represents the probability value of the c-th category label of the corresponding source domain sample predicted by the classification model; For comparison loss within the source domain, This represents a set of cross-domain positive sample feature pairs where the source domain samples have the same class label. Indicates sample pairs The corresponding similarity calculation results This represents a set of sample pairs in the source domain that have different class labels compared to cross-domain negative sample feature pairs. Indicates sample pairs The corresponding target weight coefficient, This represents a set of cross-domain positive sample feature pairs where the source domain samples have the same class label. This represents a set of sample pairs in the source domain that have different class labels compared to cross-domain negative sample feature pairs. It is the temperature hyperparameter in comparative learning; For cross-domain comparison loss, This represents a set of positive cross-domain feature pairs where the class label of the source domain sample is the same as the predicted label of the target domain sample. This represents a set of cross-domain negative sample feature pairs where the class label of the source domain sample differs from the predicted label of the target domain sample. Indicates sample pairs The target weight coefficient, Indicates sample pairs The target weight coefficient, and This is the preset loss balance coefficient.
[0093] Optionally, the above-mentioned device is applied to medical and health monitoring scenarios, wherein the time series of the source domain includes at least one of electrocardiogram signals, electroencephalogram signals, respiratory signals or blood oxygenation signals, and the time series of the target domain is different from the time series of the source domain.
[0094] This embodiment also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the aforementioned cross-domain time series classification model training method. This electronic device can be a server or a terminal device.
[0095] See Figure 3As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the above-described cross-domain time series classification model training method.
[0096] Furthermore, Figure 3 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 100, the communication interface 103 and the memory 101 connected via the bus 102.
[0097] The memory 101 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0098] The processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 100 or by instructions in software form. The processor 100 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101, and the processor 100 reads the information from memory 101 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0099] This embodiment also provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the above-mentioned cross-domain time series classification model training method, for example.
[0100] The computer program product of the cross-domain time series classification model training method, apparatus, electronic device and storage medium provided in the embodiments of this disclosure includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0101] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0102] Furthermore, in the description of the embodiments of this disclosure, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this disclosure based on the specific circumstances.
[0103] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0104] In the description of this disclosure, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this disclosure and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this disclosure. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0105] Finally, it should be noted that the above embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, 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 disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.
Claims
1. A method for training a cross-domain time series classification model, characterized in that, The method includes: Obtain a source domain time series dataset and a target domain time series dataset. Use a unified feature generation method to generate features for the source domain time series dataset and the target domain time series dataset respectively, to obtain a source domain sample feature set and a target domain sample feature set. The source domain time series dataset contains the category labels of the source domain samples, and the source domain samples are time series of the source domain. Based on the category labels of the source domain samples, the feature set of the target domain samples is clustered to obtain the predicted labels of the target domain samples in the target domain time series dataset, wherein the target domain samples are time series of the target domain; Based on the category labels of the source domain samples and the predicted labels of the target domain samples, a cross-domain positive sample feature pair set and a cross-domain negative sample feature pair set are constructed; wherein, the category labels and / or predicted labels of sample pairs in the cross-domain positive sample feature pair set are the same, and the category labels and / or predicted labels of sample pairs in the cross-domain positive sample feature pair set are different. Similarity calculation is performed on sample pairs in the cross-domain positive sample feature pair set and the cross-domain negative sample feature pair set to obtain the similarity calculation results corresponding to the sample pairs; Based on the similarity calculation results, the target weight coefficient of the sample pair is determined; wherein, the target weight coefficient is used to indicate the difficulty of distinguishing the sample pair in the feature space; Based on the sample pairs in the cross-domain positive sample feature pair set and the cross-domain negative sample feature pair set containing the target weight coefficient, the preset source domain time series classification model is trained to obtain a target classification model with the ability to classify target domain time series.
2. The method according to claim 1, characterized in that, The steps of obtaining a source domain time series dataset and a target domain time series dataset, and generating features for the source domain time series dataset and the target domain time series dataset respectively using a unified feature generation method to obtain a source domain sample feature set and a target domain sample feature set include: Obtain the source domain time series dataset and the target domain time series dataset; For both source domain and target domain time series datasets, the following feature generation method is used to process the source domain samples or target domain samples: The sample is divided into multiple subsequences arranged in chronological order. Each subsequence is encoded by a time-sequence encoder with pre-defined shared parameters to obtain the sub-feature vector corresponding to each subsequence. The sub-feature vectors are combined according to the time order using a preset order-preserving combination function to obtain the feature data corresponding to the sample. The feature data corresponding to all samples in the source domain time series dataset are determined as the source domain sample feature set, and the feature data corresponding to all samples in the target domain time series dataset are determined as the target domain sample feature set.
3. The method according to claim 1, characterized in that, During the training of a classification model for a preset source domain time series, the steps of periodically performing clustering of the target domain sample feature set based on the category labels of the source domain samples to obtain the predicted labels of the target domain samples in the target domain time series dataset are executed. The step of clustering the feature set of the target domain samples based on the category labels of the source domain samples to obtain the predicted labels of the target domain samples in the target domain time series dataset includes: In the feature space, the target domain sample feature set A preset clustering algorithm is executed to obtain clustering results where the number of clusters C is the same as the number of category labels of the source domain samples, wherein, This represents the feature of the j-th target domain sample. This represents the total number of features of the target domain samples, and the C cluster centers in the clustering result are... ; Regarding the above The predicted label of the corresponding target domain sample The following methods shall be used to determine: in, The L2 norm of a vector, i.e., the Euclidean distance, Indicates the The category index corresponding to the cluster center with the smallest Euclidean distance among the C cluster centers in the clustering results. Indicates the distance to make The minimum corresponding cluster center index c is reached.
4. The method according to claim 1, characterized in that, The steps of calculating the similarity between sample pairs in the cross-domain positive sample feature pair set and the cross-domain negative sample feature pair set, and obtaining the similarity calculation results for the sample pairs, include: For any sample pair in the set of cross-domain positive sample feature pairs or the set of cross-domain negative sample feature pairs The algorithm for calculating the similarity results is as follows: in, This represents the features of samples in the source domain or the target domain. Representing the eigenvector transpose, This represents the features of samples in the source domain or the target domain. Representing vectors with vector dot product, Indicates sample pairs The corresponding similarity calculation results.
5. The method according to claim 1, characterized in that, The step of determining the target weight coefficient of the sample pair based on the similarity calculation result includes: For a sample pair in the cross-domain positive sample feature pair set, if the corresponding similarity calculation result is less than the preset positive sample pair threshold, then the first weight coefficient is determined as the target weight coefficient of the corresponding sample pair; otherwise, the second weight coefficient is determined as the target weight coefficient of the corresponding sample pair, wherein the first weight coefficient is greater than the second weight coefficient. For a sample pair in the cross-domain negative sample feature pair set, if the corresponding similarity calculation result is greater than the preset negative sample pair threshold, then the first weight coefficient is determined as the target weight coefficient of the corresponding sample pair; otherwise, the second weight coefficient is determined as the target weight coefficient of the corresponding sample pair.
6. The method according to claim 1, characterized in that, The steps of training a pre-defined source domain time series classification model based on sample pairs in the cross-domain positive sample feature pair set and the cross-domain negative sample feature pair set, including target weight coefficients, to obtain a target classification model capable of classifying target domain time series include: The preset source domain time series classification model is trained using sample pairs from the cross-domain positive sample feature pair set containing the target weight coefficient and the cross-domain negative sample feature pair set. During training, the backpropagation algorithm is used to iteratively update the classification model end-to-end until the following joint loss function is reached. Minimum value: in, The classification loss is calculated based on the probability of the class label of the source domain sample in the sample pair and the corresponding class label predicted by the classification model. C represents the total number of features of the source domain samples, and C represents the number of category labels of the source domain samples. This is used to indicate whether the category label of the i-th source domain sample belongs to the c-th category label. If it does, then... ,otherwise, , This represents the probability value of the c-th category label of the corresponding source domain sample predicted by the classification model; For comparison loss within the source domain, This represents a set of cross-domain positive sample feature pairs where the source domain samples have the same class label. Indicates sample pairs The corresponding similarity calculation results This represents a set of sample pairs in the source domain that have different class labels compared to cross-domain negative sample feature pairs. Indicates sample pairs The corresponding target weight coefficient, This represents a set of cross-domain positive sample feature pairs where the source domain samples have the same class label. This represents a set of sample pairs in the source domain that have different class labels compared to cross-domain negative sample feature pairs. It is the temperature hyperparameter in comparative learning; For cross-domain comparison loss, This represents a set of positive cross-domain feature pairs where the class label of the source domain sample is the same as the predicted label of the target domain sample. This represents a set of cross-domain negative sample feature pairs where the class label of the source domain sample differs from the predicted label of the target domain sample. Indicates sample pairs The target weight coefficient, Indicates sample pairs The target weight coefficient, and This is the preset loss balance coefficient.
7. The method according to any one of claims 1-6, characterized in that, The method is applied to medical and health monitoring scenarios. The time series of the source domain includes at least one of electrocardiogram (ECG), electroencephalogram (EEG), respiratory signal, or blood oxygenation signal. The time series of the target domain is of a different type than the time series of the source domain.
8. A training device for a cross-domain time series classification model, characterized in that, The device includes: The acquisition module is used to acquire source domain time series datasets and target domain time series datasets, and to generate features for the source domain time series datasets and the target domain time series datasets respectively using a unified feature generation method to obtain source domain sample feature sets and target domain sample feature sets. The source domain time series dataset contains category labels of source domain samples, and the source domain samples are time series of the source domain. The clustering module is used to cluster the feature set of the target domain samples based on the category labels of the source domain samples to obtain the predicted labels of the target domain samples in the target domain time series dataset, wherein the target domain samples are time series of the target domain. The construction module is used to construct a cross-domain positive sample feature pair set and a cross-domain negative sample feature pair set based on the category label of the source domain sample and the predicted label of the target domain sample; wherein, the category label and / or predicted label of the sample pairs in the cross-domain positive sample feature pair set are the same, and the category label and / or predicted label of the sample pairs in the cross-domain positive sample feature pair set are different. The calculation module is used to calculate the similarity of sample pairs in the cross-domain positive sample feature pair set and the cross-domain negative sample feature pair set, and obtain the similarity calculation results corresponding to the sample pairs; The determination module is used to determine the target weight coefficient of the sample pair based on the similarity calculation result; wherein the target weight coefficient is used to indicate the difficulty of distinguishing the sample pair in the feature space; The training module is used to train a preset source domain time series classification model based on sample pairs in the cross-domain positive sample feature pair set and the cross-domain negative sample feature pair set containing the target weight coefficient, so as to obtain a target classification model with the ability to classify target domain time series.
9. An electronic device, characterized in that, The system includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the cross-domain time series classification model training method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the cross-domain time series classification model training method according to any one of claims 1-7.
