A spatiotemporal missing data imputation method and system based on context association and physical guidance
By employing a spatiotemporal missing data imputation method based on multivariate graph convolutional networks, self-attention mechanisms, and physical constraints, the problems of high missing rate and multi-scale dependence in marine data are solved, achieving more accurate and consistent data imputation.
Patent Information
- Application Number
- CN202511156963.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-19
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-08-19
AI Technical Summary
Existing marine data interpolation methods suffer from problems such as insufficient correlation of single variables, simplistic spatial modeling, and lack of physical constraints when dealing with high missing rates and multi-scale dependencies, leading to inaccurate and inconsistent interpolation results.
We employ a spatiotemporal missing-filling method based on context association and physical guidance. We extract spatiotemporal dependencies through a multivariate graph convolutional network, combine Gaussian noise diffusion and dual-view spatiotemporal association, introduce a self-attention mechanism and physical constraints, and use a joint loss function to optimize the model.
It improves the accuracy and consistency of marine data interpolation, enhances the ability to model multivariate data correlation, improves the expressive power of multi-scale spatial structures, and increases the physical reliability of interpolation results.
Smart Images

Figure CN120653903B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ocean data interpolation and filling, and in particular to a method and system for filling spatiotemporal gaps based on context association and physical guidance. Background Art
[0002] Data preparation is fundamental to large-scale data analysis and modeling, directly impacting the quality of model training and the reliability of analytical results. Handling missing values is one of the most challenging tasks. With the advancement of sensor technology and automated equipment, massive amounts of raw data are being used in a wide range of fields, including transportation, the environment, urban management, and climate simulation. However, due to uncontrollable factors such as sensor failure, signal interference, and human intervention, data gaps often occur.
[0003] In ocean modeling, the absence of dissolved oxygen not only affects the modeling of spatial distribution and temporal variation but also weakens the reconstruction of coupled relationships between key variables such as temperature and salinity. In particular, in data-driven methods such as deep learning, incomplete data can reduce the model's expressiveness and generalization capabilities, leading to increased prediction errors, failures in anomaly detection, clustering bias, and other issues, compromising overall decision-making quality.
[0004] To address these issues, recent research has gradually shifted from traditional static interpolation methods (such as mean filling and forward filling) to a dynamic modeling paradigm. This emphasizes leveraging the inherent structural characteristics of dissolved oxygen data, particularly the spatiotemporal dependencies between ocean variables, to rationally infer and reconstruct missing dissolved oxygen information. Within the context of large-scale ocean spatiotemporal data modeling, researchers have introduced methods such as graph neural networks and time series deep models to construct a temporal evolution modeling framework and spatial topological expression mechanisms, improving the integrity and accuracy of dissolved oxygen data.
[0005] For example, some studies have incorporated the geographic distances between sensor nodes into the modeling process by constructing graph structures, forming a graph-based spatiotemporal interpolation network. Other approaches have also introduced attention mechanisms such as the Transformer to dynamically learn the influence weights of important observation points in different time windows on the currently missing data, thereby implementing strategies for completing missing dissolved oxygen data. The introduction of these methods has not only significantly improved the accuracy of dissolved oxygen data reconstruction but also enhanced the model's ability to identify and robustly detect anomalous ocean patterns.
[0006] In general, existing filling methods mainly focus on exploring the temporal dependence and spatial correlation in seawater dissolved oxygen data to achieve reasonable estimation of missing data. However, the following outstanding issues remain unresolved:
[0007] 1) High missing data rates and insufficient correlation between single variables: Due to limited observation conditions, the missing data rate for dissolved oxygen in deep ocean or remote areas often exceeds 90%. In such high-missing scenarios, relying solely on the data for modeling makes it difficult to effectively extract spatiotemporal correlations, and insufficient information can easily affect interpolation accuracy and stability.
[0008] 2) Single-scale spatial modeling makes it difficult to express multi-scale dependencies: Most methods rely on single-scale modeling, making it difficult to reveal potential connections between local and larger areas. In reality, dissolved oxygen distribution is influenced by both local processes and macro-scale factors such as ocean current transport. This lack of multi-scale representation limits the model's ability to extract broad-area features and robustly interpolate.
[0009] 3) Lack of physical constraints can easily lead to deviations from true patterns: Traditional interpolation methods are often data-driven, ignoring the constraints of partial differential equations in the ocean, such as the convection-diffusion equation, which govern dynamics and thermodynamics. This lack of physical constraints can lead to interpolation results that, while numerically close to observations, violate the true coupling relationships between variables, reducing scientific interpretability and credibility. Summary of the Invention
[0010] In order to solve the above-mentioned problems, the present invention provides a method and system for filling spatiotemporal gaps based on context association and physical guidance.
[0011] In a first aspect, the present invention provides a method for filling spatiotemporal gaps based on context association and physical guidance, which adopts the following technical solutions:
[0012] A spatiotemporal gap filling method based on context association and physical guidance, comprising:
[0013] Obtain seawater dissolved oxygen data and contextual data;
[0014] Extract multivariate spatiotemporal dependencies based on acquired seawater dissolved oxygen data and contextual data;
[0015] Gaussian noise diffusion is performed based on the obtained seawater dissolved oxygen data;
[0016] Noise prediction based on dual-view spatiotemporal correlation;
[0017] Constrain the prediction error based on a joint loss function.
[0018] Furthermore, the multivariate spatiotemporal dependency extraction based on the acquired seawater dissolved oxygen data and contextual data includes introducing a graph convolutional network (GCN) based on multiple ocean variables to jointly model the ocean multivariate data. First, a Gaussian kernel function is used to calculate the similarity of geographically distributed nodes. in, Indicates in Layer Node and The Euclidean distance between nodes, is the scale parameter of the Gaussian kernel function, and the similarity matrix is sparsely operated to obtain the corresponding adjacency matrix ,
[0019] in is the similarity threshold parameter,
[0020] Finally, GCN is used to learn the correlation between seawater dissolved oxygen data and its ocean context data ,in, Indicates the The embedding representation of the layer, is the number of all nodes, It is The embedding dimension of the layer, is the ReLU activation function, is a learnable weight matrix.
[0021] Furthermore, the multivariate spatiotemporal dependency extraction based on the acquired seawater dissolved oxygen data and contextual data also includes adopting a hierarchical aggregation and regional mapping mechanism to extract embedding features at different spatial scales layer by layer to achieve spatial dependency modeling from local to global, wherein a regional mapping matrix is generated based on regional embedding. , which is used to transform the embedding features of the previous layer to generate a larger-scale embedding representation in the next layer. The hierarchical aggregation method is:
[0022] ,
[0023] Indicates the Layer adjacency matrix The normalized Laplace matrix of Indicates the The number of nodes in the layer, is the regional embedding representation of this layer, is the weight matrix, is the bias term, Indicates the The region mapping matrix of the layer, and then the region embedding from the previous layer is further propagated to the next layer through the region mapping matrix to generate a new larger-scale region-level embedding and adjacency matrix , and Respectively represent The number of nodes in the layer and the embedding dimension; the multi-scale spatial embedding and region mapping matrix obtained by aggregating GCN Multiply them so that the aggregated matrix is consistent in dimension with the previous layer. The multi-scale graph convolution operation is expressed as:
[0024]
[0025] in Represents multi-scale graph convolution in The output of the layer.
[0026] Furthermore, the multivariate spatiotemporal dependency extraction based on the acquired seawater dissolved oxygen data and contextual data also includes introducing an attention fusion mechanism to dynamically weighted integrate the features learned from multivariate association and multiscale association, and establish a dependency relationship between local and regional regions, which can be expressed as:
[0027] ,
[0028] in, and Represent the first The attention weights of the layers, and They represent the number of layers of the multivariate association learning module and the multi-scale association learning module respectively. The attention weight calculation is expressed as:
[0029]
[0030] in and are the shared weight matrices and bias terms.
[0031] Furthermore, the multivariate spatiotemporal dependency extraction based on the acquired seawater dissolved oxygen data and contextual data also includes introducing a self-attention mechanism to capture the correlation between different spatial positions, constructing a dynamic graph structure at each time point, extracting spatial structural features through graph convolution, and finally fusing the multi-moment graph convolution results within a time window to obtain global spatiotemporal correlation features, which can be expressed as:
[0032]
[0033] in, , is the dissolved oxygen data of seawater; Construct a dynamic graph structure for each time point in the same time window, and calculate the adjacency matrix at each time point in the same time window. and Perform graph convolution and add the graph convolution results at each time point to obtain the correlation matrix at all time points:
[0034]
[0035] in To capture the global spatiotemporal correlation features, Indicates the length of a time window.
[0036] Furthermore, the Gaussian noise diffusion is performed based on the acquired seawater dissolved oxygen data and context data, including using a diffusion probability model to perform forward diffusion and reverse diffusion on the extracted data respectively, wherein the diffusion process is expressed as:
[0037]
[0038] in, Indicates that from the initial state To The joint probability distribution of the steps, From step 1 to step All states of the step; According to the chain rule, the joint probability is decomposed into the product of the conditional probabilities of each step, represents a Gaussian distribution with variance , where the scaling factor Control the degree of noise added; It is the unit matrix, indicating that independent and identically distributed noise is added to all feature dimensions. Noise is gradually added to the original data in a recursive manner, and finally it is completely converted into Gaussian noise, so that the back diffusion process gradually restores the original data.
[0039] Furthermore, the noise prediction based on dual-view spatiotemporal correlation includes fusing the spatiotemporal correlation features of the global and local perspectives to construct a dual-view feature matrix, achieving feature aggregation in the temporal dimension through an attention mechanism, and achieving information propagation in the spatial dimension through a dynamic graph convolutional network. The noise removal process is expressed as:
[0040]
[0041] in For the t Step noisy data, For the t- 1 step data, is the noise holding factor, is a standard Gaussian noise vector; the global spatiotemporal correlation view and the local spatiotemporal correlation view are merged to form a new dual-view correlation feature matrix :
[0042] , then, Used as input to the spatiotemporal transfer module in the noise prediction module,
[0043] Time transfer is expressed as:
[0044]
[0045] in, represents the output of the time transfer mechanism, is the corresponding attention weight; spatial transfer is expressed as:
[0046]
[0047] in for and The adjacency matrix of the result after addition.
[0048] Furthermore, the noise prediction based on the dual-view spatiotemporal correlation includes the output of the time transfer mechanism Feed it into the GCN layer for feature aggregation and enhance the representation of spatial dependencies between adjacent nodes:
[0049]
[0050] in Represents the adjacency matrix built based on geographic distance, and finally outputs and After a multi-layer perceptron it is represented as:
[0051]
[0052] in, represents a gated activation unit, and All are weight coefficients It is the output of the first layer of the noise prediction module. By stacking multiple noise prediction modules and combining convolution operations, the final interpolation result is generated. :
[0053]
[0054] in, represents the noise prediction module, represents the number of layers of the noise prediction module, is the final interpolation result.
[0055] Furthermore, the prediction error constrained based on the joint loss function includes introducing a joint loss function, combining the mean square error and the mean absolute error, and comprehensively constraining the prediction error of the model in the process of recovering data. The joint loss function is defined as:
[0056]
[0057] in, is the interpolation result, is the true value, and As the weight control factor, a physical consistency loss function based on partial differential equations is introduced as a regularization term. The prediction results are constrained to meet the control equation of convection-diffusion balance to maintain the physical coupling structure between variables. The predicted value of dissolved oxygen output by the model is The optimization is performed by calculating the loss, which is expressed as:
[0058]
[0059] in, is the seawater velocity, is the diffusion coefficient, and are the first and second derivatives of the dissolved oxygen filling results, represents other ocean changes associated with dissolved oxygen, Indicates the filling result, and finally, and Combined, it serves as the overall training loss to guide the model training process.
[0060] The second aspect is a spatiotemporal gap filling system based on context association and physical guidance, including:
[0061] The data acquisition module is configured to acquire seawater dissolved oxygen data and context data;
[0062] The extraction module is configured to perform multivariate spatiotemporal dependency extraction based on the acquired seawater dissolved oxygen data and contextual data;
[0063] The diffusion module is configured to perform Gaussian noise diffusion based on the acquired seawater dissolved oxygen data;
[0064] The prediction module is configured to perform noise prediction based on dual-view spatiotemporal correlation;
[0065] The constraint module is configured to constrain the prediction error based on the joint loss function.
[0066] In a third aspect, the present invention provides a computer-readable storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor of a terminal device, a method for filling spatiotemporal gaps based on context association and physical guidance.
[0067] In a fourth aspect, the present invention provides a terminal device comprising a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; and the computer-readable storage medium is used to store multiple instructions, wherein the instructions are suitable for being loaded and executed by the processor to implement the method for filling spatiotemporal gaps based on context association and physical guidance.
[0068] In summary, the present invention has the following beneficial technical effects:
[0069] In order to improve the accuracy and rationality of interpolation of seawater dissolved oxygen data under high missing rate conditions, the present invention proposes a spatiotemporal missing value filling method based on contextual association perception and physical guidance. Existing missing value filling methods mainly capture the spatiotemporal associations under a single data source, and it is difficult to characterize the interdependence between multiple variables in the marine environment. They are often limited to modeling at a single spatial scale and lack the ability to characterize the spatiotemporal dependencies of different scales. In addition, existing methods generally do not introduce physical constraint mechanisms, which can easily cause the interpolation results to deviate from the true physical relationship between variables. The present invention has made systematic innovations in structural design and constraint mechanisms, and its beneficial effects include:
[0070] 1) Enhanced multivariate data correlation modeling capabilities
[0071] The present invention introduces a multivariate joint modeling mechanism to fully integrate the characteristic relationship between dissolved oxygen and its related environmental variables (such as temperature, salinity, flow rate, etc.) when constructing the graph structure, thereby overcoming the problem of insufficient information in single-variable modeling, improving the model's ability to characterize spatiotemporal dependency structures, and helping to more accurately recover missing data.
[0072] 2) Improved the modeling and expression capabilities of multi-scale spatial structures
[0073] This paper designs a multi-scale region mapping mechanism that supports feature aggregation and dependency modeling at different spatial levels. By integrating information hierarchically from the node level to the region level, it enables the collaborative modeling of local disturbances and large-scale patterns, enhancing the model's adaptability to complex multi-scale structures.
[0074] 3) Improved physical consistency of interpolation results
[0075] This paper introduces a physical consistency constraint mechanism based on partial differential equations during model training, ensuring that the model output is more consistent with the physical coupling laws between variables in the marine environment. This constraint effectively suppresses potential non-physical fluctuations in the interpolation results, enhancing their physical credibility and interpretability, and providing a more reliable data foundation for subsequent scientific analysis and process modeling. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] Figure 1 It is the overall flow chart of the present invention.
[0077] Figure 2 This is a flow chart of the multivariate spatiotemporal dependency extraction module in step 1 of the present invention.
[0078] Figure 3 This is a module flow chart of step 2 and step 3 of the present invention.
[0079] Figure 4 This is a flow chart of the model training module for physical guidance in step 4 of the present invention.
[0080] Figure 5 This is the result of the sensitivity experiment of the sea parameters in northeastern Japan. Figure 5 (a) shows the impact of different embedding dimensions on the filling performance of the northeastern sea of Japan. Figure 5 (b) shows the effect of different diffusion step sizes on the filling performance of the northeastern sea of Japan. Figure 5 (c) in the figure shows the effect of different numbers of attention heads on the filling performance of the northeastern sea of Japan.
[0081] Figure 6 This is the result of the North Atlantic Ocean parameter sensitivity experiment of the present invention. Figure 6 (a) shows the impact of different embedding dimensions on the filling performance of the North Atlantic Ocean. Figure 6 (b) shows the effect of different diffusion step sizes on the filling performance of the North Atlantic Ocean. Figure 6 (c) shows the effect of different numbers of attention heads on the filling performance of the North Atlantic Ocean. DETAILED DESCRIPTION
[0082] The present invention will be further described in detail below with reference to the accompanying drawings.
[0083] Example 1
[0084] Reference Figure 1 , a spatiotemporal gap filling method based on context association and physical guidance in this embodiment includes:
[0085] Figure 1 This paper presents the overall flow chart for imputing missing values for seawater dissolved oxygen using the proposed method for spatiotemporal missing value imputation based on contextual association perception and physical guidance. The overall process is divided into four parts: (1) multivariate spatiotemporal dependency extraction; (2) Gaussian noise diffusion; (3) noise prediction based on dual-view spatiotemporal correlation; and (4) physical guidance model training. These four parts are described in detail below.
[0086] This embodiment first needs to obtain seawater dissolved oxygen data and other ocean context data related to dissolved oxygen, including seawater temperature and seawater salinity data.
[0087] S1. Multivariate spatiotemporal dependency extraction
[0088] S1.1 Multivariate Association Learning
[0089] When processing marine environmental monitoring data, different variables (such as temperature, salinity, dissolved oxygen, and nutrients) often exhibit highly complex spatiotemporal coupling. To fully explore the potential relationships between these variables and improve the ability to reconstruct missing data, this step introduces Graph Convolutional Networks (GCNs) based on multiple marine variables to jointly model marine multivariate data.
[0090] Graph convolution is essentially a mechanism for propagating and aggregating features across a graph structure. By performing graph convolution on a constructed multivariate correlation graph, edges can be established between different variables, enabling cross-variable information exchange. This feature propagation mechanism allows each node (i.e., the observation value of a variable at a specific time or spatial location) to not only retain its own feature information but also aggregate information from its neighbors. This is particularly important for marine data scenarios, where data collection is often subject to missing measurements, delays, or sensor failures. This is particularly true in offshore and deep-sea environments, where large spatial distances between observation points and high sensing costs significantly increase the rate of missing data. By introducing the GCN model, we can effectively model intervariate dependencies and use variables with observed values to complete missing variables. For example, when single seawater dissolved oxygen data is inherently sparse and lacks spatiotemporal correlation, GCN significantly enhances the learnability and expressiveness of features by aggregating and propagating highly correlated features across multiple variables. This alleviates the problem of insufficient information in feature dimensions and improves the accuracy and robustness of interpolation.
[0091] To achieve the above goals, we use the Gaussian kernel function to calculate the similarity of geographically distributed nodes. The calculation formula is as follows:
[0092] (1)
[0093] in, Indicates in Layer Node and The Euclidean distance between nodes, is the scale parameter of the Gaussian kernel function. It should be noted that It includes not only the Euclidean distance between different nodes within the dissolved oxygen data, but also the distance between the nodes of the dissolved oxygen data and other ocean context data. Then, we perform a sparse operation on the similarity matrix to obtain the corresponding adjacency matrix .
[0094] (2)
[0095] in is the similarity threshold parameter.
[0096] Subsequently, we apply multi-ocean variable enhanced GCN to learn the correlation between seawater dissolved oxygen data and its ocean context data, thereby actively aggregating a large number of similar features from multiple data sources to alleviate the feature insufficiency problem caused by the sparsity of single target data.
[0097] (3)
[0098] in, Indicates the The embedding representation of the layer, is the number of all nodes, It is The embedding dimension of the layer, is the ReLU activation function, is a learnable weight matrix. Initially, the ocean multivariate spatiotemporal data with mask As input, that is .
[0099] S1.2 Multi-scale Association Learning
[0100] This step introduces a multi-scale association learning module and adopts a hierarchical aggregation and regional mapping mechanism to extract embedded features at different spatial scales layer by layer, thereby realizing spatial dependency modeling from local to global and enhancing the model's ability to express cross-regional coupling relationships and complex ocean structures.
[0101] In order to establish cross-scale spatial correlation, we use hierarchical aggregation to integrate different regions. Specifically, we first generate a region mapping matrix based on region embedding , which is used to transform the embedding features of the previous layer to generate larger-scale embedding representations in the next layer. These new embeddings not only incorporate correlation features between multiple scales, but also reflect a wider range of inter-regional correlations, thus providing a more comprehensive perspective for modeling spatial dependencies. The hierarchical aggregation method is as follows:
[0102] (4)
[0103] in, Indicates the first Layer adjacency matrix The normalized Laplace matrix of Indicates the The number of nodes in the layer, is the regional embedding representation of this layer, is the weight matrix, is the bias term. Indicates the The region mapping matrix of the layer. Assume that In the layer, the mapping is obtained new nodes, then there are Initially, the output from the multivariate learning module is Used as , and the corresponding adjacency matrix Used as .
[0104] The region embeddings from the previous layer are then further propagated to the next layer through the region mapping matrix, generating new, larger-scale region-level embeddings and adjacency matrices:
[0105] (5)
[0106] in, , and Respectively represent The number of nodes and embedding dimensions in the layer. After mapping, The region embedding generated in the layer is , the corresponding adjacency matrix is The initial embedding represents the node-level features of smaller granularity, which is then transformed into the node-level features after the region mapping matrix After propagation, these embeddings are mapped to The larger scale regions in the layer are embedded.
[0107] By aggregating the multi-scale spatial embedding obtained by GCN and the region mapping matrix Multiplication can make the aggregated matrix consistent with the previous layer in terms of dimension. In addition, It helps to selectively aggregate information from the previous layer, retaining key structural features while reducing the dimension, thereby achieving efficient propagation of embedded features in the network. The multi-scale graph convolution operation can be formally expressed as follows:
[0108] (6)
[0109] in Represents multi-scale graph convolution in The output of the layer.
[0110] In the multiscale association learning module, the correlation of multivariate ocean data is further refined through multiscale spatial correlation mapping. From the perspective of variable correlation, this module extracts joint features between multiple ocean variables (such as temperature, salinity, and current velocity) at different spatial scales, thereby refining information about high-order inter-regional correlations. This multiscale structure not only captures variable coupling within local regions but also identifies implicit dependencies across longer distances, providing more robust contextual support for missing data during interpolation. From the perspective of perceptual scope, this module employs a hierarchical spatial aggregation strategy. By constructing a regional mapping matrix, each layer aggregates the nodes of the previous layer into a higher-level regional representation. As the number of model layers increases, the perceptual scope expands, achieving layer-by-layer information fusion from local to global. This design avoids the reliance on large convolution kernels or fixed neighborhood windows in traditional convolutional neural networks, effectively improving the ability to model multiscale spatial structures while keeping the number of model parameters manageable.
[0111] S1.3 Local Dependency Awareness
[0112] This step introduces an attention fusion mechanism to dynamically weight and integrate the features learned from multivariate association and multi-scale association, establishing a dependency relationship between local and regional areas, thereby improving the model's ability to recover missing dissolved oxygen values and spatial consistency under complex spatial structures.
[0113] After multivariate and multiscale correlation learning, we obtain multivariate and multiscale correlations. In order to effectively integrate these correlations and establish local dependencies, we use the attention mechanism to fuse these correlations:
[0114] (7)
[0115] in, and Represent the first The attention weights of the layers, and They represent the number of layers of the multivariate association learning module and the multi-scale association learning module respectively. Their attention weights are calculated as follows:
[0116] (8)
[0117] in and are the shared weight matrices and bias terms.
[0118] By assigning a learnable attention score to the embedded features of each layer, the module can dynamically evaluate the relative importance between multivariate embeddings and multi-scale embeddings, thereby capturing the underlying complex correlations between the two. In its specific implementation, the fine-grained embedding at the node level represents the microscopic spatiotemporal characteristics of the local node, while the regional-level embedding reflects the information characteristics aggregated over a larger spatial range. This attention fusion mechanism can adaptively weight the embedding representations of different scales and different variable sources, which not only improves the flexibility of feature expression, but also enables the model to have stronger expressive power when processing marine data with multi-level dependencies.
[0119] In the task of interpolating dissolved oxygen in seawater, this mechanism helps the model fully exploit the detailed differences between local neighborhoods and the broad connections across the entire region, thereby providing more structured interpolation information. By fusing embedded information from multiple levels, the model is able to establish richer local-regional interdependencies, thereby enhancing its ability to recover missing data in complex marine environments and improving the spatial consistency of interpolation results.
[0120] S1.4 Global Dependency Awareness
[0121] In order to model the global spatiotemporal dependency between seawater dissolved oxygen and other marine contextual data, this step introduces a self-attention mechanism to capture the correlation between different spatial positions, and constructs a dynamic graph structure at each time point. The spatial structural features are extracted through graph convolution, and finally the multi-moment graph convolution results within a time window are fused to obtain global spatiotemporal correlation features.
[0122] (9)
[0123] in, , This is the dissolved oxygen data of seawater.
[0124] Afterwards, we Construct a dynamic graph structure for each time point in the same time window, and calculate the adjacency matrix at each time point in the same time window. and Perform graph convolution and add the graph convolution results at each time point to obtain the correlation matrix at all time points:
[0125] (10)
[0126] in To capture the global spatiotemporal correlation features, Indicates the length of a time window.
[0127] S2. Gaussian noise diffusion
[0128] The diffusion probability model is a generative model that has recently attracted significant attention in the field of deep learning. Compared to other generative models (such as GANs or VAEs), the diffusion probability model's step-by-step noise restoration process more naturally captures data diversity, resulting in an imputed result closer to the true distribution. This makes it particularly suitable for imputing dissolved oxygen in seawater, which has a high missing rate. Generally speaking, the diffusion probability model can be formalized as two Markov chains: a diffusion process and a reverse process. In the forward diffusion process, the model starts from the true data distribution and gradually injects Gaussian noise into the data, causing it to gradually converge to an isotropic Gaussian distribution. This process can be understood as a process of destroying the data structure, aiming to transform the original complex distribution into a simple prior noise distribution, making it easier to model. In contrast, the reverse process attempts to gradually recover the original data from this pure noise state. In this process, the model gradually removes noise by learning the conditional probability distribution at each step, achieving the transformation from a Gaussian distribution to the true data distribution. The key to this process is to accurately model the noise restoration at each step, so that the final generated result approximates the true data distribution.
[0129] Diffusion probability models offer inherent advantages when applied to interpolating dissolved oxygen data in the ocean. Long-term ocean sensors often generate large numbers of missing values due to environmental interference, equipment failure, and other factors. This is particularly true for variables such as dissolved oxygen, which are extremely sensitive to temporal and spatial variations. Diffusion models, through their progressive recovery mechanism, can effectively reconstruct the original distribution characteristics of data even under conditions of high missing rates, improving interpolation accuracy and enhancing the model's robustness to anomalous fluctuations. This property makes diffusion probability models a promising solution for addressing the problem of missing multivariate spatiotemporal data in the ocean.
[0130] Specifically, the diffusion process can be expressed as follows:
[0131] (11)
[0132] in, Indicates that from the initial state To The joint probability distribution of the steps, From step 1 to step According to the chain rule, the joint probability can be decomposed into the product of the conditional probabilities of each step. represents a Gaussian distribution with variance . Wherein, the scaling factor Control the degree of noise added; It is the identity matrix, indicating that independent and identically distributed noise is added to all feature dimensions.
[0133] By recursively adding noise through the equation, the final state The final result of this process is to convert the original data into Gaussian noise, so that the back diffusion process can recover the data.
[0134] S3. Noise Prediction Based on Dual-View Spatiotemporal Correlation
[0135] This step aims to achieve accurate noise prediction through the dual-view spatiotemporal correlation mechanism, thereby supporting the reverse denoising process in the diffusion model. Specifically, the model first fuses the spatiotemporal correlation features of the global and local perspectives, constructs a dual-view feature matrix, and inputs it into the spatiotemporal transfer module. This module implements feature aggregation in the time dimension through the attention mechanism, and information propagation in the spatial dimension through the dynamic graph convolutional network. On this basis, the model further enhances the spatial dependency expression in combination with the geographic adjacency matrix, and finally completes the noise prediction through the multi-layer perceptron. By stacking multiple noise prediction modules and combining convolution operations, the model can gradually restore the noise perturbations in the diffusion process and achieve high-quality interpolation of missing data. The noise removal process is as follows:
[0136] (12)
[0137] in For the t Step noisy data, For the t- 1-step data (closer to the original data), is the noise holding factor, is a standard Gaussian noise vector.
[0138] To achieve the above noise prediction, we first merge the global spatiotemporal correlation view and the local spatiotemporal correlation view to form a new dual-view correlation feature matrix :
[0139] (13)
[0140] Dual-view fusion enables the model to take into account both overall structure and local features during noise prediction, effectively improving the accuracy and spatial consistency of the interpolation results and enhancing the ability to express complex spatiotemporal patterns.
[0141] Then, Used as input to the spatiotemporal transfer module in the noise prediction module. Take time transfer as an example:
[0142] (14)
[0143] in, represents the output of the time transfer mechanism, is the corresponding attention weight, They can be further expressed as:
[0144] (15)
[0145] in is a learnable matrix, represents the initial input, which can be further expressed as:
[0146] (16)
[0147] Then, the spatial transfer process is implemented through the following dynamic graph convolutional network:
[0148] (17)
[0149] in for and The adjacency matrix of the result after addition.
[0150] Time and space transfer mechanisms use Calculate the weights, which avoids The weight error learned in . Then, It is fed into the GCN layer for feature aggregation, which further enhances the representation of spatial dependencies between adjacent nodes:
[0151] (18)
[0152] in Represents an adjacency matrix built based on geographic distances.
[0153] Finally, the output and After a multilayer perceptron (MLP):
[0154] (19)
[0155] in, represents a gated activation unit, and All are weight coefficients is the output of the first layer of the noise prediction module. By stacking multiple noise prediction modules and combining convolution operations, the final interpolation result can be generated. :
[0156] (20)
[0157] in, represents the noise prediction module, represents the number of layers of the noise prediction module, is the final interpolation result.
[0158] S4. Physics-guided model training
[0159] In the reverse denoising process, we introduce a joint loss function that combines the mean squared error (MSE) and the mean absolute error (MAE) to more comprehensively constrain the model's prediction error in the process of restoring data. The joint loss function is defined as follows:
[0160] (twenty one)
[0161] in, is the interpolation result, is the true value, and is the weight control factor.
[0162] Furthermore, in real-world physical systems, the relationships between multiple ocean variables (such as dissolved oxygen, temperature, salinity, nutrients, and wind speed) are not random or isolated, but rather are governed by a series of physical processes. These processes are often characterized by explicit partial differential equations (PDEs), such as convection-diffusion or reaction-transport equations based on conservation principles in ocean dynamics, thermodynamics, or biogeochemistry. The coefficients and structures of these equations have clear physical meanings under specific environmental conditions and are used to describe the stable coupling mechanisms between these variables. Take dissolved oxygen, for example. Its concentration is typically affected by temperature and salinity, and is regulated by local flow velocities, diffusion processes, and biological oxygen consumption. Its changes can be approximately described by steady-state convection-diffusion PDEs.
[0163] In this context, if these physical constraints are not explicitly incorporated into the interpolation model during training, the model may learn variable relationships that do not conform to real physical laws, resulting in unstable or abnormal prediction results when faced with complex or sparse data. Such deviations reduce the physical credibility of the model and may cause errors in local predictions to propagate, affecting the overall interpolation accuracy.
[0164] Therefore, in order to enhance the interpolation model's ability to perceive ocean physical processes, this method introduces a physical consistency loss function based on partial differential equations as a regularization term, which constrains the prediction results to satisfy the governing equation of convection-diffusion balance to maintain the physical coupling structure between variables. Specifically, the model outputs the predicted value of dissolved oxygen. It is embedded in the residual term of the physical equation and optimized by the following loss:
[0165] (twenty two)
[0166] in, is the seawater velocity, is the diffusion coefficient, and are the first and second derivatives of the dissolved oxygen filling results, represents other ocean changes associated with dissolved oxygen, Indicates the filling result.
[0167] Finally, and Combined, it serves as the overall training loss to guide the model training process.
[0168] (twenty three)
[0169] in Represents the weight coefficient.
[0170] During the model training process, we first select a batch of training samples and validation samples from the dataset for model training and performance evaluation. In each round of training, the model performs forward propagation and back propagation operations based on the current sample, iteratively updates the parameters, and outputs the corresponding missing value filling results, and calculates the loss function. Constrain and evaluate the gap filling results. During training, if the loss does not meet the preset convergence criteria, iterative training continues. If the convergence criteria are met, the model parameters with the current optimal performance are output and saved. Finally, model training is completed, resulting in a gap filling model that can be used in practical applications.
[0171] Experimental verification:
[0172] In this experiment, the dissolved oxygen (DO) data from the Global Ocean Data Analysis Project (GLODAPv2) were selected as the target variable for the interpolation study.
[0173] In the experiments, the batch size was set to 16, the learning rate to 0.001, and the number of attention heads to 8. The minimum noise level was set to 0.0001, and the maximum noise level to 0.2. For both the Tohoku Sea and the North Atlantic, the number of nodes was 19,200, and the diffusion step sizes were 4 and 6, respectively. For the dissolved oxygen data, the original missing values were 97.97% and 97.87% for the Tohoku Sea and the North Atlantic, respectively. During model training and validation, 99% of the observations were randomly masked. Due to the high missing values in the original data, to avoid randomness in the evaluation metrics, all available observations were evaluated during the testing phase.
[0174] The method of the present invention is evaluated on the two real datasets mentioned above, and the comparison indicators include: root mean square error (RMSE) and mean absolute error (MAE).
[0175] Table 1 Comparison of results of different methods on real datasets
[0176]
[0177] From the above results, we can conclude that our proposed model performs best in all indicators. Compared with other existing methods, the performance is improved by 13.08%, 10.39%, 12.13%, and 11.48%, respectively, which fully verifies the effectiveness and accuracy of our method in the gap filling task.
[0178] Subsequently, the present invention conducted parameter sensitivity experiments on three important parameters: embedding dimension, diffusion steps, and the number of attention heads, further providing a basis for selecting the optimal parameters. Figure 5 and Figure 6 The results of parameter sensitivity experiments in the northeastern waters of Japan and the North Atlantic are presented respectively. Figure 5 (a) and Figure 6 (a) shows the impact of different embedding dimensions on filling performance. Figure 5 (b) and Figure 6 (b) in the figure shows the effect of different diffusion step sizes on the filling performance. Figure 5 (c) and Figure 6 (c) in the figure shows the effect of different numbers of attention heads on the filling performance.
[0179] Experimental results with different embedding dimensions show that, in the initial stage, increasing the embedding dimension helps improve model performance; however, when the embedding dimension is too large, model performance actually decreases. The main reason is that the multivariate embedding is too sparse or overfitting occurs, resulting in the model being unable to learn sufficient features, causing a decrease in the model's expressiveness and affecting performance.
[0180] When the diffusion step size is small, less noise is injected at each step, making it difficult for the model to learn an effective denoising process. However, as the step size increases, the model can gradually reconstruct high-quality data during the denoising process, thereby improving the diversity of generated samples. However, if the diffusion step size is too large, the amount of noise injected at each step will become excessive, causing the characteristics of the original data to be severely damaged at an early stage, making it difficult for the model to recover detailed information during subsequent denoising, ultimately resulting in poor performance.
[0181] When the number of attention heads is set to a small number in the experiment, the model has difficulty focusing on multiple locations simultaneously, which may cause important spatiotemporal features to be overlooked. As the number of attention heads increases, the model can more effectively learn complex dependencies. However, more attention heads increase the complexity of the model and may cause overfitting.
[0182] Example 2
[0183] This embodiment provides a spatiotemporal gap filling system based on context association and physical guidance, including:
[0184] The data acquisition module is configured as follows:
[0185] A computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor of a terminal device, a method for filling spatiotemporal gaps based on context association and physical guidance.
[0186] A terminal device includes a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions, and the instructions are suitable for being loaded and executed by the processor to implement a spatiotemporal gap filling method based on context association and physical guidance.
[0187] The above are all preferred embodiments of the present invention, and are not intended to limit the scope of protection of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for filling spatiotemporal gaps based on context association and physical guidance, characterized in that: include: Obtain seawater dissolved oxygen data and contextual data; Multivariate spatiotemporal dependency extraction is performed based on the acquired seawater dissolved oxygen data and contextual data. A graph convolutional network (GCN) based on multiple ocean variables is introduced to jointly model ocean multivariate data. A hierarchical aggregation and regional mapping mechanism is used to extract embedding features at different spatial scales layer by layer, achieving spatial dependency modeling from local to global. A regional mapping matrix is generated based on regional embedding to transform the embedding features of the previous layer, thereby generating a larger-scale embedding representation in the next layer. An attention fusion mechanism is introduced to dynamically weighted integrate the features learned from multivariate associations and multiscale associations to establish local and regional dependencies. A self-attention mechanism is introduced to capture the correlation between different spatial positions, and a dynamic graph structure is constructed at each time point. Graph convolution is used to extract spatial structural features, and finally, the multi-moment graph convolution results within a time window are fused to obtain global spatiotemporal correlation features. Gaussian noise diffusion is performed based on the obtained seawater dissolved oxygen data; Noise prediction based on dual-view spatiotemporal correlation; The prediction error is constrained based on the joint loss function. This includes introducing a joint loss function that combines the mean square error and the mean absolute error to fully constrain the prediction error of the model during data recovery. The joint loss function is defined as: in, is the interpolation result, is the true value, and As the weight control factor, a physical consistency loss function based on partial differential equations is introduced as a regularization term. The prediction results are constrained to meet the control equation of convection-diffusion balance to maintain the physical coupling structure between variables. The predicted value of dissolved oxygen output by the model is The optimization is performed by calculating the loss, which is expressed as: in, is the seawater velocity, is the diffusion coefficient, and are the first and second derivatives of the dissolved oxygen filling results, represents other ocean changes associated with dissolved oxygen, Indicates the filling result, and finally, and Combined, it serves as the overall training loss to guide the model training process.
2. The method for filling spatiotemporal gaps based on context association and physical guidance according to claim 1, characterized in that: The multivariate spatiotemporal dependency extraction based on the acquired seawater dissolved oxygen data and contextual data includes the introduction of a graph convolutional network (GCN) based on multiple ocean variables to jointly model the ocean multivariate data. First, the Gaussian kernel function is used to calculate the similarity between geographically distributed nodes. in, Indicates in Layer Node and The Euclidean distance between nodes, is the scale parameter of the Gaussian kernel function, and then the similarity matrix is sparsely operated to obtain the corresponding adjacency matrix , in is the similarity threshold parameter, Finally, GCN is used to learn the correlation between seawater dissolved oxygen data and its ocean context data , in, Indicates the The embedding representation of the layer, is the number of all nodes, It is The embedding dimension of the layer, is the ReLU activation function, is a learnable weight matrix.
3. The method for filling spatiotemporal gaps based on context association and physical guidance according to claim 2, characterized in that: The multivariate spatiotemporal dependency extraction based on the acquired seawater dissolved oxygen data and context data also includes adopting a hierarchical aggregation and regional mapping mechanism to extract embedding features at different spatial scales layer by layer to achieve spatial dependency modeling from local to global, wherein a regional mapping matrix is generated based on regional embedding , which is used to transform the embedding features of the previous layer to generate a larger-scale embedding representation in the next layer. The hierarchical aggregation method is: , Indicates the Layer adjacency matrix The normalized Laplace matrix of Indicates the The number of nodes in the layer, is the regional embedding representation of this layer, is the weight matrix, is the bias term, Indicates the The region mapping matrix of the layer, and then the region embedding from the previous layer is further propagated to the next layer through the region mapping matrix, generating a new larger-scale region-level embedding and adjacency matrix: , and Respectively represent The number of nodes in the layer and the embedding dimension; the multi-scale spatial embedding and region mapping matrix obtained by aggregating GCN Multiply them so that the aggregated matrix is consistent in dimension with the previous layer. The multi-scale graph convolution operation is expressed as: in Represents multi-scale graph convolution in The output of the layer.
4. The method for filling spatiotemporal gaps based on context association and physical guidance according to claim 3, characterized in that: The multivariate spatiotemporal dependency extraction based on the acquired seawater dissolved oxygen data and contextual data also includes introducing an attention fusion mechanism to dynamically weight and integrate the features learned from multivariate association and multiscale association to establish a dependency relationship between local and regional regions, which can be expressed as: in, and Represent the first The attention weights of the layers, and They represent the number of layers of the multivariate association learning module and the multi-scale association learning module respectively. The attention weight calculation is expressed as: in and are the shared weight matrices and bias terms.
5. The method for filling spatiotemporal gaps based on context association and physical guidance according to claim 4, characterized in that: The multivariate spatiotemporal dependency extraction based on the acquired seawater dissolved oxygen data and contextual data also includes introducing a self-attention mechanism to capture the correlation between different spatial positions, constructing a dynamic graph structure at each time point, extracting spatial structural features through graph convolution, and finally fusing the multi-moment graph convolution results within a time window to obtain global spatiotemporal correlation features, which can be expressed as: in, , is the dissolved oxygen data of seawater; Construct a dynamic graph structure for each time point in the same time window, and calculate the adjacency matrix at each time point in the same time window. and Perform graph convolution and add the graph convolution results at each time point to obtain the correlation matrix at all time points: in To capture the global spatiotemporal correlation features, Indicates the length of a time window.
6. The method for filling spatiotemporal gaps based on context association and physical guidance according to claim 5, characterized in that: The Gaussian noise diffusion is performed based on the acquired seawater dissolved oxygen data and context data, including using a diffusion probability model to perform forward diffusion and reverse diffusion on the extracted data, respectively. The diffusion process is expressed as: in, Indicates that from the initial state To The joint probability distribution of the steps, From step 1 to step All states of the step; According to the chain rule, the joint probability is decomposed into the product of the conditional probabilities of each step, represents a Gaussian distribution with variance , where the scaling factor Control the degree of noise added; It is the unit matrix, indicating that independent and identically distributed noise is added to all feature dimensions. Noise is gradually added to the original data in a recursive manner, and finally it is completely converted into Gaussian noise, so that the back diffusion process gradually restores the original data.
7. The method for filling spatiotemporal gaps based on context association and physical guidance according to claim 6, characterized in that: The noise prediction based on dual-view spatiotemporal correlation includes fusing the spatiotemporal correlation features of the global and local perspectives to construct a dual-view feature matrix, achieving feature aggregation in the temporal dimension through the attention mechanism, and achieving information propagation in the spatial dimension through a dynamic graph convolutional network. The noise removal process is expressed as: in For the t Step noisy data, For the t- 1 step data, is the noise holding factor, is a standard Gaussian noise vector; the global spatiotemporal correlation view and the local spatiotemporal correlation view are merged to form a new dual-view correlation feature matrix : , then, Used as input to the spatiotemporal transfer module in the noise prediction module, Time transfer is expressed as: in, represents the output of the time transfer mechanism, is the corresponding attention weight; spatial transfer is expressed as: in for and The adjacency matrix of the result after addition.
8. The method for filling spatiotemporal gaps based on context association and physical guidance according to claim 7, characterized in that: The noise prediction based on dual-view spatiotemporal correlation includes the output of the time transfer mechanism Feed it into the GCN layer for feature aggregation and enhance the representation of spatial dependencies between adjacent nodes: in Represents the adjacency matrix built based on geographic distance, and finally outputs and After a multi-layer perceptron it is represented as: in, represents a gated activation unit, and All are weight coefficients It is the output of the first layer of the noise prediction module. By stacking multiple noise prediction modules and combining convolution operations, the final interpolation result is generated. : in, represents the noise prediction module, represents the number of layers of the noise prediction module, is the final interpolation result.
9. A spatiotemporal gap filling system based on context association and physical guidance, which implements the spatiotemporal gap filling method based on context association and physical guidance as claimed in claim 1, characterized in that: include: The data acquisition module is configured to acquire seawater dissolved oxygen data and context data; an extraction module configured to perform multivariate spatiotemporal dependency extraction based on the acquired seawater dissolved oxygen data and contextual data; The diffusion module is configured to perform Gaussian noise diffusion based on the acquired seawater dissolved oxygen data; The prediction module is configured to perform noise prediction based on dual-view spatiotemporal correlation; The constraint module is configured to constrain the prediction error based on the joint loss function.
Citation Information
Patent Citations
Space-time data filling method, system and equipment based on guide information and medium
CN116166642A
Sea surface temperature complementation method and system based on missing correlation and physical constraint
CN119107261A