Transferable vector quantization alignment method and device based on unsupervised domain adaptation
By employing an unsupervised domain-adaptive transferable vector quantization alignment method, and utilizing feature extraction and pseudo-label optimization techniques, the problem of feature inconsistency and misalignment in cross-domain time series signal analysis is solved, thereby improving the recognition performance and classification effect of unlabeled target domains.
Patent Information
- Application Number
- CN202511056873.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-11-07
AI Technical Summary
Existing unsupervised domain adaptation methods struggle to effectively address issues such as global feature inconsistency, local structural misalignment, and feature space confusion in cross-domain time series signal analysis, resulting in insufficient model recognition performance in unlabeled target domains.
A transferable vector quantization alignment method based on unsupervised domain adaptation is adopted. Features of the source and target domains are extracted through the feature extraction unit, and the nearest neighbor search method is used to perform feature alignment in the codebook. The local alignment loss function is calculated through the bottleneck layer, and the pseudo-labels are optimized by combining the cross-entropy classification loss and the mutual information weighted maximization confusion matrix loss function, so as to achieve cross-domain feature extraction and classification.
It improves the recognition performance of unlabeled target domains, reduces the impact of domain offset on classification performance, and achieves efficient classification and generalization capabilities for cross-domain signals.
Smart Images

Figure CN120910620A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of signal processing and machine learning, in particular to a transferable vector quantization alignment method and device based on unsupervised domain adaptation. BACKGROUND
[0002] With the deep development of communication and signal processing technology, the wide application of multi-source data acquisition equipment in intelligent systems, unsupervised domain adaptation (UDA) becomes particularly important in cross-domain time series signal analysis and processing. UDA aims to solve the domain shift problem between the labeled source domain and the unlabeled target domain due to the difference in data distribution, and to achieve good generalization ability of the model in the target domain.
[0003] To alleviate the impact of domain shift, researchers have proposed various UDA methods. Among them, traditional UDA methods are mainly based on feature alignment and pseudo-label training mechanism, and rely on convolutional neural networks (CNN) or recurrent neural networks (RNN) to extract features from time series signals. These methods have achieved certain results in some tasks, but still have key problems: first, CNN and RNN models are difficult to capture complex temporal dependencies and fine-grained structures, limiting feature expression; second, pseudo-labels are easily affected by initial model errors and are prone to introduce bias when the distribution difference is large; third, most methods ignore the alignment of local regions between the source domain and the target domain, affecting the transfer effect.
[0004] In recent years, Transformer has shown its advantages in time series signal processing due to its strong global modeling ability and multi-head attention mechanism. However, the research on UDA based on Transformer is still in its infancy, and the problems of inconsistent global features, misaligned local structures and feature space confusion have not been fully solved, especially in the alignment and discriminative learning of high-dimensional multi-source time series signals.
[0005] Therefore, in the complex and variable time series signal environment, how to integrate the strong representation ability of Transformer and effective cross-domain adaptation strategies to achieve feature consistency modeling between the source domain and the target domain at the global and local levels, and thus improve the recognition performance of the unlabeled target domain, has become a key difficulty in current UDA research. SUMMARY
[0006] Therefore, it is necessary to provide a transferable vector quantization alignment method and device based on unsupervised domain adaptation to improve the recognition performance of the unlabeled target domain.
[0007] A transferable vector quantization alignment method based on unsupervised domain adaptation, the method comprising: Obtain a labeled source domain dataset and an unlabeled target domain dataset, wherein both the source domain dataset and the target domain dataset contain time-series signals; The source domain dataset and the target domain dataset are input into the feature extraction unit to obtain source domain features and target domain features, respectively; The nearest neighbor search method is used to search for the feature term that is closest to the source domain feature and the target domain feature in the codebook. Based on the source domain feature, the target domain feature and the closest feature term, the overall feature distribution loss function is calculated to achieve overall feature distribution alignment. The source domain features and target domain features are concatenated with the closest feature terms and then input into the bottleneck layer to obtain source domain bottleneck features and target domain bottleneck features respectively. The local alignment loss function is then calculated based on the source domain bottleneck features and target domain bottleneck features to achieve local feature alignment. The bottleneck features of the source domain and the bottleneck features of the target domain are classified by a classifier to obtain pseudo-labels of the source domain and the target domain respectively. The cross-entropy classification loss function is calculated based on the pseudo-labels of the source domain and the corresponding ground truth labels. After normalizing the pseudo-labels of the source domain, mutual information is introduced to obtain the sample weights in each target domain dataset. The mutual information weighted maximum confusion matrix loss function is calculated. The parameters in the feature extraction unit, codebook, bottleneck layer, and classifier are updated using the overall feature distribution loss function, local alignment loss function, cross-entropy classification loss function, and mutual information weighted maximization confusion matrix loss function until convergence, resulting in a feature extraction unit, codebook, bottleneck layer, and classifier capable of cross-domain feature extraction, feature alignment, and classification of time-series signals.
[0008] In one embodiment, after obtaining a feature extraction unit, codebook, bottleneck layer, and classifier capable of cross-domain extraction, feature alignment, and classification of time-series signals: Construct a time-series signal classification network based on the trained feature extraction unit, codebook, bottleneck layer, and classifier; The target domain time series signal to be classified is obtained, and the target domain time series signal is sequentially input into the time series signal classification network to obtain the classification prediction result.
[0009] In one embodiment, the feature extraction unit uses a time-series transformer as the backbone network.
[0010] In one embodiment, the feature extraction unit uses a Crossformer network as its backbone network, in which: The input time-series signal is divided into multiple time-series segments of a preset size, and an initial embedding representation is generated through linear projection. adding a position encoding to each initial embedding representation, and then learning potential associations between pieces of signals by using a self-attention mechanism, to obtain the source domain feature and the target domain feature.
[0011] In one embodiment, the overall feature distribution loss function aligns the target domain feature and the source domain feature with the closest feature items of each other by using a mean square error or a Euclidean distance.
[0012] In one embodiment, the overall feature distribution loss function is expressed as:
[0013] In the above formula, represents a stop gradient operation, is a scalar parameter, represents a mean square error or a Euclidean distance, represents aligning the target domain feature with the closest feature item of the source domain in the codebook, represents aligning the source domain feature with the closest feature item of the target domain in the codebook.
[0014] In one embodiment, the bottleneck layer includes a linear layer, a ReLU activation, and a batch normalization layer connected in sequence.
[0015] In one embodiment, after the source domain pseudo labels are normalized, mutual information is introduced to obtain the sample weight in each target domain data set, and when calculating the mutual information weighted maximum confusion matrix loss function: After normalizing all source domain pseudo labels output by the classifier, the mutual information between the prediction probability distribution of each sample and the overall distribution is calculated; According to the mutual information, a weight is assigned to each sample, a weight matrix is constructed, and after each sample is weighted according to the weight matrix, a confusion matrix is obtained. The mutual information weighted maximum confusion matrix loss function is constructed according to the confusion matrix.
[0016] In one embodiment, the mutual information weighted maximum confusion matrix loss function is expressed as:
[0017] In the above formula, represents the correlation between the target class and the target class in the target domain, represents the normalized , and represents the number of target classes in the source domain data set.
[0018] The application also provides a transferable vector quantization alignment device based on unsupervised domain adaptation, which comprises: A sample data set acquisition module is configured to acquire a labeled source domain data set and an unlabeled target domain data set, and the source domain data set and the target domain data set both comprise time series signals. A time series signal feature extraction module is configured to input the source domain data set and the target domain data set into a feature extraction unit to obtain source domain features and target domain features, respectively. An overall distribution feature alignment module is configured to search for the closest feature items in a codebook through a nearest neighbor search method, and calculate an overall feature distribution loss function according to the source domain features, the target domain features and the closest feature items, so as to realize overall distribution feature alignment. A local feature alignment module is configured to input the source domain features and the target domain features after being spliced with the closest feature items into a bottleneck layer to obtain source domain bottleneck features and target domain bottleneck features, respectively, and calculate a local alignment loss function according to the source domain bottleneck features and the target domain bottleneck features, so as to realize local feature alignment. A target classification loss calculation module is configured to classify the source domain bottleneck features and the target domain bottleneck features through a classifier to obtain source domain pseudo labels and target domain pseudo labels, respectively, calculate a cross-entropy classification loss function according to the source domain pseudo labels and corresponding true value labels, and calculate a mutual information weighted maximum confusion matrix loss function after introducing mutual information after normalizing the source domain pseudo labels. A training update module is configured to update parameters in the feature extraction unit, the codebook, the bottleneck layer and the classifier by using the overall feature distribution loss function, the local alignment loss function, the cross-entropy classification loss function and the mutual information weighted maximum confusion matrix loss function until convergence, so as to obtain the feature extraction unit, the codebook, the bottleneck layer and the classifier with the ability of cross-domain extraction, aligned features and classification of time series signals.
[0019] A computer device comprises a memory and a processor, the memory stores a computer program, and the processor executes the steps in the above-mentioned transferable vector quantization alignment method based on unsupervised domain adaptation.
[0020] A computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps in the above-mentioned transferable vector quantization alignment method based on unsupervised domain adaptation.
[0021] The transferable vector quantization alignment method and device based on unsupervised domain adaptation, by using the feature extraction unit to extract the source domain features and the target domain features of the source domain data set and the target domain data set, searching for the feature items most similar to the features in the codebook, calculating the overall feature distribution loss function, and calculating the local alignment loss function through the bottleneck layer, finally classifying to obtain the source domain pseudo label and the target domain pseudo label, calculating the cross-entropy classification loss function according to the source domain pseudo label and the corresponding true value label, after normalizing the target domain pseudo label, introducing mutual information to obtain the sample weight in each target domain data set, calculating the mutual information weighted maximum confusion matrix loss function, and updating the parameters in each module until convergence using these loss functions, obtaining the feature extraction unit, the codebook, the bottleneck layer and the classifier with the ability of cross-domain extraction, aligned features and classified time series signal. The method can improve the unlabeled target domain recognition performance. BRIEF DESCRIPTION OF DRAWINGS
[0022] Figure 1 A flowchart of the transferable vector quantization alignment method based on unsupervised domain adaptation in one embodiment; Figure 2 An implementation framework diagram of the transferable vector quantization alignment method based on unsupervised domain adaptation in one embodiment; Figure 3 A structure block diagram of the transferable vector quantization alignment method device based on unsupervised domain adaptation in one embodiment; Figure 4 An internal structure diagram of a computer device in one embodiment. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0024] In the present application, as shown in Figure 1 A transferable vector quantization alignment method based on unsupervised domain adaptation is provided, which specifically includes the following steps: Step S100, obtaining a labeled source domain data set and an unlabeled target domain data set, both the source domain data set and the target domain data set being time series signals.
[0025] Step S110, inputting the source domain data set and the target domain data set into the feature extraction unit to obtain the source domain features and the target domain features, respectively.
[0026] In step S120, the nearest neighbor search method is used to search for the closest feature item in the codebook to the source domain feature and the target domain feature, and a global feature distribution loss function is calculated based on the source domain feature, the target domain feature and the closest feature item, so as to realize global distribution feature alignment.
[0027] In step S130, after the source domain feature and the target domain feature are spliced with the closest feature item, the source domain bottleneck feature and the target domain bottleneck feature are obtained by inputting them into the bottleneck layer, and a local alignment loss function is calculated based on the source domain bottleneck feature and the target domain bottleneck feature, so as to realize local feature alignment.
[0028] In step S140, the source domain bottleneck feature and the target domain bottleneck feature are classified by the classifier to obtain the source domain pseudo label and the target domain pseudo label, respectively, a cross-entropy classification loss function is calculated based on the source domain pseudo label and the corresponding true value label, the target domain pseudo label is normalized, mutual information is introduced to obtain the sample weight of each target domain data set, and a mutual information weighted maximum confusion matrix loss function is calculated.
[0029] In step S150, the parameters in the feature extraction unit, the codebook, the bottleneck layer and the classifier are updated by using the global feature distribution loss function, the local alignment loss function, the cross-entropy classification loss function and the mutual information weighted maximum confusion matrix loss function until convergence is achieved, so as to obtain the feature extraction unit, the codebook, the bottleneck layer and the classifier with the ability of cross-domain extraction, aligned feature and classification of time sequence signals.
[0030] In the method, an unsupervised domain adaptation transferable vector quantization alignment method for wireless communication time sequence signals is proposed. The method can adaptively align the signal distribution difference between heterogeneous communication devices, time-varying channel conditions or complex scenes, effectively solve the accuracy degradation problem caused by device signal difference, channel fading or scene switching in cross-domain communication signal recognition, and is widely applicable to cross-scene migration problems in WiFi, LoRa, radar and other communication signal recognition, modulation mode classification, transmission source fingerprint identification and other tasks.
[0031] In step S100, the source domain data set and the target domain data set are time sequence signals in a wireless communication scenario, such as WiFi, LoRa, radar and other wireless communication devices, which transmit or receive sampling signal sequences with time sequence structure within a certain time. Among them, the source domain data set includes multiple categories of time sequence signals, and each category includes multiple time sequence signal samples and corresponding true value labels, such as modulation mode, device ID or transmission source type. Similarly, the target domain data set also includes multiple categories of time sequence signals, and each category also includes multiple time sequence signal samples, which are used to carry out unsupervised or less supervised cross-domain transfer learning tasks.
[0032] In the embodiment, the time series signal samples in the source domain data set and the target domain data set are divided by batches. Specifically, a batch of sample data is extracted from the source domain data set and the target domain data set respectively each time, and is input into the subsequent time series feature extraction unit for processing. In the whole training process, the model parameter updating is completed through multiple batch iterations.
[0033] In step S110, the feature extraction unit for extracting time series features of each time series signal sample data in the source domain data set and the target domain data set adopts a time series transformer as a backbone network. The time series transformer can adopt a Crossformer, which extracts discriminative features from the source domain and target domain time series signal data using a self-attention mechanism. An Informer can also be used to reduce the long sequence calculation complexity with a sparse self-attention mechanism; or a Performer can be used to reduce the self-attention complexity to linear by kernel approximation to speed up the processing; a TST is designed for time series data, which removes the position encoding and introduces the time-aware attention; a Reformer combines local sensitive hashing with reversible residual layers, which is suitable for modeling ultra-long time series; in addition, GPT-TS, Conformer which combines CNN and Transformer, and Temporal Fusion Transformer (TFT) which has long and short term dependency processing capability, etc. Architecture can be flexibly selected according to the length, periodicity and computing resource demand of the time series signal.
[0034] In the embodiment, the feature extraction unit adopts a Crossformer network as a backbone network, in which: the input time series signal is divided into multiple time series patches of a preset size, and an initial embedding representation is generated through linear projection, position encoding is added to each initial embedding representation, and a self-attention mechanism is used to learn the potential association between each signal patch to obtain source domain features and target domain features.
[0035] Specifically, the input data input into the Crossformer network, i.e., the time series signal samples in the source domain data set and the time series signal samples in the target domain data set, are represented as , wherein, is the time step, is the number of variables, and the signal is divided into time series patches of a fixed size, and an initial embedding representation is generated through linear projection . Position encoding is added to each time series patch and added to its feature embedding to form a final input representation that retains time series content and position information.
[0036] Further, the Crossformer utilizes its self-attention mechanism (including cross-variable and cross-time attention) to learn the potential correlation between signals and generate feature representations from the source domain and the target domain, respectively, denoted as:
[0037]
[0038] In the above formula, denotes the source domain feature, denotes the target domain feature, is the number of sample data in the batch, is the feature dimension.
[0039] In step S120, after obtaining the source domain feature and the target domain feature , in order to eliminate the domain shift problem between the source domain and the target domain, the codebook is used to compare with the features from the source domain and the target domain, and the content in the codebook is updated through the corresponding loss function, denoted as:
[0040] In the above formula, is the dimension of the codebook vector , and is the number of codebook items.
[0041] In this embodiment, the item closest to the feature in the codebook is selected by the nearest neighbor search, and the search process is denoted as:
[0042] In the above formula, denotes the output of the feature extractor, i.e., the source domain feature and the target domain feature .
[0043] In this embodiment, the overall feature distribution loss function aligns the target domain feature and the source domain feature with the closest feature items of each other by using the mean square error or the Euclidean distance.
[0044] Specifically, the overall feature distribution loss function is denoted as:
[0045] In the above formula, denotes the stop gradient operation, is a scalar parameter, denotes the mean square error or the Euclidean distance, This means aligning the target domain features with the closest feature terms in the source domain of the codebook. This means aligning the source domain features with the closest feature in the target domain of the codebook.
[0046] In step S130, local alignment is performed by aligning source and target domain features of the same category using pseudo-labels, thus aligning the features. and After concatenation, the data passes through a bottleneck layer, generating new features, represented as follows:
[0047]
[0048] In the above formula, and These represent the bottleneck features of the source domain and the bottleneck features of the target domain, respectively. Indicates the bottleneck layer. These represent the source domain features and the closest feature found in the codebook, respectively. These represent the target domain features and the closest feature found in the codebook, respectively.
[0049] In this embodiment, the bottleneck layer includes a linear layer, a ReLU activation layer, and a batch normalization layer connected in sequence.
[0050] In this embodiment, the local alignment loss function is expressed as:
[0051] In the above formula, To classify members belonging to the same class based on the pseudo-labels output by the subsequent classifier. The bottleneck characteristics of the source domain and the bottleneck characteristics of the target domain, This represents an adjustable scalar parameter. This represents the number of categories.
[0052] In step S140, the aligned features are processed through a fully connected layer and a classifier C. Map to the target category to generate classification output.
[0053] Specifically, for target domain data, after normalizing the target domain pseudo-labels, mutual information is introduced to obtain the sample weights in each target domain dataset. When calculating the mutual information weighted maximum confusion matrix loss function: after normalizing all source domain pseudo-labels output by the classifier, the mutual information between the predicted probability distribution of each sample and the overall distribution is calculated. Then, weights are assigned to each sample according to the mutual information to construct a weighted matrix. After weighting each sample according to the weighted matrix, the confusion matrix is obtained. Finally, the mutual information weighted maximum confusion matrix loss function is constructed based on the confusion matrix.
[0054] Specifically, the mutual information weighted maximization of the confusion matrix loss function is used to constrain the classifier's output based on the bottleneck features of the target domain, which can be expressed as:
[0055] In the above formula, This refers to the entire network framework, which consists of feature extraction units, a codebook, a bottleneck layer, and a classifier. This indicates the number of categories in the source domain dataset. It is the batch size of the target domain. This represents the classification probability of the target domain samples in the entire batch.
[0056] Furthermore, to enhance the robustness of the probability distribution, we first... After normalization, it is represented as:
[0057] In the above formula, Indicates the first one belonging to the target domain The class of One sample, It is the probability normalization scaling parameter.
[0058] Next, mutual information is introduced. To measure each sample The importance of the target domain classification is calculated using the following formula:
[0059] In the above formula, , This represents the expected value of the overall probability distribution of the target domain. Represents entropy.
[0060] Furthermore, the weight of each sample is calculated based on mutual information, using the following formula:
[0061] In the above formula, This represents a diagonal matrix, indicating the importance of each sample batch to the target domain. It utilizes probability normalization... and sample weights The weighted confusion matrix is calculated and represented as follows:
[0062] In the above formula, This represents the weighted confusion matrix, which represents the class in the target domain. and class The correlation between them, Normalization yields .
[0063] In the embodiment, the mutual information weighted maximum confusion matrix loss function is represented as:
[0064] In the above formula, represents the correlation between the target class and the target class in the target domain, represents the normalization processing of , represents the number of target classes in the source domain data set.
[0065] In the embodiment, when calculating the mutual information weighted maximum confusion matrix loss function described above, in order to improve the quality of the pseudo label, the confidence threshold is set, and only the samples with the prediction probability participate in the calculation of the local alignment loss , so as to reduce the influence of the noise pseudo label.
[0066] Specifically, for the source domain data, the cross entropy loss is calculated to optimize the performance of the classifier.
[0067] In step S150, the global alignment loss , the local alignment loss , the target domain MIMC loss and the source domain cross entropy loss are jointly optimized to realize the classification of the time series signal. The unified framework is realized by jointly optimizing the following loss functions:
[0068] In the above formula, , , is a balance parameter.
[0069] In the embodiment, after multiple iterations of optimization through the training steps as shown in Figure 2 , the feature extraction unit, the codebook, the bottleneck layer and the classifier with the ability of cross-domain extraction, alignment feature and classification of time series signal are obtained. The trained feature extraction unit, codebook, bottleneck layer and classifier can be used to construct a time series signal classification network (TransVQA). The target domain time series signal to be classified is obtained, and the target domain time series signal is input into the time series signal classification network in sequence to obtain the classification prediction result.
[0070] The aforementioned unsupervised domain adaptation-based TransVQA alignment method extracts discriminative features of multivariate time-series signals using a Crossformer network, employs a two-step vector quantization alignment technique to address cross-domain distribution differences, optimizes pseudo-label confidence using a MIMC module, and integrates these into a unified framework to achieve efficient unsupervised domain adaptation classification. This paper proposes an unsupervised domain adaptation TransVQA method that successfully achieves feature alignment and efficient classification of cross-domain time-series signals. Through a two-step alignment and pseudo-label optimization strategy, it significantly reduces the impact of domain offset on classification performance and improves the model's generalization ability in unlabeled target domains. It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0071] In one embodiment, such as Figure 3 As shown, a transferable vector quantization alignment device based on unsupervised domain adaptation is provided, comprising: a sample dataset acquisition module 200, a time-series signal feature extraction module 210, an overall distribution feature alignment module 220, a local feature alignment module 230, a target classification loss calculation module 240, and a training update module 250, wherein: The sample dataset acquisition module 200 is used to acquire a labeled source domain dataset and an unlabeled target domain dataset, wherein both the source domain dataset and the target domain dataset contain time-series signals. The time-series signal feature extraction module 210 is used to input the source domain dataset and the target domain dataset into the feature extraction unit to obtain source domain features and target domain features respectively; The overall distribution feature alignment module 220 is used to search for the feature term that is closest to the source domain feature and the target domain feature in the codebook using the nearest neighbor search method, and calculate the overall feature distribution loss function based on the source domain feature, the target domain feature and the closest feature term to achieve overall distribution feature alignment. The local feature alignment module 230 is configured to splice the source domain feature and the target domain feature with the closest feature item respectively, input the spliced features into the bottleneck layer, obtain the source domain bottleneck feature and the target domain bottleneck feature respectively, and calculate a local alignment loss function according to the source domain bottleneck feature and the target domain bottleneck feature, so as to realize local feature alignment. The target classification loss calculation module 240 is configured to classify the source domain bottleneck feature and the target domain bottleneck feature by using a classifier to obtain a source domain pseudo label and a target domain pseudo label respectively, calculate a cross-entropy classification loss function according to the source domain pseudo label and a corresponding true value label, normalize the source domain pseudo label, introduce mutual information to obtain a sample weight in each target domain data set, and calculate a mutual information weighted maximum confusion matrix loss function. The training update module 250 is configured to update parameters in the feature extraction unit, the codebook, the bottleneck layer and the classifier by using the overall feature distribution loss function, the local alignment loss function, the cross-entropy classification loss function and the mutual information weighted maximum confusion matrix loss function until convergence is achieved, so as to obtain the feature extraction unit, the codebook, the bottleneck layer and the classifier that have the ability of cross-domain extraction, aligned feature and classification of time series signals.
[0072] The specific definitions of the device for transferable vector quantization alignment based on unsupervised domain adaptation can refer to the definitions of the method for transferable vector quantization alignment based on unsupervised domain adaptation in the foregoing, and will not be described herein. Each module in the device for transferable vector quantization alignment based on unsupervised domain adaptation can be realized by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in a hardware form, or can be stored in a memory in a computer device in a software form, so as to be called and executed by a processor to perform operations corresponding to each module.
[0073] In one embodiment, a computer device is provided, which can be a terminal, and an internal structure diagram of the computer device can be as shown in FIG. 6. Figure 4As shown in the figure. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with the external terminal through the network connection. The computer program is executed by the processor to implement a transferable vector quantization alignment method based on unsupervised domain adaptation. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0074] Those skilled in the art can understand that, Figure 4 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0075] In one embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the following steps: Obtaining a labeled source domain data set and an unlabeled target domain data set, both the source domain data set and the target domain data set being time series signals; Inputting the source domain data set and the target domain data set into a feature extraction unit to obtain source domain features and target domain features, respectively; Searching for the closest feature items in the codebook to the source domain features and the target domain features by a nearest neighbor search method, and calculating an overall feature distribution loss function according to the source domain features, the target domain features and the closest feature items to realize overall distribution feature alignment; After splicing the source domain features and the target domain features with the closest feature items, respectively, inputting them into a bottleneck layer to obtain source domain bottleneck features and target domain bottleneck features, respectively, and calculating a local alignment loss function according to the source domain bottleneck features and the target domain bottleneck features to realize local feature alignment; The source domain bottleneck feature and the target domain bottleneck feature are classified by a classifier to obtain a source domain pseudo label and a target domain pseudo label, respectively, a cross-entropy classification loss function is calculated according to the source domain pseudo label and a corresponding true value label, and after the source domain pseudo label is normalized, mutual information is introduced to obtain a sample weight in each target domain data set, and a mutual information weighted maximum confusion matrix loss function is calculated; The parameters in the feature extraction unit, the codebook, the bottleneck layer and the classifier are updated by using the whole feature distribution loss function, the local alignment loss function, the cross-entropy classification loss function and the mutual information weighted maximum confusion matrix loss function until convergence is achieved, thereby obtaining the feature extraction unit, the codebook, the bottleneck layer and the classifier with the ability to extract, align features and classify time series signals across domains.
[0076] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the following steps: A labeled source domain data set and an unlabeled target domain data set are obtained, and the source domain data set and the target domain data set both include time series signals; The source domain data set and the target domain data set are input into a feature extraction unit to obtain source domain features and target domain features, respectively; The nearest neighbor search method is used to search for the closest feature items in the codebook to the source domain features and the target domain features, and a whole feature distribution loss function is calculated according to the source domain features, the target domain features and the closest feature items to achieve whole distribution feature alignment; The source domain features and the target domain features are spliced with the closest feature items respectively, and then input into a bottleneck layer to obtain source domain bottleneck features and target domain bottleneck features, respectively, and a local alignment loss function is calculated according to the source domain bottleneck features and the target domain bottleneck features to achieve local feature alignment; The source domain bottleneck features and the target domain bottleneck features are classified by a classifier to obtain a source domain pseudo label and a target domain pseudo label, respectively, a cross-entropy classification loss function is calculated according to the source domain pseudo label and a corresponding true value label, and after the source domain pseudo label is normalized, mutual information is introduced to obtain a sample weight in each target domain data set, and a mutual information weighted maximum confusion matrix loss function is calculated; The parameters in the feature extraction unit, the codebook, the bottleneck layer and the classifier are updated by using the whole feature distribution loss function, the local alignment loss function, the cross-entropy classification loss function and the mutual information weighted maximum confusion matrix loss function until convergence is achieved, thereby obtaining the feature extraction unit, the codebook, the bottleneck layer and the classifier with the ability to extract, align features and classify time series signals across domains.
[0077] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, storage, databases, or other media in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0078] The technical features of the above embodiments can be combined in any way. In order to make the description simple, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present application.
[0079] The above embodiments only express several embodiments of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of the present application. Therefore, the scope of the patent of the present application should be subject to the appended claims.
Claims
1. A transferable vector quantization alignment method based on unsupervised domain adaptation, characterized in that, The method comprises: obtaining a labeled source domain data set and an unlabeled target domain data set, both of which are time series signals; inputting the source domain data set and the target domain data set into a feature extraction unit to obtain source domain features and target domain features respectively; searching for the closest feature items in a codebook to the source domain features and the target domain features by a nearest neighbor search method, and calculating an overall feature distribution loss function according to the source domain features, the target domain features and the closest feature items to realize overall distribution feature alignment; after the source domain features and the target domain features are spliced with the closest feature items respectively, inputting them into a bottleneck layer to obtain source domain bottleneck features and target domain bottleneck features respectively, and calculating a local alignment loss function according to the source domain bottleneck features and the target domain bottleneck features to realize local feature alignment; classifying the source domain bottleneck features and the target domain bottleneck features by a classifier to obtain source domain pseudo labels and target domain pseudo labels respectively, calculating a cross-entropy classification loss function according to the source domain pseudo labels and corresponding true value labels, and obtaining sample weights in each target domain data set by introducing mutual information after normalizing the source domain pseudo labels to calculate a mutual information weighted maximum confusion matrix loss function; updating parameters in the feature extraction unit, the codebook, the bottleneck layer and the classifier by using the overall feature distribution loss function, the local alignment loss function, the cross-entropy classification loss function and the mutual information weighted maximum confusion matrix loss function until convergence is achieved, to obtain a feature extraction unit, a codebook, a bottleneck layer and a classifier with the ability of cross-domain extraction, aligned feature and classification of time series signals.
2. The unsupervised domain adaptation based transferable vector quantization alignment method according to claim 1, characterized in that, After obtaining the feature extraction unit, the codebook, the bottleneck layer and the classifier with the ability of cross-domain extraction, aligned feature and classification of time series signals: constructing a time series signal classification network according to the trained feature extraction unit, codebook, bottleneck layer and classifier; obtaining a target domain time series signal to be classified, and inputting the target domain time series signal into the time series signal classification network in sequence to obtain a classification prediction result.
3. The unsupervised domain adaptation based transferable vector quantization alignment method according to claim 2, wherein, The feature extraction unit uses a time series transformer as a backbone network.
4. The unsupervised domain adaptation based transferable vector quantization alignment method according to claim 3, characterized in that, The feature extraction unit uses a Crossformer network as a backbone network, and in the Crossformer network: dividing an input time series signal into a plurality of time series segments of a preset size, and generating an initial embedding representation by linear projection; adding position encoding to each initial embedding representation, and then learning the potential association between each signal segment by using a self-attention mechanism to obtain the source domain features and the target domain features.
5. The unsupervised domain adaptation based transferable vector quantization alignment method according to claim 4, characterized in that, The overall feature distribution loss function aligns the target domain features and the source domain features with the closest feature items of each other by using mean square error or Euclidean distance.
6. The unsupervised domain adaptation based transferable vector quantization alignment method according to claim 5, characterized in that, The overall feature distribution loss function is expressed as: In the above formula, denotes a stop gradient operation, is a scalar parameter, denotes a mean squared error, or Euclidean distance, denotes aligning target domain features with the closest feature entry in the codebook for the source domain, denotes aligning source domain features with the closest feature entry in the codebook for the target domain.
7. The unsupervised domain adaptation based transferable vector quantization alignment method according to claim 6, characterized in that, The bottleneck layer comprises linear layers, ReLU activations and batch normalization layers connected in sequence.
8. The unsupervised domain adaptation based transferable vector quantization alignment method according to claim 7, characterized in that, When the source domain pseudo labels are normalized and mutual information is introduced to obtain sample weights in each target domain data set, the mutual information weighted maximum confusion matrix loss function is calculated. After normalizing all source domain pseudo labels output by the classifier, mutual information between a prediction probability distribution of each sample and an overall distribution is calculated; According to the mutual information, weights are assigned to each sample, a weighted matrix is constructed, and after each sample is weighted according to the weighted matrix, a confusion matrix is obtained; The mutual information weighted maximum confusion matrix loss function is constructed according to the confusion matrix.
9. The unsupervised domain adaptation based transferable vector quantization alignment method according to claim 8, characterized in that, The mutual information weighted maximum confusion matrix loss function is expressed as: In the above formula, denotes the correlation between the target class in the target domain and the target class in the source domain, denotes the normalization processing of , and denotes the number of target classes in the source domain data set.
10. A transferable vector quantization alignment device based on unsupervised domain adaptation, characterized by, The device comprises: A sample data set acquisition module is configured to acquire a labeled source domain data set and an unlabeled target domain data set, and the source domain data set and the target domain data set both comprise time series signals; A time series signal feature extraction module is configured to input the source domain data set and the target domain data set into a feature extraction unit to obtain source domain features and target domain features, respectively; An overall distribution feature alignment module is configured to search for the closest feature items in a codebook to the source domain features and the target domain features by using a nearest neighbor search method, and calculate an overall feature distribution loss function according to the source domain features, the target domain features and the closest feature items to realize overall distribution feature alignment; A local feature alignment module is configured to input the source domain features and the target domain features after being spliced with the closest feature items into a bottleneck layer to obtain source domain bottleneck features and target domain bottleneck features, respectively, and calculate a local alignment loss function according to the source domain bottleneck features and the target domain bottleneck features to realize local feature alignment; A target classification loss calculation module is configured to classify the source domain bottleneck features and the target domain bottleneck features by using a classifier to obtain source domain pseudo labels and target domain pseudo labels, respectively, calculate a cross-entropy classification loss function according to the source domain pseudo labels and corresponding true value labels, normalize the source domain pseudo labels, introduce mutual information to obtain sample weights in each target domain data set, and calculate a mutual information weighted maximum confusion matrix loss function; A training update module is configured to update parameters in the feature extraction unit, the codebook, the bottleneck layer and the classifier by using the overall feature distribution loss function, the local alignment loss function, the cross-entropy classification loss function and the mutual information weighted maximum confusion matrix loss function until convergence is achieved, so as to obtain the feature extraction unit, the codebook, the bottleneck layer and the classifier with the ability of cross-domain extraction, aligned features and classification of time series signals.
Citation Information
Patent Citations
Unsupervised domain adaptation method based on adversarial learning loss function
CN110837850A
Image classification method based on reliable weighted optimal transport (RWOT)
US20210390355A1
Cited By
Time-frequency dual-mode alignment method and device for multivariable time sequence signals
CN122310090A