A method for spatio-temporal prediction of offshore chlorophyll-a based on local background collaborative modeling
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-08-11
AI Technical Summary
[0004]1. 传统数值模式的局限性:传统的海洋生物地球化学数值模式(如基于物理-生物耦合的模型)虽然在理论上具有较好的可解释性,但在实际业务化应用中面临严峻挑战
[0051]This invention proposes a spatiotemporal forecasting method for nearshore chlorophyll a based on local and background co-modeling. It is primarily implemented using a spatiotemporal forecasting model based on local and background co-modeling (BaT-ConvLSTM). This model consists of a multi-branch spatiotemporal feature encoding module, a multi-scale feature fusion enhancement module, and a multi-step prediction spatial decoding module. A dataset corresponding to the spatiotemporal data of the nearshore environment is constructed, and the dataset is divided into training, validation, and test sets according to time sequence. The dataset is then pruned and logarithmically transformed to compress magnitude differences, and latitude and longitude normalized coordinate channels are injected to enhance spatial location priors. Then, the ConvLSTM local branch unit, self-generated background modeling unit, multi-query temporal attention unit, and multi-scale dilated convolutional pyramid in the system are trained using the training set. During training, a masked mean squared error loss function (Masked-MSELoss) is introduced to eliminate interference from land and missing values on gradient updates. After each training round, the prediction accuracy of the trained prediction system is tested using a validation set. If the network weight parameters in that round result in the minimum validation loss and optimal prediction performance, the weight parameters of each trainable module in that round are saved. After the final training round, the best-performing nearshore chlorophyll-a spatiotemporal prediction model is obtained. Finally, the best-performing prediction model is used to perform short-term forecasts based on nearshore environmental data from multiple consecutive time periods input by the user. This invention, while ensuring the grid spatial structure and short-term evolution capability, utilizes a multi-branch architecture to extract local dynamics and global background features, solving the problems of insufficient background constraints and blurred detail characterization in existing models, improving prediction accuracy and stability, and achieving high-resolution Chl-a short-term forecasts for complex nearshore waters.
Smart Images

Figure CN122548201A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the interdisciplinary field of marine remote sensing and deep learning, and in particular to a spatiotemporal prediction method for nearshore chlorophyll a based on local background collaborative modeling. Background Technology
[0002] Chlorophyll a (Chl-a) is a core indicator of marine primary productivity and phytoplankton biomass, and also an important water quality parameter for assessing nearshore ecological risks (such as eutrophication and red tide warnings). In nearshore waters, especially estuarine areas like the Pearl River Estuary, the distribution of Chl-a exhibits extremely high spatiotemporal variability due to the combined effects of estuarine runoff, nearshore human activities, monsoon fluctuations, and upwelling. Accurate short-term forecasts are of significant scientific and engineering value for marine ecological environment monitoring, fisheries resource management, and marine disaster early warning.
[0003] Currently, forecasting methods for Chl-a are mainly divided into two categories: numerical models and data-driven models.
[0004] 1. Limitations of Traditional Numerical Models: While traditional marine biogeochemical numerical models (such as those based on physico-biological coupling) possess good theoretical interpretability, they face significant challenges in practical operational applications. First, these models are highly sensitive to initial fields, open boundary conditions, dynamic parameters, and complex biochemical reaction processes, making parameter tuning extremely difficult. Second, numerical simulations require enormous computational resources, making it difficult to meet the demands of high-timeliness, short-term forecasts. Most importantly, nearshore areas exhibit numerous small-scale, sudden local anomalies, and traditional numerical models, limited by grid resolution and simplified physical mechanisms, often struggle to capture these localized spatiotemporal evolution details in a timely and precise manner.
[0005] 2. Current Status and Bottlenecks of Deep Learning Models: With the accumulation of satellite remote sensing observation data, data-driven methods such as deep learning have been widely used due to their powerful nonlinear high-dimensional modeling capabilities. Currently commonly used spatiotemporal prediction models (such as ConvLSTM, E3D-LSTM, etc.) can preserve the spatial topological relationships of the raster through convolutional structures and utilize recurrent units to model temporal dependencies, achieving prediction results superior to traditional machine learning.
[0006] However, existing spatiotemporal models and forecasting methods still have the following core shortcomings when dealing with complex nearshore waters:
[0007] (a) The contradiction between handling spatial heterogeneity and homogeneous modeling:
[0008] Most existing models tend to treat the spatiotemporal features of the entire sea area as homogeneous input for unified modeling, failing to effectively distinguish between the high-frequency, abrupt, small-scale patch features in nearshore areas and the large-scale, smooth background features driven by seasons in offshore areas. On the other hand, some existing technologies, such as the Chinese patent publication number CN115587646A, disclose a method and system for predicting nearshore chlorophyll a concentration based on spatiotemporal feature fusion. To address the spatial heterogeneity problem, this method employs a "physical hard partitioning" approach for separate training and prediction. This simple partitioning strategy not only easily leads to discontinuities in the prediction field at the boundaries of sub-regions but also disrupts the integrity and continuity of the sea area's evolution process.
[0009] (ii) Insufficient ability to extract multi-scale spatiotemporal coupled features:
[0010] Existing techniques typically focus on single-dimensional processing during feature extraction, such as employing a single-path time recursive structure or a strategy of spatiotemporal separation followed by fusion (e.g., using standard LSTM for temporal features and CNN for spatial local features). These methods lack the ability to explicitly model the deep spatiotemporal coupling relationship between "local high-frequency fluctuations" and "large-scale seasonal / climate background." This results in insufficient cross-scale information interaction when the model deals with the transition region from nearshore to offshore, leading to a significant degradation in forecast accuracy.
[0011] (iii) Lack of global context constraints leads to systematic biases:
[0012] Because they fail to incorporate large-scale seasonal or climatic background fields as global stability constraints, existing models that rely solely on local convolutional structures or simple recurrent network structures are prone to large-scale systematic biases during long-term series or multi-step recursive predictions. For example, prediction results often show spatial imbalances such as "overall higher nearshore predictions and overall lower offshore predictions" or vice versa. Furthermore, local prediction textures tend to gradually smooth and blur over time, leading to the loss of high-gradient features along the coast and detailed information from small-scale extreme patches.
[0013] Therefore, how to design a deep learning architecture that does not require physical region segmentation, can adaptively take into account spatial heterogeneity, and can accurately characterize the high-frequency detailed features of nearshore areas while stably constraining the seasonal background field of offshore areas, thereby effectively eliminating systematic biases in transitional sea areas and possessing cross-seasonal and multi-step forecast stability, has become a key technical problem that urgently needs to be solved in the field of nearshore ecological element forecasting. Summary of the Invention
[0014] To address the aforementioned technical problems in related technologies, this invention proposes a spatiotemporal prediction method for nearshore chlorophyll a based on local background collaborative modeling, comprising the following steps:
[0015] This invention provides a spatiotemporal prediction method for nearshore chlorophyll a based on local background co-modeling, which specifically includes the following steps:
[0016] S1. Based on multi-source operational marine products, multi-source heterogeneous data are obtained and preprocessed to obtain the historical nearshore environmental spatiotemporal data sequence of the nearshore research area. Then, the historical nearshore environmental spatiotemporal data sequence is divided into training set, validation set and test set according to time order.
[0017] S2. Input the nearshore environmental spatiotemporal data sequence corresponding to the training set into the pre-constructed nearshore chlorophyll a spatiotemporal forecasting model for distributed parallel training and parameter optimization to obtain the trained nearshore chlorophyll a spatiotemporal forecasting model.
[0018] The nearshore chlorophyll a spatiotemporal prediction model consists of a multi-branch spatiotemporal feature encoding module, a multi-scale feature fusion enhancement module, and a multi-step prediction spatial decoding module. The multi-branch spatiotemporal feature encoding module synchronously extracts local feature maps, background feature maps, and temporal background feature maps from the input nearshore environmental spatiotemporal data sequence. The multi-scale feature fusion enhancement module concatenates and integrates the local feature maps, background feature maps, and temporal background feature maps, performs multi-scale enhancement, and then performs adaptive weighting to obtain a fused feature map. The multi-step prediction spatial decoding module compresses and reconstructs the fused feature map and corrects the residuals before outputting the predicted chlorophyll a concentration results for multiple future time periods.
[0019] S3. The chlorophyll a concentration prediction results are obtained by performing short-term forecasts on newly input nearshore environmental spatiotemporal data sequences using the trained nearshore chlorophyll a spatiotemporal forecasting model.
[0020] Specifically, the method further includes:
[0021] S4. The predicted chlorophyll a concentration is first restored to logarithmic space using an inverse normalization operator, and then the following steps are performed: The inverse exponential transform restores the chlorophyll concentration values to physical quantities, ultimately yielding the chlorophyll a concentration prediction matrix. ;
[0022] S5. Chlorophyll a concentration prediction matrix The local edge filling algorithm and the restricted channel expansion algorithm were used for repair, and then the repaired chlorophyll a concentration prediction matrix was generated using the xarray tool. The corresponding geographic latitude and longitude coordinates are encapsulated to generate a standard NetCDF format file, resulting in a nearshore chlorophyll a spatiotemporal forecast product.
[0023] Specifically, the multi-branch spatiotemporal feature encoding module consists of local branches and background and global temporal branches; the local branches are composed of multiple layers of concatenated convolutional long short-term memory network units; each convolutional long short-term memory network unit contains a convolutional gating structure, which updates the cell state and hidden state by receiving the input features at the current time step and the hidden state at the previous time step, and using the Sigmoid and Tanh activation functions; the local branches extract the hidden state feature map of the last time step of the input nearshore environment spatiotemporal data sequence as the local feature map;
[0024] The background and global temporal branches consist of a self-generated background modeling module, a multi-query temporal attention module, and a 1×1 convolutional layer. The self-generated background modeling module calculates the temporal mean field, the field at the end of the sequence, and the difference trend field between the first and last frames from the input nearshore environment spatiotemporal data sequence, and concatenates the three in the channel dimension to obtain a feature tensor. The feature tensor is then compressed into a spatial feature map through a 1×1 convolution.
[0025] The multi-query temporal attention module compresses nearshore environmental spatiotemporal data into a sequence of temporal feature vectors through spatial global average pooling, introduces Q learnable query vectors, and obtains a global temporal feature vector by matching different temporal evolution patterns through a dot product attention mechanism. The global temporal feature vector is then expanded into a temporal background feature map in the spatial dimension.
[0026] Specifically, the multi-scale feature fusion enhancement module consists of a feature fusion unit, a multi-scale dilated convolutional pyramid module, and a channel attention module. The feature fusion unit receives local evolution features from local branches and background and temporal feature maps from background and global temporal branches. These features are concatenated along the channel dimension and integrated at the pixel level using 1×1 convolutions to achieve adaptive weight allocation for local dynamic features and large-scale background features, resulting in a fused feature tensor. The multi-scale dilated convolutional pyramid module consists of four parallel dilated convolutional branches with dilation rates A1, A2, A3, and A4, respectively. The number of channels output by each branch is proportionally allocated and concatenated along the channel dimension to obtain multi-scale enhanced features. The channel attention module consists of a pooling layer, two fully connected linear layers, and a Dropout layer. The channel attention module calculates the weight coefficients of each channel using global average pooling and two fully connected linear layers, adaptively reweights the multi-scale enhanced features, and combines a two-dimensional Dropout layer to suppress overfitting, resulting in an enhanced fused feature map.
[0027] Specifically, the multi-step prediction spatial decoding module consists of a convolutional decoding sub-network, a residual refinement module, and a multi-horizon output head. The convolutional decoding sub-network compresses and reconstructs the fused feature map, and the residual refinement module corrects the residuals before the multi-horizon output head outputs the chlorophyll a concentration prediction results for multiple future time periods.
[0028] Specifically, the convolutional decoding subnetwork consists of two 3×3 convolutional layers, a normalization layer, and a ReLU activation layer, used to progressively compress the channel dimension and extract the spatial texture features required for prediction; the residual thinning module performs boundary adjustment and detail compensation on the fused feature map through a residual branch composed of two 3×3 convolutional layers to obtain a thinned feature map; the multi-horizon output head consists of a 3×3 convolutional layer, used to receive the thinned feature map from the residual thinning module and simultaneously generate chlorophyll a concentration prediction results for multiple future time periods of the thinned feature map.
[0029] Specifically, step S1 includes the following steps:
[0030] S11. Using a date-matching-based dynamic file indexing mechanism, chlorophyll a concentration data and physical environment field data are retrieved and indexed from global multi-source satellite water color fusion products through regular expression matching algorithms, and biogeochemical field data are retrieved and indexed from global marine biogeochemical analysis and forecast products to construct multi-source heterogeneous data.
[0031] S12. The retrieved chlorophyll a concentration data, physical environmental field data, and biogeochemical field data are uniformly cropped to the nearshore study area to obtain nearshore area data. The numerical validity discrimination method is used to identify the land area and missing pixels in the nearshore study area, and the corresponding binarization mask M is generated. The nearshore area data includes chlorophyll a concentration data, physical environmental field data, and biogeochemical field data of the nearshore study area.
[0032] S13. Perform a logarithmic transformation on the valid chlorophyll a pixel values in the chlorophyll a concentration data of the nearshore area to obtain logarithmically valid chlorophyll a data.
[0033] S14. Use the coordinate encoding module to generate normalized geographic coordinate codes for the nearshore area data based on the latitude and longitude grid;
[0034] S15. Based on the pre-fitted standardization operator, the logarithmically effective chlorophyll data and the physical environment field data of the nearshore area data are standardized channel by channel and then spliced with the normalized position code in the channel dimension to obtain the standardized nearshore environment spatiotemporal data.
[0035] S16. Using the sliding window technique, the spatiotemporal data of the nearshore environment over several consecutive days are constructed into a historical spatiotemporal data sequence of the nearshore environment, and the historical spatiotemporal data sequence of the nearshore environment is divided into a training set, a validation set, and a test set according to the chronological order.
[0036] Specifically, step S2 includes the following steps:
[0037] S21. During the startup phase, the system performs resource scheduling for training environment configuration and distributed initialization;
[0038] S22. After resource scheduling is completed, the system constructs a multi-process distributed collaborative computing environment;
[0039] S23. The input nearshore environmental spatiotemporal data sequence is simultaneously extracted by multi-branch encoding using the multi-branch spatiotemporal feature encoding module, which extracts local feature maps, background feature maps, and temporal background feature maps. The data format of the input nearshore environmental spatiotemporal data is as follows: The shapes of the local feature map, background feature map, and temporal background feature map are all... ;in, This represents the number of hidden channels in a convolutional long short-term memory network unit; where, Represents batch size. Represents the input time step length. The number of grid points representing the latitudinal direction of the nearshore research area. The number of grid points representing the longitude of the nearshore research area. Represents the number of channels;
[0040] S24. The local feature map, background feature map, and temporal background feature map are stitched together along the channel dimension by the feature fusion unit to obtain a shape of... The concatenated feature tensor is then processed by... Convolutional gating mechanisms integrate pixel-level features to obtain a fused feature tensor with the shape of... Then, the fused feature tensor is fed into the multi-scale dilated convolutional pyramid module to obtain multi-scale enhanced features. Finally, the multi-scale enhanced features are adaptively weighted by the channel attention module to obtain the enhanced fused feature map.
[0041] S25. In the spatial decoding stage, the fused feature map is progressively compressed in terms of channel number and the spatial texture is reconstructed through the convolutional decoding sub-network, wherein the shape of the decoded feature tensor output by the first layer of the decoder is as follows: The shape of the decoded feature tensor output by the second layer is The decoded feature tensor is obtained by compensating for texture and boundary errors in the fused feature map through a residual refinement module, and the shape remains the same. Finally, the future is generated simultaneously through a multi-horizon output head. The predicted chlorophyll a concentration results for each time period are shown in the following shape: .
[0042] Specifically, step S2 also includes:
[0043] S26. During model optimization, the system uses the mask mean square error loss function as the training objective function; let the model prediction result be... The corresponding observed true value is The mask mean square error loss function L is defined as follows:
[0044] ,
[0045] in, This represents the index of dimension B in the batch, indicating the index of the currently calculated [number]. One data sample; The index represents the time step T, indicating the predicted digit. A future moment; Indicates the spatial location index of grid points along the latitudinal direction; Indicates the spatial location index of grid points along the longitude direction; This represents the spatial grid coordinates of the i-th sample at the t-th prediction time step. The predicted value of the target variable at the location; This represents the spatial grid coordinates of the i-th sample at the t-th prediction time step. The actual observed value at the location; M is the binarization mask, where Represents the effective water area pixels, Indicates a land area or a region with missing pixels; The binary mask M generated during the preprocessing stage represents the coordinates... The value at;
[0046] S27. In the backpropagation and parameter optimization stages, an automatic mixed-precision training mechanism and a loss scaling strategy are introduced. In the distributed training scenario, the local gradients calculated by each computing device are updated synchronously through a full reduction operation. The parameter optimization adopts the Adam optimizer and introduces a weight decay term to constrain the model complexity, so that the learning rate gradually decays with the training rounds.
[0047] S28. During the training monitoring and model persistence phase, after each round of training, the validation set is used for inference evaluation, and performance indicators for different future forecast lead times are statistically analyzed. The performance indicators include mean absolute error, root mean square error, and coefficient of determination. When the validation set loss of a certain round of training reaches the historical best level, the system automatically saves the weight parameters of each feature extraction, feature fusion, and spatial decoding module in the current model. At the same time, an early stopping mechanism is set. When the validation set loss does not fall below a preset threshold in F consecutive rounds of training, the training process is automatically terminated, and the trained nearshore chlorophyll a spatiotemporal forecast model is finally obtained.
[0048] Specifically, step S23 includes:
[0049] The input spatiotemporal data sequence of the nearshore environment is fed into a multi-layered cascaded convolutional long short-term memory network unit structure. Within each time step, the hidden state and memory state are cyclically updated using a convolutional gating mechanism to capture small-scale, sudden nonlinear evolutionary features in nearshore waters. After encoding, the hidden state at the end of the sequence is extracted as a local feature map, and its output tensor shape is... ;
[0050] The self-generated background modeling module calculates the time-averaged field, the field of the last frame of the sequence, and the difference trend field between the first and last frames from the input spatiotemporal data sequence of the nearshore environment, and then stitches the above three fields together in the channel dimension to obtain a shape of The feature tensor; the feature tensor is then passed through Convolution performs spatial compression and channel mapping, making its channel dimensions consistent with the hidden channel dimensions of the local branches, and outputs a background feature map with the shape of... Based on this, the multi-query time attention module performs spatial global average pooling on the input nearshore environmental spatiotemporal data sequence, compressing the input nearshore environmental spatiotemporal data sequence into a time vector sequence, forming a shape of and introduce A learnable query vector is used to match different temporal evolution patterns through a dot product attention mechanism, resulting in a global temporal feature vector after attention aggregation to characterize seasonal changes or abnormal fluctuations. This vector is then expanded in the spatial dimension after linear mapping, ultimately generating a temporal background feature map, the output shape of which is also [missing information]. .
[0051] This invention proposes a spatiotemporal forecasting method for nearshore chlorophyll a based on local and background co-modeling. It is primarily implemented using a spatiotemporal forecasting model based on local and background co-modeling (BaT-ConvLSTM). This model consists of a multi-branch spatiotemporal feature encoding module, a multi-scale feature fusion enhancement module, and a multi-step prediction spatial decoding module. A dataset corresponding to the spatiotemporal data of the nearshore environment is constructed, and the dataset is divided into training, validation, and test sets according to time sequence. The dataset is then pruned and logarithmically transformed to compress magnitude differences, and latitude and longitude normalized coordinate channels are injected to enhance spatial location priors. Then, the ConvLSTM local branch unit, self-generated background modeling unit, multi-query temporal attention unit, and multi-scale dilated convolutional pyramid in the system are trained using the training set. During training, a masked mean squared error loss function (Masked-MSELoss) is introduced to eliminate interference from land and missing values on gradient updates. After each training round, the prediction accuracy of the trained prediction system is tested using a validation set. If the network weight parameters in that round result in the minimum validation loss and optimal prediction performance, the weight parameters of each trainable module in that round are saved. After the final training round, the best-performing nearshore chlorophyll-a spatiotemporal prediction model is obtained. Finally, the best-performing prediction model is used to perform short-term forecasts based on nearshore environmental data from multiple consecutive time periods input by the user. This invention, while ensuring the grid spatial structure and short-term evolution capability, utilizes a multi-branch architecture to extract local dynamics and global background features, solving the problems of insufficient background constraints and blurred detail characterization in existing models, improving prediction accuracy and stability, and achieving high-resolution Chl-a short-term forecasts for complex nearshore waters. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0053] Figure 1 This is a schematic diagram of a spatiotemporal forecasting method for nearshore chlorophyll a based on local background collaborative modeling provided in an embodiment of the present invention;
[0054] Figure 2 This is a schematic diagram of the overall structure and flow of the spatiotemporal forecasting model combining nearshore chlorophyll a provided by an embodiment of the present invention;
[0055] Figure 3 A spatial distribution comparison diagram of the forecast results of the nearshore chlorophyll a spatiotemporal forecasting model provided in this embodiment of the invention with other comparative models; wherein, Figure 3(a1), (a2), (a3), and (a4) in the table correspond to the satellite inversion true values, the 1-day forecast results of the BaT-ConvLSTM model, the 1-day forecast results of the ConvLSTM model, and the 1-day forecast results of the LSTM model for typical dates in the winter of 2025, respectively. Figure 3 (b1), (b2), (b3), and (b4) in the table correspond to the satellite inversion true value, the 1-day forecast result of the BaT-ConvLSTM model, the 1-day forecast result of the ConvLSTM model, and the 1-day forecast result of the LSTM model for typical dates in spring 2025, respectively. Figure 3 (c1), (c2), (c3), and (c4) in the table correspond to the satellite inversion true value, the 1-day forecast result of the BaT-ConvLSTM model, the 1-day forecast result of the ConvLSTM model, and the 1-day forecast result of the LSTM model for typical dates in the summer of 2025, respectively. Figure 3 In the table, (d1), (d2), (d3), and (d4) correspond to the satellite inversion true value, the 1-day forecast result of the BaT-ConvLSTM model, the 1-day forecast result of the ConvLSTM model, and the 1-day forecast result of the LSTM model for typical dates in autumn 2025, respectively.
[0056] Figure 4 A comparison chart of accuracy evaluation metrics for nearshore chlorophyll a spatiotemporal prediction models based on the CMEMS dataset provided in this embodiment of the invention; wherein, Figure 4 (a) in the figure is a comparison chart of mean absolute error (MAE). Figure 4 (b) in the figure is a comparison chart of root mean square error (RMSE). Detailed Implementation
[0057] The invention will be explained in detail through the following embodiments. The purpose of this invention is to protect all technical improvements within its scope. In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0058] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0059] Example 1
[0060] Existing differential equation-driven ocean numerical models suffer from high sensitivity to initial fields and biogeochemical parameters, enormous computational costs, and difficulty in accurately capturing the details of small-scale, sudden spatiotemporal evolution in nearshore waters. Current deep learning-based spatiotemporal forecasting systems often employ homogeneous modeling, making it difficult to simultaneously account for both high-frequency abrupt changes in nearshore processes and large-scale background fields in the open ocean dominated by seasons. This results in accuracy degradation and systematic distribution biases in cross-seasonal forecasts or in transitional zones from nearshore to the open ocean.
[0061] refer to Figure 1 This embodiment provides a spatiotemporal forecasting method for nearshore chlorophyll a based on local background co-modeling, including the following steps:
[0062] S1. Based on multi-source operational marine products, multi-source heterogeneous data are obtained and preprocessed to obtain the historical nearshore environmental spatiotemporal data sequence of the nearshore research area. Then, the historical nearshore environmental spatiotemporal data sequence is divided into training set, validation set and test set according to time order.
[0063] S11. Multi-source heterogeneous data indexing: First, using a date-matching-based dynamic file indexing mechanism, a regular expression matching algorithm is used to automatically retrieve and index NetCDF format data files containing specific version suffixes or time zone identifiers, thereby enabling fault-tolerant reading of multi-source heterogeneous data. The multi-source heterogeneous data includes chlorophyll a concentration data and physical environmental field data retrieved from global multi-source satellite water color fusion products, and biogeochemical field data retrieved from global marine biogeochemical analysis and forecast products.
[0064] The multi-source operational marine products include global multi-source satellite water color fusion products and global marine biogeochemical analysis and forecasting products;
[0065] The dataset used in this invention is constructed based on a global multi-source satellite water color fusion product. The original chlorophyll a (Chl-a) concentration data and physical environment field data are both derived from the L4 level global multi-source satellite water color fusion product provided by the Copernicus Marine Environment Monitoring Service (CMEMS), with the product number OCEANCOLOUR_GLO_BGC_L4_MY_009_104. The product contains NetCDF format data files with specific version suffixes or time zone identifiers. This product integrates multi-source satellite remote sensing observation data and, after atmospheric correction, quality control, and temporal interpolation, generates a spatially continuous global chlorophyll a raster field with diurnal resolution.
[0066] To compare and evaluate the model forecast performance, the global marine biogeochemical analysis and forecast product (product number GLOBAL_ANALYSISFORECAST_BGC_001_028) provided by CMEMS was selected as operational reference data.
[0067] S12. Study Area Cropping and Invalid Value Masking: Next, the retrieved chlorophyll a concentration data, physical environmental field data, and biogeochemical field data are uniformly cropped to the nearshore study area to obtain nearshore area data; the nearshore area data includes chlorophyll a concentration data, physical environmental field data, and biogeochemical field data of the nearshore study area; at the same time, the numerical validity discrimination method is used to identify the land areas and missing pixels in the nearshore study area, and generate the corresponding binary mask M (Mask), which is used to exclude the interference of non-water areas on the results in the subsequent model training and loss function calculation process;
[0068] The so-called unified cropping to the near-shore research area refers to cropping the same area from different data sources, and the cropped data has the same network structure;
[0069] S13. Nonlinear order-of-magnitude compression: Subsequently, logarithmic transformation is performed on the effective chlorophyll a pixel values in the chlorophyll a concentration data of the nearshore area data to obtain logarithmically effective chlorophyll a data.
[0070] The logarithmic transformation takes the form of: The transformation function mathematically compresses the dynamic range difference between the nearshore high-value region and the offshore low-value region, which spans multiple orders of magnitude, thereby alleviating the gradient vanishing problem that may occur during the training of deep neural networks; where x is the effective chlorophyll a pixel value; y is the logarithmically effective chlorophyll a data.
[0071] Because the chlorophyll a concentration data contains invalid values such as land, the valid chlorophyll a pixel value refers to the data after removing the invalid land values from the original chlorophyll a concentration data; the logarithmic transformation still yields chlorophyll a data, but the values have changed due to the logarithmic transformation.
[0072] S14. Geographic Coordinate Encoding: Further, the coordinate encoding module is used to generate normalized geographic coordinate encoding of the nearshore area data based on the latitude and longitude grid, including the latitude normalization channel lat_norm and the longitude normalization channel lon_norm, whose value range is limited to 0 to 1. These are used as static spatial prior information and spliced into the feature dimension of the input tensor to enhance the model's ability to perceive differences in geographic spatial location.
[0073] This step is to ensure that the spatial grids of the three types of nearshore area data obtained by uniformly cropping to the nearshore research area are consistent.
[0074] The coordinate encoding module is an existing technology. Traditional neural networks have difficulty perceiving absolute position. This module inputs the latitude and longitude coordinates of each grid point as additional features into the model, allowing the model to "see" the specific geographical location of the data.
[0075] S15. Feature Standardization: During the training phase, the system prefits a standardization operator based on the dataset samples. According to the standardization operator, the logarithmically effective chlorophyll data and the physical environmental field data of the nearshore area data are standardized channel by channel and then concatenated with the normalized position code in the channel dimension to obtain the standardized nearshore environmental spatiotemporal data, which is used as the subsequent model input data. This ensures that each feature dimension has zero mean and unit variance, thereby improving the numerical stability of the model training process.
[0076] The dataset sample includes log-validated chlorophyll data and physical environmental field data of the nearshore area data;
[0077] The standardization operator is the mean and standard deviation of each data point, used to normalize the data, and needs to be calculated in advance before model training.
[0078] S16. Finally, the sliding window technique is used to construct a historical nearshore environmental spatiotemporal data sequence from multiple consecutive days of nearshore environmental spatiotemporal data, and the historical nearshore environmental spatiotemporal data sequence is divided into training set, validation set and test set according to the time sequence.
[0079] The nearshore environmental spatiotemporal data includes standardized logarithmically valid chlorophyll data, physical environmental field data of the nearshore area, and five-dimensional grid data with normalized geographic coordinate encoding. The data format is as follows: ,in Represents batch size. Represents the input time step length. The number of grid points representing the latitudinal direction of the nearshore research area. The number of grid points representing the longitude of the nearshore research area. The number of representative channels (including standardized logarithmically valid chlorophyll data and physical environmental field data and normalized geographic coordinate codes of the nearshore area data); the input historical time step length is set to 5 days, and the prediction target time step length is set to the next 3 days; the constructed historical nearshore environmental spatiotemporal data sequence is strictly divided into training set, validation set and test set according to the chronological order to ensure the scientific and objective nature of the model forecast performance evaluation.
[0080] A sliding window is a technique that uses a fixed-length time window to slide along a timeline in predetermined steps (usually one day or one moment), thereby breaking down a long, continuous time series into numerous overlapping input-output pairs. In this embodiment, its function is to divide several years of continuous historical data into countless sample blocks that predict the next three days (output window) using the past five days (input window) for training a neural network.
[0081] S2. Input the nearshore environmental spatiotemporal data sequence corresponding to the training set into the pre-constructed nearshore chlorophyll a spatiotemporal forecasting model for distributed parallel training and parameter optimization to obtain the trained nearshore chlorophyll a spatiotemporal forecasting model.
[0082] like Figure 2 As shown, the nearshore chlorophyll a spatiotemporal prediction model (BaT-ConvLSTM model) is a nearshore chlorophyll a concentration prediction model that uses local and background co-modeling. It consists of a multi-branch spatiotemporal feature encoding module, a multi-scale feature fusion enhancement module, and a multi-step prediction spatial decoding module.
[0083] The multi-branch spatiotemporal feature coding module is connected to the multi-scale feature fusion enhancement module and is used to receive the spatiotemporal data sequence of nearshore environment input by the user.
[0084] The multi-branch spatiotemporal feature encoding module consists of local branches and background and global time branches, and is used to simultaneously extract local evolution features and global background features from the input nearshore environment spatiotemporal data sequence.
[0085] The local branch consists of multiple layers of cascaded Convolutional Long Short-Term Memory (ConvLSTM) units. Each ConvLSTM unit contains a convolutional gating structure. By receiving the input features at the current time step and the hidden state at the previous time step, it updates the cell state and hidden state using Sigmoid and Tanh activation functions to capture the small-scale, sudden nonlinear spatiotemporal evolution features in nearshore waters. The local branch extracts the hidden state feature map of the last time step of the input nearshore environmental spatiotemporal data sequence and uses it as a local feature map (local_feat) to characterize the details of the nearshore high-gradient region. The local feature map is a local evolution feature and is sent to the multi-scale feature fusion and enhancement module.
[0086] The background and global temporal branch consists of a self-generated background modeling module, a multi-query temporal attention module, and a 1×1 convolutional layer. The self-generated background modeling module calculates the temporal mean field, the field at the end of the sequence, and the difference trend field between the first and last frames from the input nearshore environmental spatiotemporal data sequence. These three fields are concatenated along the channel dimension to obtain a feature tensor. This feature tensor is then compressed spatially using a 1×1 convolution to obtain a background feature map representing slowly changing background information. The multi-query temporal attention module compresses the nearshore environmental spatiotemporal data into a temporal feature vector sequence using spatial global average pooling. It introduces Q learnable query vectors and matches different temporal evolution patterns using a dot product attention mechanism to characterize global temporal features such as seasonal changes or abnormal fluctuations, obtaining a global temporal feature vector. This global temporal feature vector is then expanded spatially to form a temporal background feature map. The background and global temporal branch sends the background feature map and the fused temporal background features as global background features to the multi-scale feature fusion enhancement module.
[0087] The multi-scale feature fusion enhancement module is connected to the multi-branch spatiotemporal feature encoding module and the multi-step prediction spatial decoding module, respectively. The multi-scale feature fusion enhancement module consists of a feature fusion unit, a multi-scale dilated convolutional pyramid module, and a channel attention module. The feature fusion unit receives local evolution features from local branches and background and temporal background feature maps from background and global temporal branches, concatenates them in the channel dimension, and integrates pixel-level features using 1×1 convolution to achieve adaptive weight allocation for local dynamic features and large-scale background features, fusing them to obtain a fused feature tensor. The multi-scale dilated convolutional pyramid module (ASPP-Lite) consists of four parallel dilated convolutional branches with dilation rates A1, A2, A3, and A4, respectively. The number of output channels of each branch is distributed according to the dilation rate and concatenated along the channel dimension to obtain multi-scale enhanced features. These features are used to extract multi-scale spatial context information from nearshore narrowband details to large-scale offshore backgrounds at different receptive field scales. The number of output channels of each branch is evenly distributed and padded with remainders based on the preset total number of output channels, which can extract spatial features from local neighborhoods to large-scale regions without significantly increasing computational cost.
[0088] In this example, A1 is a positive integer greater than or equal to 1, and A4 = 2 * A3 = 4 * A2 = 8 * A1. The four are proportional. In this embodiment, A1, A2, A3 and A4 are 1, 2, 4 and 8 respectively.
[0089] The channel attention module consists of a pooling layer, two fully connected linear layers, and a Dropout layer.
[0090] The channel attention module calculates the weight coefficients of each channel through global average pooling and two fully connected linear layers, adaptively reweights the multi-scale enhanced features, and combines a two-dimensional Dropout layer to suppress overfitting, thereby obtaining an enhanced fused feature map. Finally, the enhanced fused feature map is sent to the multi-step prediction space decoding module.
[0091] The multi-step prediction spatial decoding module consists of a convolutional decoding sub-network, a residual refinement module, and a multi-horizon output head. The convolutional decoding sub-network consists of two 3×3 convolutional layers, a normalization layer, and a ReLU activation layer, used to progressively compress channel dimensions and extract the spatial texture features required for prediction. The residual refinement module performs boundary adjustment and detail compensation on the fused feature map through a residual branch composed of two 3×3 convolutional layers to obtain a refined feature map, so as to balance the reconstruction accuracy of high gradient areas along the coast and low value areas in the open sea. The multi-horizon output head consists of a 3×3 convolutional layer, used to receive the refined feature map from the residual refinement module and simultaneously generate multiple target elements for future time periods, i.e., chlorophyll a concentration prediction results, such as the spatiotemporal distribution prediction field for the next 3 days.
[0092] To improve the system's robustness in complex land-sea interface areas, a masking mechanism is introduced into the loss function design during the model training phase. The Masked Mean Square Error Loss (MSELoss) is adopted, which sets the loss weights for land areas and areas with missing values to 0, thereby ensuring that the model only performs forecast optimization for effective water areas. The predicted chlorophyll a concentration results are consistent with the input five-dimensional grid data in terms of spatial resolution, and the final nearshore chlorophyll a spatiotemporal forecast results are obtained through inverse standardization and exponential restoration in the output phase.
[0093] In this step, the system utilizes a distributed computing environment, a multi-objective parameter optimization algorithm, and a validation set feedback mechanism to achieve efficient learning of large-scale marine spatiotemporal raster data (the nearshore environmental spatiotemporal data sequence corresponding to the training set, hereinafter referred to as the nearshore environmental spatiotemporal data sequence) by the nearshore chlorophyll a spatiotemporal forecasting model.
[0094] S21. During the startup phase, the system performs resource scheduling for training environment configuration and distributed initialization;
[0095] Specifically, the system utilizes device management tools for environmental self-checks. By parsing the current status information of computing resources, it automatically identifies and selects idle computing units as available resources. To improve memory utilization efficiency during large-scale data processing, the system enables a dynamic memory management mechanism, allowing the computing cache to dynamically expand according to the tensor size, thereby avoiding performance bottlenecks caused by memory fragmentation.
[0096] S22. After resource scheduling is completed, the system constructs a multi-process distributed collaborative computing environment;
[0097] Inter-process communication baselines are established by setting communication addresses and dynamic ports, and a high-performance communication backend is used to initialize distributed process groups. During the data distribution phase, the system uses a distributed sampler to partition training samples without repetition, ensuring that the data processed by each computing process is independent. At the same time, the model is encapsulated through a distributed data parallel architecture, enabling multiple computing units to synchronously perform gradient calculations and parameter updates, achieving efficient parallel training.
[0098] During the training process, the forward computation of the nearshore chlorophyll a spatiotemporal prediction model goes through four core stages in sequence: multi-branch coding, feature fusion, multi-scale spatial enhancement, and spatial decoding.
[0099] S23. The input nearshore environment spatiotemporal data sequence is encoded by a multi-branch spatiotemporal feature coding module to simultaneously extract local feature maps, background feature maps, and temporal background feature maps.
[0100] Assume the input batch size is The input time step length is The number of input channels is The input nearshore environmental spatiotemporal data sequence is first fed into the model in a five-dimensional format, the data format of which is: To meet the computational requirements of convolutional neural networks, the system re-orders the dimensions of the original tensor (spatial-shore environmental spatiotemporal data) and transforms it into... The input sequence in the specified format is fed into the main body of the model;
[0101] S231. In the multi-branch coding stage, the local branch first performs short-term spatiotemporal dynamic modeling on the input sequence to obtain a local feature map;
[0102] Specifically, this includes: the input sequence entering a multi-layered concatenated ConvLSTM structure, in... Within each time step, the hidden state and memory state are cyclically updated using a convolutional gating mechanism to capture small-scale, sudden nonlinear evolutionary features in nearshore waters. After encoding, the system extracts the hidden state at the end of the sequence as a local feature map (local_feat), whose output tensor shape is... ,in This represents the number of hidden channels in a Convolutional Long Short-Term Memory (ConvLSTM) unit.
[0103] S232. At the same time, the background and global time branches model the slowly varying background information and long-term evolution patterns in the input sequence to obtain the background feature map and the time background feature map.
[0104] Specifically, this includes: the self-generated background modeling module calculating the time-averaged field, the field of the last frame of the sequence, and the difference trend field between the first and last frames from the input sequence, and then concatenating these three fields in the channel dimension to obtain a shape of... The feature tensor; this feature tensor is then passed through Convolution performs spatial compression and channel mapping, making its channel dimensions consistent with the hidden channel dimensions of the local branches, and outputs a background feature map bg_feat, the shape of which is... Based on this, the multi-query temporal attention module performs spatial global average pooling on the input sequence, compressing the input sequence into a temporal vector sequence, forming a shape of... The time features represent the sequence, and introduce A learnable query vector is used to match different temporal evolution patterns through a dot product attention mechanism, resulting in a global temporal feature vector after attention aggregation to characterize seasonal changes or abnormal fluctuations. This vector is then expanded in the spatial dimension after linear mapping, ultimately generating a temporal background feature map, `season_map`, whose output shape is also [missing information]. .
[0105] S24. After completing multi-branch feature encoding, the system enters the feature fusion and multi-scale spatial enhancement stage: the feature fusion unit concatenates the local feature map, background feature map, and temporal background feature map along the channel dimension to obtain a shape of... The concatenated feature tensor is then processed by... Convolutional gating mechanisms integrate pixel-level features, enabling the system to adaptively allocate weights between local dynamic information and large-scale background information, and output a fused feature tensor with the shape of... Based on this, the fused feature tensor is fed into the multi-scale dilated convolutional pyramid module, where spatial context information under different receptive fields is extracted from parallel convolutional branches with dilation rates of (1, 2, 4, 8), and then concatenated along the channel dimension to obtain multi-scale enhanced features with the shape of... Then, the multi-scale enhanced features are adaptively weighted through a channel attention module to highlight the feature channels that contribute significantly to the prediction results while suppressing redundant information. The shape of the output tensor remains unchanged, resulting in an enhanced fused feature map with the following shape: .
[0106] S25. Subsequently, the spatial decoding stage begins. The fused feature map is progressively compressed in terms of channel number and the spatial texture is reconstructed using a convolutional decoding sub-network. The shape of the decoded feature tensor output by the first layer of the decoder is... The shape of the decoded feature tensor output by the second layer is To further improve the reconstruction accuracy of spatial boundaries and detailed regions, the system introduces a residual refinement module in the decoding stage. This module compensates for texture and boundary errors in the fused feature map through residual connections. The shape of the decoded feature tensor after residual correction remains the same. Ultimately, the system simultaneously generates future data through a multi-horizon output head. The predicted chlorophyll a concentration results for each time period are shown in the following shape: ; It is a positive integer greater than or equal to 1;
[0107] S26. During model optimization, the system uses the Masked Mean Squared Error Loss (MSELoss) as the training objective function; let the model prediction result be... The corresponding observed true value is The binarized mask generated in the preprocessing stage is ,in Represents the effective water area pixels, If the region represents a land area or a region with missing pixels, then the mask mean square error loss function is defined as:
[0108] ,
[0109] in, This represents the index of dimension B in the batch, indicating the index of the currently calculated [number]. One data sample; The index represents the time step T, indicating the predicted digit. The nth future moment (e.g., the nth time step corresponding to the target prediction time step mentioned above) sky); Indicates the spatial location index of the grid point in the latitudinal direction H; Indicates the spatial location index of the grid point in the longitude direction W; This represents the specific numerical value of the model's prediction result in a particular dimension, i.e., the first... The sample at the th Each prediction time step, located in spatial grid coordinates The predicted value of the target variable (such as chlorophyll a concentration) at the location; This represents the observed true value corresponding to the prediction result (Ground Truth), i.e., the first... The sample at the th Each prediction time step, located in spatial grid coordinates The actual observed values at the location; The two-dimensional spatial binary mask generated during the preprocessing stage is represented by the coordinates... The value at that location. Because the spatial distribution characteristics of land and sea in the study area typically do not change with batch ( ) and time ( The mask changes, therefore it depends only on spatial coordinates. When coordinates The value is 1 when the area is within valid water; the value is 0 when the area is within land or a missing pixel area.
[0110] This loss function only backpropagates the prediction error within the effective water body area, thereby effectively avoiding interference from the land-sea boundary and missing areas on the model parameter update process;
[0111] S27. During the backpropagation and parameter optimization stages, the system introduces an automatic mixed-precision training mechanism to dynamically switch between low-precision and high-precision calculations, and combines this with a loss scaling strategy to ensure the numerical stability of gradient calculations. In distributed training scenarios, the local gradients calculated by each device are synchronized through an all-reduce operation, thereby achieving globally consistent parameter updates. Parameter optimization uses the Adam optimizer and introduces a weight decay term to constrain model complexity, causing the learning rate to gradually decay with each training round, ensuring that the model can converge smoothly in the later stages of training.
[0112] In a multi-GPU distributed training environment, local gradient refers to the parameter update direction calculated by a single GPU based solely on the small portion of data it receives. It cannot be used directly to update the model. Instead, it serves as the basic material, communicating and aggregating with the local gradients calculated by all other GPUs (i.e., the All-Reduce operation) to obtain a unique global gradient. Then, all GPUs use this unified global gradient to synchronously update their respective model parameters, thereby ensuring that the model on each GPU remains completely consistent.
[0113] S28. During the training monitoring and model persistence phase, the system performs inference evaluation using the validation set after each round of training, and calculates the mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination for different forecast lead times (e.g., Day 1, Day 2, Day 3). The system includes performance metrics such as feature extraction, feature fusion, and spatial decoding. When the validation set loss in a certain training round reaches the historical best level, the system automatically saves the weight parameters of each feature extraction, feature fusion, and spatial decoding module in the current model. At the same time, the system has a built-in early stopping mechanism. When the validation loss does not decrease significantly in F consecutive training rounds (below the preset threshold), the training process is automatically terminated to prevent the model from overfitting. Finally, the trained nearshore chlorophyll a spatiotemporal prediction model is obtained. In this embodiment, F is a positive integer, taking values in [20, 30]. Preferably, F is 25. The preset threshold is selected according to actual needs.
[0114] S3. The chlorophyll a concentration prediction results are obtained by performing short-term forecasts on newly input nearshore environmental spatiotemporal data sequences using the trained nearshore chlorophyll a spatiotemporal forecasting model.
[0115] S4. The predicted chlorophyll a concentration is first restored to logarithmic space using an inverse normalization operator, and then the following steps are performed: The inverse exponential transform restores the numerical value to the physical order of chlorophyll concentration (unit: Finally, the chlorophyll a concentration prediction matrix was obtained. Its shape is Corresponding to the future continuous The spatiotemporal distribution of chlorophyll a concentration over the days;
[0116] Since the data used in model training has been normalized and standardized, and the actual training data is not the real physical value, it is necessary to perform inverse standardization and other operations on the model's prediction results during inference to restore their values to the values in the real physical space and obtain the chlorophyll concentration at the physical order of magnitude.
[0117] Understandably, standardization operators scale data according to specific rules (such as Z-Score standardization: subtract the mean and divide the standard deviation) to make the feature mean 0 and the variance 1; inverse standardization operators are the reverse operation, restoring the standardized data to its original scale.
[0118] S5. Space Repair and Product Packaging Implementation: System Prediction Matrix for Chlorophyll a Concentration Two-stage spatial repair processing was performed to obtain the repaired and updated chlorophyll a concentration prediction matrix. First, a local edge-filling algorithm is used to repair fragmented pixels in the nearshore area. Then, a restricted channel dilation algorithm is used to extend the prediction matrix inland along the estuary direction, effectively eliminating prediction noise in inland lake areas while preserving the prediction information of rivers connected to the ocean. Finally, the xarray tool is used to extract the repaired chlorophyll a concentration prediction matrix. Encapsulating the corresponding geographic latitude and longitude coordinates, a standard NetCDF format file is generated to obtain a nearshore chlorophyll a spatiotemporal forecast product. Where t refers to the date of the initial field and τ refers to the forecast lead time.
[0119] The local edge filling algorithm is as follows: Based on the land-sea mask and the chlorophyll a concentration prediction matrix Y, it identifies pixels in the nearshore region that are adjacent to effective ocean pixels but have missing, abnormal, or fragmented predicted values. Within the local neighborhood window of each pixel to be repaired, the predicted chlorophyll a concentration values of the surrounding effective ocean pixels are statistically analyzed, and the repair value is calculated based on the spatial distance, connectivity, or statistical characteristics of the effective pixels in the neighborhood. When the number of effective ocean pixels in the local neighborhood meets a preset threshold, the pixel to be repaired is filled using a neighborhood distance-weighted average. When the number of effective pixels is insufficient, the pixel is left unupdated. In this way, scattered missing or fragmented predicted pixels in the nearshore edge region can be repaired without changing the large-scale spatial distribution structure, thus improving the spatial continuity of the nearshore chlorophyll a concentration forecast field.
[0120] The restricted channel expansion algorithm is as follows: Using the repaired effective nearshore prediction area as the initial expansion area, and combining land-sea masking, water body masking, or channel connectivity constraints, the algorithm performs limited expansion of river cells connected to the ocean along the estuary towards the inland direction. During the expansion process, only cells spatially connected to the current effective prediction area and meeting the river water body conditions are allowed to be included in the update range, and the expansion range is controlled according to preset maximum expansion distance, maximum number of iterations, or channel width constraints. For inland lakes, reservoirs, isolated water bodies, and enclosed water bodies that are not connected to the ocean, even if they are identified as water bodies by the water body masking, they do not participate in the expansion update. For river cells included in the expansion range, the chlorophyll a concentration prediction value of their adjacent effective ocean or estuary cells can be used for assignment, or a distance-weighted method on the connected path can be used for smooth updates. This method can preserve the forecast information with ocean connectivity in the estuary and river channel areas flowing into the sea, while suppressing spatial noise interference caused by isolated inland water bodies to nearshore chlorophyll a forecast products.
[0121] Understandable, It refers to predicting the future continuous The results of the day, such as the model settings A value of 5 means that the model can predict chlorophyll levels for the next 5 days; while τ is [1 Any value in ];
[0122] This embodiment proposes a spatiotemporal forecasting method for nearshore chlorophyll a based on local and background co-modeling. It is primarily implemented using a nearshore chlorophyll a spatiotemporal forecasting model (BaT-ConvLSTM) based on local and background co-modeling. This model consists of a multi-branch spatiotemporal feature encoding module, a multi-scale feature fusion enhancement module, and a multi-step prediction spatial decoding module. A dataset corresponding to the spatiotemporal data of the nearshore environment is constructed, and the dataset is divided into training, validation, and test sets according to time sequence. The dataset is then pruned and logarithmically transformed to compress magnitude differences, and latitude and longitude normalized coordinate channels are injected to enhance spatial location. First, the system is trained using a training set. Then, the ConvLSTM local branch unit, self-generated background modeling unit, multi-query temporal attention unit, and multi-scale dilated convolutional pyramid are trained. During training, a masked mean squared error loss function (Masked-MSELoss) is introduced to eliminate interference from land and missing values on gradient updates. After each training round, the prediction accuracy of the trained prediction system is tested using a validation set. If the network weight parameters in that round result in the minimum validation loss and optimal prediction performance, the weight parameters of each trainable module in that round are saved. After the final training round, the best-performing nearshore chlorophyll a spatiotemporal prediction model is obtained. Finally, the best-performing prediction model is used to perform short-term forecasts based on continuous nearshore environmental data from multiple time intervals input by the user. This invention, while ensuring the grid spatial structure and short-term evolution capability, utilizes a multi-branch architecture to extract local dynamics and global background features, solving the problems of insufficient background constraints and blurred detail characterization in existing models, improving forecast accuracy and stability, and realizing high-resolution Chl-a short-term forecasts for complex nearshore sea areas.
[0123] Example 2
[0124] This embodiment selects the coastal waters of Guangzhou (between the western outer edge of the Pearl River Estuary and the coast of Guangzhou) as the coastal research area, with the geographical range defined as 20° to 24° north latitude and 112° to 116° east longitude. The present invention is used to carry out operational forecasting of chlorophyll a (Chl-a) concentration.
[0125] The first step is to construct a nearshore chlorophyll a (Chl-a) spatiotemporal forecasting system based on a nearshore chlorophyll a spatiotemporal forecasting model using local and background co-modeling. For example... Figure 1 As shown, the system receiving format constructed in this embodiment is as follows: The five-dimensional grid sequence data, i.e., the spatiotemporal data of the nearshore environment. In this embodiment, the batch size... Set the value to 8, and input the time step length. For 5 days, spatial resolution for Number of channels for input elements It includes Chl-a concentration after logarithmic transformation, physical environmental field, and normalized geographic coordinate encoding.
[0126] 1.1 The local branches of the multi-branch spatiotemporal feature encoding module employ three cascaded ConvLSTM units. Each layer utilizes a convolutional gating structure to capture nearshore small-scale evolutionary features, with the number of hidden channels set to 64. The system receives a sequence input from the past five days and extracts the hidden state feature map of the last moment (day 5) of the input sequence as the local feature `local_feat`, whose tensor shape is... .
[0127] 1.2 The background and global time branching methods utilize a self-generated background modeling module to calculate the time average field, the field at the end of the sequence (day 5), and the difference trend field between the first and last frames (day 5 minus day 1) from the input 5-day sequence. These three fields are then concatenated along the channel dimension. Convolution compression into shape is The background feature map bg_feat. Simultaneously, the multi-query time attention module introduces four learnable query vectors ( By using a dot product attention mechanism to match seasonal variation patterns, an updated temporal background feature map, `season_map`, is generated, with the following output shape: .
[0128] 1.3 The multi-scale feature fusion enhancement module receives the local_feat output from the local branch, the background feature map bg_feat output from the background branch, and the temporal background feature map season_map, and concatenates them along the channel dimension to form The tensor, and through Convolutional integration The data is then fed into the ASPP-Lite module, where multi-scale spatial context information is extracted from parallel branches with expansion rates of 1, 2, 4, and 8. The outputs of each branch are then concatenated to obtain a shape of... Enhanced features. The channel attention module calculates the weights of 192 channels through global average pooling, adaptively weights the multi-scale features, and combines a Dropout layer to suppress overfitting.
[0129] 1.4 The convolutional decoding subnetwork in the multi-step prediction spatial decoding module consists of two layers. The convolution process progressively compresses the number of channels, with the first layer outputting a feature map of type 1. The second layer output feature map is The residual refinement module uses two layers. The residual branch, constructed from convolutions, performs boundary adjustments and detail compensation on the 64-channel feature map. Finally, the multi-horizon output head generates a target feature prediction field for the next three days, with the output tensor shape being... .
[0130] 1.5 During the model training phase, the Masked Mean Squared Error Loss (MSELoss) function is used. A binary mask generated based on land and missing values is used to set the weights of the corresponding regions to 0, thus ensuring that the model optimizes only for the effective water body region. The generated forecast field is inversely normalized and then subjected to... Inverse exponential transform, after The numerical value of the logarithmic transformation is converted back to physical units. The actual Chl-a concentration forecast results.
[0131] The second step involves constructing the nearshore chlorophyll a spatiotemporal forecasting system dataset. This embodiment details how to construct and preprocess a standardized dataset for model training and evaluation based on multi-source operational marine products. Regarding data sources, the diurnal L4-level global multi-source satellite ocean color fusion product (OCEANCOLOUR_GLO_BGC_L4_MY_009_104) provided by CMEMS is selected as the core training data. This product, after atmospheric correction and temporal interpolation, provides a spatially continuous chlorophyll a (Chl-a) raster field. Simultaneously, the analytical forecast product (GLOBAL_ANALYSISFORECAST_BGC_001_028) is selected as operational reference data for comparative evaluation of model forecast results.
[0132] 2.1 Fault-Tolerant Index Implementation: The system utilizes a dynamic file indexing mechanism based on regular expressions to automatically retrieve multi-source data. In this embodiment, the algorithm can parse file paths containing date strings and version number identifiers (e.g., _UTC+08), enabling automatic matching and fault-tolerant reading of multi-source heterogeneous NetCDF format data, thereby ensuring accurate alignment and stable loading of data in the time dimension;
[0133] 2.2 Study Area Cropping and Mask Generation: All retrieved marine element data, including chlorophyll a (Chl-a), physical fields, and biogeochemical fields, were uniformly cropped to the nearshore study area between 20° and 24° North latitude and 112° and 116° East longitude. Subsequently, numerical validity discrimination methods were used to identify land areas and missing pixels, generating a spatial resolution of [missing information - likely a specific value]. A binary mask is used to shield the influence of non-water areas during subsequent model training and loss function calculation.
[0134] 2.3 Nonlinear Order-of-Flight Compression Transformation: Logarithmic transformation is performed on the valid Chl-a pixel values. This embodiment uses a transformation function... This method can effectively compress nearshore high-concentration areas (typically higher than...). ) and offshore low-concentration areas (usually below) The dynamic range difference between them spans several orders of magnitude, compressing the original difference of hundreds of times to a range of several times, thereby alleviating the gradient vanishing problem in the training process of deep neural networks and improving the convergence stability of the model.
[0135] 2.4 Geographic Coordinate Encoding Injection: A normalized spatial location encoding channel, including a latitude normalized channel, is generated through the coordinate encoding module. and longitude normalization channel The generated coordinate grid size is Its value ranges from 0 to 1, and it is used as prior information in static space to be concatenated into the feature dimension of the input tensor, thereby enhancing the model's ability to perceive differences in different geographical locations.
[0136] 2.5 Channel-by-Channel Feature Standardization: The system pre-fits a standardization operator based on the training set samples and performs channel-by-channel standardization on Chl-a and other environmental physical elements to ensure that each feature dimension meets the zero-mean and unit-variance distribution. This step unifies the numerical scale of different physical quantities, effectively improving the numerical stability and convergence efficiency of the model training process.
[0137] 2.6 Spatiotemporal Sequence Sample Construction and Dataset Partitioning: The sliding window technique is used to construct continuous time series data into a five-dimensional tensor format. The training samples. In this embodiment, the input historical time step length is set. Day, predict the target time step length After the sample was constructed, the data was divided according to chronological order, with data from 2000 to 2022 used as the training set, data from 2023 to 2024 used as the validation set, and data from 2025 used as the test set, to ensure the scientific and objective nature of the model's forecast performance evaluation.
[0138] The third step involves the distributed parallel training and parameter optimization of the nearshore chlorophyll a spatiotemporal forecasting system. This embodiment details how to utilize a distributed computing environment and specific optimization strategies to efficiently train and perform performance tuning on a forecasting system based on the BaT-ConvLSTM architecture.
[0139] 3.1 Training Environment Configuration and Dynamic Memory Management Implementation: This embodiment executes training tasks in a distributed environment composed of multiple computing units. Upon system startup, a hardware self-test is performed using a device management tool to identify the current resource load and select idle computing units. (The last sentence appears to be incomplete and possibly refers to a specific implementation or feature.) To address the memory pressure caused by high-resolution raster data, the system enables the expandable_segments:True dynamic expansion mechanism, thereby reducing memory fragmentation during training and improving memory utilization efficiency and data throughput.
[0140] 3.2 Distributed Collaboration and DDP Encapsulation Implementation: The system establishes a distributed communication foundation by configuring MASTER_ADDR and MASTER_PORT, and initializes process groups using a high-performance communication backend. During the data loading phase, a DistributedSampler mechanism is introduced to ensure that data samples processed by different computing cards do not overlap. The overall model is encapsulated using the DistributedDataParallel (DDP) architecture to achieve synchronous gradient calculation and consistent parameter updates across multiple devices, thereby improving training efficiency.
[0141] 3.3 Forward computation input and dimensionality rearrangement implementation: Set batch size during training. Enter the historical time step Spatial resolution , Input channel number It includes standardized, logarithmically valid chlorophyll data, physical environmental field data of the nearshore area, and normalized geographic coordinate encoding. The original input tensor shape is... Before entering the model, convert it to a channel-first format. The input sequence is used to meet the computational requirements of deep learning frameworks.
[0142] 3.4 Local Branch Encoding Implementation: The input sequence enters a ConvLSTM network structure consisting of three cascaded layers. The nonlinear dynamic changes of the nearshore water body are modeled through a convolutional gating mechanism. In this embodiment, the number of hidden channels is set to [number missing]. The hidden state of day 5 of the sequence is extracted as a local feature map local_feat, and its output shape is... .
[0143] 3.5 Background and Global Temporal Branch Encoding Implementation: In the self-generated background modeling part, the system calculates the temporal mean field, the final time field, and the first and last frame difference trend field for the input 5-day sequence, respectively. After concatenation in the channel dimension, it compresses the data to obtain a shape of... The background feature map bg_feat. In the multi-query time attention mechanism, the raster sequence is first compressed into The time vector is used, and four learnable query vectors are introduced for global pattern matching. The aggregated time features are spatially expanded to form a time background feature map, season_map, with the shape of [shape missing]. .
[0144] 3.6 Feature Fusion and Multi-Scale Enhancement Implementation: The local_feat, bg_feat, and season_map are concatenated along the channel dimension to form... The tensor, and through Convolution is used for gating and integration, and the output shape is The fusion feature is then input into the multi-scale dilated convolutional pyramid module (ASPP-Lite), which extracts multi-scale spatial context information from parallel branches with dilation rates of 1, 2, 4, and 8. The outputs of each branch are then concatenated to obtain a shape of... Multi-scale enhancement features.
[0145] 3.7 Spatial Decoding and Multi-Horizon Output Implementation: The enhanced features are first adaptively weighted by the channel attention module, and then input into the decoding sub-network for spatial reconstruction via a convolutional neural network. The first layer output feature map of the decoder is as follows: The second layer output is In the residual refinement stage, the feature map boundary error is compensated through residual branching. Finally, the output head simultaneously generates the forecast results for the next three days, with the output tensor shape being... .
[0146] 3.8 Masked Loss Function Optimization Implementation: The masked mean square error loss function (MaskedMSELoss) is used as the optimization objective in model training to mask land areas and missing pixels, so that the model only updates the gradient for the prediction error of the effective water area, thereby improving the physical rationality and numerical stability of the training.
[0147] 3.9 Mixed Precision Training and Optimizer Implementation: Automatic Mixed Precision (AMP) technology is introduced during training, combined with a loss scaling strategy, to improve computational efficiency while ensuring computational stability. Local gradients generated by each computing device are updated synchronously through an All-Reduce mechanism. The optimizer uses Adam and is configured with a learning rate scheduling strategy, where the step size parameter is step_size=5 and the decay factor gamma=0.5, so that the learning rate gradually decreases with each training epoch, thereby promoting model convergence.
[0148] 3.10 Monitoring Indicators and Early Termination Mechanism Implementation: After each training round, the model is evaluated using the validation set, and the MAE, RMSE, and [other parameters] of the 1-day, 2-day, and 3-day forecasts are calculated. The system automatically saves the current model weights when the validation set performance is better than the historical best result. Simultaneously, an early stopping mechanism is implemented: if the validation set loss does not significantly decrease within 25 consecutive rounds, the training process is automatically terminated to prevent overfitting.
[0149] The fourth step involves using the trained nearshore chlorophyll a spatiotemporal forecasting system to perform operational forecasts. This embodiment details how to utilize the optimal weight parameters, which have undergone distributed training, to perform automated inference and spatial repair on real-time environmental sequence data input by the user, thereby producing forecast products that meet operational accuracy requirements.
[0150] 4.1 Implementation of User Input Standardization and Feature Transformation: The system receives a 5-day historical observation sequence of the Guangzhou nearshore area input by the user. Its data format is A five-dimensional tensor, in which the number of channels The system includes information on Chl-a concentration and geographic coordinates. First, it standardizes the input data based on the overall mean and standard deviation of the training set, and then performs standardization on the Chl-a feature channels. A logarithmic transformation is performed to balance the dynamic range of the data, followed by the injection of normalized latitude and longitude location encoding channels to obtain a standardized input matrix. It is then input into the multi-branch spatiotemporal feature encoding module.
[0151] 4.2 Local Feature Extraction Implementation: Local branches utilize a 3-layer concatenated convolutional long short-term memory network (ConvLSTM) for... Forward computation is performed. A convolutional gating structure is used to dynamically capture small-scale and sudden nonlinear evolution information in nearshore waters, and the hidden state output of the final time step (day 5) is extracted to obtain a local feature map. Its shape is 64 is the number of hidden channels. .
[0152] 4.3 Implementation of Feature Extraction for Self-Generated Background Modeling: The self-generated background modeling unit receives... Simultaneously calculate the time average field of the 5-day sequence, the field at the end of the sequence (day 5), and the difference trend field of the first and last frames (day 5 minus day 1). After concatenating these three fields along the channel dimension, [the process is then performed using...]. Convolutional compression generates background feature maps. Its shape is It is used to provide stable background prior information.
[0153] 4.4 Implementation of Global Temporal Pattern Extraction: The multi-query temporal attention module utilizes spatial global average pooling to extract... Compress to The time vector sequence, through 4 learnable query vectors ( The system matches and models seasonal patterns and periodic changes, and then expands the resulting global temporal feature vector in the spatial dimension to generate a temporal background feature map. Its shape is .
[0154] 4.5 Pixel-level feature fusion implementation: Feature fusion unit receives... , and After splicing along the channel dimension, through Convolutional gating mechanisms enable pixel-level feature integration. This process adaptively weights local dynamic features with global background features to obtain a fused feature tensor. Its shape is .
[0155] 4.6 Multi-scale spatial augmentation implementation: fusing feature tensors The ASPP-Lite module is input, and multi-scale spatial context information is extracted from parallel dilated convolution branches with dilation rates of 1, 2, 4, and 8. This enables the model to simultaneously perceive small-scale changes in the narrow estuarine region and the large-scale structure of the open ocean circulation. Finally, the enhanced feature map is obtained by stitching the data together. Its shape is The number of channels has been expanded to 192.
[0156] 4.7 Channel Adaptive Weighted Implementation: Channel Attention Module Reception By calculating the saliency weight coefficients of each channel, adaptive reweighting is performed on the feature responses at different scales to obtain the enhanced feature map. .
[0157] 4.8 Spatial Decoding and Refinement Implementation: Feature Map The input consists of two layers. The decoding network, constructed from convolutions, performs channel compression, reducing the number of channels to 96 and then 64. Subsequently, the residual refinement module compensates for and optimizes boundary gradients and high-frequency details through residual branches, generating a reconstructed high-dimensional prediction feature map. And pass it to the output module.
[0158] 4.9 Forecast Generation and Physical Quantity Reduction Implementation: The multi-horizon output head simultaneously generates forecasts for the next 3 days through convolutional layers. These forecasts are first reduced to logarithmic space using an inverse normalization operator, and then... The inverse exponential transform restores the numerical value to the physical order of chlorophyll concentration (unit: The final prediction matrix is obtained. Its shape is This corresponds to the spatiotemporal distribution results for the next three consecutive days.
[0159] Since the data used in model training has been normalized and standardized, and the actual training data is not the real physical value, it is necessary to perform inverse standardization and other operations on the model's prediction results during inference to restore their values to the values in the real physical space and obtain the chlorophyll concentration at the physical order of magnitude.
[0160] Understandably, standardization operators scale data according to specific rules (such as Z-score standardization: subtracting the mean and dividing by the standard deviation) to make the feature mean 0 and the variance 1; inverse standardization operators are the reverse operation, restoring the standardized data to its original scale.
[0161] 4.10 Spatial Repair and Product Packaging Implementation: System for Prediction Matrix A two-stage spatial restoration process is performed: First, a local edge-filling algorithm is used to repair fragmented pixels in the nearshore area. Then, a restricted channel dilation algorithm is used to extend the forecast inland along the estuary direction, effectively eliminating prediction noise in inland lake areas while preserving forecast information of rivers connected to the ocean. Finally, the forecast field is encapsulated with the corresponding geographic latitude and longitude coordinates using the xarray tool to generate a standard NetCDF format file, resulting in the nearshore chlorophyll a spatiotemporal forecast product. Where t refers to the date of the initial field and τ refers to the forecast lead time.
[0162] Step 5, Experimental Results:
[0163] 5.1 Experimental Setup and Evaluation Methods. This embodiment selects the coastal area of Guangzhou (112°–116°E, 20°–24°N) as the research object to systematically evaluate the performance of the coastal chlorophyll a spatiotemporal forecasting system. The ground truth data uses the L4 level global multi-source satellite water color fusion product (Product ID: OCEANCOLOUR_GLO_BGC_L4_MY_009_104) provided by the Copernicus Marine Environment Monitoring Service (CMEMS). This data undergoes unified atmospheric correction and temporal interpolation processing, exhibiting diurnal continuity and spatial coverage integrity.
[0164] In terms of sample construction, the system reassembles the original raster data into fixed-length spatiotemporal sequence samples according to time sequence. The input time step is set to 5 days, and the prediction time step is the next 3 days, that is, it uses historical observation data from 5 consecutive days to predict the spatial distribution of chlorophyll a for the next 3 days. In terms of dataset partitioning, the data from 2000 to 2025 are divided into training set, validation set and test set according to time sequence. The test set selects data from January 1, 2025 to November 7, 2025. This part of the data is not used in the model training and validation process, but is used to evaluate the model's generalization ability and business extrapolation performance.
[0165] For model comparison, traditional recurrent neural network LSTM and ConvLSTM with spatial convolution structure were selected as benchmark models. All models were inferenced under the same computing environment and a unified test set. Meanwhile, the CMEMS Global Marine Biogeochemical Analysis and Forecasting Product (Product ID: GLOBAL_ANALYSISFORECAST_BGC_001_028) was introduced as operational reference data. Forecast accuracy was compared through daily difference analysis to evaluate the performance of the method in practical applications.
[0166] In terms of evaluation indicators, the root mean square error (RMSE), mean absolute error (MAE), and coefficient of determination (R²) are used as core quantitative indicators to measure the degree of deviation between the predicted results and the actual observed values and the fitting ability. The calculation formulas are as follows:
[0167] ,
[0168] in, The total number of test samples; For the first The actual observed values of each sample; For the first The model prediction value for each sample; This is the average of all true observations.
[0169] By statistically analyzing the spatial average prediction error across the entire study area, the overall forecasting performance of different models during the test period was evaluated. The statistical results are shown in Table 1.
[0170] Table 1. Comparison of daily evaluation metrics for different models (BaT-ConvLSTM / ConvLSTM / LSTM)
[0171] Experimental results show that the proposed BaT-ConvLSTM model achieves the lowest root mean square error (RMSE) and mean absolute error (MAE) under various prediction durations, while also reaching the highest level in the coefficient of determination (R²). Compared to the basic ConvLSTM model, this invention demonstrates superior numerical stability and stronger spatiotemporal feature fitting ability under different forecast lead times.
[0172] refer to Figure 3 , Figure 3This is a spatial distribution comparison of the forecast results of the nearshore chlorophyll a spatiotemporal forecasting model of this invention with other comparative models. The first to fourth rows correspond to typical dates in winter (January), spring (April), summer (July), and autumn (October) of 2025, respectively; the first column is the satellite inversion ground truth, and the second to fourth columns are the 1-day forecast results of the BaT-ConvLSTM model, ConvLSTM model, and LSTM model of this invention, respectively.
[0173] From winter to autumn, it can be seen that BaT-ConvLSTM can reproduce the location and morphology of the narrow high-value zone along the Pearl River Estuary and adjacent sea areas well in all seasons. It has a relatively clear depiction of the tongue-shaped high-value zone extending beyond the estuary and local high-value patches. At the same time, it maintains a low-value background and a relatively smooth gradient structure close to the observation in the offshore area, making it the closest to the observation overall. In contrast, although ConvLSTM can roughly capture the main high-value zone along the Pearl River Estuary in the nearshore area, the high-value area is generally wider, and the location of local extreme values is somewhat offset. In some periods, there are also large-scale systematic biases in the offshore area where the background field is generally higher or lower than normal. It is significantly weaker than BaT-ConvLSTM in terms of detail depiction of the narrow coastal zone and local patches. LSTM, due to the lack of an explicit spatial convolution structure, has a smoother predicted field. The high values of the narrow coastal zone are significantly weakened or even flattened, and small-scale patches are difficult to distinguish. It can only reflect the general spatial distribution trend.
[0174] 5.2 Daily Comparison of the Nearshore Chlorophyll a Spatiotemporal Forecasting Model BaT-ConvLSTM with Existing Operational Products. (Reference) Figure 4 To further evaluate the performance of this project's forecast products, we systematically assessed the project's products (forecasts for the next 3 days) against the global marine biogeochemical analysis field provided by CMEMS under the same conditions. Evaluation metrics included mean absolute error (MAE) and root mean square error (RMSE). Multi-source remote sensing chlorophyll concentration interpolation data provided by Copernicus were used as ground truth. In the absence of historical forecast product archives, this method, by constructing a daily difference sequence of Δ = Forecast - CMEMS, provides the best feasible approach to directly measure the relative merits of the two types of products on the same observation set.
[0175] Experimental results show that, in daily comparisons from January 1, 2025 to August 1, 2025, the forecast product of this study outperformed CMEMS across all three lead periods (D+1, D+2, and D+3). Taking D+1 as an example, this product exhibited a lower overall error level compared to CMEMS. In the 174 valid comparison samples at this stage, approximately 86% (150 days) of the RMSE and 90% (156 days) of the MAE were superior to CMEMS, demonstrating a significant short-term forecasting advantage. Entering the D+2 stage, the advantage converged somewhat but remained significant. In the 175 valid comparison samples, approximately 80% (140 days) of the RMSE and 86% (150 days) of the MAE were still superior to CMEMS. By D+3, with the increase in forecast lead time, the cumulative error effect became more pronounced, but this product still maintained a certain advantage. In 176 valid comparison samples, the RMSE was better than CMEMS in about 76% (134 days) and the MAE was better in 81% (143 days), indicating that even with a three-day lead time, this model can still provide higher quality forecasts than CMEMS on the vast majority of dates.
[0176] It should be noted that this specification is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 A process, multiple processes, and / or boxes Figure 1 Devices that specify the functions in one or more boxes.
[0177] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including an instruction device, which is implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0178] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0179] The parts of this invention not described in detail are prior art. It will be apparent to those skilled in the art that this invention is not limited to the details of the above exemplary embodiments, and that the invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be regarded as exemplary and non-limiting in all respects, and are intended to encompass all changes falling within the meaning and scope of equivalents within this invention.
Claims
1. A method for spatio-temporal prediction of offshore chlorophyll-a based on local background co-modeling, characterized in that, Includes the following steps: S1. Based on multi-source operational marine products, multi-source heterogeneous data are obtained and preprocessed to obtain the historical nearshore environmental spatiotemporal data sequence of the nearshore research area. Then, the historical nearshore environmental spatiotemporal data sequence is divided into training set, validation set and test set according to time order. S2. Input the nearshore environmental spatiotemporal data sequence corresponding to the training set into the pre-constructed nearshore chlorophyll a spatiotemporal forecasting model for distributed parallel training and parameter optimization to obtain the trained nearshore chlorophyll a spatiotemporal forecasting model. The nearshore chlorophyll a spatiotemporal prediction model consists of a multi-branch spatiotemporal feature encoding module, a multi-scale feature fusion enhancement module, and a multi-step prediction spatial decoding module. The multi-branch spatiotemporal feature encoding module synchronously extracts local feature maps, background feature maps, and temporal background feature maps from the input nearshore environmental spatiotemporal data sequence. The multi-scale feature fusion enhancement module concatenates and integrates the local feature maps, background feature maps, and temporal background feature maps, performs multi-scale enhancement, and then performs adaptive weighting to obtain a fused feature map. The multi-step prediction spatial decoding module compresses and reconstructs the fused feature map and corrects the residuals before outputting the predicted chlorophyll a concentration results for multiple future time periods. S3. The chlorophyll a concentration prediction results are obtained by performing short-term forecasts on newly input nearshore environmental spatiotemporal data sequences using the trained nearshore chlorophyll a spatiotemporal forecasting model.
2. The method according to claim 1, characterized in that, The method further includes: S4. The predicted chlorophyll a concentration is first restored to logarithmic space using an inverse normalization operator, and then the following steps are performed: The inverse exponential transform restores the chlorophyll concentration values to physical quantities, ultimately yielding the chlorophyll a concentration prediction matrix. ; S5. Chlorophyll a concentration prediction matrix The local edge filling algorithm and the restricted channel expansion algorithm are used for repair, and then the repaired chlorophyll a concentration prediction matrix is used. The corresponding geographic latitude and longitude coordinates are encapsulated to generate a standard format file, resulting in a nearshore chlorophyll a spatiotemporal forecast product.
3. The method according to claim 1, characterized in that, The multi-branch spatiotemporal feature encoding module consists of local branches and background and global temporal branches. The local branches are composed of multiple layers of convolutional long short-term memory network units. Each convolutional long short-term memory network unit contains a convolutional gating structure. By receiving the input features at the current time step and the hidden state at the previous time step, the cell state and hidden state are updated using sigmoid and tanh activation functions. The local branches extract the hidden state feature map of the last time step of the input nearshore environment spatiotemporal data sequence as the local feature map. The background and global temporal branches consist of a self-generated background modeling module, a multi-query temporal attention module, and a 1×1 convolutional layer. The self-generated background modeling module calculates the temporal mean field, the field at the end of the sequence, and the difference trend field between the first and last frames from the input nearshore environment spatiotemporal data sequence, and concatenates the three in the channel dimension to obtain a feature tensor. The feature tensor is then compressed into a spatial feature map through a 1×1 convolution. The multi-query temporal attention module compresses nearshore environmental spatiotemporal data into a sequence of temporal feature vectors through spatial global average pooling, introduces Q learnable query vectors, and obtains a global temporal feature vector by matching different temporal evolution patterns through a dot product attention mechanism. The global temporal feature vector is then expanded into a temporal background feature map in the spatial dimension.
4. The method according to claim 3, characterized in that, The multi-scale feature fusion enhancement module consists of a feature fusion unit, a multi-scale dilated convolutional pyramid module, and a channel attention module. The feature fusion unit receives local evolution features from local branches and background and temporal feature maps from background and global temporal branches. These are concatenated along the channel dimension, and pixel-level feature integration is achieved using 1×1 convolutions to adaptively allocate weights to local dynamic features and large-scale background features, resulting in a fused feature tensor. The multi-scale dilated convolutional pyramid module consists of four parallel dilated convolutional branches with dilation rates A1, A2, A3, and A4, respectively. The number of channels output by each branch is proportionally allocated and concatenated along the channel dimension to obtain multi-scale enhanced features. The channel attention module consists of a pooling layer, two fully connected linear layers, and a Dropout layer. The channel attention module calculates the weight coefficients of each channel using global average pooling and two fully connected linear layers, adaptively reweights the multi-scale enhanced features, and combines a two-dimensional Dropout layer to suppress overfitting, resulting in an enhanced fused feature map.
5. The method according to claim 4, characterized in that, The multi-step prediction spatial decoding module consists of a convolutional decoding sub-network, a residual refinement module, and a multi-horizon output head. The convolutional decoding sub-network compresses and reconstructs the fused feature map, and the residual refinement module corrects the residuals before the multi-horizon output head outputs the chlorophyll a concentration prediction results for multiple future time periods.
6. The method according to claim 5, characterized in that, The convolutional decoding subnetwork consists of two 3×3 convolutional layers, a normalization layer, and a ReLU activation layer, used to progressively compress the channel dimension and extract the spatial texture features required for prediction; the residual thinning module performs boundary adjustment and detail compensation on the fused feature map through a residual branch composed of two 3×3 convolutional layers to obtain a thinned feature map; the multi-horizon output head consists of a single 3×3 convolutional layer, used to receive the thinned feature map from the residual thinning module and simultaneously generate chlorophyll a concentration prediction results for multiple future time periods based on the thinned feature map.
7. The method according to claim 5, characterized in that, Step S1 specifically includes the following steps: S11. Using a date-matching-based dynamic file indexing mechanism, chlorophyll a concentration data and physical environment field data are retrieved and indexed from global multi-source satellite water color fusion products through regular expression matching algorithms, and biogeochemical field data are retrieved and indexed from global marine biogeochemical analysis and forecast products to construct multi-source heterogeneous data. S12. The retrieved chlorophyll a concentration data, physical environmental field data, and biogeochemical field data are uniformly cropped to the nearshore study area to obtain nearshore area data. The numerical validity discrimination method is used to identify the land area and missing pixels in the nearshore study area, and the corresponding binarization mask M is generated. The nearshore area data includes chlorophyll a concentration data, physical environmental field data, and biogeochemical field data of the nearshore study area. S13. Perform a logarithmic transformation on the valid chlorophyll a pixel values in the chlorophyll a concentration data of the nearshore area to obtain logarithmically valid chlorophyll a data. S14. Use the coordinate encoding module to generate normalized geographic coordinate codes for the nearshore area data based on the latitude and longitude grid; S15. Based on the pre-fitted standardization operator, the logarithmically effective chlorophyll data and the physical environment field data of the nearshore area data are standardized channel by channel and then spliced with the normalized position code in the channel dimension to obtain the standardized nearshore environment spatiotemporal data. S16. Using the sliding window technique, the spatiotemporal data of the nearshore environment over several consecutive days are constructed into a historical spatiotemporal data sequence of the nearshore environment, and the historical spatiotemporal data sequence of the nearshore environment is divided into a training set, a validation set, and a test set according to the chronological order.
8. The method according to claim 7, characterized in that, Step S2 specifically includes the following steps: S21. During the startup phase, the system performs resource scheduling for training environment configuration and distributed initialization; S22. After resource scheduling is completed, the system constructs a multi-process distributed collaborative computing environment; S23. The input nearshore environmental spatiotemporal data sequence is simultaneously extracted by multi-branch encoding using the multi-branch spatiotemporal feature encoding module, which extracts local feature maps, background feature maps, and temporal background feature maps. The data format of the input nearshore environmental spatiotemporal data is as follows: The shapes of the local feature map, background feature map, and temporal background feature map are all... ;in, This represents the number of hidden channels in a convolutional long short-term memory network unit; where, Represents batch size. Represents the input time step length. The number of grid points representing the latitudinal direction of the nearshore research area. The number of grid points representing the longitude of the nearshore research area. Represents the number of channels; S24. The local feature map, background feature map, and temporal background feature map are stitched together along the channel dimension by the feature fusion unit to obtain a shape of... The concatenated feature tensor is then processed by... Convolutional gating mechanisms integrate pixel-level features to obtain a fused feature tensor with the shape of... Then, the fused feature tensor is fed into the multi-scale dilated convolutional pyramid module to obtain multi-scale enhanced features. Finally, the multi-scale enhanced features are adaptively weighted by the channel attention module to obtain the enhanced fused feature map. S25. In the spatial decoding stage, the fused feature map is progressively compressed in terms of channel number and the spatial texture is reconstructed through the convolutional decoding sub-network, wherein the shape of the decoded feature tensor output by the first layer of the decoder is as follows: The shape of the decoded feature tensor output by the second layer is The decoded feature tensor is obtained by compensating for texture and boundary errors in the fused feature map through a residual refinement module, and the shape remains the same. Finally, the future is generated simultaneously through a multi-horizon output head. The predicted chlorophyll a concentration results for each time period are shown in the following shape: .
9. The method according to claim 8, characterized in that, Step S2 also includes: S26. During model optimization, the system uses the mask mean square error loss function as the training objective function; let the model prediction result be... The corresponding observed true value is The mask mean square error loss function L is defined as follows: , in, This represents the index of dimension B in the batch, indicating the index of the currently calculated [number]. One data sample; The index represents the time step T, indicating the predicted digit. A future moment; Indicates the spatial location index of grid points along the latitudinal direction; Indicates the spatial location index of grid points along the longitude direction; This represents the spatial grid coordinates of the i-th sample at the t-th prediction time step. The predicted value of the target variable at the location; This represents the spatial grid coordinates of the i-th sample at the t-th prediction time step. The actual observed value at the location; M is the binarization mask, where Represents the effective water area pixels, Indicates a land area or a region with missing pixels; The binary mask M generated during the preprocessing stage represents the coordinates... The value at; S27. In the backpropagation and parameter optimization stages, an automatic mixed-precision training mechanism and a loss scaling strategy are introduced. In the distributed training scenario, the local gradients calculated by each computing device are updated synchronously through a full reduction operation. The parameter optimization adopts the Adam optimizer and introduces a weight decay term to constrain the model complexity, so that the learning rate gradually decays with the training rounds. S28. During the training monitoring and model persistence phase, after each round of training, the validation set is used for inference evaluation, and performance indicators for different future forecast lead times are statistically analyzed. The performance indicators include mean absolute error, root mean square error, and coefficient of determination. When the validation set loss of a certain round of training reaches the historical best level, the system automatically saves the weight parameters of each feature extraction, feature fusion, and spatial decoding module in the current model. At the same time, an early stopping mechanism is set. When the validation set loss does not fall below a preset threshold in F consecutive rounds of training, the training process is automatically terminated, and the trained nearshore chlorophyll a spatiotemporal forecast model is finally obtained.
10. The method according to claim 8, characterized in that, Step S23 specifically includes: The input spatiotemporal data sequence of the nearshore environment is fed into a multi-layered cascaded convolutional long short-term memory network unit structure. Within each time step, the hidden state and memory state are cyclically updated using a convolutional gating mechanism to capture small-scale, sudden nonlinear evolutionary features in nearshore waters. After encoding, the hidden state at the end of the sequence is extracted as a local feature map, and its output tensor shape is... ; The self-generated background modeling module calculates the time-averaged field, the field of the last frame of the sequence, and the difference trend field between the first and last frames from the input spatiotemporal data sequence of the nearshore environment, and then stitches the above three fields together in the channel dimension to obtain a shape of The feature tensor; the feature tensor is then passed through Convolution performs spatial compression and channel mapping, making its channel dimensions consistent with the hidden channel dimensions of the local branches, and outputs a background feature map with the shape of... Based on this, the multi-query time attention module performs spatial global average pooling on the input nearshore environmental spatiotemporal data sequence, compressing the input nearshore environmental spatiotemporal data sequence into a time vector sequence, forming a shape of and introduce A learnable query vector is used to match different temporal evolution patterns through a dot product attention mechanism, resulting in a global temporal feature vector after attention aggregation to characterize seasonal changes or abnormal fluctuations. This vector is then expanded in the spatial dimension after linear mapping, ultimately generating a temporal background feature map, the output shape of which is also [missing information]. .
Citation Information
Patent Citations
Offshore chlorophyll concentration prediction method and system based on spatial-temporal feature fusion
CN115587646A