Space-time data rule extraction method based on space-time Fourier expert mixture
By combining a Spatiotemporal Fourier Expert Hybrid Network (STF-MoE) with a denoising network and Fourier convolution, the problem of capturing global stability and local perturbation in urban spatiotemporal data modeling is solved, thereby improving the robustness and interpretability of urban traffic flow prediction.
Patent Information
- Application Number
- CN202511912581.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-18
- Publication Date
- 2026-04-28
AI Technical Summary
Existing urban spatiotemporal data modeling methods struggle to effectively capture global stability and local disturbance characteristics in open environments. They lack structural constraints on dynamic evolution mechanisms and cannot simultaneously extract periodicity, spatial synergy, and frequency domain dynamic features, resulting in unstable prediction results and a lack of interpretability.
A spatiotemporal data regularity extraction method based on spatiotemporal Fourier expert hybrid network is adopted. The spatiotemporal Fourier expert hybrid network (STF-MoE) is combined with a denoising network and a subconditional gradient field network. Multi-scale features are extracted by using temporal Fourier convolution and spatial Fourier graph convolution. The spatiotemporal regularity is integrated through expert hybrid mechanism, and the spatiotemporal Fourier attention mechanism is introduced to improve the prediction ability.
It achieves stable law extraction of the influence of multiple factors in urban traffic flow prediction, improves the robustness and interpretability of the model, can adaptively adjust the feature contribution ratio, reduce noise interference, and adapt to dynamic urban environments.
Smart Images

Figure CN121935868A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of urban spatiotemporal data processing technology, specifically to a method for extracting spatiotemporal data patterns based on a spatiotemporal Fourier expert mixture. Background Technology
[0002] In recent years, urban spatiotemporal data prediction systems have exhibited highly dynamic and open-environment characteristics. Influenced by multiple factors such as human travel habits, geographic spatial structure, random operational disturbances, and changes in the external environment, their observed data exhibit significant non-stationarity, multi-scale coupling, and complex spatiotemporal dependencies. Existing spatiotemporal data modeling methods are mainly based on statistical distribution fitting or deep neural network learning, extracting spatiotemporal features by constructing temporal convolutional networks, recurrent networks, or graph convolutional networks. However, traditional methods primarily learn internal patterns based on the surface distribution patterns of observed data, lacking structural constraints on the dynamic evolution mechanism, and thus failing to effectively characterize the global stability and local perturbation characteristics driven by real physical laws. Furthermore, when faced with changes in external environmental conditions, sudden abnormal disturbances, sensor noise, data gaps, and long-tailed sparse events, the models are prone to unstable predictions or erroneous trend inferences, resulting in unreliable and uninterpretable results.
[0003] Furthermore, different types of environmental factors exhibit significant differences in their spatial and temporal scope and intensity of influence: global conditions typically have a sustained impact at the system level, while local conditions generate short-term disturbances within the topological neighborhood, resulting in observed data simultaneously exhibiting periodic variations, random fluctuations, and local abrupt changes. This global-local, multi-scale coupling characteristic makes it difficult for traditional single-domain feature extraction methods to simultaneously capture periodicity, spatial synergy, and frequency domain dynamics, thus limiting the accuracy of data modeling and generation.
[0004] Chinese invention patent application, publication number CN113674122A, entitled "A Method for Rapidly Extracting Urban Residents' Travel Patterns Applicable to High-Concurrency Travel Data," describes a method that rapidly extracts urban residents' travel patterns by establishing a spatial index for a selected area, performing parallel fast map matching, and then extracting both temporal and spatial features of these patterns. However, this method fails to consider the impact of external environmental changes and differences in transportation modes on traffic flow patterns, resulting in results that do not accurately reflect actual patterns.
[0005] Therefore, although there are various spatiotemporal feature modeling techniques in the existing methods, they generally have the following technical limitations: (1) They only perform single-scale feature extraction in the time domain or spatial domain, and cannot take into account both periodicity and spatially dependent structural features; (2) They lack interpretable frequency domain feature modeling mechanisms, and it is difficult to identify periodic energy distribution and noise components; (3) They lack feature decomposition mechanisms for actual engineering noise, and it is difficult to extract reusable spatiotemporal regularity information from noisy data.
[0006] Therefore, there is an urgent need for a new model structure that can simultaneously handle features in the time domain, frequency domain, spatial domain, and spatial-frequency domain, so as to extract multi-scale dynamic patterns of urban traffic flow and improve the robustness of data processing in open systems. Summary of the Invention
[0007] In view of the above problems, in order to capture the regularity of spatiotemporal data and improve the ability to model data distribution in open environments, this invention provides a spatiotemporal data regularity extraction method based on spatiotemporal Fourier Mixture of Experts (STF-MoE). This method involves establishing a STF-MoE network to model a denoising network and a sub-conditional gradient field network; using temporal Fourier convolution to capture periodic patterns in the temporal domain and spatial Fourier graph convolution to capture spatial correlations; fusing temporal and spatial regularities through an expert mixing mechanism; and finally, improving the predictive ability of the target result and strengthening the robustness of the generative model through a spatiotemporal Fourier attention mechanism.
[0008] Urban spatiotemporal systems are characterized by openness, dynamism, and significant multi-scale spatiotemporal features. For example, traffic flow or average road speed data is influenced by multiple factors such as road structure, congestion propagation patterns, temporary events, weather conditions, and human travel behavior, exhibiting characteristics of non-stationarity, periodicity, and local abrupt changes. Existing spatiotemporal data prediction and pattern modeling methods are mostly based on temporal convolutional networks, recurrent networks, or graph convolutional networks, but they typically extract features only from a single temporal or spatial perspective, failing to simultaneously extract periodic patterns, spatial co-correlation, and local perturbation features. Furthermore, when facing open environmental conditions such as holiday pattern switching, sudden traffic events, sensor noise, and data gaps, the model's predictive stability and anomaly detection capabilities are insufficient, making it difficult to balance accuracy, generalization, and interpretability. Therefore, it is necessary to propose a spatiotemporal data processing method that can jointly utilize features from the time domain, time-frequency domain, spatial domain, and spatial-frequency domain to meet the needs of urban traffic flow prediction and anomaly detection tasks and improve its application capabilities in open urban spatiotemporal systems.
[0009] According to embodiments of the present invention, a spatiotemporal data pattern extraction method based on spatiotemporal Fourier expert mixture is provided for urban traffic flow prediction, including: S1: Spatiotemporal data acquisition module, which acquires historical data information, including collecting historical spatiotemporal data of the area to be predicted in the city, quantifying the historical spatiotemporal data to obtain a set of spatiotemporal observation data sequences in the observation space, including multiple spatiotemporal observation data sequences as samples; each sample includes spatiotemporal observation data at a certain moment in the observation space and external environmental data; among which, the spatiotemporal observation data includes traffic flow information of the area to be predicted; the external environmental data represents external environmental data, including timestamp information, weather, and the proportion of various modes of transportation within the observation space area; S2: Establish a spatiotemporal Fourier expert hybrid network to extract features of spatiotemporal observation data sequences in the time domain, time-frequency domain, spatial domain, and space-frequency domain based on spatiotemporal observation data sequence sets, obtaining time domain features, time-frequency domain features, spatial domain features, and space-frequency domain features; and perform expert hybridization of time domain features, time-frequency domain features, spatial domain features, and space-frequency domain features to obtain hybrid features; S3: Adaptive group normalization is used as a conditional fusion module to perform conditional fusion processing on the mixed features to obtain fused features; S4: Establish a spatiotemporal Fourier attention mechanism module to perform spatiotemporal Fourier attention processing on the fused features to obtain the output features; S5: Establish a diffusion model to combine with a noise estimation network, perform back-diffusion on noisy data based on output features to obtain predicted denoised data, and train the model to obtain a trained diffusion model. S6: Sampling obtains spatiotemporal data, which is input into a trained diffusion model to extract causal patterns, which are then used in urban traffic flow prediction and control processes.
[0010] Optionally, it also includes: establishing a multi-scale trend decomposition module, which is used to cooperate with one or more of the spatiotemporal data acquisition module, the spatiotemporal Fourier expert hybrid network and the spatiotemporal Fourier attention mechanism module respectively, receiving their output results as input, and performing multi-scale trend decomposition to obtain trend components and residual components respectively, using each trend component as input to the next module, and retaining the residual components for use in the noise estimation network in the diffusion model.
[0011] Optionally, the multi-scale trend decomposition module performs multi-scale trend decomposition on the received input in the following manner:
[0012]
[0013] in, This indicates the extraction of information about the input. The trend component, This indicates the extraction of information about the input. The residual components, This represents the list of average pooling kernels. The index for the average pooling kernel. Indicates based on received input Adaptive calculation of average pooling kernel The corresponding contribution rate The input received from the previous module is based on the multi-scale trend decomposition module. Indicates the average pooling kernel Average pooling operation.
[0014] Optionally, S2 includes: S2.1: Map the spatiotemporal observation data sequence set to the feature space using a fully connected network to obtain embedded features. Merge the embedded features at all time steps into a spatiotemporal feature set to obtain the spatiotemporal feature set. S2.2: Based on the spatiotemporal feature set, a one-dimensional convolutional neural network is used to extract features in the time domain, including extracting the contextual autocorrelation features of time series in the time domain; S2.3: Based on the spatiotemporal feature set, extract features in the time-frequency domain, including extracting the periodic features of the time series in the time-frequency domain, where high-frequency information is filtered and low-frequency information is retained, in order to identify and extract the trend and periodicity of the time series; S2.4: Based on the spatiotemporal feature set, extract features of the spatial domain, including extracting the dynamic connection relationship of spatial structure in the spatial domain, where basic graph convolution is used to process each spatiotemporal observation data sequence; S2.5: Based on the spatiotemporal feature set, extract features in the spatial frequency domain, including extracting the total variation between spatiotemporal observation data sequences under a given spatial structure. Among these features, spatial Fourier diagram convolution is used to filter high-frequency information while retaining low-frequency information, which is used to identify and extract effective spatial correlations in the spatiotemporal sequences.
[0015] Optionally, S2 also includes: establishing an expert mixing module, which treats the time domain features, time-frequency domain features, spatial domain features, and space-frequency domain features as four experts that respectively control the contextual autocorrelation features, temporal periodicity features, dynamic connectivity features, and spatial correlation features of spatiotemporal data, and mixes the experts using a weighted summation method to obtain the mixed features.
[0016] Optionally, S4 includes: S4.1: Use the array reshaping function to compress the spatial and temporal dimensions of the fused features into the same space; S4.2: Use a fully connected layer to process the fused features to obtain the fully connected layer processed features, and use an attention mechanism and discrete Fourier transform to obtain the query, key, and value of the attention mechanism based on the fused features; based on the fully connected layer processed features, and the query, key, and value of the attention mechanism, restore the spatiotemporal dimension to the original space through an array reshaping function to obtain the output features.
[0017] Alternatively, the diffusion model in S5 is as follows:
[0018]
[0019] in, This represents the mean of the data after noise reduction. For learnable parameters, Indicates parameters The parameterized probability distribution function, Represents a noise estimation network. Indicates the first Noisy spatiotemporal data of each diffusion step, Indicates conditional information, Indicates diffusion step The variance of the Gaussian distribution, Represents the normal distribution function. Indicates diffusion step Noise scheduling parameters, Indicates intermediate variables. The index represents the diffusion step of a uniform distribution. This represents the total number of diffusion steps.
[0020] Compared with existing technologies, the spatiotemporal data pattern extraction method based on spatiotemporal Fourier expert mixture provided by the present invention has at least the following beneficial effects.
[0021] (1) The spatiotemporal Fourier expert hybrid network proposed in this invention can simultaneously extract features in the time domain, time-frequency domain, spatial domain and spatial-frequency domain in the spatiotemporal data of urban traffic flow prediction. It can achieve joint modeling of periodic patterns, spatial structure correlation and local disturbance phenomena through multi-domain feature fusion. Compared with the modeling method based only on the time domain or spatial domain, it can maintain stable pattern extraction ability in heterogeneous environments and improve the adaptability and expression integrity of noisy data caused by multiple factors such as human travel habits, geographic spatial structure, random operation disturbance and external environmental changes in urban traffic flow prediction.
[0022] (2) The present invention adopts a feature extraction mechanism based on Fourier analysis, which makes the energy distribution of periodic signals explicit. By separating low-frequency components and high-frequency components, the trend information and dynamic noise information are decoupled, which can reduce the interference of environmental noise, local anomalies and equipment errors in urban traffic flow prediction on the feature extraction process, and ensure that the generated or predicted results are more consistent with the long-term regularity characteristics of the actual physical system.
[0023] (3) The present invention adopts an expert hybrid structure and introduces a learnable weighting strategy, so that the contribution ratio of different domain features can be automatically adjusted under different behavioral modes, thereby realizing adaptive modeling of global steady-state changes and local short-term changes, reducing the dependence on manual feature selection, and improving the transferability of the model in different scenarios, regions and time periods in the process of urban traffic flow prediction.
[0024] (4) The present invention introduces a multi-scale trend decomposition module, which can automatically distinguish regular features and residual information within the network, avoiding the mismatch caused by direct fitting of noise or local anomalies in deep networks, so that the final output results can retain both long-term trend regularity and local change description, making it more suitable for traffic flow prediction, simulation, analysis and control scenarios in dynamic urban environments. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the embodiments will be briefly introduced below. The features and advantages of the present invention can be more clearly understood by referring to the accompanying drawings. The accompanying drawings are schematic and should not be construed as limiting the present invention in any way. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 A principle block diagram of a spatiotemporal data pattern extraction method based on spatiotemporal Fourier expert mixture provided according to an embodiment of the present invention.
[0027] Figure 2 A visualization of the observation results generated for a specific region on the dataset in Example 1.
[0028] Figure 3 A visualization of the observation results for another specific region on the dataset in Example 1 is generated.
[0029] Figure 4 A visualization of the generation results for a specific region on the dataset in Example 1. Detailed Implementation
[0030] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments of the present invention and the features thereof can be combined with each other.
[0031] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein. Therefore, the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0032] The following detailed description, with reference to the accompanying drawings, illustrates a spatiotemporal data pattern extraction method based on spatiotemporal Fourier expert mixture according to an embodiment of the present invention. Key innovations of this invention include: proposing a multi-expert feature modeling framework based on the time domain, time-frequency domain, spatial domain, and spatial-frequency domain, enabling simultaneous capture of periodic patterns, spatial dependencies, disturbance patterns, and spectral energy structures; constructing a Fourier mixture feature fusion mechanism, which can learnably adjust the importance of multi-domain features, achieving dynamic adaptability in feature extraction; and introducing a multi-scale trend decomposition module, enabling structured separation of real spatiotemporal evolution trends and noise disturbance components, improving generation stability and interpretability. The spatiotemporal data pattern extraction method based on spatiotemporal Fourier expert mixture provided by this embodiment can be used for tasks such as urban traffic flow prediction, road average speed change trend analysis, sudden congestion identification, traffic anomaly detection, and future traffic operation simulation, and can support intelligent transportation platforms, traffic operation monitoring systems, and urban traffic digital twin systems.
[0033] As shown in the figure, the spatiotemporal data pattern extraction method based on spatiotemporal Fourier expert mixture according to an embodiment of the present invention includes the following steps.
[0034] S1: Establish a spatiotemporal data acquisition module to acquire historical data information, including collecting spatiotemporal data of the areas in the city that need to be used for data prediction (as the observation space), quantizing the spatiotemporal data to obtain a set of spatiotemporal observation data sequences in the observation space, which includes multiple spatiotemporal observation data sequences as samples; each sample includes spatiotemporal observation data at a certain moment in the observation space and external environmental data. The spatiotemporal observation data sequences obtained above in the observation space constitute the time-segmented datasets for each region.
[0035] Among them, spatiotemporal observation data express Spatiotemporal data at any given moment can include traffic flow information within the observed spatial area; external environmental data. express External environmental data at any given moment may include timestamp information, weather, and the proportion of various modes of transportation within the observed spatial area.
[0036] The content of the sample may vary depending on the application area. For example, in applications that predict urban traffic flow data (such as average road speed) and detect anomalies in urban traffic flow data, the sample may include spatiotemporal observation data sequences of urban spatiotemporal systems.
[0037] For example, one sample corresponds to one time step, and each sample includes the average road speed of multiple roads at each time step. For instance, spatiotemporal data of areas in a city that need to be predicted can be collected, and the spatiotemporal data can be quantized to obtain time-segmented datasets for each area, that is, to obtain a spatiotemporal observation data sequence in the observation space.
[0038] Processed spatiotemporal observation data sequence set ,in It is used in subsequent steps such as the spatiotemporal Fourier expert hybrid network, the spatiotemporal Fourier attention mechanism module, and the diffusion model.
[0039] S2: Establish a spatiotemporal Fourier expert hybrid network, and extract the features of the spatiotemporal observation data sequences in the time domain, time-frequency domain, spatial domain, and spatial-frequency domain based on the obtained spatiotemporal observation data sequence set. This step may specifically include the following steps.
[0040] S2.1: Set up spatiotemporal observation data sequences Use a fully connected network Mapping into the feature space yields the embedded features. The embedded features at all time steps are merged into a spatiotemporal feature set to obtain the spatiotemporal feature set. , Total time step length of the data.
[0041] S2.2: Based on the obtained spatiotemporal feature set, time-domain features can be extracted, including the extraction of contextual autocorrelation features of the time series in the time domain. STF-MoE (Spatiotemporal Fourier Expert Hybrid Network) uses a basic 1D-CNN (One-Dimensional Convolutional Neural Network) to process each time series; the calculation process is as follows:
[0042] in, It is the kernel size of a 1D-CNN. It is the expansion factor. These are the convolution kernel parameters. This represents the index during convolution calculation, recording the current time position of the convolution kernel calculation. Representing time-domain features, Representing the spatiotemporal feature set exist Value at position, This represents the 1D-CNN convolution operation. Represents a spatiotemporal feature set. This represents the time step. This step's function is to learn the temporal periodic features of a given spatiotemporal data from a set of spatiotemporal features, within the time dimension.
[0043] S2.3: Based on the obtained spatiotemporal feature set, extract features in the time-frequency domain, including extracting the periodicity features of the time series in the time-frequency domain. By transforming the time series from the time domain to the frequency domain, the energy distribution of the time series at different frequencies can effectively reflect the main frequencies of the time series. In this step, filtering high-frequency information and retaining low-frequency information helps to identify and extract the main trends and periodicity of the time series; in addition, convolution in the time domain is equivalent to multiplication in the frequency domain, which can effectively improve computational efficiency.
[0044] set up This refers to the Discrete Fourier Transform (DFT). It is the Inverse Discrete Fourier Transform (IDFT).
[0045] The method for extracting features in the time-frequency domain is as follows: given time-domain data , Represents the position index of a complex space sequence. The length of the complex spatial sequence is represented by DFT and IDFT, respectively:
[0046] in, Indicates the middle value. It is a complex sequence in the time-frequency domain. Indicates frequency domain index, Represents the position index of a complex space sequence. It is the base of the natural logarithm. It is a plural unit. It is angular frequency.
[0047] In the frequency domain complex space, given a set of spatiotemporal features in the time domain After DFT transformation, a frequency domain complex sequence is obtained. Define the convolution kernel parameters , Representing the dimension of the feature space, Fourier temporal convolution is defined as:
[0048] in, It represents time-frequency domain features. Its main function is to learn the temporal and frequency characteristics in given spatiotemporal data from a spatiotemporal feature set. S2.4: Based on the obtained spatiotemporal feature set, extract features in the spatial domain. This includes extracting the dynamic connectivity relationships of spatial structures in the spatial domain.
[0049] STF-MoE uses basic graph convolution to process each spatiotemporal observation data sequence as follows: (4)
[0050] in, These are learnable parameters used to learn node embeddings; and These are the trainable parameters of graph convolution; It is a saturation factor used to increase the saturation of the activation function, and can be set to... , It is a spatial domain feature. This indicates that implicit spatial correlations are learned based on data fitting. Represents the hyperbolic tangent function. This represents a non-linear activation function.
[0051] S2.5: Based on the obtained spatiotemporal feature set, extract features in the spatial frequency domain. This includes extracting spatiotemporal sequences within a given spatial structure. Below, spatiotemporal feature set The total variation (TV) between adjacent nodes is small when they have similar time series, representing a low-frequency component in the spatial frequency domain. This indicates strong spatial correlation between nodes given a spatial structure. Conversely, a large TV represents a high-frequency component in the spatial frequency domain, indicating low spatial correlation between nodes given a spatial structure. Using spatial Fourier diagram convolution, by filtering high-frequency information and retaining low-frequency information, helps to identify and extract effective spatial correlations in spatiotemporal sequences.
[0052] First, based on the given spatial structure Calculate its regularized Laplacian matrix. : (5)
[0053] in, It is a diagonal matrix. For each item in the matrix, , For the row and column indices of the matrix, It is the identity matrix. Represents the largest eigenvalue of the Laplacian matrix. This is the median value.
[0054] Perform spectral decomposition on the regularized Laplacian matrix:
[0055] in, It is the eigenvector matrix. It is an eigenvalue matrix.
[0056] The graph Fourier transform is constructed as follows:
[0057] in, Represents the Fourier transform of the graph. This represents the inverse graph Fourier transform. This represents the data after the Fourier transform of the graph.
[0058] For spatiotemporal feature sets Construct Fourier plot convolution as follows:
[0059] in, Indicates the first Chebyshev polynomials This represents the order index of a Chebyshev polynomial. This represents the total order of the Chebyshev polynomial. It is the first Learnable parameters of the Chebyshev polynomial It is a spatial frequency domain characteristic.
[0060] This step may also include establishing an expert fusion module to perform expert fusion based on time-domain features, time-frequency domain features, spatial domain features, and space-frequency domain features to obtain fused features. This step treats time-domain features, time-frequency domain features, spatial domain features, and space-frequency domain features as four experts, respectively controlling the contextual autocorrelation features, temporal periodicity features, dynamic connectivity features, and spatial correlation features of spatiotemporal data. STF-MoE fuses these four types of features using a weighted summation method to obtain the fused features, calculated as follows:
[0061] in, , , and These are learnable parameters. This indicates the characteristics after mixing.
[0062] S3: Adaptive group normalization is used as a conditional fusion module to perform conditional fusion processing on the mixed features to obtain fused features.
[0063] When STF-MoE is used as a denoising network, conditional information needs to be fused. To fully integrate the input data and conditions, adaptive group normalization is used as the condition fusion module, and the calculation method is as follows:
[0064] in, Indicates fusion characteristics, This represents the adaptive group normalization function. This indicates a group normalization operation. This represents the scaling factor for the diffusion step. This represents the translation coefficient of the diffusion step. The scaling factor representing the conditional information. The translation coefficients represent the conditional information. This represents the diffusion step in the diffusion model. Indicates conditional information, and By respectively through diffusion steps and condition information Obtained by linear projection.
[0065] Among them, condition information External environment data sets The calculation method is as follows: , It is a perceptron network consisting of any number of fully connected layers.
[0066] The above-described conditional fusion method can more effectively utilize conditional information and accurately estimate noise. . This represents a noise estimation network for an arbitrary diffusion model. This indicates that by utilizing the forward diffusion process, in the original data The level has been increased to The data contains Gaussian noise. Noise is not added to external environment data; therefore, conditional information is not required during the forward and backward diffusion processes of the diffusion model. Unaffected by diffusion steps The impact.
[0067] S4: Establish a spatiotemporal Fourier attention mechanism module to perform spatiotemporal Fourier attention processing on the fused features to obtain the output features.
[0068] To enhance the correlation between mixed features and strengthen key information, a spatiotemporal Fourier attention mechanism module can be added to STF-MoE. In this process, the spatiotemporal Fourier attention mechanism module compresses the spatial and temporal dimensions into the same space and performs spatiotemporal Fourier attention processing on that space.
[0069] S4.1: First, time and space can be compressed into the same latent space. ,in, This function represents an array reshaping function, signifying a process of compressing time and space, that is, reducing the original dimensions of time and space. Compress to Dimensionality is used to reduce the dimensionality of data and improve computational efficiency.
[0070] S4.2: The fused features are processed using a fully connected layer to obtain the processed features. Furthermore, an attention mechanism and Discrete Fourier Transform are used to obtain the query, key, and value based on the fused features. The calculation method of the spacetime Fourier attention mechanism module is as follows:
[0071] in, , and These are the learnable parameters in the complex space. It is the length of the sequence after the spacetime Fourier transform. Indicates a fully connected layer. This represents the activation function. This represents the features after processing by the fully connected layer. Queries representing attention mechanisms Keys representing attention mechanisms The value represents the attention mechanism. Represents the convolution kernel parameters. Representing the original dimensions of time and space Compress to Dimensionality reduction, in order to reduce the dimensionality of data and improve computational efficiency. Represents the dimension of the feature space.
[0072] Since the output of formula (10) is Finally, the function is reshaped using a fully connected layer and an array. The operation restores the spatiotemporal dimensions to the original space, yielding the output features. ,Right now .
[0073] Alternatively, in another implementation, a multi-scale trend decomposition module can be established to perform multi-scale trend decomposition on the output features to obtain trend components. and residual components .
[0074] Optionally, a denoising network Given noisy data As input data, separating the noise and true patterns is crucial. Therefore, a multi-scale trend decomposition module is proposed to be added between each module in STF-MoE. This module extracts the trend components from the given input data using average pooling kernels of different sizes. Larger kernels focus more on overall trend information, while smaller kernels focus more on local details.
[0075] The multi-scale trend decomposition module performs multi-scale trend decomposition on the output features as follows: (11)
[0076] in, This represents the list of average pooling kernels, based on a time series. The hyperparameters of length variation, The index for the average pooling kernel. Indicates based on given input Adaptively obtain the average pooling kernel The corresponding contribution rate The features corresponding to the output of the previous module processed by the multi-scale trend decomposition module can be the spatiotemporal feature set output by the spatiotemporal data acquisition module. Fusion characteristics of spatiotemporal Fourier expert hybrid network output or output features of the spatiotemporal Fourier attention mechanism module . This indicates the extraction of information about the input. The trend component is a regular characteristic. This indicates the extraction of information about the input. The residual component is a noise feature. Using a multi-scale average pooling kernel is beneficial for focusing on the multi-scale regularity information of the input data. Indicates the average pooling kernel Average pooling operation.
[0077] like Figure 1 As shown, the multi-scale trend decomposition module can be combined with the spatiotemporal feature set output by the spatiotemporal data acquisition module. Fusion characteristics of spatiotemporal Fourier expert hybrid network output Output characteristics of the spatiotemporal Fourier attention mechanism module One or more of them work together to receive the output values from each module, that is, to respectively... , , As in formula (11) The input is only processed by the multi-scale trend decomposition module, and the output value is decomposed into trend components. and residual components Then, the trend component is used as the input to the next module, while the residual component is retained. Finally, the residual component is summed with the output result to obtain the final output result.
[0078] STF-MoE can output predictive noise. Used to improve the diffusion model's responsiveness to conditional information. Its integration capabilities.
[0079] S5: Build a diffusion model and train it to obtain a trained diffusion model.
[0080] In this implementation, a classifier-less conditional diffusion model with strong conditional control can be used for data generation. During this stage, a learnable noise estimation network can be established. The parameters used are Denoising network predicts the current time step Noisy data The noise level in, while with As conditional information in the denoising process, it enhances the guidance of the generation process.
[0081] The diffusion model is established as follows: (12)
[0082] in, Indicates parameters The parameterized probability distribution function is the inverse process of the diffusion model. Indicates conditional information, Indicates the first Noisy spatiotemporal data of each diffusion step, This represents the mean of the data after noise reduction. Indicates diffusion step The variance of the Gaussian distribution is usually It is a constant. Represents the normal distribution function. Indicates diffusion step Noise scheduling parameters, , , indicating an intermediate variable. Represents a noise estimation network. Indicates the diffusion step index for a uniform distribution. These are learnable parameters.
[0083] The above formula indicates that in the diffusion step According to noisy data and condition variables Estimate the next state The mean value, which is used for the forward diffusion process. This gradually generates data from the noise. Specifically, first, a noise estimation network... Based on the current diffusion step input Noisy data and condition variables Predict the noise; then use the noisy data from the current time step. Subtract the scaled prediction noise from the result and rescale the result using the scaling parameter to obtain the mean.
[0084] During generation, it can be obtained from pure Gaussian noise. Initially, conditional distributions are applied step by step for sampling, ultimately resulting in denoised data. .
[0085] The loss function used to train the denoising network for establishing the diffusion model is: (13) in, Represents real noise. This represents the final denoised data after diffusion step 0. This represents the expected value.
[0086] The network can be trained using the loss function described above, and its parameters can be updated by minimizing the loss using gradient descent. This is to predict, as accurately as possible, the actual noise added to the data during the forward pass, thereby enabling conditional data generation.
[0087] The diffusion model process starts with real data. In the middle, based on the formula Increase the level to Gaussian noise was used to obtain noisy data. And record the added noise. Used for subsequent calculation of the loss function, and also based on external environmental data. Calculation condition information Then, a denoising network is used. Predicted in The noise content is increased, and formula (13) is used as the loss function, with the aim of making the denoising network able to process only the noisy data. and condition information Increased noise can be predicted. The denoising network can be trained using the loss function described above, resulting in a pre-trained denoising network. The network parameters can be updated by minimizing this loss using gradient descent. This is to predict, as accurately as possible, the actual noise added to the data during the forward pass, thereby enabling conditional data generation.
[0088] The denoising network can be trained using the above loss function to obtain a pre-trained denoising network.
[0089] S6: Sampling yields spatiotemporal data, which is then input into a trained diffusion model to extract causal patterns. These extracted causal patterns can be used for tasks such as urban traffic flow prediction, analysis of average road speed change trends, identification of sudden congestion, detection of traffic anomalies, urban traffic control, and simulation of future traffic operations. They can also be used to support intelligent transportation platforms, traffic operation monitoring systems, and urban traffic digital twin systems.
[0090] During the generation process, external environmental data can be used. From random noise Spatiotemporal data is generated through progressive sampling, and a denoising diffusion implicit model (DDIM) is used as an accelerated sampler.
[0091] Based on formula (1), it can be seen that observation generation only requires the use of conditional information. Simulates the causal laws of system evolution under normal conditions to ensure that the generated results conform to the physical laws of the real world, such as population travel patterns, under specific external environmental data. The travel demand of people will decrease under certain circumstances, such as on rainy days.
[0092] Alternatively, the sampling process is as follows: (14) in, This represents the data prediction function. Indicates the diffusion time step Denoising data.
[0093] in, This can be considered as a diffusion step Below, to The estimate is used to iteratively derive the above formula until the result is obtained. This is the generated result. Due to conditional information... This affected the direction of the diffusion model, therefore, by changing... Different generation results can be obtained.
[0094] According to another embodiment of the present invention, a spatiotemporal data pattern extraction system based on spatiotemporal Fourier expert mixture is provided. The method for performing the above embodiment may include: a spatiotemporal data acquisition module for acquiring historical data information and performing preprocessing; a spatiotemporal Fourier expert mixture network for extracting features of spatiotemporal observation data sequences in the time domain, time-frequency domain, spatial domain, and space-frequency domain based on a set of spatiotemporal observation data sequences, and performing expert mixture to obtain mixed features; a conditional fusion module for performing conditional fusion processing on the mixed features to obtain fused features; a spatiotemporal Fourier attention mechanism module for performing spatiotemporal Fourier attention processing on the fused features to obtain output features; a diffusion model module for combining a noise estimation network to perform back-diffusion on noisy data based on the output features to obtain predicted denoised data; and a sampling module for sampling spatiotemporal data, inputting it into a trained diffusion model, and obtaining the extracted causal patterns for urban traffic flow prediction. Optionally, a diffusion model module training module may also be included for training the diffusion model to obtain a trained diffusion model.
[0095] Example 1 To better understand the present invention, the following describes Example 1 of the spatiotemporal data pattern extraction method based on spatiotemporal Fourier expert mixture provided by the present invention.
[0096] In Example 1, the method is illustrated using the outbound travel flow data generated from October 13th to 27th, 2022 (a total of 14 days) in the Financial Street area of Xicheng District, Beijing. Figure 1 As shown, under the condition of observable control signals, the spatiotemporal Fourier expert hybrid network can accurately capture the dynamic evolution patterns in spatiotemporal data as well as the temporal periodicity and spatial correlation characteristics of the spatiotemporal sequence itself, so that the generated results have very obvious periodicity and regularity.
[0097] To demonstrate the responsiveness of this implementation method to control signals, in Figure 2 The first row displays the raw traffic flow data for the Financial Street area of Xicheng District, Beijing, from May 1st to 7th, 2022, and October 1st to 7th, 2022, a total of 14 days. In Example 1, the time information is set to rest days, and only this control signal is used as the generation condition to continuously generate 14 days of sequence data. The generation result is as follows. Figure 2 As shown in the second row, by comparing the generated results of Example 1 with the original data, it can be seen that the traffic flow during rest days exhibits a single-peak characteristic, and the method of Example 1 can accurately respond to the impact of time information on the final traffic flow. Figures 2 to 4 In the graph, the vertical axis represents traffic flow, and the horizontal axis represents time.
[0098] To verify the model's deductive reasoning in an open environment, Example 1 uses real traffic flow data from October 13th to 27th, 2022 (14 days) in the Financial Street area of Xicheng District, Beijing, to construct three sets of generative experiments. The visualization results are shown below. Figure 3 As shown. First, for the deductive reasoning related to traffic control, the operation of reducing traffic speed during the evening rush hour is executed. Based on given real traffic flow data, the changes in traffic flow during the evening rush hour when traffic speed decreases are simulated. The generation results of Example 1 are as follows. Figure 3 As shown in the second line, traffic flow increases significantly during the evening rush hour, indicating that, under the condition that other external environmental conditions remain unchanged, traffic speed and traffic flow have a clear negative causal relationship.
[0099] Secondly, for the deductive reasoning related to travel structure, the operation of increasing the proportion of bicycle traffic was performed to simulate the impact of changing the travel structure on the final traffic flow under the condition that the total traffic volume remains unchanged. The generated results of Example 1 are as follows: Figure 3 As shown in the third line, since most motor vehicle traffic is commuter traffic, exhibiting a clear morning and evening peak pattern, while bicycle traffic is mostly random, under the condition that the total traffic volume remains unchanged, increasing the proportion of bicycle traffic will lead to a decrease in motor vehicle traffic, which in turn will lead to an increase in the proportion of random traffic flow and a decrease in the proportion of regular commuter traffic flow.
[0100] Finally, for the deductive reasoning related to changes in the external environment, the operation of changing the weather to rain is performed to simulate the impact of the external environment on the final traffic flow, generating the following results: Figure 3 As shown in the fourth line, weather directly affects traffic demand, which in turn directly affects traffic flow for various modes of transportation. Therefore, when the weather changes to rain, it leads to a compression and proportional decrease in traffic flow throughout the day, with strong overall fluctuations in flow. Compared to traditional spatiotemporal data generation methods, the method in Example 1 maintains both "causal rationality" and "environmental authenticity" in the generated results, and the generated results conform to basic common sense.
[0101] All of the above-mentioned optional technical solutions can be combined in any way to form optional embodiments of the present invention, and will not be described in detail here.
[0102] In the description of this application, it should be understood that if terms such as "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential" appear, these terms indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.
[0103] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order and method of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0104] It should be understood that the foregoing only illustrates some embodiments, and changes, modifications, additions, and / or variations can be made without departing from the scope and spirit of the disclosed embodiments. These embodiments are illustrative and not restrictive. Furthermore, the described embodiments relate to those currently considered most practical and preferred, and should be understood as not being limited to the disclosed embodiments, but rather intended to cover different modifications and equivalent arrangements included within the spirit and scope of those embodiments. Moreover, the various embodiments described above can be used in conjunction with other embodiments; for example, an aspect of one embodiment can be combined with an aspect of another embodiment to achieve yet another embodiment. Additionally, individual features or components of any given component can constitute another embodiment.
[0105] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the claims and specification of the present invention.
Claims
1. A spatiotemporal data pattern extraction method based on spatiotemporal Fourier expert mixture, characterized in that, Used for urban traffic flow prediction, including: S1: Spatiotemporal data acquisition module, which acquires historical data information, including collecting historical spatiotemporal data of the area to be predicted in the city, quantifying the historical spatiotemporal data to obtain a set of spatiotemporal observation data sequences in the observation space, including multiple spatiotemporal observation data sequences as samples; each sample includes spatiotemporal observation data at a certain moment in the observation space and external environmental data; among which, the spatiotemporal observation data includes traffic flow information of the area to be predicted; the external environmental data represents external environmental data, including timestamp information, weather, and the proportion of various modes of transportation within the observation space area; S2: Establish a spatiotemporal Fourier expert hybrid network to extract features of spatiotemporal observation data sequences in the time domain, time-frequency domain, spatial domain, and space-frequency domain based on spatiotemporal observation data sequence sets, obtaining time domain features, time-frequency domain features, spatial domain features, and space-frequency domain features; and perform expert hybridization of time domain features, time-frequency domain features, spatial domain features, and space-frequency domain features to obtain hybrid features; S3: Adaptive group normalization is used as a conditional fusion module to perform conditional fusion processing on the mixed features to obtain fused features; S4: Establish a spatiotemporal Fourier attention mechanism module to perform spatiotemporal Fourier attention processing on the fused features to obtain the output features; S5: Establish a diffusion model to combine with a noise estimation network, perform back-diffusion on noisy data based on output features to obtain predicted denoised data, and train the model to obtain a trained diffusion model. S6: Sampling obtains spatiotemporal data, which is input into a trained diffusion model to extract causal patterns, which are then used in urban traffic flow prediction and control processes.
2. The spatiotemporal data pattern extraction method based on spatiotemporal Fourier expert mixture according to claim 1, characterized in that, It also includes: establishing a multi-scale trend decomposition module, which is used to cooperate with one or more of the spatiotemporal data acquisition module, the spatiotemporal Fourier expert hybrid network and the spatiotemporal Fourier attention mechanism module respectively, receiving their output results as input, and performing multi-scale trend decomposition to obtain trend components and residual components respectively, using each trend component as input to the next module, and retaining the residual components for noise estimation network in the diffusion model.
3. The spatiotemporal data pattern extraction method based on spatiotemporal Fourier expert mixture according to claim 2, characterized in that, The multi-scale trend decomposition module performs multi-scale trend decomposition on the received input in the following way: in, This indicates the extraction of information about the input. The trend component, This indicates the extraction of information about the input. The residual components, This represents the list of average pooling kernels. The index for the average pooling kernel. Indicates based on received input Adaptive calculation of average pooling kernel The corresponding contribution rate The input received from the previous module is based on the multi-scale trend decomposition module. Indicates the average pooling kernel Average pooling operation.
4. The spatiotemporal data pattern extraction method based on spatiotemporal Fourier expert mixture according to claim 1, characterized in that, S2 include: S2.1: Map the spatiotemporal observation data sequence set to the feature space using a fully connected network to obtain embedded features. Merge the embedded features at all time steps into a spatiotemporal feature set to obtain the spatiotemporal feature set. S2.2: Based on the spatiotemporal feature set, a one-dimensional convolutional neural network is used to extract features in the time domain, including extracting the contextual autocorrelation features of time series in the time domain; S2.3: Based on the spatiotemporal feature set, extract features in the time-frequency domain, including extracting the periodic features of the time series in the time-frequency domain, where high-frequency information is filtered and low-frequency information is retained, in order to identify and extract the trend and periodicity of the time series; S2.4: Based on the spatiotemporal feature set, extract features of the spatial domain, including extracting the dynamic connection relationship of spatial structure in the spatial domain, where basic graph convolution is used to process each spatiotemporal observation data sequence; S2.5: Based on the spatiotemporal feature set, extract features in the spatial frequency domain, including extracting the total variation between spatiotemporal observation data sequences under a given spatial structure. Among these features, spatial Fourier diagram convolution is used to filter high-frequency information while retaining low-frequency information, which is used to identify and extract effective spatial correlations in the spatiotemporal sequences.
5. The spatiotemporal data pattern extraction method based on spatiotemporal Fourier expert mixture according to claim 1, characterized in that, S2 also includes: establishing an expert hybrid module, which treats time-domain features, time-frequency domain features, spatial domain features, and space-frequency domain features as four experts that respectively control the contextual autocorrelation features, temporal periodicity features, dynamic connectivity features, and spatial correlation features of spatiotemporal data, and performs expert hybridization using a weighted summation method to obtain the hybrid features.
6. The spatiotemporal data pattern extraction method based on spatiotemporal Fourier expert mixture according to claim 1, characterized in that, S4 include: S4.1: Use the array reshaping function to compress the spatial and temporal dimensions of the fused features into the same space; S4.2: Use a fully connected layer to process the fused features to obtain the fully connected layer processed features, and use an attention mechanism and discrete Fourier transform to obtain the query, key and value of the attention mechanism based on the fused features; Based on the features processed by the fully connected layer, and the queries, keys, and values of the attention mechanism, the spatiotemporal dimensions are restored to the original space through the array reshaping function to obtain the output features.
7. The spatiotemporal data pattern extraction method based on spatiotemporal Fourier expert mixture according to claim 1, characterized in that, The diffusion model in S5 is as follows: in, This represents the mean of the data after noise reduction. For learnable parameters, Indicates parameters The parameterized probability distribution function, Represents a noise estimation network. Indicates the first Noisy spatiotemporal data of each diffusion step, Indicates conditional information, Indicates diffusion step The variance of the Gaussian distribution, Represents the normal distribution function. Indicates diffusion step Noise scheduling parameters, Indicates intermediate variables. The index represents the diffusion step of a uniform distribution. This represents the total number of diffusion steps.
Citation Information
Patent Citations
Urban resident travel rule rapid extraction method suitable for high-concurrency travel data
CN113674122A