A method and system for financial time series forecasting with frequency domain enhancement and morphological embedding

By employing frequency domain enhancement and morphological embedding methods, the problems of missing local semantic features and numerical drift in financial stock data prediction are solved, achieving high-precision stock price prediction and stable market trend following, thus improving the robustness of the model.

CN122453522APending Publication Date: 2026-07-24CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING UNIV OF POSTS & TELECOMM
Filing Date
2026-05-07
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing models suffer from problems such as missing local semantic features, data augmentation disrupting long-term trends, and numerical drift in non-stationary data when processing financial stock candlestick data. These issues lead to large prediction errors, especially when the market is experiencing sharp fluctuations and the models are unable to accurately capture market turning points.

Method used

This method employs frequency domain enhancement and morphological embedding. It extracts deep features of K-lines through CNN morphological embedding, uses frequency domain enhancement to preserve low-frequency trends and applies perturbation to high-frequency components, and combines an adaptive inverse normalization strategy to achieve high-precision prediction of stock prices.

Benefits of technology

It achieves high-precision stock price prediction, with the average absolute error reduced to 23.62 and the relative error rate below 0.67%. It maintains the ability to follow trends without lag even in volatile markets, significantly improving the robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122453522A_ABST
    Figure CN122453522A_ABST
Patent Text Reader

Abstract

The present application relates to artificial intelligence, deep learning, financial technology, time series prediction technology field, specifically refers to a kind of financial time series prediction method and system of frequency domain enhancement and morphology embedding, comprising: first, obtain stock market daily line level opening price, highest price, lowest price, closing price, transaction volume multidimensional K line data and do moving average smoothing;Again, reorder column dimension, extract K line morphology features by multilayer one-dimensional convolution and project into high-dimensional vector;In the training phase, the data is enhanced in the frequency domain, and only the high-frequency component is disturbed;The features are input into the iTransformer encoder to extract the time series features;Finally, the real prediction value is restored by adaptive inverse normalization.The present application realizes high-precision prediction of stock price by morphology embedding, frequency domain fine enhancement, adaptive inverse normalization and iTransformer modeling, eliminates the numerical cliff effect, improves the trend following and inflection point capturing ability, and enhances the overall robustness of the algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence, deep learning, financial technology, and time series forecasting, specifically to a financial time series forecasting method and system that combines frequency domain enhancement and morphological embedding. Background Technology

[0002] In recent years, Transformer-type models have achieved significant results in time series forecasting. iTransformer, in particular, effectively captures the correlation between data variables by treating the entire time series as a single feature unit through an inverted embedding strategy. However, directly applying these models to stock price forecasting presents significant limitations using existing techniques. Most models use linear layers for feature embedding, failing to extract high-dimensional candlestick pattern features. The low signal-to-noise ratio in financial markets means that directly adding noise in the time domain can mask weak trend signals, highlighting the inherent flaws of data augmentation strategies. To address the issue of non-stationary data, the industry typically employs reversible instance normalization. However, in actual inference, this method lacks an effective statistical recovery mechanism, often resulting in the loss of absolute price information. Predictions may only maintain a similar trend shape, with significant deviations in absolute values.

[0003] Traditional models often treat opening price, closing price, highest price, and lowest price as independent time points, ignoring the crucial morphological semantic information contained in candlestick patterns, resulting in the loss of local semantic features. Existing time-domain data augmentation methods easily disrupt the long-term trend characteristics of stock data, causing the model to learn incorrect data distributions and impair its generalization ability. Financial data exhibits strong non-stationarity. Traditional normalization methods, when predicting strong trend data such as unilateral upward or downward movements, perform mean-reduction processing. The predicted values ​​after denormalization are prone to precipitous drops or overall numerical drift, failing to reconstruct the true stock price levels.

[0004] Therefore, there is an urgent need to provide a financial time series forecasting method that integrates frequency domain enhancement and morphological embedding to solve the problems of missing local semantic features, data enhancement disrupting long-term trends, and numerical drift of non-stationary data when existing models process financial stock K-line data. Summary of the Invention

[0005] The purpose of this invention is to provide a financial time series prediction method and system that integrates frequency domain enhancement and morphological embedding. It extracts deep features of K-lines through CNN morphological embedding, uses FreRA frequency domain enhancement to preserve low-frequency trends of data and applies perturbations to high-frequency parts to improve model robustness, and combines an adaptive inverse normalization strategy to achieve high-precision and absolutely accurate prediction of stock prices.

[0006] To solve the above-mentioned technical problems, the technical solution provided by the present invention is as follows: A financial time series forecasting method combining frequency domain enhancement and morphological embedding includes the following steps: S1. Obtain multi-dimensional K-line data of daily opening price, highest price, lowest price, closing price, and trading volume in the stock market, and perform moving average smoothing on the raw data; S2. The preprocessed sequence is rearranged in dimensions to adapt to the convolution operation. Local morphological features of K-line combination are extracted through multiple one-dimensional convolutional neural layers and projected into high-dimensional feature vectors. S3. In the model training phase, perform frequency domain refinement enhancement, separate the data into low-frequency trend and high-frequency noise components through frequency domain transformation, and restore the enhanced training samples by perturbing only the high-frequency components and then performing inverse frequency domain transformation. S4. Input the features into the iTransformer encoder and extract time-related features through a multi-head attention mechanism and a forward feedback neural network; S5. Perform adaptive inverse normalization at the decoding end, lock the global mean and standard deviation of the original sequence before normalization, and perform manual inverse transformation on the prediction results to restore the true values.

[0007] Furthermore, the moving average smoothing is performed using a 20-day moving average smoothing.

[0008] Furthermore, in step S2, feature extraction and vector generation include the following steps: Step S21: Rearrange the dimensions of the input sequence from Batch, Seq_Len, Variates to Batch, Variates, Seq_Len; Step S22: Use multi-layer one-dimensional convolutional neural layers to extract active window features from the time series of each variable; Step S23: The convolution output is processed by an activation function, projected into a high-dimensional feature vector, and input into the iTransformer encoder.

[0009] Furthermore, in step S3, the frequency domain refinement enhancement includes the following steps: Step S31: Convert the time series data to the frequency domain using a fast Fourier transform; Step S32: Based on the set threshold, distinguish the low-frequency trend component and the high-frequency noise component from the frequency domain data; Step S33: Keep the low-frequency trend component unchanged, and randomly perturb the amplitude and phase of the high-frequency noise component; Step S34: Convert the processed frequency domain data into time domain data through inverse fast Fourier transform to obtain enhanced training samples.

[0010] Furthermore, in step S5, the adaptive inverse normalization includes the following steps: Step S51: Before data normalization, record the global mean and global standard deviation of the original sequence; Step S52: Adapt to morphological prediction mode and automatically identify the column index of the prediction target; Step S53: Perform a manual inverse transformation on the model prediction results according to the following formula: ; in, These are forecasts of real financial time series data. Output predicted values ​​for the model. The global standard deviation of the original sequence. This is the global mean of the original sequence.

[0011] A financial time series forecasting system integrating frequency domain enhancement and morphological embedding includes a data preprocessing module, a morphological embedding module, a frequency domain refinement enhancement module, a time-series dependency modeling module, and an adaptive inverse normalization module. The data preprocessing module acquires multi-dimensional K-line data and performs moving average smoothing. The morphological embedding module adjusts the dimensions of the sequence and extracts convolutional features to generate high-dimensional feature vectors. The frequency domain refinement enhancement module performs frequency domain transformation, component differentiation, high-frequency perturbation, and time domain restoration during the training phase. The time-series dependency modeling module extracts time-series related features using an iTransformer encoder. The adaptive inverse normalization module records the original sequence statistics and performs manual inverse transformation.

[0012] The technical effects of this invention are as follows: This invention extracts deep features from K-lines through morphological embedding, enhances and preserves low-frequency trends in the data through frequency domain refinement while reasonably perturbing high-frequency components, and corrects prediction numerical deviations through adaptive inverse normalization. Combined with iTransformer to complete time-series dependency modeling, it achieves high-precision stock price prediction, reducing the average absolute error to 23.62 and the relative error rate to less than 0.67%, reaching the industry's S-level standard. It eliminates the numerical cliff effect at the end of the predicted sequence in traditional models, ensuring a perfect connection between the predicted curve and the actual curve. It maintains lag-free trend following capability in scenarios of sharp market fluctuations such as crashes or surges, accurately capturing market turning points. Simultaneously, it maintains stable output under market noise interference, significantly improving the overall robustness of the algorithm. Attached Figure Description

[0013] The accompanying drawings, which form part of this application, are used to provide a further understanding of the application and to make other features, objects, and advantages of the application more apparent. The illustrative embodiments and descriptions of this application are used to explain the application and do not constitute an undue limitation of the application.

[0014] In the attached diagram: Figure 1 This is a flowchart of a financial time series prediction method using frequency domain enhancement and morphological embedding, as described in Example 1.

[0015] Figure 2 This is a flowchart of the morphological embedding step in Example 1.

[0016] Figure 3 This is a flowchart of the frequency domain refinement enhancement steps in Example 1.

[0017] Figure 4 This is a flowchart of the adaptive denormalization step in Example 1.

[0018] Figure 5 This is a comparison chart of the K-line prediction and the actual results in Example 1. Detailed Implementation

[0019] The following detailed description of the embodiments is intended to exemplify the principles of this application, but should not be used to limit the scope of this application. That is, the financial time series prediction method and system of frequency domain enhancement and morphological embedding of this application are not limited to the described embodiments.

[0020] The present invention will be further described below with reference to embodiments.

[0021] Example 1 The data used in this embodiment are core Chinese A-share indices, including the CSI 300 and SSE 50, spanning from January 2005 to January 2024, covering nearly two decades of bull and bear cycles. The feature dimensions are daily opening price, highest price, lowest price, closing price, and trading volume. This embodiment selects the CSI 300 index for experimental verification, using the time series partitioning method to select the last 20% of the data, i.e., 923 trading days, as the test set. The feasibility of the scheme is verified by calculating the mean squared error and the mean absolute error and plotting the curve comparing the actual value and the predicted value.

[0022] like Figure 1As shown, S1: Obtain multi-dimensional K-line data of the stock market's daily opening price, highest price, lowest price, closing price, and trading volume. Perform moving average smoothing on the original data, specifically a 20-day moving average smoothing. In this embodiment, daily data of the CSI 300 Index from January 2005 to December 2024 is selected. The original multi-dimensional K-line data of the index's opening price, highest price, lowest price, closing price, and trading volume are smoothed using a 20-day moving average to filter out extreme intraday random fluctuations in the original data and retain the core long-term trend components of the market.

[0023] like Figure 2 As shown in S2, the preprocessed sequence is rearranged in dimensions to adapt to the convolution operation. Multiple one-dimensional convolutional neural layers are used to extract local morphological features of the K-line combination and project them into a high-dimensional feature vector. In this embodiment, the input sequence dimensions are rearranged from Batch, Seq_Len, Variations to Batch, Variations, Seq_Len. Multiple one-dimensional convolutional neural layers are used to extract active window features from the time series of each variable: opening price, highest price, lowest price, closing price, and trading volume. The convolution output is processed by an activation function and projected into a high-dimensional feature vector. This feature vector is directly input into the iTransformer encoder. This embodiment enables morphological embedding to fully extract the local morphological features of the K-line combination.

[0024] like Figure 3 As shown in Figure S3, frequency domain refinement enhancement is performed during the model training phase. The data is separated into low-frequency trend components and high-frequency noise components through frequency domain transformation. Only the high-frequency components are perturbed, and then restored to enhanced training samples through inverse frequency domain transformation. In this embodiment, the preprocessed time series data is converted to the frequency domain through fast Fourier transform. Low-frequency trend components and high-frequency noise components are distinguished according to a set threshold. The low-frequency trend components are kept unchanged, and the amplitude and phase of the high-frequency noise components are randomly perturbed. The frequency domain enhancement rate is set to 0.1. The processed frequency domain data is converted to time domain data through inverse fast Fourier transform to obtain enhanced training samples that retain the long-term trend.

[0025] like Figure 4As shown, in step S4, the features are input into the iTransformer encoder, and time-related features are extracted through a multi-head attention mechanism and a feedback neural network. In this embodiment, the high-dimensional feature vector after morphological embedding is input into the iTransformer encoder, with the sequence length set to 96, the prediction length to 1, the batch size to 16, and the learning rate to 0.0001. SSE50_volume is used as the target anchor point to lock the data column order. During model training, the loss value quickly converges from the initial 0.5 to around 0.005, and the extraction of multivariate time-related features is completed by relying on the multi-head attention mechanism and the feedback neural network.

[0026] S5. Adaptive inverse normalization is performed at the decoding end to lock the global mean and standard deviation of the original sequence before normalization. A manual inverse transformation is then performed on the prediction result to restore the true value. In this embodiment, the global mean and global standard deviation of the original sequence are recorded before data normalization. This adapts to the morphological prediction mode and automatically identifies the column index of the prediction target, according to... The formula performs a manual inverse transformation on the model prediction results, where These are forecasts of real financial time series data. Output predicted values ​​for the model. The global standard deviation of the original sequence. This is the global mean of the original sequence, and this method is used throughout the testing phase to restore the true stock price value.

[0027] like Figure 5 As shown, this embodiment measured a mean square error of 987.07 on the CSI 300 index, an average absolute error of 23.62, and a relative error of less than 0.7%. The orange prediction curve almost overlaps with the blue actual K-line trend, and the prediction curve perfectly matches the actual trend. The Y-axis accurately presents the actual price range of 3700 to 4100. In the market decline from step 60 to step 90, the model can provide accurate decline predictions without lag, gaps, or numerical drift issues, fully demonstrating the effectiveness of this solution.

[0028] It should be noted that the combination of the technical features in this case is not limited to the combination methods described in the claims of this case or the combination methods described in the specific embodiments. All technical features described in this case can be freely combined or combined in any way, unless they contradict each other.

[0029] It should also be noted that the embodiments listed above are merely specific embodiments of the present invention. Obviously, the present invention is not limited to the above embodiments, and similar changes or modifications made thereto are those that can be directly derived or easily conceived by those skilled in the art from the content disclosed in the present invention, and should all fall within the protection scope of the present invention.

Claims

1. A financial time series forecasting method combining frequency domain enhancement and morphological embedding, characterized in that, Includes the following steps: S1. Obtain multi-dimensional K-line data of daily opening price, highest price, lowest price, closing price, and trading volume in the stock market, and perform moving average smoothing on the raw data; S2. The preprocessed sequence is rearranged in dimensions to adapt to the convolution operation. Local morphological features of K-line combination are extracted through multiple one-dimensional convolutional neural layers and projected into high-dimensional feature vectors. S3. In the model training phase, perform frequency domain refinement enhancement, separate the data into low-frequency trend and high-frequency noise components through frequency domain transformation, and restore the enhanced training samples by perturbing only the high-frequency components and then performing inverse frequency domain transformation. S4. Input the features into the iTransformer encoder and extract time-related features through a multi-head attention mechanism and a forward feedback neural network; S5. Perform adaptive inverse normalization at the decoding end, lock the global mean and standard deviation of the original sequence before normalization, and perform manual inverse transformation on the prediction results to restore the true values.

2. The financial time series prediction method based on frequency domain enhancement and morphological embedding according to claim 1, characterized in that: The moving average smoothing process is a 20-day moving average smoothing process.

3. The financial time series prediction method based on frequency domain enhancement and morphological embedding according to claim 2, characterized in that: In step S2, feature extraction and vector generation include the following steps: Step S21: Rearrange the dimensions of the input sequence from Batch, Seq_Len, Variates to Batch, Variates, Seq_Len; Step S22: Use multi-layer one-dimensional convolutional neural layers to extract active window features from the time series of each variable; Step S23: The convolution output is processed by an activation function, projected into a high-dimensional feature vector, and input into the iTransformer encoder.

4. The financial time series prediction method based on frequency domain enhancement and morphological embedding according to claim 3, characterized in that: In step S3, the frequency domain refinement enhancement includes the following steps: Step S31: Convert the time series data to the frequency domain using a fast Fourier transform; Step S32: Based on the set threshold, distinguish the low-frequency trend component and the high-frequency noise component from the frequency domain data; Step S33: Keep the low-frequency trend component unchanged, and randomly perturb the amplitude and phase of the high-frequency noise component; Step S34: Convert the processed frequency domain data into time domain data through inverse fast Fourier transform to obtain enhanced training samples.

5. The financial time series prediction method based on frequency domain enhancement and morphological embedding according to claim 4, characterized in that: In step S5, the adaptive inverse normalization includes the following steps: Step S51: Before data normalization, record the global mean and global standard deviation of the original sequence; Step S52: Adapt to morphological prediction mode and automatically identify the column index of the prediction target; Step S53: Perform a manual inverse transformation on the model prediction results according to the following formula: ; in, These are forecasts of real financial time series data. Output predicted values ​​for the model. The global standard deviation of the original sequence. This is the global mean of the original sequence.

6. A financial time series forecasting system integrating frequency domain enhancement and morphological embedding, characterized in that: The system includes a data preprocessing module, a morphological embedding module, a frequency domain refinement and enhancement module, a temporal dependency modeling module, and an adaptive inverse normalization module. The data preprocessing module acquires multi-dimensional candlestick data and performs moving average smoothing. The morphological embedding module adjusts the dimensions of the sequence and extracts convolutional features to generate high-dimensional feature vectors. The frequency domain refinement and enhancement module performs frequency domain transformation, component differentiation, high-frequency perturbation, and temporal domain restoration during the training phase. The temporal dependency modeling module extracts temporally relevant features using the iTransformer encoder. The adaptive inverse normalization module is used to record the original sequence statistics and perform manual inverse transformation.