A time series task prediction method and device based on unsupervised multi-model fusion
Through the unsupervised multi-model fusion method, the temporal characteristics and prediction results of sequential tasks are processed and optimized, prediction conflicts are eliminated, and time slice distribution weights are assigned, which solves the problem of insufficient consistency of model fusion in the existing technology and improves the efficiency of sequential tasks. Prediction accuracy and applicability.
Patent Information
- Application Number
- CN202210071568.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-21
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-01-21
AI Technical Summary
Existing time series task prediction methods require extremely high consistency in the functions and parameters of the source model and target model during model fusion, resulting in insufficient prediction accuracy when multiple source models are fused, and there is a lack of mature algorithms suitable for time series tasks. frame.
Using an unsupervised multi-model fusion method, by inputting time-series tasks into the optimized target model, the feature fusion module and classification loss function are used to process and optimize the temporal features and prediction results of the source model, eliminate prediction conflicts, and perform predictions based on time. The slice distribution is assigned weights to achieve unified fusion of source model results and optimization of the target model.
It improves the accuracy of time series task prediction, enhances the applicability and accuracy of the model, and can maintain efficient prediction performance when merging multiple source models.
Smart Images

Figure CN114418007B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data mining and machine learning, and in particular to a method and device for predicting time series tasks based on unsupervised multi-model fusion. Background Art
[0002] In real-world applications, a large number of machine learning models are designed only for specific tasks and lose their usefulness after completing the task. However, a well-designed and trained model usually highly condenses the "knowledge" contained in the training data. The goal of model reuse is to use existing pre-trained models to assist the learning of the target model, especially in situations where the amount of data and data annotation are insufficient. The main methods of model reuse include knowledge distillation and knowledge fusion.
[0003] Knowledge distillation improves the performance of lightweight target models by fitting the soft labels output by the source model. Subsequently, distillation methods based on intermediate layer constraints have developed rapidly. Attention transfer adds stronger layer-by-layer constraints to the knowledge distillation of the feature layer by aligning multiple sets of attention feature maps between the source model and the target model. Similarly, Aguilar et al. guided the training of simple models through the internal representation of the intermediate layers of large models, which is more effective than the learning method of soft labels. In addition to achieving model compression, knowledge distillation can also significantly speed up the training of the target model. At present, knowledge distillation is mostly applied to the case of a single source model and the same task domain. Even if multiple source models are involved, the task domains of the source model and the target model are required to be strictly aligned.
[0004] The research focus of knowledge fusion is on the many-to-one knowledge transfer between the source model and the target model, that is, fusing multiple source models of different tasks to obtain a target model that has the task capabilities of each source model. Shen et al. proposed a convolutional network knowledge fusion framework for fine-grained image classification, using convolutional autoencoders to fuse the feature maps of the corresponding layers of multiple source models to obtain a composite feature map of each layer, and then regressing layer by layer, and finally connecting all regression modules in series to obtain the target model. Subsequent studies also followed this idea. Ye et al. selected a branched hourglass network as the target model to achieve fusion between different image pixel-level tasks. However, this method requires that the source models are basically consistent in their hierarchical structures, and its applicability is insufficient. Luo et al. proposed a heterogeneous convolutional network fusion method based on common feature learning, which transforms the feature maps at the end of the source model and the target model into a common feature space to calculate the loss, and relaxes the structural constraints on the source model. The relevant research on knowledge fusion is not yet extensive. The current results are mainly focused on the convolutional network fusion in the image field, and there is a lack of mature algorithm framework for time series tasks.
[0005] Time series prediction is mainly used to predict the weather in a certain area or to predict the use of bearings in industrial production. Although the existing prediction methods for time series tasks involve model fusion, they only input data into multiple models and set an independent judgment standard for each. This method requires that the functions and parameters of all models have extremely high consistency, which is equivalent to multiple people voting on the same thing, and this requires everyone to have the same level, otherwise it will greatly affect the accuracy of the judgment. However, it is difficult for existing technologies to achieve model unification, and the prediction of time series tasks is not accurate. Summary of the invention
[0006] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and to provide a time series task prediction method and device based on unsupervised multi-model fusion.
[0007] The purpose of the present invention can be achieved by the following technical solutions:
[0008] A time series task prediction method based on unsupervised multi-model fusion includes the following steps:
[0009] Input the time series task into the optimized target model to obtain the prediction result. The optimization process of the optimized prediction model is as follows:
[0010] S1, initialize unlabeled dataset, multiple source models, source model tasks, target model, target task and feature fusion module;
[0011] S2, randomly sample some data from the unlabeled dataset, input them into all source models, and obtain several sets of time series features and prediction results;
[0012] S3, splicing the time series features of all source models corresponding to each set of data according to the time slice distribution, and inputting them into the feature fusion module to obtain the feature fusion loss;
[0013] S4, splicing the prediction results of all source models corresponding to each group of data, and eliminating prediction conflicts according to the spliced time series features to obtain the true prediction results, and calculating the classification loss according to the true prediction results;
[0014] S5. Input the data obtained in step S2 into the target model, and optimize the input target model according to the classification loss and feature fusion loss.
[0015] Furthermore, the method for eliminating prediction conflicts in step S4 is as follows:
[0016] A1. Obtain the splicing prediction results with the highest and second highest confidence levels;
[0017] A2. If the difference between the two is less than the set threshold, it is determined that there is a conflict, and step A3 is executed; if the difference between the two is greater than the set threshold, it is determined that there is no conflict, and step A4 is executed;
[0018] A3. Calculate the similarity between the splicing prediction results with the highest confidence and the second highest confidence according to the time series characteristics of the corresponding samples, and take the prediction result with the higher value as the true prediction result;
[0019] A4. Use the sliding average method to update the splicing prediction result with the highest confidence to obtain the true prediction result.
[0020] Furthermore, in step S5, the method for optimizing the input target model is the stochastic gradient descent method, and after executing step S5, the method returns to step S3 for loop optimization.
[0021] Furthermore, when the number of cyclic optimization rounds is lower than the set round number threshold, the prediction conflict is not eliminated, and the sliding average method is directly used to update the splicing prediction result with the highest confidence to calculate the classification loss.
[0022] Furthermore, if the source model tasks overlap or the source model tasks exceed the scope of the target tasks, the spliced prediction results are deduplicated and trimmed.
[0023] Furthermore, the weight of the time slice distribution in step S3 is set according to the source model and the source model task.
[0024] A time series task prediction device based on unsupervised multi-model fusion includes a memory and a processor; the memory is used to store a computer program; the processor is used to implement the following method when executing the computer program:
[0025] Input the time series task into the optimized target model to obtain the prediction result. The optimization process of the optimized prediction model is as follows:
[0026] S1, initialize unlabeled dataset, multiple source models, source model tasks, target model, target task and feature fusion module;
[0027] S2, randomly sample some data from the unlabeled dataset, input them into all source models, and obtain several sets of time series features and prediction results;
[0028] S3, splicing the time series features of all source models corresponding to each set of data according to the time slice distribution, and inputting them into the feature fusion module to obtain the feature fusion loss;
[0029] S4, splicing the prediction results of all source models corresponding to each group of data, and eliminating prediction conflicts according to the spliced time series features to obtain the true prediction results, and calculating the classification loss according to the true prediction results;
[0030] S5. Input the data obtained in step S2 into the target model, and optimize the input target model according to the classification loss and feature fusion loss.
[0031] Compared with the prior art, the present invention has the following advantages:
[0032] 1. The present invention processes the time characteristics and prediction results output by the source model respectively to calculate the feature fusion loss and classification loss, and optimizes the target model according to the above loss function; the present invention fuses the results of all source models. Different from the prior art in which the results of the source models are output one by one, the present invention outputs the results according to the basic characteristics of the time series features, and then inputs them into a target model for continuous optimization, taking into account the characteristics of all source models, so that the prediction accuracy of the target model finally obtained is higher.
[0033] 2. The present invention judges and eliminates prediction conflicts. At the same time, in the early stage of optimization, due to the randomness of samples, conflicts cannot be eliminated. Only result updates are performed without eliminating conflicts, which further improves the accuracy of model prediction.
[0034] 3. The present invention assigns weights to the time slice distribution, which can better conform to the actual source model characteristics and further improve the accuracy of model prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 Optimize the flow chart for the target model of the present invention.
[0036] Figure 2 It is a schematic diagram of the overall process of target model optimization of the present invention. DETAILED DESCRIPTION
[0037] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0038] This embodiment provides a time series task prediction method based on unsupervised multi-model fusion, including inputting the time series task into an optimized target model to obtain a classification prediction result, wherein the optimization process of the optimized prediction model is as follows: Figure 1 As shown, the specific steps include:
[0039] Step S1, initialization algorithm input, including feature fusion module f adp (*), target model T, target task Target task unlabeled dataset X = {x i}, source model S k (k=1,...,K), source model task The tasks of different source models may overlap, and the union of the source model tasks should be able to fully cover the target tasks, that is, The total number of steps for fusion training is max_step; the prediction conflict setting threshold is conf_thd; the round number threshold is warm_up. Among them, the feature fusion module is implemented with a single-layer LSTM, and the feature prototype of the target model can be expressed as The width of each prototype is equal to the sum of the widths of all source model features.
[0040] Step S2: Randomly sample some data x from the unlabeled dataset i , input into all source models, and obtain several groups of time series features and prediction results
[0041] Step S3: splice the time series features of all source models corresponding to each set of data according to the time slice distribution to obtain the spliced time series features And input the feature fusion module to calculate the feature fusion loss The expression is as follows:
[0042]
[0043] Among them, because f adp (*) is a recurrent encoding network, and its output encoding features still have the time slice dimension. The current sample x i The number of time slices is TS i represents, σ(ts) is the time slice distribution weight customized according to the characteristics of the task and source model, and f t (x i ) represents the feature extraction network in the target model. The loss function is used to constrain the output features and f of the target model in each time slice. adp (*)Module outputs remain consistent to ensure that information from each source model is encoded into the target model.
[0044] Step S4: splice the prediction results of all source models corresponding to each set of data to obtain a spliced prediction result If the task scopes of different source models overlap, or the task scope of the source model exceeds the target task, then p s (x i ) to remove duplicates and trim them. The method of retaining the maximum value or retaining the mean can be adopted for removing duplicates. And according to the spliced time series features, the prediction conflicts are eliminated to obtain the real prediction results. The specific process of eliminating prediction conflicts is as follows:
[0045] Step A1: Obtain the splicing prediction results max1(p s (x i )) and max2(ps (x i )).
[0046] Step A2: If the difference between the two is less than the predicted conflict setting threshold conf_thd, it is determined that there is a conflict and step A3 is executed; if the difference between the two is greater than the predicted conflict setting threshold conf_thd, it is determined that there is no conflict and step A4 is executed.
[0047] Step A3: According to the corresponding sample f s (x i )’s time series characteristics, this sample f s (x i ) calculates the similarity with the splicing prediction results with the highest and second highest confidence one by one, and takes the higher one as the true prediction result.
[0048] Step A4: Use the sliding average method to update the splicing prediction result with the highest confidence to obtain the true prediction result. The update rule is as follows:
[0049]
[0050] Among them, λ is the sliding update parameter. The larger the value, the slower the update.
[0051] Finally, the classification loss is calculated based on the actual prediction results. The loss function The expression is as follows:
[0052]
[0053] Among them, T(x i ) represents the classification network in the target model. The loss function constrains the prediction results of the target model to be consistent with the source model.
[0054] It is worth noting that when the algorithm is in the early stage of optimization, due to the randomness of parameter initialization, if conflict elimination is performed directly, it will affect the accuracy of the model, so a round number threshold warm_up is set. When the number of optimization rounds does not reach warm_up, it is not determined whether there is a conflict, and steps A2 and A3 are skipped to directly execute step A4 and update directly.
[0055] Step S5: Input the data obtained in step S2 into the target model, optimize the input target model according to the classification loss and feature fusion loss, and use the joint loss function The expression is as follows:
[0056]
[0057] Among them, λ adp is the corresponding proportional coefficient.
[0058] In this embodiment, the target model is optimized by random gradient descent. After executing step S5, the optimization is looped back to step S3 for max_step times. The above optimization process is as follows: Figure 2 shown.
[0059] This embodiment also proposes a time series task prediction device based on unsupervised multi-model fusion, including a memory and a processor; the memory is used to store computer programs; the processor is used to implement the above-mentioned time series task prediction method based on unsupervised multi-model fusion when executing the computer program.
[0060] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A time series task prediction method based on unsupervised multi-model fusion, characterized in that: The following steps are involved: The time series task of weather forecasting is input into the optimized target model to obtain the forecast result. The optimization process of the optimized forecasting model is as follows: S1, initialize the unlabeled weather dataset, multiple source models, source model tasks, target model, target task and feature fusion module; S2, randomly sample some data from the unlabeled dataset, input them into all source models, and obtain several groups of weather time series features and prediction results; S3, splicing the time series features of all source models corresponding to each set of data according to the time slice distribution, and inputting them into the feature fusion module to obtain the feature fusion loss; S4, splicing the prediction results of all source models corresponding to each set of data, and eliminating prediction conflicts based on the spliced time series features to obtain the true weather prediction results, and calculating the classification loss based on the true prediction results; S5, inputting the data obtained in step S2 into the target model, and optimizing the input target model according to the classification loss and the feature fusion loss; The method for eliminating prediction conflicts in step S4 is as follows: A1. Obtain the splicing prediction results with the highest and second highest confidence levels; A2. If the difference between the two is less than the set threshold, it is determined that there is a conflict, and step A3 is executed; if the difference between the two is greater than the set threshold, it is determined that there is no conflict, and step A4 is executed; A3. Calculate the similarity between the splicing prediction results with the highest confidence and the second highest confidence according to the time series characteristics of the corresponding samples, and take the prediction result with the higher value as the true prediction result; A4. Use the sliding average method to update the splicing prediction result with the highest confidence to obtain the true prediction result.
2. According to claim 1, a time series task prediction method based on unsupervised multi-model fusion is characterized in that: The method for optimizing the input target model in step S5 is the stochastic gradient descent method. After executing step S5, the method returns to step S3 for loop optimization.
3. According to claim 2, a time series task prediction method based on unsupervised multi-model fusion is characterized in that: When the number of cyclic optimization rounds is lower than the set round number threshold, the prediction conflict is not eliminated, and the sliding average method is directly used to update the splicing prediction result with the highest confidence to calculate the classification loss.
4. According to claim 1, a time series task prediction method based on unsupervised multi-model fusion is characterized in that: If the source model tasks overlap or the source model tasks exceed the scope of the target tasks, the spliced prediction results will be deduplicated and trimmed.
5. According to claim 1, a time series task prediction method based on unsupervised multi-model fusion is characterized in that: The weights of the time slice distribution in step S3 are set according to the source model and the source model tasks.
6. A time series task prediction device based on unsupervised multi-model fusion, characterized in that: The invention comprises a memory and a processor; the memory is used to store a computer program; the processor is used to implement the following method when executing the computer program: The time series task of weather forecasting is input into the optimized target model to obtain the forecast result. The optimization process of the optimized forecasting model is as follows: S1, initialize the unlabeled weather dataset, multiple source models, source model tasks, target model, target task and feature fusion module; S2, randomly sample some data from the unlabeled dataset, input them into all source models, and obtain several groups of weather time series features and prediction results; S3, splicing the time series features of all source models corresponding to each set of data according to the time slice distribution, and inputting them into the feature fusion module to obtain the feature fusion loss; S4, splicing the prediction results of all source models corresponding to each set of data, and eliminating prediction conflicts based on the spliced time series features to obtain the true weather prediction results, and calculating the classification loss based on the true prediction results; S5, inputting the data obtained in step S2 into the target model, and optimizing the input target model according to the classification loss and the feature fusion loss; The method for eliminating prediction conflicts in step S4 is as follows: A1. Obtain the splicing prediction results with the highest and second highest confidence levels; A2. If the difference between the two is less than the set threshold, it is determined that there is a conflict, and step A3 is executed; if the difference between the two is greater than the set threshold, it is determined that there is no conflict, and step A4 is executed; A3. Calculate the similarity between the splicing prediction results with the highest confidence and the second highest confidence according to the time series characteristics of the corresponding samples, and take the prediction result with the higher value as the true prediction result; A4. Use the sliding average method to update the splicing prediction result with the highest confidence to obtain the true prediction result.
7. The time series task prediction device based on unsupervised multi-model fusion according to claim 6 is characterized in that: The method for optimizing the input target model in step S5 is the stochastic gradient descent method. After executing step S5, the method returns to step S3 for loop optimization.
8. The time series task prediction device based on unsupervised multi-model fusion according to claim 6 is characterized in that: When the number of cyclic optimization rounds is lower than the set round number threshold, the prediction conflict is not eliminated, and the sliding average method is directly used to update the splicing prediction result with the highest confidence to calculate the classification loss.
