Time series prediction method and device based on mask visual generation, and medium
By converting time series data into images and using masked vision to generate large models for reconstruction, the problem of insufficient cross-modal adaptability of large model-based time series prediction methods is solved, achieving more efficient time series prediction that is suitable for various application scenarios.
Patent Information
- Application Number
- CN202611058811.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-16
- Publication Date
- 2026-11-27
AI Technical Summary
Existing time series forecasting methods based on large models have shortcomings in cross-modal adaptability and transferability. In particular, large language models and continuous time series data have significant differences in data representation and statistical characteristics, resulting in poor prediction performance.
One-dimensional time series data is converted into two-dimensional matrices, rendered as images, and then a pre-trained masked vision generation model is used for image reconstruction. Time series prediction is performed through masked regions, enabling cross-modal knowledge transfer.
It improves the accuracy and generalization of time series forecasting, and can maintain good forecasting performance on time series data in different fields or types. It is suitable for financial market forecasting, weather change forecasting, energy load forecasting, and trend analysis of hot events.
Smart Images

Figure CN123181633A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of time series forecasting technology, and more specifically, to a time series forecasting method based on mask visual generation. Background Technology
[0002] Time series forecasting aims to predict future trends or values of a target based on its historical observation sequences. It is widely used in various technical fields such as finance, meteorology, and hotspot event forecasting, and has become an important area of continuous focus and research in both academia and industry. In recent years, large-scale model-related technologies have developed rapidly. Large-scale model foundations, pre-trained on massive datasets, have demonstrated good generalization and adaptability in downstream tasks such as natural language processing and computer vision. Time series forecasting tasks are also gradually evolving towards a technology paradigm based on large-scale model foundations, that is, shifting from building dedicated models for single datasets or specific tasks to performing time series forecasting based on general-purpose large-scale model foundations.
[0003] Time series methods based on large model bases can be broadly categorized into two types. The first type primarily involves adapting or transferring a large language model (LLM) pre-trained on text data to time series prediction tasks. However, LLMs are mainly pre-trained on discrete text data, resulting in significant modal differences in data representation and statistical properties compared to continuous time series data, leading to insufficient adaptability for continuous time series data. The second type collects large-scale time series data from various domains and retrains the large model base based on the collected sequence data. However, time series data is significantly less available than text and image data in terms of public scale, data volume, annotation completeness, and cross-domain coverage, thus limiting the scale of pre-training data for large models. Furthermore, unlike text and image data, time series data exhibits significant heterogeneity in sequence length, sampling frequency, and domain, further limiting the transferability of large models to downstream application domains. Summary of the Invention
[0004] The present invention aims to provide a time series prediction method based on mask visual generation to address the shortcomings of existing time series methods based on large model bases.
[0005] In a first aspect, the present invention provides a time series prediction method based on mask visual generation, comprising: Convert a one-dimensional time series into a two-dimensional time series matrix; Render a two-dimensional time series matrix into an image; The image is aligned to the image size required for the large visual generation model. The aligned image includes the visible area and the masked area. The aligned image is input into a large visual model to reconstruct the mask region, and the reconstructed image is output. The reconstructed image is restored to a one-dimensional time series structure, and the predicted time series is obtained.
[0006] In a preferred embodiment, the step of converting a one-dimensional time series into a two-dimensional time series matrix includes: For a given one-dimensional time series, it is segmented according to a set period to obtain several subsequences; Stack the subsequences in order to construct a two-dimensional time series matrix.
[0007] In a preferred embodiment, rendering the time-series two-dimensional matrix into an image includes: Instance normalization is performed on the two-dimensional time series matrix based on its mean and standard deviation; The instance-normalized time series two-dimensional matrix is rendered as a three-channel grayscale image; the values of the three channels are the same as those of the instance-normalized time series two-dimensional matrix.
[0008] In a preferred embodiment, aligning the image to the image specifications required for visual generation of a large model includes: The image is resampled to align it to the image specifications used in the pre-training stage of the large visual generation model. In the aligned image, the left side is the visible area, and the right side is the masked area; wherein, the aligned image is divided into A number of two-dimensional image blocks, wherein the number of visible image blocks in the visible region is set to 1. The number of mask image blocks in the mask region is set to , The length of historical observations in the time series With predicted length The proportional relationship is determined.
[0009] In a preferred embodiment, the step of inputting the aligned image into a large model for visual reconstruction of the mask region and outputting the reconstructed image includes: The aligned image is then processed by an encoder to extract spatial features, resulting in a feature map. The feature map is processed by a vector quantization module to obtain a two-dimensional discrete token matrix. The mask token is determined by the mask iterative reconstruction module using a two-dimensional discrete token matrix. The two-dimensional discrete token matrix after determining the mask tokens is restored to the reconstructed image by the decoder.
[0010] In a preferred embodiment, obtaining a two-dimensional discrete token matrix from the feature map via a vector quantization module includes: Build includes A discrete visual dictionary of individual codewords; For each feature vector in the feature map output by the encoder, find the nearest codeword and replace the original feature vector with the corresponding codeword index to obtain a two-dimensional discrete token matrix.
[0011] In a preferred embodiment, determining the masked token by using a mask iterative reconstruction module from a two-dimensional discrete token matrix includes: In a two-dimensional discrete token matrix, the masked region is initialized as a masked token, and the visible region is initialized as a visible token, forming a complete token sequence of visible tokens and masked tokens; The complete token sequence is input into the Transformer network, and the probability distribution of all masked tokens is predicted in parallel. The discrete visual dictionary probability distribution corresponding to each masked token is output, thus obtaining the predicted probability of each masked token. Select a portion of the masked tokens based on the predicted confidence level, while keeping the rest masked. Repeat the above process until all mask tokens are determined or the maximum number of iterations is reached. Finally, map the determined mask tokens back to their corresponding codewords to construct a quantized feature map.
[0012] In a preferred embodiment, the step of restoring the reconstructed image to a one-dimensional time series structure to obtain the predicted time series includes: Resampling restores the reconstructed image to the image size rendered by the time-series two-dimensional matrix. A pixel-wise averaging operation is performed on the three channels of the reconstructed image to convert the three-channel image into a single-channel image representation; Perform inverse normalization on a single-channel image based on the mean and standard deviation recorded in the rendered image. The image after inverse normalization is flattened and rearranged according to the segmented stacking method used when converting to a two-dimensional time series matrix, restoring it to a one-dimensional time series structure, and the time series of the corresponding prediction window region is extracted as the prediction time series.
[0013] In a second aspect, the present invention provides an electronic device, comprising: At least one processor; and a memory communicatively connected to said at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the instructions stored in the memory to perform the above-described method.
[0014] Thirdly, the present invention provides a computer-readable storage medium for storing instructions that, when executed, enable the above-described method to be implemented.
[0015] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are: This invention utilizes a pre-trained masked visual generation model to model continuous signals, fully exploiting the structural similarity between image data and time series data, and achieving cross-modal knowledge transfer. It innovatively transforms the time series prediction task into a masked image reconstruction task, using masked image generation from the visual generation model for time series prediction, thus improving the accuracy and generalization of time series prediction. Furthermore, because the visual generation model is pre-trained on large-scale visual data, the method maintains good predictive performance when facing time series data from different domains or of different types. It can be applied to various time series prediction scenarios such as financial market forecasting, weather change forecasting, energy load forecasting, and trend analysis of hot events, demonstrating significant engineering application value. Attached Figure Description
[0016] Figure 1 This is a flowchart of a time series prediction method based on mask visual generation provided in an embodiment of the present invention.
[0017] Figure 2 This is a schematic diagram of a time series prediction method based on mask visual generation provided in an embodiment of the present invention.
[0018] Figure 3 This is a schematic diagram of the structure of the large model generated by MaskGIT vision in an embodiment of the present invention.
[0019] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0021] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0022] Compared to text data in discrete symbolic form, image data and time series data are both continuous signal forms, exhibiting high similarity in data structure characteristics, numerical distribution patterns, and pattern representation methods. Therefore, they possess a good foundation for cross-modal mapping at the modal structure level. Based on this similarity, this invention proposes a time series prediction method based on masked visual generation. This method constructs a visual representation of time series data and utilizes a large-scale masked visual generation model pre-trained on large-scale image data for modeling and inference to predict future trends in the time series.
[0023] Compared with traditional time series prediction schemes based on pre-trained large language models of text or training large models from scratch using only time series data, this invention can make fuller use of the capabilities of visual generative large models in continuous signal modeling and complex pattern extraction, thereby improving the cross-domain transfer capability, data utilization efficiency and prediction accuracy of the base model, and maintaining stable and excellent prediction performance in scenarios with few or zero samples.
[0024] In view of this, embodiments of the present invention provide a time series prediction method based on masked visual generation. This method uses a large visual generation model to perform time series prediction through masked image generation. Specifically, historical time series data are converted into visible image patches, and time series prediction is mapped to masked image patches. Through this mapping, the time series prediction problem is structurally equivalent to the masked image reconstruction problem, thus enabling direct use of a pre-trained large visual generation model for time series inference.
[0025] like Figure 1 As shown in the figure, an embodiment of the present invention provides a time series prediction method based on mask visual generation, which includes the following steps: Step 1: Convert the one-dimensional time series into a two-dimensional time series matrix.
[0026] To transform the time series prediction problem into a masked image reconstruction problem, the original one-dimensional time series must first be converted into a two-dimensional matrix form. Specifically, for a given one-dimensional time series... In this embodiment of the invention, the length is The period is divided into segments to obtain The time series consists of several subsequences, the period of which can be adjusted according to needs and practical applications. After the subsequences are cut, they are stacked in order to construct a two-dimensional time series matrix representation. .
[0027] In this embodiment of the invention, the time series segmentation strategy ensures that adjacent elements in the time series two-dimensional matrix maintain a strong correlation in their numerical trends, thereby satisfying the spatial locality characteristic of image data, i.e., adjacent pixels often have high similarity. Therefore, it further reduces the modal difference between time series data and image data, providing a structural foundation for subsequent time series prediction based on visual generative models.
[0028] Step 2: Render the time series two-dimensional matrix into an image.
[0029] Given that image data typically has three channels, this embodiment of the invention requires rendering the time-series matrix into a three-channel image representation. Before image rendering, considering that in the pre-training process of large-scale visual generation models, it is usually necessary to standardize the input image based on the mean and standard deviation of the image dataset, this embodiment of the invention first processes the constructed two-dimensional time-series matrix... Instance normalization is performed based on the mean and standard deviation. This preprocessing strategy is the same as the conventional data preprocessing procedure in the current field of time series forecasting. The two-dimensional time series matrix after instance normalization is denoted as... Its calculation method can be expressed as:
[0030] in, Representing a two-dimensional matrix of time series The mean, Representing a two-dimensional matrix of time series standard deviation This is the amplitude scaling hyperparameter. Through this instance normalization strategy, the consistency between the time-series 2D matrix representation and the input distribution of the pre-trained visual generation large model can be further improved, thereby enhancing the transfer effect and time-series prediction performance of the visual generation large model.
[0031] Next, in this embodiment of the invention, the time series two-dimensional matrix after instance normalization is... Rendered as a three-channel grayscale image, denoted as :
[0032] The values of the three channels are all correlated with the instance-normalized two-dimensional time series matrix. The same approach is used, namely, constructing a three-channel image input structure through channel duplication. This simple and stable three-channel duplication strategy, compared to mapping a single-channel grayscale image to a three-channel color image and learning the optimal color transformation relationship through fine-tuning, ensures that the input format remains consistent with the channel structure of the pre-trained visual generation model. It also avoids introducing unnecessary parameter learning processes, thus improving overall computational efficiency and feasibility while maintaining prediction performance.
[0033] Step 3: Align the image to the image size required for visual generation of the large model. The aligned image includes visible image blocks and mask image blocks.
[0034] In this embodiment of the invention, a three-channel grayscale image is reconstructed. The corresponding column area on the right is used to predict future time series data. Specifically, the image... The left-hand region is considered as visible patches, and the right-hand region to be predicted is considered as masked patches. A masked visual reconstruction mechanism is used to reconstruct and predict the right-hand region. However, since the images used in pre-trained large-scale visual generation models are usually of fixed size, the images obtained through time-series mapping... The size may not be consistent with the input size of the pre-trained large-scale visual generation model. To ensure compatibility between the input structure and the architecture of the pre-trained large-scale visual generation model, this embodiment of the invention proposes to modify the image... Resampling is performed to align the images to the image specifications used in the pre-training phase of the large visual generation model.
[0035] Specifically, assuming the image input to the pre-trained large vision generation model is divided into... There are 2D image patches, each with a size of [size missing]. In the prediction task of this invention, the number of visible image patches is set to... The number of mask image blocks is set to ,in The length of historical observations in the time series With predicted length The proportional relationship is determined. Then, the image... From the original size Resampling to size is To ensure that its spatial resolution is consistent with the image block structure of the pre-trained large visual generation model, thereby enhancing the model's adaptability to input sequence data. During the resampling process, this embodiment employs bilinear interpolation to perform size transformation for resampling, reducing information distortion caused by interpolation while maintaining numerical continuity.
[0036] Through the aforementioned image alignment and structure mapping mechanism, the time series prediction task can be made consistent with the mask image generation task in form, thereby enabling the pre-trained large visual generation model to be directly transferred to the time series prediction task without retraining.
[0037] Step 4: Input the aligned image into the large model of visual generation to reconstruct the mask region, and output the reconstructed image.
[0038] Image reconstruction using masked regions involves feature modeling and content restoration to achieve complete generation of the masked regions. In time series forecasting, these masked regions correspond to future prediction window areas.
[0039] In this embodiment of the invention, a pre-trained MaskGIT visual generation model is used for time series prediction. Compared with traditional image generation models, it adopts a non-autoregressive generation mechanism, enabling parallel prediction of all mask positions in each iteration. Image reconstruction can be completed with only a few iterations, thus significantly improving the efficiency of time series prediction. The MaskGIT visual generation model mainly includes four core modules: an encoder, a vector quantization module, a mask iterative reconstruction module, and a decoder. The specific reconstruction process is detailed below: Step 4.1: The aligned image is processed by an encoder to extract spatial features, resulting in a feature map. The main function of the encoder is to convert the input image into a low-dimensional latent representation and provide a feature base for subsequent discretization processing. In the MaskGIT visual generation model, the encoder is typically implemented using a pre-trained VQ-VAE encoder. The aligned image is then passed through an encoder constructed from a convolutional neural network to extract spatial features, resulting in a low-resolution continuous latent feature map of the image.
[0040] This feature map preserves the main structural information of the input image while reducing spatial resolution and redundancy.
[0041] Step 4.2: Obtain a two-dimensional discrete token matrix from the feature map through the vector quantization module.
[0042] The MskGIT visual generation model maps continuous features to discrete visual tokens through a vector quantization module. Specifically, this includes constructing a large-scale visual token system using the vector quantization module. Discrete visual dictionary of individual codewords To find the nearest codeword for each feature vector in the feature map output by the encoder, the original feature vector is replaced with the corresponding codeword index, resulting in a two-dimensional discrete token matrix:
[0043] Through the vector quantization module, the MSkGIT visual generation model transforms the image generation problem into a discrete classification problem, laying the foundation for subsequent masked image generation.
[0044] Step 4.3, Mask Iterative Reconstruction Module Iterative decoding and mask reconstruction is the core innovative mechanism of the MaskGIT visual generation model. Unlike traditional image generation models that generate image mask regions pixel by pixel, the MaskGIT visual generation model employs a non-autoregressive generation mechanism, enabling parallel prediction of all mask positions in each iteration, thus completing image reconstruction with only a small number of iterations.
[0045] For a two-dimensional discrete token matrix, the MaskGIT visual generation model first initializes all unknown masked regions as mask tokens, while the known visible regions remain unchanged and are initialized as visible tokens, forming a complete token sequence of visible and mask tokens. Then, the current complete token sequence is input into a Transformer network, which predicts the probability distribution of all mask tokens in parallel, outputting the discrete visual dictionary probability distribution corresponding to each mask token, thus obtaining the predicted probability of each mask token. Next, based on the prediction confidence, a portion of the mask tokens are selected for determination, while the rest remain masked. This process is repeated until all mask tokens are determined or the maximum number of iterations is reached. Finally, the determined mask tokens are mapped back to their corresponding codewords to construct a quantized feature map. .
[0046] Step 4.4 involves reconstructing the image from the two-dimensional discrete token matrix after determining the masked tokens using a decoder. Specifically, the feature map is quantized using a decoder composed of a convolutional neural network. Restore to continuous images .
[0047]
[0048] Step 5: Reconstruct the image into a one-dimensional time series structure to obtain the predicted time series.
[0049] After obtaining the reconstructed image output by the MaskGIT visual generation model, this embodiment of the invention performs an inverse transformation operation corresponding to the aforementioned preprocessing steps. This restores the image to its time-series space and extracts the prediction results. Specifically, firstly, the reconstructed image is restored to the original time-series two-dimensional matrix rendering size through bilinear interpolation resampling; then, pixel-wise averaging is performed on the three channels of the reconstructed image, converting the three-channel image into a single-channel image representation, thereby restoring the grayscale matrix form consistent with the original time-series mapping; next, based on the mean and standard deviation parameters recorded during the rendering image preprocessing stage, an inverse normalization operation is performed on the single-channel image to restore its original numerical scale; finally, the image after the inverse normalization operation is flattened and rearranged according to the segmented stacking method used when initially converted to a time-series two-dimensional matrix, restoring it to a one-dimensional time-series structure, and the time series corresponding to the prediction window region is extracted as the predicted time series. Through the above operation process, the structural restoration from the "mask image reconstruction result" to the "time-series prediction result" is achieved, thus completing the time-series prediction process based on the mask visual generation model.
[0050] Based on the same technical concept, embodiments of the present invention also provide an electronic device that can implement the time series prediction method based on mask visual generation provided in the above embodiments of the present invention. In one embodiment, the electronic device can be a server, a terminal device, or other electronic devices. Figure 4 As shown, the electronic device may include: At least one processor and a memory connected to the at least one processor. In this embodiment of the invention, the specific connection medium between the processor and the memory is not limited. Figure 4 The example used is the connection between the processor and memory via a bus. The bus... Figure 4 The connections between other components are indicated by thick lines and are for illustrative purposes only, not as limiting information. Buses can be categorized into address buses, data buses, control buses, etc., but for ease of representation, [the specific bus type is not shown here]. Figure 4 The processor is represented by a single thick line, but this does not imply that there is only one bus or one type of bus. Alternatively, a processor can also be called a controller; there are no restrictions on the name.
[0051] In this embodiment of the invention, the memory stores instructions that can be executed by at least one processor. By executing the instructions stored in the memory, at least one processor can execute a time series prediction method based on mask visual generation as described above.
[0052] The processor is the control center of the device. It can connect to various parts of the control device through various interfaces and lines. By running or executing instructions stored in memory and calling data stored in memory, it can monitor the device's various functions and process data, thereby enabling overall monitoring of the device.
[0053] In an alternative design, the processor may include one or more processing units. The processor may integrate an application processor and a modem processor, wherein the application processor primarily handles the operating system, user interface, and applications, while the modem processor primarily handles wireless communication. It is understood that the modem processor may also not be integrated into the processor. In some embodiments, the processor and memory may be implemented on the same chip; in some embodiments, they may also be implemented separately on separate chips.
[0054] The processor can be a general-purpose processor, such as a CPU, digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the time series prediction method based on mask vision generation disclosed in the embodiments of this invention can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.
[0055] Memory, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory can include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, magnetic disk, optical disk, etc. Memory is any other medium capable of carrying or storing desired program code in the form of instructions or data structures, and accessible by a computer, but is not limited thereto. In embodiments of the present invention, memory can also be a circuit or any other device capable of implementing storage functions, used to store program instructions and / or data.
[0056] By designing and programming the processor, the code corresponding to the time series prediction method based on mask vision generation described in the foregoing embodiments can be embedded into the chip, enabling the chip to execute the steps of the method described in the foregoing embodiments during runtime. How to design and program the processor is a technique well-known to those skilled in the art and will not be elaborated upon here.
[0057] Based on the same inventive concept, embodiments of the present invention also provide a storage medium storing computer instructions that, when executed on a computer, cause the computer to perform a time series prediction method based on mask visual generation as described above.
[0058] In some alternative embodiments, the present invention also provides that various aspects of a mask-based visual generation time series prediction method can also be implemented as a program product comprising program code that, when the program product is run on a device, causes the control device to perform the steps in a mask-based visual generation time series prediction method according to various exemplary embodiments of the present invention as described above.
[0059] It should be noted that although several units or sub-units of the apparatus have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of the invention, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units. Furthermore, although the operation of the method of the invention is described in a specific order in the drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0060] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0061] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a server, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0062] Program code for performing the operations of this invention can be written using any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0063] In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0064] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0065] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0066] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A time series prediction method based on mask visual generation, characterized in that, include: Convert a one-dimensional time series into a two-dimensional time series matrix; Render a two-dimensional time series matrix into an image; The image is aligned to the image size required for the large visual generation model. The aligned image includes the visible area and the masked area. The aligned image is input into a large visual model to reconstruct the mask region, and the reconstructed image is output. The reconstructed image is restored to a one-dimensional time series structure, and the predicted time series is obtained.
2. The time series prediction method based on mask visual generation according to claim 1, characterized in that, The process of converting a one-dimensional time series into a two-dimensional time series matrix includes: For a given one-dimensional time series, it is segmented according to a set period to obtain several subsequences; Stack the subsequences in order to construct a two-dimensional time series matrix.
3. The time series prediction method based on mask visual generation according to claim 1, characterized in that, The process of rendering a two-dimensional time-series matrix into an image includes: Instance normalization is performed on the two-dimensional time series matrix based on its mean and standard deviation; The instance-normalized time series two-dimensional matrix is rendered as a three-channel grayscale image; the values of the three channels are the same as those of the instance-normalized time series two-dimensional matrix.
4. The time series prediction method based on mask visual generation according to claim 1, characterized in that, The process of aligning images to the image specifications required for visually generating large models includes: The image is resampled to align it to the image specifications used in the pre-training stage of the large visual generation model. In the aligned image, the left side is the visible area, and the right side is the masked area; wherein, the aligned image is divided into A number of two-dimensional image blocks, wherein the number of visible image blocks in the visible region is set to 1. The number of mask image blocks in the mask region is set to , Based on the length of historical observations in the time series With predicted length The proportional relationship is determined.
5. The time series prediction method based on masked visual generation according to claim 1, characterized in that, The process of inputting the aligned image into a large visual model to reconstruct the mask region and outputting the reconstructed image includes: The aligned image is then processed by an encoder to extract spatial features, resulting in a feature map. The feature map is processed by a vector quantization module to obtain a two-dimensional discrete token matrix. The mask token is determined by the mask iterative reconstruction module using a two-dimensional discrete token matrix. The two-dimensional discrete token matrix after determining the mask tokens is restored to the reconstructed image by the decoder.
6. The time series prediction method based on mask visual generation according to claim 5, characterized in that, The step of obtaining a two-dimensional discrete token matrix from the feature map through a vector quantization module includes: Build includes A discrete visual dictionary of individual codewords; For each feature vector in the feature map output by the encoder, find the nearest codeword and replace the original feature vector with the corresponding codeword index to obtain a two-dimensional discrete token matrix.
7. The time series prediction method based on mask visual generation according to claim 5, characterized in that, The step of determining the masked token by using a mask iterative reconstruction module on a two-dimensional discrete token matrix includes: In a two-dimensional discrete token matrix, the masked region is initialized as a masked token, and the visible region is initialized as a visible token, forming a complete token sequence of visible tokens and masked tokens; The complete token sequence is input into the Transformer network, and the probability distribution of all masked tokens is predicted in parallel. The discrete visual dictionary probability distribution corresponding to each masked token is output, thus obtaining the predicted probability of each masked token. Select a portion of the masked tokens based on the predicted confidence level, while keeping the rest masked. Repeat the above process until all mask tokens are determined or the maximum number of iterations is reached. Finally, map the determined mask tokens back to their corresponding codewords to construct a quantized feature map.
8. The time series prediction method based on mask visual generation according to claim 1, characterized in that, The process of restoring the reconstructed image to a one-dimensional time series structure to obtain the predicted time series includes: Resampling restores the reconstructed image to the image size rendered by the time-series two-dimensional matrix. A pixel-wise averaging operation is performed on the three channels of the reconstructed image to convert the three-channel image into a single-channel image representation; Perform inverse normalization on a single-channel image based on the mean and standard deviation recorded in the rendered image. The image after inverse normalization is flattened and rearranged according to the segmented stacking method used when converting to a two-dimensional time series matrix, restoring it to a one-dimensional time series structure, and the time series of the corresponding prediction window region is extracted as the prediction time series.
9. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which executes the instructions stored in the memory to perform the method as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store instructions that, when executed, cause the method as described in any one of claims 1-8 to be implemented.
