Cross-subject time sequence signal analysis method based on quaternion rotation

By using a quaternion-based representation and rotation alignment method, the problems of amplitude difference and direction offset in cross-individual time series signal analysis are solved, achieving highly accurate and robust cross-individual time series analysis, which is suitable for intelligent physiological monitoring and time series pattern recognition.

CN121901828APending Publication Date: 2026-04-21SOUTHEAST UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511959105.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Differences in physiological structure among individuals lead to variations in the amplitude, direction, and frequency domain characteristics of time-series signals, resulting in poor generalization ability and low robustness of models under cross-individual conditions. Existing methods are unable to effectively alleviate these problems.

Method used

We adopt a method based on quaternion representation and rotation alignment. By constructing a unified quaternion feature space and combining a learnable geometric rotation mechanism, we align the structure and orientation of time-series signals. We introduce a quaternion long short-term memory network for deep time-series modeling to enhance the correlation modeling capability between multiple channels.

Benefits of technology

It significantly improves the accuracy and generalization ability of cross-individual time series analysis, enhances the stability and robustness of the model, maintains high-quality feature extraction results in complex acquisition scenarios, and is suitable for intelligent physiological monitoring and time series pattern recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121901828A_ABST
    Figure CN121901828A_ABST
Patent Text Reader

Abstract

The invention discloses a quaternion-based cross-tested time sequence signal analysis method, which comprises the following steps of: firstly, dividing a cross-tested time sequence signal into a plurality of time windows, mapping multi-window data into a uniform quaternion representation form, then constructing a quaternion-based transformator module, and analyzing the quaternion-based cross-tested time sequence signal according to the quaternion-based transformator module to obtain the quaternion-based cross-tested time sequence signal. A Hamiltonian product is used for replacing real value operation to enhance the coupling representation capability between signals, learnable quaternion geometric rotation is introduced into a self-attention mechanism, and spatial vector rotation mapping is performed on a value component of an attention module, so that feature direction offset under different individuals or different acquisition conditions is aligned; and finally, further reducing the distribution difference among different individuals through adversarial training, and improving the generalization performance of the model in an environment without individuals or in a new environment. According to the method, the multi-window time sequence characteristics, the amplitude-phase correlation multi-modal characteristics and the structural offset between different individuals can be represented at the same time, and the method has excellent cross-individual generalization ability and robustness; the method can be widely applied to the fields of complex time sequence data modeling, cross-equipment medical signal analysis, intelligent monitoring and other multi-source time sequence data analysis, and provides effective technical support for constructing a high-reliability cross-domain time sequence analysis system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a cross-subject temporal signal analysis method based on quaternions, belonging to the field of medical signal acquisition and post-processing application technology. Background Technology

[0002] Time-series signals are an important form of data reflecting the internal physiological processes of the human body. For example, multi-channel continuous time-series signals collected from the skin, muscles, nerves, or other physiological structures are commonly used in various scenarios such as health monitoring, behavior recognition, physiological state assessment, and disease early warning. These signals typically feature high temporal resolution, a large number of channels, and rapid dynamic changes, containing rich amplitude variations, phase variations, and multimodal characteristics. Therefore, accurate modeling and analysis of time-series signals is a crucial foundation for intelligent health monitoring systems.

[0003] However, due to significant differences in physiological structure, electrode or sensor placement, skin impedance, and individual response patterns among different individuals, even when acquiring the same type of time-series signal, obvious amplitude differences, directional shifts, and inconsistencies in frequency domain characteristics still occur between individuals. This cross-individual distribution difference not only causes rotation or deformation of the signal spatial structure but also causes drift in the time-series pattern, making it difficult for models trained on a single individual or in a fixed environment to be generalized to new individuals or under new acquisition conditions, resulting in poor model generalization ability and low robustness.

[0004] To mitigate the impact of cross-individual differences, some existing methods attempt to reduce the signal distribution variations between individuals through traditional feature engineering, alignment algorithms, or domain adaptation (DA) techniques. For example, linear mapping, statistical equalization, or conventional adversarial learning can be used to extract individual-independent temporal features. However, because temporal signals often contain complex characteristics such as amplitude, phase, and multi-time window coupling, and the differences between spatial channels often manifest as directional shifts or nonlinear rotations, traditional real-domain methods struggle to simultaneously model the coupling relationships between these multimodal features. In practical analysis, even after some data calibration, significant structural differences still exist in the signals of different individuals, leading to performance degradation of the model under cross-individual conditions.

[0005] This invention proposes a cross-individual time-series signal analysis method based on quaternion representation and rotation alignment. This method addresses the issues of amplitude differences, direction shifts, and inconsistent distributions among different individuals in multi-channel time-series signals. It achieves consistent modeling of the structure and direction of time-series signals by constructing a unified quaternion feature space and combining it with a learnable geometric rotation mechanism. Specifically, this invention first encapsulates multi-time-window time-series signals into quaternion form to simultaneously express the coupling relationships between amplitude, phase, and multimodal information. Then, in the encoding stage, a multi-head self-attention module based on quaternion rotation is introduced. Global dependencies across time windows are established through quaternion linear mapping and Hamiltonian products, and learnable quaternion rotation is used to align feature direction shifts between different individuals, thereby improving the domain invariance and representational stability of features. Furthermore, this invention introduces a quaternion long short-term memory network in the deep time-series modeling stage, enabling the model to capture long-term dependencies and dynamic change patterns in the time-series signals, and enhancing the correlation modeling capability between multiple channels through quaternion structure sharing. Through the aforementioned phased and progressive quaternion feature encoding method, this invention can effectively alleviate cross-individual distribution differences while maintaining the integrity of the temporal structure, improve the generalization ability and robustness of temporal signal analysis tasks in complex acquisition scenarios, and provide reliable technical support for intelligent physiological monitoring and temporal pattern recognition in cross-individual and multi-device environments. Summary of the Invention

[0006] To generate high-quality feature representations that meet the needs of time-series signal analysis under cross-individual and multi-device conditions, this invention provides a quaternion-based cross-subject time-series signal analysis method. This method employs a staged, progressive feature encoding approach, effectively learning multi-window amplitude and phase change information of the time-series signal in the shallow stage, as well as cross-temporal dependencies and individual-independent features in the deep encoding stage. This enables robust extraction of key patterns in the time-series signal, significantly improving the accuracy and generalization ability of cross-individual time-series analysis, and providing reliable technical support for practical applications in intelligent physiological monitoring and time-series behavior recognition.

[0007] To address the shortcomings of existing technologies, this invention provides a method for cross-subject temporal signal analysis based on quaternions, the process of which is as follows: Figure 1 As shown, it includes the following steps:

[0008] Step 1: Obtain the raw time-series signal data to be analyzed;

[0009] Step 2: Preprocess and optionally label the time series signal obtained in step (1), and normalize and augment the signal data.

[0010] Step 3: Divide the preprocessed time series signal into multiple time windows and map the multidimensional signal of each time window into a quaternion representation to uniformly model amplitude, phase or other multimodal features;

[0011] Step 4: Input the quaternion representation temporal features obtained in step (3) into the multi-head self-attention module based on quaternion rotation. Align the feature direction offsets of different individuals or different acquisition conditions through quaternion linear mapping, Hamiltonian product and learnable quaternion rotation. Extract global correlation features across time windows through quaternion feedforward network to form deep quaternion representation.

[0012] Step 5: Input the deep quaternion features obtained in step (4) into the quaternion LSTM module to perform time-dependent modeling on the quaternion feature sequence in order to extract discriminative key information in the time-series change pattern and reduce interference from irrelevant features.

[0013] Step 6: Input the features obtained in steps (4) and (5) into the classification / regression module to complete the cross-individual unified analysis of the time series signal, thereby outputting the corresponding time series analysis results.

[0014] Specifically, the quaternion representation module in step 3 is used to map multi-time-window time-series signals into a unified quaternion structure. This module consists of a time-window partitioning unit, a feature construction unit, and a quaternion encapsulation unit. Its feature extraction process is as follows: To effectively model the temporal correlation of multi-source signals, time-window segmentation is performed on each 3-second time-series data segment. Using non-overlapping windows of 0.75 seconds in length, the signal is divided into a series of continuous time segments, and the data from different time segments are mapped to the following quaternion representation:

[0015] X s (m)=x tn=1 (m)+x tn=2 (m)i+x tn=3 (m)j+x tn=4 (m)k,

[0016] Where x tn=1 x tn=2 x tn=3 x tn=4 This is window data. When frequency domain analysis is required, the quaternion signal is frequency-domain mapped using the left-hand quaternion Fourier Transform (LQFT), defined as follows:

[0017]

[0018] Where N represents the number of time points within the time window, f is the frequency index, and μ represents the pure unit quaternion defining the transformation axis. Furthermore, by taking the square of the modulus of the frequency domain result and summing it over a preset frequency band, the quaternion power spectral density characteristics are obtained:

[0019]

[0020] Where F b Let |F| represent the set of frequencies corresponding to the b-th frequency band. b | indicates the frequency count in the set. Then, perform a differential entropy transform on the PSD to obtain the final features:

[0021]

[0022] Finally, the obtained multimodal features are encapsulated in quaternion form to obtain a dimension of The quaternion input feature tensor. Compared with existing techniques, such as real difference entropy extraction methods, the quaternion difference entropy extraction method can process time-series signals under four time windows simultaneously. While maintaining the structural information of the original signal, it greatly enhances the signal coupling under different time windows, providing a unified structured time-series feature expression for the subsequent quaternion rotation self-attention module.

[0023] The multi-head self-attention mechanism based on quaternion rotation in step 4 consists of a quaternion linear mapping layer, a learnable quaternion rotation unit, a multi-head self-attention computation unit, and a quaternion feedforward network. First, the quaternion input features obtained in step (3) are fed into the three quaternion linear mapping layers to obtain the query vector, key vector, and value vector. The feature transmission process is as follows:

[0024]

[0025] In the formula, This represents the Hamiltonian product operation of quaternions. The quaternion rotation multi-head self-attention mechanism is performed by rotating the value using quaternions. Its key feature is that, for the Transformer framework, quaternion rotation operations can be performed on queries (Query, Q), keys (Key, K), and values ​​(Value, V) to obtain more consistent and separable deep features. In the above formula, W is a learnable quaternion weight matrix. Subsequently, the value vector V is passed to the learnable quaternion rotation unit. The rotation unit consists of a learnable angle parameter θ and a rotation axis. The rotation quaternion R is a unit quaternion, defined as:

[0026]

[0027] This will combine the query (Q), key (K), and the rotated... Input a multi-head self-attention unit and calculate the attention output:

[0028]

[0029] The final attention output is processed through residual connections and layer normalization:

[0030]

[0031] In the above formula, LayerNorm represents layer normalization, softmax is the activation function, and d k The scaling parameter is given by the above formula, which yields the preliminary feature representation of the time series signal in this invention. Compared with existing technologies, such as real number multi-head self-attention mechanisms, the self-attention module based on quaternion rotation can couple relevant information at different times, enabling multi-source time series signals to have strong generalization ability.

[0032] The quaternion LSTM module in step 5 is used for temporal dependency modeling of deep quaternion feature sequences. The quaternion LSTM module consists of a quaternion forget gate, an input gate, an output gate, a candidate state update unit, and a quaternion hidden state update unit. Let f... t i t ,o t ,c t , and h t These include the forget gate, input gate, output gate, cell state, and the hidden state of the LSTM cell within the time window t.

[0033]

[0034] in denoted by Hamiltonian, ⊙ represents element-wise multiplication, α represents the Sigmoid activation function, and tanh() represents the hyperbolic tangent activation function. All weight parameters are in quaternion form. Compared with existing technologies, such as real-valued LSTM, the quaternion LSTM in this invention can more compactly represent the intrinsic relationships between high-dimensional multimodal features, reducing the number of parameters while extracting more accurate task-related feature representations.

[0035] The classification module in step 6 is characterized by constructing a multi-source domain discriminator D. s (Quaternion linear layer) is used to distinguish which subject a feature originates from. During the pre-training phase, two types of labels are used for supervision. Sentiment labels are used to calculate the cross-entropy loss. This measures the difference between the true and predicted values ​​of the task. Additionally, we introduce extra domain labels to supervise the domain discriminative power of the features. Deep features are output by a quaternion LSTM, which is then fed into D... sPreviously, a gradient inversion layer (GRL) was added to combat the loss. The calculation. and The calculation formula is as follows:

[0036]

[0037] in and These represent the predicted sentiment label and the predicted domain label, respectively, and L represents the total number of multi-source signals. and λ represents the actual emotion label and the domain label, respectively, and λ represents the gradient reversal coefficient.

[0038] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the aforementioned method for cross-subject temporal signal analysis based on quaternion rotation.

[0039] A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the aforementioned method for cross-subject temporal signal analysis based on quaternion rotation.

[0040] Compared with existing technologies, the advantages and beneficial effects of this invention are as follows: This invention constructs a unified quaternion feature modeling framework for multi-entity time-series signals. By encapsulating time-series signals with multiple time windows into quaternion representations, it achieves the joint expression of amplitude, phase, and other multimodal information. This enables the model to simultaneously learn the local dynamic changes and global correlation patterns of the signal under a unified structure, significantly improving feature representation capabilities and model stability. In the feature encoding stage, this invention introduces a multi-head self-attention module based on quaternion rotation. It utilizes quaternion linear mapping and learnable geometric rotation to align the spatial orientation offsets between different individuals, effectively alleviating the feature mismatch problem caused by inconsistent cross-entity signal distributions. This allows the model to adaptively adjust the feature space orientation and learn more robust cross-entity shared features. Furthermore, this invention employs a quaternion long short-term memory network in the deep time-series modeling stage. Through a quaternion gating structure, it achieves tight-coupled modeling capabilities for multi-channel, multimodal time-series features. This not only reduces model redundancy under parameter sharing conditions but also enhances the correlation expression capabilities between different features, resulting in higher accuracy and robustness in handling long-sequence dependency relationships. This invention significantly reduces the overall number of model parameters by leveraging the weight-sharing characteristics of quaternion structures, improving training efficiency and deployment flexibility while maintaining model performance. Furthermore, the learnable quaternion rotation module proposed in this invention can precisely adjust for directional shifts caused by physiological differences, sensor placement variations, or environmental changes between individuals, ensuring a consistent distribution of deep features in the imaginary space and significantly enhancing signal transferability across individuals or devices. Through the synergistic effect of self-attention and quaternion rotation, this invention enhances global dependency modeling capabilities, suppresses the negative impacts of noise interference and redundant information, and enables the model to maintain high-quality feature extraction even in complex scenarios. Through the aforementioned staged and progressive quaternion feature encoding method, this invention can comprehensively learn key features in time-series signals from the bottom layer to the deep layer, achieving robust time-series analysis capabilities across various environmental conditions. This provides reliable technical support for intelligent health monitoring, multi-source time-series signal analysis, and cross-device signal modeling, demonstrating significant application value and promising prospects. Attached Figure Description

[0041] Figure 1 This is a schematic diagram of the overall process of the present invention.

[0042] Figure 2 This is a schematic diagram of the overall model structure of the present invention.

[0043] Figure 3 A visual illustration of the model's generalization ability across subjects. Detailed Implementation

[0044] The technical solutions provided by the present invention will now be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention.

[0045] Example: Figure 1 As shown, this invention proposes a cross-subject temporal signal analysis method based on quaternion rotation, comprising the following steps:

[0046] Step 1: Obtain the raw time-series signal data to be analyzed;

[0047] Step 2: Preprocess and optionally label the time series signal obtained in step (1), and normalize and augment the signal data.

[0048] Step 3: Divide the preprocessed time series signal into multiple time windows and map the multidimensional signal of each time window into a quaternion representation to uniformly model amplitude, phase or other multimodal features;

[0049] Step 4: Input the quaternion representation temporal features obtained in step (3) into the multi-head self-attention module based on quaternion rotation. Align the feature direction offsets of different individuals or different acquisition conditions through quaternion linear mapping, Hamiltonian product and learnable quaternion rotation. Extract global correlation features across time windows through quaternion feedforward network to form deep quaternion representation.

[0050] Step 5: Input the deep quaternion features obtained in step (4) into the quaternion LSTM module to perform time-series dependency modeling on the quaternion feature sequence in order to extract discriminative key information in the time-series change pattern and reduce the interference of redundant features.

[0051] Step 6: Input the features obtained in steps (4) and (5) into the classification / regression module to complete the cross-individual unified analysis of the time series signal, thereby outputting the corresponding time series analysis results.

[0052] like Figure 2 As shown, the quaternion representation module in step 3 is used to map multi-time-window time-series signals into a unified quaternion structure. This module consists of a time-window partitioning unit, a feature construction unit, and a quaternion encapsulation unit. To effectively model the temporal correlation of multi-source signals, time-window segmentation is performed on each 3-second time-series data segment. Using non-overlapping windows of 0.75 seconds in length, the signal is divided into a series of continuous time segments, and the data from different time segments are mapped to the following quaternion representation:

[0053] X s (m)=x tn=1 (m)+x tn=2 (m)i+x tn=3 (m)j+x tn=4 (m)k,

[0054] Where x tn=1 x tn=2 x tn=3 x tn=4 This is window data. When frequency domain analysis is required, the quaternion signal is frequency-domain mapped using the Left Quaternion Fourier Transform (LQFT), defined as follows:

[0055]

[0056] Where N represents the number of time points within the time window, m represents the m-th sampling point, f is the frequency index, and μ represents the pure unit quaternion defining the transform axis. The choice of the μ parameter has a significant impact on the transform characteristics. This invention adopts... The (i+j+k)-axis configuration evenly distributes the rotation across the three imaginary parts i, j, and k, resulting in an isotropic spectral representation. This choice ensures that the frequency components corresponding to different time segments are symmetrically processed when mapped one-to-one to the imaginary parts i, j, and k, which aligns with the modeling objective of giving equal importance to each time window in quaternion representation. To improve computational efficiency, we employ a complex factorization strategy, representing the quaternion as a combination of two complex numbers:

[0057]

[0058] Make quaternion signals The quaternion signal can be represented by two complex numerical forms, z1(t) and z2(t), thus realizing the complex decomposition of the quaternion signal. Therefore, the discrete Fourier transform of the quaternion can be converted into two complex fast Fourier transforms (symplectic decomposition):

[0059]

[0060] Through symplectic decomposition, the quaternion discrete Fourier transform maps the quaternion signal to two complex subplanes along the same imaginary axis μ, allowing frequency domain calculations to be efficiently performed using two standard complex fast Fourier transforms. This property enables the quaternion discrete Fourier transform to perform quaternion frequency domain analysis at the same cost as the complex fast Fourier transform without sacrificing quaternion structural information. After obtaining the frequency domain information in the quaternion space, the differential entropy feature is calculated component-by-component. The quaternion structure is represented by Q(f) obtained through this invention as follows:

[0061] Q(f) = Q (a) (f)+Q (i) (f)i+Q (j) (f)j+Q (k) (f)k

[0062] In this invention, the superscripts (a, i, j, k) represent the components of the quaternion, which correspond to four channels.

[0063] For the standard frequency band (δ: 1-3Hz, θ: 4-7Hz, α: 8-13Hz, β: 14-30Hz, γ: 31-50Hz), we calculate the band power by component:

[0064]

[0065] Where F b Represents the set of frequency indices, |F b | indicates its cardinality. The component difference entropy (DE) is defined as:

[0066]

[0067] Finally, we construct quaternion DE features for each component, the expression of which is:

[0068] DE s =DE (a) +DE (i) i+DE (j) j+DE (k) k

[0069] Therefore, the obtained quaternion DE features have a time window × channel × frequency band dimension (that is, a certain frequency band under a certain time window contains four quaternion components).

[0070] like Figure 2 As shown, the multi-head self-attention mechanism based on quaternion rotation in step 4 consists of a quaternion linear mapping layer, a learnable quaternion rotation unit, a multi-head self-attention computation unit, and a quaternion feedforward network. In the traditional Transformer, the query (Q), key (K), and value (V) are usually obtained by processing the input features X. s The linear transformation is used to calculate attention weights and representation fusion. The key idea in this invention is to replace this linear transformation with a more expressive hypercomplex transformation using the Hamiltonian product rule of quaternions:

[0071]

[0072] To further enhance the model's modeling capability in multimodal feature spaces, this invention introduces a quaternion rotation mechanism to rotate the Value component, thereby modeling and calibrating structural differences between temporal signal channels (such as subject head size, electrode distribution offset, etc.) at the physical space level. This rotation is controlled by a learnable unit quaternion R and is adaptively optimized through backpropagation during training.

[0073]

[0074] Among them, the rotation axis Defined as a pure unit quaternion, and denoted as The parameters x, y, and z are random numbers generated according to a known initialization criterion. The angle θ is randomly generated within the interval [-π, π]. This formula is the classical Euler formula e^(-π / 2). iθ =cosθ+isinθ is a natural generalization of quaternion space. The rotation of the value component can be defined as performing a squeeze operation on the original characteristic quaternion V:

[0075]

[0076] Where V is the input multi-feature quaternion, R is the rotation quaternion, and R * Let R be the conjugate quaternion. To ensure the numerical stability and geometric meaning of the rotation operation, the rotation quaternion R must satisfy the unit norm constraint, i.e.:

[0077]

[0078] in During training, R uses a learnable parameter vector [r] a ,r i ,r j ,r k The form is initialized to follow a uniform distribution. The random value. Subsequently, in each training iteration, this vector is forcibly projected back into the unit quaternion space through an L2 normalization operation, i.e.:

[0079]

[0080] This normalization process is performed during forward propagation, ensuring that rotation operations are always performed within the unit quaternion domain, thus avoiding gradient explosion and maintaining the stability of hypercomplex rotation transformations. The final attention output is then processed through residual connections and layer normalization.

[0081]

[0082] in, In the above formula, LayerNorm represents layer normalization, softmax is the activation function, and d k The scaling parameter is given by the above formula, which yields the preliminary feature representation of the time series signal in this invention. Compared with existing technologies, such as real number multi-head self-attention mechanisms, the self-attention module based on quaternion rotation can couple relevant information at different times, enabling multi-source time series signals to have strong generalization ability.

[0083] like Figure 2As shown, the module in step 5 receives the output features from step 4. Although the quaternion rotation multi-head self-attention module can model the global dependencies of multiple features and alleviate the cross-subject bias problem by introducing a learnable rotation mechanism, multi-source time-series signals inherently possess strong temporal dynamic characteristics, and relying solely on the attention mechanism is insufficient to fully capture their local temporal dependencies. Therefore, this invention further introduces a quaternion-based Long Short-Term Memory (QuaternionLSTM) network to enhance the model's ability to model time-series changes. Traditional LSTM has been widely validated for its effectiveness in modeling time series, but its ability to handle multimodal features is limited. Therefore, this invention reconstructs the LSTM structure using a quaternion neural network framework to uniformly model the temporal evolution relationships between multiple features. Let the output of the quaternion rotation Transformer be the quaternion feature sequence. In this invention, the size of the time window T is 12, and the input features of each time window are... These correspond to three amplitude-phase characteristics (obtained from the quaternion rotation Transformer module). The gate is defined by quaternions; therefore, its function is to independently modify each component of the signal by multiplying each component of the quaternion numerical signal by the quaternion numerical gate potential component by component. Let f... t i t ,o t ,c t , and h t These include the forget gate, input gate, output gate, cell state, and the hidden state of the LSTM cell within the time window t.

[0084]

[0085] in denoted by Hamiltonian, ⊙ represents element-wise multiplication, α represents the Sigmoid activation function, and tanh() represents the hyperbolic tangent activation function. All weight parameters are in quaternion form. Compared to real-valued LSTM, quaternion LSTM can more compactly represent the intrinsic relationships between high-dimensional multimodal features, reducing the number of parameters while extracting more accurate task-related feature representations.

[0086] The classification module in step 6 is characterized by constructing a multi-source domain discriminator D. s (Quaternion linear layer) is used to distinguish which subject a feature originates from. During the pre-training phase, two types of labels are used for supervision. Sentiment labels are used to calculate the cross-entropy loss. This measures the difference between the true and predicted values ​​of the task. Additionally, we introduce extra domain labels to supervise the domain discriminative power of the features. Deep features are output by a quaternion LSTM, which is then fed into D... s Previously, a gradient inversion layer (GRL) was added to combat the loss. The calculation. and The calculation formula is as follows:

[0087]

[0088] in and These represent the predicted sentiment label and the predicted domain label, respectively, and L represents the total number of multi-source signals. and λ represents the actual emotion label and the domain label, respectively, and λ represents the gradient reversal coefficient.

[0089] like Figure 3 As shown, this invention demonstrates significant model generalization ability across subjects and environments. In the first column, observation reveals that the original multi-source time-series signals lack class separability and distribution consistency. Notably, compared to the first dataset (first row), the second dataset (second row) shows less distributional difference among subjects, indicating that the multi-source time-series signal acquisition paradigm influences signal variability. In the second column, it is evident that regardless of the first or second dataset, after quaternion-based multi-component DE feature extraction, class information remains confused. The third column shows the pre-training effect of this invention; the data distribution among subjects is significantly reduced (coordinate range), and samples of the same class become closer, while samples of different classes become more distant (observable within each cluster). The third column also shows the visualization effect of this invention after fine-tuning. It is clearly visible that the categories of all subjects become clearly defined into three or four clusters, greatly enhancing class separability. This demonstrates that this invention not only reduces the distributional difference between the source and target domains of multi-source time-series signals but also correctly extracts class-related feature information.

[0090] In another embodiment, the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the aforementioned method for cross-subject temporal signal analysis based on quaternion rotation.

[0091] In another embodiment, the present invention provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the described method for cross-subject temporal signal analysis based on quaternion rotation.

[0092] The above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments, but also includes technical solutions constituted by any combination of technologies under the concept of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principle of the present invention should be considered within the scope of protection of the present invention.

Claims

1. A method for cross-subject temporal signal analysis based on quaternions, characterized in that, Includes the following steps: Step 1: Obtain the raw time-series signal data to be analyzed; Step 2: Preprocess and optionally label the time series signal obtained in step (1), and normalize and augment the signal data. Step 3: Divide the preprocessed time series signal into multiple time windows and map the multidimensional signal of each time window into a quaternion representation to uniformly model amplitude, phase or other multimodal features; Step 4: Input the quaternion representation temporal features obtained in step (3) into the multi-head self-attention module after quaternion rotation. Align the feature direction offsets of different individuals or different acquisition conditions through quaternion linear mapping, Hamiltonian product and learnable quaternion rotation. Extract global correlation features across time windows through quaternion feedforward network to form deep quaternion representation. Step 5: Input the deep quaternion features obtained in step (4) into the Quaternion Long Short-Term Memory network (LSTM) module to perform time-dependent modeling on the quaternion feature sequence in order to extract discriminative key information in the time-series change pattern and reduce interference from irrelevant features. Step 6: Input the features obtained in steps (4) and (5) into the classification / regression module to complete the cross-individual unified analysis of the time series signal, thereby outputting the corresponding time series analysis results.

2. The cross-individual time series signal analysis method based on quaternion representation and rotation alignment according to claim 1, characterized in that, The quaternion representation module in step 3 is used to map multi-time-window time-series signals into a unified quaternion structure. This module consists of a time-window partitioning unit, a feature construction unit, and a quaternion encapsulation unit. Its feature extraction process is as follows: To effectively model the temporal correlation of multi-source signals, time-window segmentation is performed on each 3-second time-series data segment. A non-overlapping window of 0.75 seconds is used to divide the signal into a series of continuous time periods. The data from different time periods are mapped to the following quaternion representation: X s (m)=x tn=1 (m)+x tn=2 (m)i+x tn=3 (m)j+x tn=4 (m)k, Where x tn=1 x tn=2 x tn=3 x tn=4 For windowed data, tn represents the window, m represents the time index, and i, j, k are the imaginary units of the quaternion. When frequency domain analysis is required, the quaternion signal is mapped to the frequency domain through the left-hand quaternion Fourier Transform (LQFT), and the transform is defined as follows: Where N represents the number of time points within the time window, f is the frequency index, and μ represents the pure unit quaternion defining the transformation axis. The quaternion power spectral density characteristics are obtained by taking the square of the modulus of the frequency domain result and summing it within a preset frequency band. Where F b Let |F| represent the set of frequencies corresponding to the b-th frequency band. b | represents the frequency count in the set, Q (p) The frequency domain information under different quaternion components is represented, and then the PSD is subjected to differential entropy transformation to obtain the final features: Where p represents the components under the quaternion structure, Var represents the variance calculation, and finally the multimodal features obtained above are encapsulated in quaternion form to obtain a dimension of Quaternion input feature tensors.

3. The cross-individual time series signal analysis method based on quaternion representation and rotation alignment according to claim 1, characterized in that, The multi-head self-attention mechanism based on quaternion rotation in step 4 consists of a quaternion linear mapping layer, a learnable quaternion rotation unit, a multi-head self-attention computation unit, and a quaternion feedforward network. First, the quaternion input features obtained in step (3) are fed into the three quaternion linear mapping layers to obtain the query vector, key vector, and value vector. The feature transmission process is as follows: In the formula, This represents the Hamiltonian product operation of quaternions, X. s The input timing signal is R, which is a learnable rotation quaternion (given by its real part r). a With the imaginary part r i r j r k The quaternion rotation multi-head self-attention module is composed of quaternion rotations performed on the value. Its key feature is that, for the Transformer framework, quaternion rotation operations can be performed on the query (Query, Q), key (Key, K), and value (Value, V) to obtain more consistent and separable deep features. In the above formula, W is a learnable quaternion weight matrix. Subsequently, the value vector V is passed to the learnable quaternion rotation unit, which consists of a learnable angle parameter θ and a rotation axis. The rotation quaternion R is a unit quaternion, defined as: This will combine the query (Q), key (K), and the rotated... Input a multi-head self-attention unit and calculate the attention output: The final attention output is processed through residual connections and layer normalization: In the above formula, LayerNorm represents layer normalization, softmax is the activation function, and d k The scaling parameter is used to obtain a preliminary characteristic representation of the timing signal using the above formula.

4. The cross-individual time series signal analysis method based on quaternion representation and rotation alignment according to claim 1, characterized in that, The quaternion LSTM module in step 5 is used to perform temporal dependency modeling on the deep feature sequence of quaternions. The quaternion LSTM module consists of a quaternion forget gate, an input gate, an output gate, a candidate state update unit, and a quaternion hidden state update unit. Let f... t i t ,o t ,c t , and h t These include the forget gate, input gate, output gate, cell state, and the hidden state of the LSTM cell within the time window t. in denoted as Hamiltonian product, ⊙ as element-wise multiplication, α as sigmoid activation function, all weight parameters W are in quaternion form, and tanh() as hyperbolic tangent activation function.

5. The cross-individual time series signal analysis method based on quaternion representation and rotation alignment according to claim 1, characterized in that, Step 6 constructs a multi-source domain discriminator D. s (Quaternion linear layer) is used to distinguish which subject a feature originates from. During the pre-training phase, two types of labels are used for supervision: the sentiment label is used to calculate the cross-entropy loss. It measures the difference between the true and predicted values ​​of the task, and also introduces additional domain labels to supervise the domain discriminative power of the features. Deep features are output by a quaternion LSTM, which is then input into D. s Previously, a gradient inversion layer (GRL) was added to combat the loss. The calculation, and The calculation formula is as follows: in and These represent the predicted sentiment label and the predicted domain label, respectively, and L represents the total number of multi-source signals. and λ represents the actual emotion label and the domain label, respectively, and λ represents the gradient reversal coefficient.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements a quaternion-based cross-subject temporal signal analysis method as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing computer instructions thereon, characterized in that, When executed by a processor, the computer instructions implement a quaternion-based cross-subject temporal signal analysis method as described in any one of claims 1 to 4.