A time series prediction method based on convex hull knowledge distillation
By using the convex hull-based knowledge distillation framework (KDConv) to quantize the model output using the convex hull centroid and direction vector, the problem that traditional methods cannot capture the periodicity and trend of time series is solved, achieving a high-efficiency improvement in the prediction accuracy of the student model, which is suitable for resource-constrained time series prediction tasks.
Patent Information
- Application Number
- CN202510641744.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2026-11-20
AI Technical Summary
Existing knowledge distillation methods cannot effectively capture the periodicity and trends of data in time series forecasting, resulting in student models being unable to fully learn the complex features of teacher models and making it difficult to improve prediction accuracy while maintaining model lightweightness.
We employ a convex hull-based knowledge distillation framework (KDConv) to quantify model output through the geometric structure of the convex hull. We use the centroid and direction vector of the convex hull to measure the similarity between teacher and student models. By combining soft loss, hard loss, centroid distance loss, and direction vector loss, we achieve refined knowledge transfer.
It significantly improves the prediction accuracy of the student model. Experimental results show that the MSE is improved by an average of 2.48% and the MAE is improved by an average of 1.27% on multiple datasets, while maintaining the lightweight characteristics of the model, making it suitable for resource-constrained scenarios.
Smart Images

Figure CN123140145A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of time series analysis and machine learning technology, specifically relating to a time series prediction method based on convex hull knowledge distillation (KDConv). This method introduces convex hull geometry to quantify the structured knowledge output by the model, significantly improving the accuracy and efficiency of lightweight student models in time series prediction tasks. Background Technology
[0002] Time series forecasting is of irreplaceable importance for business decision-making, economic analysis and even scientific research. As the complexity of models increases, those models with many parameters face deployment challenges in resource-constrained environments. To solve this problem, model compression technology [1] has emerged, aiming to reduce the computation and storage requirements of models while maintaining prediction accuracy. Among the many model compression methods, knowledge distillation (KD) technology stands out due to its unique knowledge transfer capability. This technology not only achieves model lightweighting by transferring the knowledge contained in complex models to lightweight models, but also significantly improves the deployment efficiency of models.
[0003] However, most existing knowledge distillation methods rely on Mean Squared Error (MSE) to measure the similarity between teacher and student models. While this method is simple and intuitive, it is significantly inadequate in capturing complex features such as periodicity and trends in time series data. Even when the periodicity and trends of the time series data differ significantly, the loss values calculated by MSE show similarities. This is because MSE primarily focuses on the numerical difference between predicted and actual values, neglecting the periodicity and trends in the time series data. In other words, because the MSE measurement method fails to fully utilize the inherent knowledge within the time series data, the student model cannot adequately learn from the teacher model.
[0004] This invention proposes an innovative knowledge distillation framework based on convex hull loss—KDConv (Knowledge Distillation based on Convex). This framework utilizes the geometric structure of the convex hull to capture important features in time series data, providing a more structured form of knowledge representation. The convex hull not only characterizes the overall shape and distribution of data but also reflects its periodicity and trend information to a certain extent, thus serving as a novel loss function to improve the knowledge distillation process.
[0005] The core idea of KDConv is to represent the structured knowledge output by the model through the geometry and orientation of the convex hull. Specifically, the framework measures the similarity between the teacher and student models by comparing their convex hull properties, such as centroid position and orientation vector. In this way, the geometric features of the convex hull provide a basis for quantifying the key feature differences between the teacher and student models, thereby effectively realizing knowledge transfer and sharing.
[0006] Compared to the traditional mean squared error (MSE) loss function, KDConv describes the overall shape and distribution of time series data through the centroid and direction vector of the convex hull, providing a richer and more comprehensive similarity evaluation method. KDConv can more deeply understand and convey the intrinsic structure of time series data, significantly improving the prediction accuracy of student models.
[0007] In the experimental section, this invention uses the iTransformer[3] and PatchTST[4] models, which currently perform well in the field of time series prediction, for training. Dlinear and Nlinear[5] are used as student models, respectively, as well as experiments on Transformer and iTransformer guiding LSTM models. The experimental results show that the convex hull-based knowledge distillation method can effectively improve the prediction accuracy of the student model. Experimental results on multiple datasets show that compared with existing knowledge distillation methods, KDConv improves the MSE index by an average of 2.48%, which fully verifies its effectiveness and superiority in time series prediction.
[0008] The main contributions of this invention include the following aspects.
[0009] (1) Enhanced Model Similarity Quantization Method: An innovative convex hull-based quantization method is proposed, which effectively overcomes the limitation of traditional knowledge distillation methods that rely solely on mean squared error (MSE). This method provides a new perspective for evaluating the similarity between models by capturing the features of time series more comprehensively.
[0010] (2) Refined Knowledge Distillation Framework: Based on the enhanced quantification of model similarity, a refined knowledge distillation framework was further developed. This framework incorporates the concept of convex hull, enabling more precise guidance of student models during the knowledge distillation process and achieving efficient knowledge transfer.
[0011] (3) Comprehensive experimental evaluation and performance improvement: Rigorous experimental evaluation on benchmark datasets in three different fields demonstrates the practicality and robustness of the proposed method. Experimental results show that the proposed method achieves a significant improvement in prediction accuracy, specifically an average improvement of 2.48% in mean squared error (MSE) and an average improvement of 1.27% in mean absolute error (MAE). Summary of the Invention
[0012] To address the problems existing in the prior art, this invention provides a time series prediction method based on convex hull knowledge distillation. The technical problem to be solved by this invention is: how to overcome the limitations of traditional knowledge distillation methods in time series prediction, so that the student model can better learn the time series geometric features (such as periodicity, trend, etc.) captured by the teacher model, thereby improving prediction accuracy while maintaining the lightweight nature of the model.
[0013] The present invention adopts the following technical solution:
[0014] A time series prediction method based on convex hull knowledge distillation includes the following steps:
[0015] S1. Construct a teacher-student model framework; in the knowledge distillation framework, the teacher model is typically a complex and high-performance model (such as Transformer, iTransformer, or PatchTST), while the student model is a lightweight model (such as DLinear, Linear, or LSTM). The teacher model, with its rich parameters and powerful feature extraction capabilities, can capture complex patterns and long-term dependencies in time-series data. The student model, by mimicking the behavior of the teacher model, learns its prediction distribution and structured knowledge, thereby improving prediction performance while maintaining low computational cost.
[0016] In practice, the teacher and student models are trained in parallel by sharing input data. The output of the teacher model (including predicted values and hidden layer representations) serves as a "soft objective" to guide the training process of the student model. This framework not only conveys numerical knowledge but also transmits higher-level semantic information through structured features (such as the geometric properties of the convex hull), thereby significantly improving the generalization ability of the student model.
[0017] S2. Time Series Data Processing; Time series data processing is fundamental to model training. First, the raw data is standardized or normalized to eliminate dimensional differences between different features. Then, the data is divided into training, validation, and test sets to ensure temporal continuity and avoid data leakage.
[0018] For multivariate time series, each time point can be represented as a point in a high-dimensional space, the dimension of which is determined by the number of features. To accommodate the input requirements of the model, the data is typically partitioned into fixed-length sliding windows, where historical windows are used as model input and future windows are used as prediction targets. Furthermore, for high-dimensional data, principal component analysis (PCA) can be used for dimensionality reduction to reduce computational complexity while preserving key features.
[0019] S3. Convex Hull Feature Extraction
[0020] A convex hull is the smallest convex enclosing structure of time series data points in the feature space, effectively representing the overall shape and distribution trend of the data. In the KDConv method, convex hull feature extraction includes the following steps: Data point mapping: Mapping the outputs of the teacher and student models to a set of points in a high-dimensional space. Convex hull calculation: Calculating the vertices of the convex hull of the point set using a fast convex hull algorithm (such as the Graham scan method). Centroid and direction vector extraction: Centroid: Representing the central position of the data, reflecting the centroid of the overall distribution. Direction vector: A vector pointing from the centroid to the vertices of the convex hull, describing the trend and shape changes of the data. Through convex hull features, the periodicity and trend of time series data can be transformed into geometric attributes, providing a structured representation for knowledge distillation.
[0021] S4. Knowledge Distillation Loss Calculation
[0022] KDConv's loss function consists of four parts, which comprehensively optimize the predictive performance of the student model:
[0023] 1. Soft Loss: Measures the difference between the predictions of the student model and the teacher model, ensuring that the student model learns the output distribution of the teacher model.
[0024] 2. Hard Loss: Directly optimizes the student model's ability to fit the true labels.
[0025] 3. Centroid Distance Loss (CD Loss): Calculates the Euclidean distance between the centroids of the convex hulls of the teacher and student models, constraining the overall distribution consistency of the two in the feature space.
[0026] 4. Direction Vector Loss (AD Loss): This method uses cosine similarity to measure the consistency of direction vectors and captures the similarity of data trends.
[0027] S5. Model Optimization
[0028] Model optimization employs the Adam optimizer combined with dynamic learning rate adjustment strategies (such as cosine annealing) to accelerate convergence and avoid local optima. During training, performance is further improved through the following strategies: gradient pruning to prevent gradient explosion and ensure training stability; early stopping to terminate training based on validation set performance to avoid overfitting; and loss weight tuning to optimize knowledge distillation by adjusting α, β, γ, and δ through grid search or validation set performance. Experiments show that the KDConv method significantly reduces training loss and reaches a stable state within fewer training epochs. Furthermore, its lightweight design achieves a good balance between prediction accuracy and computational efficiency in the student model.
[0029] Example configuration: Hardware environment: GPU: NVIDIA Tesla V100 32GB, Memory: 256GB DDR4
[0030] Software environment: Python 3.10, PyTorch 1.12.1, CUDA 11.6
[0031] Further, step S1 includes the following steps:
[0032] S11. Select the teacher model: Use iTransformer or PatchTST as the teacher model.
[0033] S12. Select Student Model: Use DLinear, Linear, or LSTM as a lightweight student model.
[0034] S13. Initialize model parameters: The teacher model uses pre-trained weights, and the student model is initialized randomly.
[0035] Furthermore, step S2 includes the following steps:
[0036] S21. Data Preprocessing:
[0037] After standardizing the input time series X∈R^(L×M), it is divided into training set / validation set / test set (8:1:1 ratio), and a time window is constructed: historical length T, prediction length P.
[0038] S22. Data Augmentation (Optional):
[0039] Add Gaussian noise Time warping is used to enhance temporal robustness.
[0040] Furthermore, step S3 includes the following steps:
[0041] S31. Model Output Mapping: Teacher Model Output Student model output
[0042] S32. Dimensionality Reduction: Use PCA to reduce the output from P×M dimensions to 2 dimensions; retain more than 95% of the variance information.
[0043] S33. Convex Hull Calculation; Calculate the convex hull vertex V of a 2D point set using the Quickhull algorithm; Calculate the centroid C of the convex hull:
[0044]
[0045] S34. Direction Vector Extraction; Calculate the direction vector of each vertex relative to the centroid:
[0046]
[0047] Furthermore, step S4 includes the following steps:
[0048] S41. Traditional loss term: Soft loss: Hard loss:
[0049] S42. Convex Hull Geometric Loss: Centroid Distance Loss: Calculates the Euclidean distance between the centroids of the convex hulls formed by the predicted sequences of the teacher and student models.
[0050]
[0051] Directional similarity loss:
[0052]
[0053] S43. Weight Setting; Initial Weights:
[0054] Furthermore, step S5 includes the following steps:
[0055] S51. Comprehensive Loss Function:
[0056]
[0057] S52. Backpropagation; using the Adam optimizer, learning rate lr=3e-4, batch size 32, and early stopping mechanism (patience=5).
[0058] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0059] This invention presents a time series prediction method based on convex hull knowledge distillation. Through steps S1 to S5, it effectively captures the geometric structural features of time series, significantly improving the prediction accuracy of lightweight models. Compared with traditional knowledge distillation methods, this invention quantifies the structured knowledge output by the model through the convex hull centroid and direction vector, solving the problem that traditional MSE loss cannot characterize the periodicity and trend features of time series. Experiments show that this method reduces the predicted MSE by an average of 2.48% and MAE by 1.27% on datasets such as ETT and Weather, while maintaining the lightweight nature of the model.
[0060] Preferably, this invention achieves effective transfer of time-series knowledge by combining convex hull geometric feature extraction with multi-objective loss optimization. By introducing centroid distance loss and orientation similarity loss, the model can better learn the temporal pattern features captured by the teacher model, exhibiting stronger robustness in noisy environments (noise sensitivity coefficient reduced by 38.3%). Furthermore, by employing PCA dimensionality reduction and a fast convex hull algorithm, the computational complexity is controlled at the O(nlogn) level, increasing time overhead by only 8.7%. In practical applications such as power load forecasting and weather forecasting, this method can enable a lightweight student model to achieve over 95% of the accuracy of the teacher model, while reducing the number of parameters by over 90%, providing an efficient solution for time-series forecasting in resource-constrained scenarios. Attached Figure Description
[0061] Since the text-based patent specification cannot directly include drawings, only a brief description of the drawings is provided here:
[0062] Figure 1 This is a flowchart of the present invention, "A Time Series Prediction Method Based on Convex Hull Knowledge Distillation".
[0063] Figure 2 This is an illustrative diagram illustrating the limitations of the present invention in using MSE as a guide for the training process in traditional knowledge distillation methods;
[0064] Figure 3 This is a sensitivity analysis diagram of the convex hull model introduced in this invention in capturing the features of time series data;
[0065] Figure 4 This is a schematic diagram of the convex hull construction and the enhanced knowledge distillation method based on the convex hull structure of the present invention; Detailed Implementation
[0066] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with embodiments and accompanying drawings, so as to fully understand the purpose, solution, and effects of the present invention. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The same reference numerals used throughout the accompanying drawings indicate the same or similar parts.
[0067] Reference Figure 1 , Figure 2 , Figure 3 and Figure 4 A time series prediction method based on convex hull knowledge distillation includes the following steps:
[0068] S1. Teacher Model Outputs Time Series Embeddings: A high-performance teacher model (such as iTransformer or PatchTST) is selected to model the input time series and output a multi-dimensional embedding sequence. This embedding sequence serves as an important knowledge foundation for representing dynamic patterns in the data.
[0069] S2. Based on the embedding sequence output by the teacher model generated in step S1, construct the convex hull features of the teacher model using the convex hull construction method.
[0070] The process includes: calculating the convex hull boundary of all embedding points; calculating the centroid of the convex hull to measure the global structure; and extracting the direction vector set from the centroid to each vertex to reflect the trend characteristics of the data.
[0071] S3: Based on step S2, construct the student model embedding and extract geometric features.
[0072] Repeat step S2 on the embedded sequence output by the student model to obtain its corresponding set of convex hull centroids and direction vectors.
[0073] S4: Define the structured distillation loss function based on the teacher and student model outputs calculated in step S3.
[0074] Combining the traditional soft target loss (L_soft) and hard label loss (L_hard), the following geometric structure loss term is introduced:
[0075] • Centroid Distance Loss (L_CD): Measures the Euclidean distance between the embedding centroids of the student and teacher models.
[0076] • Direction Vector Angle Loss L_AD: Uses cosine similarity to measure the angular difference between the direction vectors of the two models.
[0077] The final loss function is:
[0078] Here, α, β, γ, and δ are hyperparameters of the loss for each part, and their specific values can be optimized using a validation set according to the nature of the task.
[0079] S5: Multi-round training and optimization
[0080] The total loss is used for backpropagation to iteratively optimize the student model parameters until convergence on the validation set. Experiments show that the student model using the KDConv method can improve prediction accuracy while maintaining model lightweightness, making it particularly suitable for deployment scenarios on resource-constrained devices.
[0081] In one embodiment, step S1 includes the following sub-steps:
[0082] S11: Constructing the Teacher Model Structure
[0083] First, a high-performance model suitable for multivariate time series prediction tasks is selected as the teacher model. This invention preferably uses Transformer-type architectures with strong structural expressive power and long-term dependency capture capabilities, such as iTransformer and PatchTST. These models can fully extract the association patterns between multiple scales and multiple variables in time series data.
[0084] S12: Input the time series and encode it into an embedded sequence.
[0085] Input the time series data into the teacher model, let the input be... Where L is the sequence length and M is the number of variables. The teacher model encodes this as a sequence of feature embeddings of dimension d. ,in This serves as the structural output of the teacher model.
[0086] S13: Teacher Embedded Sequence Cache
[0087] The embedding sequence is temporarily stored for use in subsequent convex hull structure calculations.
[0088] Furthermore, step S2 includes the following sub-steps:
[0089] S21: Map the embedded point set to a point set in Euclidean space.
[0090] The embedding sequence T can be viewed as a set of points in a high-dimensional space. Since the Transformer model outputs a high-dimensional embedding vector, which has spatial meaning, it is suitable as the basis for geometric structure analysis.
[0091] S22: Construct the convex hull structure of the embedded point set
[0092] The point set T is processed using a convex hull construction algorithm (such as QuickHull) to obtain the convex hull boundary Conv(T). This convex hull is the minimal convex polyhedron containing all embedded points and can describe the overall shape and boundary contour of the point set.
[0093] S23: Calculate the centroid of the convex hull
[0094] The centroid of the convex hull is calculated by finding the geometric centers of all vertices of the convex hull. The centroid is the average distribution center of all embedding points, reflecting the model's ability to capture the global trend of time series data.
[0095] S24: Calculate the set of direction vectors from the centroid to the vertex.
[0096] The vector from the centroid to each vertex of the convex hull is used as the set of direction vectors. This set reflects the main directions and temporal trend characteristics that the model focuses on. It is used in subsequent distillations to evaluate the student model's ability to understand "trend information".
[0097] Furthermore, step S3 includes the following sub-steps:
[0098] S31: Select Student Model Structure
[0099] The student model in this invention can use models with relatively light structures such as DLinear, NLinear, and LSTM, which have certain modeling capabilities. They have advantages such as small number of parameters and fast inference speed, and are suitable for resource-constrained scenarios.
[0100] S32: Input the same time series and obtain the student embedding representation.
[0101] Encode the same input sequence X as the teacher model to generate the student model embedding sequence.
[0102] S33: Construct the convex hull structure Conv(S) of the student embedding points.
[0103] The same convex hull construction method is used to construct the embedding point S. This forms the geometric structural representation of the student model.
[0104] S34: Calculate the set of centroid and direction vectors of the convex hull of the student model.
[0105] Calculate the centroid of the convex hull of the student model respectively. and the set of direction vectors originating from the centroid and pointing to the vertex. As an important indicator for subsequent orientation alignment and centroid matching.
[0106] Furthermore, step S4 includes the following sub-steps:
[0107] S41: Soft Target Loss
[0108] The mean squared error between the teacher model's predicted values and the student model's output is calculated to reflect the overall behavioral differences between the models.
[0109] S42: Hard Label Loss
[0110] Calculate the error (such as MSE or MAE) between the student model output and the true label to ensure the student model's basic ability in task accuracy.
[0111] S43: Centroid Loss
[0112] The Euclidean distance between the centroids of the convex hulls of the teacher and student model output point sets is compared to measure the degree of matching of the structure centers. The formula is:
[0113]
[0114] S44: Loss due to the angle between direction vectors
[0115] Calculate the average angle difference between the two sets of direction vectors to assess whether the trend directions are consistent. The formula is:
[0116]
[0117] S45: Combination into the total loss function
[0118] The above losses are combined using weights to form the final distillation loss function:
[0119]
[0120] Among them, α, β, γ, and δ are hyperparameters that are adjusted according to the actual dataset to achieve a balance between task adaptability and convergence stability.
[0121] Furthermore, step S5 includes the following sub-steps:
[0122] S51: Initialize model parameters
[0123] Set the initial parameters and training hyperparameters for the model, including learning rate, batch size, and optimizer type. Input the training data into the teacher model and student model sequentially to obtain the predicted output and structural representation, respectively.
[0124] S53: Calculate the loss function
[0125] Using the loss functions defined in step S4, the current state of the student model is comprehensively evaluated. Backpropagation is performed based on the total loss function to optimize the student model parameters, gradually converging to the optimum. The training process is iterated multiple times, monitoring the validation set error, until the stopping condition is met, completing the model training.
[0126] Currently, time series forecasting models are widely used in various practical scenarios, including power load forecasting, traffic flow forecasting, and financial data analysis. Mainstream methods can be broadly categorized into two types: traditional statistical models (such as ARIMA and SARIMA): These methods have simple structures and are suitable for short-term linear trend modeling, but they struggle to handle complex time series data with multiple variables, large scale, high dimensionality, and long-term dependencies. Deep learning models (such as LSTM, GRU, and Transformer architectures): These have made significant progress in time series modeling in recent years, especially the Transformer architecture, which has become a mainstream choice due to its excellent long-term dependency modeling capabilities thanks to its self-attention mechanism. However, these models typically have high computational complexity, a large number of parameters, and high training costs, making them difficult to deploy on edge devices and in resource-constrained scenarios. To reduce deployment difficulty and inference costs, researchers have introduced knowledge distillation (KD) methods, attempting to transfer knowledge from high-performance teacher models to lightweight student models. Most current mainstream knowledge distillation methods rely on point-to-point prediction errors (such as mean squared error (MSE) or cross-entropy) as a knowledge alignment method between teacher and student models. However, these loss functions have significant shortcomings: they only measure the differences between predicted values and cannot reflect the model's learning performance at the structural level (such as trend patterns and distribution structures); they lack the ability to model high-dimensional information such as temporal trends, distribution patterns, and periodic characteristics in time series; for medium- to long-term prediction tasks in complex scenarios, traditional point loss distillation methods are insufficient to guide student models in learning the overall expressive capabilities of teacher models; and they do not fully utilize the spatial geometric features output by the teacher model as knowledge carriers. Therefore, current knowledge distillation mechanisms suffer from significant accuracy bottlenecks and insufficient structural expression when processing complex time series data, making it difficult to fully unleash the potential knowledge capabilities of teacher models.
[0127] The invention brings about the following technical effects:
[0128] (1) This invention extracts temporal distribution information in high-dimensional space through convex hull structure and explicitly models temporal structure information, which more comprehensively describes the pattern and trend of teacher model output than the traditional point error method; enhances the effectiveness of knowledge transfer: centroid loss ensures that student model learns the global trend, and direction vector loss strengthens the perception of temporal directionality and change trend, so that student model not only imitates the result, but also imitates the structure;
[0129] (2) This invention captures long-term dependencies through convex hull structure, significantly improving prediction accuracy and adapting to complex time series prediction tasks: especially in time series with strong periodicity and trends, it combines structured distillation with low-complexity student model design to achieve a balance between accuracy and deployment cost, and is suitable for scenarios with limited computing power such as mobile devices and edge devices.
[0130] (3) The convex hull knowledge representation method proposed in this invention can be combined with various types of deep networks and is applicable to mainstream model systems such as Transformer and LSTM, possessing broad adaptability. Rigorous experimental evaluation on benchmark datasets in three different fields demonstrates the practicality and robustness of the proposed method. Experimental results show that the proposed method achieves a significant improvement in prediction accuracy, specifically an average improvement of 2.48% in mean squared error (MSE) and an average improvement of 1.27% in mean absolute error (MAE).
[0131] Example 1: Power Load Forecasting (ETTh2 Dataset)
[0132] 1. Data preparation: Use the ETTh2 dataset (electric transformer temperature data, 7 features, 1-hour interval), and divide it into training, validation and test sets in an 8:1:1 ratio;
[0133] 2. Model Configuration:
[0134] - Teacher model: iTransformer (17.8M parameters)
[0135] - Student model: DLinear (0.07M parameters)
[0136] - Hyperparameter settings: α=0.6, β=0.4, γ=0.05, δ=0.1, batch size 32;
[0137] 3. Training process:
[0138] - Step 1: Train the teacher model and the student model separately;
[0139] - Step 2: Perform PCA dimensionality reduction on the prediction results (reduce to 2 dimensions);
[0140] - Step 3: Calculate the vertices and geometric features of the convex hull;
[0141] - Step 4: Calculate the overall loss and backpropagate;
[0142] - Step 5: Repeat the above steps until convergence;
[0143] 4. Test results: The MSE of the method of this invention is 0.280, which is 1.4% higher than the traditional KD method (0.284), and the inference speed is 3.2 times that of the teacher model.
[0144] Example 2: Weather Forecast (Weather Dataset)
[0145] 1. Data preparation: Use the Weather dataset (21 meteorological features, 10-minute intervals);
[0146] 2. Noise test: After adding Gaussian noise with σ=0.45, the DTW index of the present invention increased by only 0.58%, which is significantly better than the traditional KD method (0.94%).
[0147] 3. Efficiency Comparison: The student model reduces the number of parameters by 92% while maintaining 95% of the accuracy of the teacher model.
[0148] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Therefore, any modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. A time series prediction method based on convex hull knowledge distillation, characterized in that, Includes the following steps: S1. Construct a teacher-student model framework: Select a high-performance time series prediction model as the teacher model and a lightweight prediction model as the student model to establish a knowledge transfer channel; the student model learns the prediction distribution and structured knowledge by imitating the behavior of the teacher model, thereby improving prediction performance while maintaining low computational cost. 2.S2. Time Series Data Preprocessing: The original time series data is standardized, training samples are generated using the sliding window technique, and feature dimensionality reduction is performed. First, the original data is standardized or normalized to eliminate dimensional differences between different features. Then, the data is divided into training, validation, and test sets to ensure temporal continuity and avoid data leakage. 3.S3. Convex Hull Feature Extraction: The convex hull is the smallest convex enclosing structure of time series data points in the feature space, effectively representing the overall shape and distribution trend of the data. In the KDConv method, convex hull feature extraction includes the following steps: Data point mapping: Mapping the outputs of the teacher and student models to a set of points in a high-dimensional space. Convex hull calculation: Calculating the vertices of the convex hull of the point set using a fast convex hull algorithm (such as Graham's scan). Centroid and direction vector extraction: Centroid: Represents the central location of the data, reflecting the centroid of the overall distribution. Direction vector: A vector pointing from the centroid to the convex hull vertex, describing the trend and shape changes of the data. Through convex hull features, the periodicity and trend of time series can be transformed into geometric attributes, providing a structured representation for knowledge distillation. 4.S4. Multi-objective knowledge distillation: Construct a comprehensive loss function that includes soft target loss, hard target loss, centroid distance loss, and orientation vector loss; Soft Loss: Measures the difference between the predicted values of the student model and the teacher model, ensuring that the student model learns the output distribution of the teacher model; Hard Loss: Directly optimizes the student model's ability to fit the true labels; Centroid Distance Loss (CD Loss): Calculates the Euclidean distance between the centroids of the convex hulls of the teacher model and the student model, constraining the overall distribution consistency of the two in the feature space; Orientation Vector Loss (AD Loss): Measures the consistency of orientation vectors through cosine similarity, capturing the similarity of data trends.
5. Model Optimization and Deployment; Model optimization employs the Adam optimizer combined with dynamic learning rate adjustment strategies (such as cosine annealing) to accelerate convergence and avoid local optima. During training, performance is further improved through the following strategies: Gradient pruning: preventing gradient explosion and ensuring training stability; Early stopping mechanism: terminating training based on validation set performance to avoid overfitting; Loss weight tuning: adjusting α, β, γ, and δ through grid search or validation set performance to optimize knowledge distillation. Experiments show that the KDConv method can significantly reduce training loss and reach a stable state within fewer training epochs. Furthermore, its lightweight design allows the student model to achieve a good balance between prediction accuracy and computational efficiency.
6. The method according to claim 1, characterized in that, Step S1 includes the following sub-steps: S11. Selecting the Teacher Model: This step aims to transform the embedded representation output by the teacher model into a structured convex hull structure using geometric methods, thereby guiding the student model to learn spatial distribution and trend direction. iTransformer or PatchTST is used as the teacher model. S12. Selecting the Student Model: In this step, the student model will model the same input data and generate its own temporal embedding representation with a low-complexity structure. Knowledge transfer is achieved by comparing the geometric structure embedded in the student model with that of the teacher model. In this invention, the student model uses lightweight models such as DLinear, NLinear, and LSTM, which have certain modeling capabilities, advantages such as small parameter count and fast inference speed, and are suitable for resource-constrained scenarios. 7.S13. Initialize model parameters: The teacher model uses pre-trained weights, and the student model is initialized randomly.
8. The method according to claim 1, characterized in that, Step S2 includes the following sub-steps: S21. Data Preprocessing: For the input time series After standardization, the dataset is divided into training, validation, and test sets (8:1:1 ratio). A time window is constructed with a historical length T and a prediction length P. The multivariate time series is then standardized using Z-score. The time series is segmented into fixed-length input-output pairs using a sliding window technique; principal component analysis (PCA) is used to reduce high-dimensional features to 2 dimensions to reduce computational complexity. 9.S22. Data Augmentation (Optional): Add Gaussian noise Time warping is employed to enhance temporal robustness.
10. The method according to claim 1, characterized in that, Step S3 includes the following sub-steps: S31. Model Output Mapping: Training data is sequentially input into the teacher model and student model to obtain the predicted output and structural representation, respectively. Teacher Model Output Student model output ... 11.S32. Dimensionality Reduction: Use PCA to reduce the output from P×M dimensions to 2 dimensions; S33. Convex Hull Calculation; Calculate the convex hull vertex V of a 2D point set using the Quickhull algorithm; Calculate the centroid C of the convex hull: 12.S34. Direction Vector Extraction; Calculate the direction vector of each vertex relative to the centroid, and normalize the direction vectors:
13. The method according to claim 1, characterized in that, Step S4 includes the following sub-steps: S41. Traditional loss term: Soft loss: Hard loss: The mean squared error (MSE) between the teacher model's predicted values and the student model's output is calculated separately to reflect the overall behavioral differences between the models. The error (MSE, MAE) between the student model's output and the true label is also calculated to ensure the student model's basic ability in task accuracy. 14.S42. Convex Hull Geometric Loss: Centroid Distance Loss: Calculates the Euclidean distance between the centroids of the convex hulls formed by the predicted sequences of the teacher and student models, measuring the degree of matching of the structural centers.
15. Directional similarity loss: assesses whether the trend directions are consistent. 16.S43. Weight Setting; Initial Weights:
17. The method according to claim 1, characterized in that, Step S5 includes the following sub-steps: S51. Comprehensive Loss Function:
18. Among them, α, β, γ, and δ are hyperparameters that are adjusted according to the actual dataset to achieve a balance between task adaptability and convergence stability.
19. S52. Backpropagation; using the Adam optimizer, learning rate lr=1e-4, batch size 32, gradient clipping is implemented to prevent gradient explosion; an early stopping mechanism is set to prevent overfitting. The early stopping mechanism (patience=5) sequentially inputs training data into the teacher model and student model to obtain the predicted output and structural representation respectively. The various loss functions defined in step S4 are used to comprehensively evaluate the current state of the student model. Backpropagation is performed based on the total loss function to optimize the student model parameters, gradually converging to the optimum. Finally, the training process is iterated multiple times, monitoring the validation set error until the stopping condition is met, completing model training.
20. The method according to claim 1, characterized in that, Also includes: Noise robustness enhancement module: Adds Gaussian noise to the training data to improve the robustness of the model; Dynamic weight adjustment module: Automatically adjusts the weights of each loss term according to the training progress; Multi-scale feature extraction module: Extracts convex hull features at different time scales.
21. The method according to claim 1, characterized in that, The method is applicable to the following scenarios: power system load forecasting; financial market time series analysis; meteorological data modeling and forecasting; traffic flow forecasting; and industrial production process monitoring.
22. A time series prediction system based on convex hull knowledge distillation, characterized in that, include: The data preprocessing module is used for standardization and feature extraction of time series data; the teacher model module contains a pre-trained high-performance prediction model; the student model module contains a lightweight prediction model to be trained; and the convex hull feature calculation module is used to extract the convex hull features output by the teacher and student models. The knowledge distillation module enables knowledge transfer based on convex hull features. The model optimization module is responsible for updating the parameters and optimizing the performance of the student model. The performance evaluation module uses mean squared error (MSE) and mean absolute error (MAE) to assess prediction accuracy; and dynamic time warping (DTW) distance to assess the shape similarity of the predicted sequences.
23. The method according to claim 1, characterized in that, The convex hull feature calculation module includes: a vertex calculation unit, which uses the Graham scan method to determine the vertices of the convex hull; a centroid calculation unit, which solves for the centroid of the convex hull using an integral method; and a direction vector generation unit, which constructs direction vectors from the centroid to each vertex.
