A ship traffic flow prediction method and device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-13
- Publication Date
- 2026-08-11
AI Technical Summary
[0005]本发明实施例提供一种船舶交通流预测方法及装置,以解决在面对AIS数据噪声、拓扑结构异常及非平稳时序特征时鲁棒性不足的问题
[0016]In the ship traffic flow prediction method and apparatus provided by this invention, dynamic traffic flow correlation information is obtained from cleaned traffic flow data and fused with geospatial connectivity information to construct an initial adjacency matrix. Further, the initial adjacency matrix is denoised based on a low-rank representation mechanism using node embedding to form a robust adjacency matrix. This process can explicitly capture the spatial correlation of ship traffic flow dynamics over time and suppress noise and spurious connections, thereby solving the problem of traditional adjacency matrices being susceptible to noise interference. In addition, the denoised robust adjacency matrix is fused with the cleaned traffic flow data, and spatial features are extracted from the fused matrix. The extracted spatial features are then input into a liquid neural network (LNN) for temporal feature extraction. This constructs a temporal modeling mechanism that can dynamically adjust the memory span and parameters to adaptively capture non-stationary, high-frequency dynamic changes, improving the accuracy and robustness of traffic flow temporal modeling in complex waters. The ship traffic flow prediction method provided in this invention achieves high-precision, multi-step, and stable prediction of ship density, speed, and flow in multiple segments under complex environments with missing AIS data, false connections in the topology, and strong non-stationarity of traffic flow. It also significantly improves the perception capability and early warning timeliness of navigation situation in complex waters, providing reliable data support for maritime supervision, waterway planning, and ship navigation plans. It has good practical value and prospects for promotion.
Smart Images

Figure CN122551609A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent water transportation technology, specifically to a method and apparatus for predicting ship traffic flow. Background Technology
[0002] Vessel traffic flow prediction is one of the core functions of Intelligent Waterway Transportation Systems (IWTS), providing crucial data support for maritime regulation, waterway planning, and vessel navigation. However, existing deep learning prediction technologies still have limitations in complex maritime scenarios.
[0003] First, traditional recurrent neural networks typically treat each segment or grid as an independent node, ignoring the inherent spatial topology of waterways (such as upstream-downstream connections and the influence of junctions). Some methods employing graph convolutional networks (GCNs) often assume a static graph structure, failing to adapt to the dynamic spatial relationships of ship traffic flow over time, leading to spatiotemporal decoupling and limited prediction accuracy. Second, the lack of deep cleaning and graph structure denoising mechanisms for AIS data trajectory drift, abrupt changes, large-area missing data, and spurious spatial relationships results in high sensitivity to multi-source maritime noise, easily causing prediction distortion. Furthermore, facing the strong non-stationarity of maritime traffic flow (such as sudden changes in flow due to accidents), time-series models with fixed parameters cannot dynamically adjust memory spans and evolution constants, making it difficult to capture high-frequency dynamic changes.
[0004] To address the aforementioned issues of "multi-source noise" and "non-stationary dynamics," there is an urgent need for a robust ship traffic flow prediction method to achieve high-precision perception of navigation conditions in complex waterways. Summary of the Invention
[0005] This invention provides a method and apparatus for predicting ship traffic flow to address the problem of insufficient robustness when facing AIS data noise, topological anomalies, and non-stationary time series characteristics.
[0006] On one hand, the present invention provides a method for predicting ship traffic flow, the method comprising: Obtain the original AIS trajectory sequence of the vessel in the target waters and clean the original AIS trajectory sequence; Dynamic traffic flow correlation information is obtained from the cleaned traffic flow data. The dynamic traffic flow correlation information is fused with geospatial location connectivity information to obtain an initial adjacency matrix. The initial adjacency matrix is then denoised based on a low-rank representation mechanism with node embedding. The denoised robust adjacency matrix is fused with the cleaned traffic flow data, and spatial features are extracted from the fused matrix. Then, a liquid neural network is used to extract temporal features from the extracted spatial features. Spatial features and extracted temporal features are fused together, and ship traffic flow prediction results are obtained based on the fused spatiotemporal features.
[0007] In some embodiments of the present invention, a liquid neural network is used to extract temporal features from the extracted spatial features, including: The hidden state vector of the current time window and the spatial features of the current time window are weighted and combined to obtain the combined state; and the hidden state vector of the current time window is subjected to basic decay processing to obtain the decayed state. The combined state and the decayed state are numerically discretized and solved. The hidden state vector of the current time window is updated using the solved state to obtain the hidden state of the next time window. The temporal features are obtained by integrating the spatial features along the time axis based on the hidden states of each time window.
[0008] In some embodiments of the present invention, dynamic traffic flow correlation information is fused with geospatial location connectivity information to obtain an initial adjacency matrix, and the initial adjacency matrix is denoised based on a low-rank representation mechanism of node embedding, including: Construct a geographic adjacency matrix based on geospatial connectivity information; Construct a dynamic traffic flow correlation matrix based on dynamic traffic flow correlation information; The geographic adjacency matrix and the dynamic traffic flow correlation matrix are linearly weighted and fused to obtain the initial adjacency matrix; Based on the initial adjacency matrix, a joint optimization objective function is constructed, and the joint optimization objective function is jointly optimized using the backpropagation algorithm, finally obtaining the denoised robust adjacency matrix: ; In the formula, This is the initial adjacency matrix; This represents the robust adjacency matrix after denoising. Represents the node embedding matrix. For the embedding dimension, N is the total number of spatial grid nodes; This represents the Frobenius norm, used to measure matrix reconstruction error. This represents the nuclear norm, used to constrain the low-rank property of the node embedding matrix; and This is the regularization hyperparameter.
[0009] In some embodiments of the present invention, the denoised robust adjacency matrix is fused with the cleaned traffic flow data, and spatial feature extraction is performed on the fused matrix, including: Add self-loops to the denoised robust adjacency matrix to obtain the adjacency matrix with added self-loops; The adjacency matrix with added self-loops is fused with the cleaned traffic flow data, and the fused matrix is input into a graph convolutional network to extract spatial features from the fused matrix.
[0010] In some embodiments of the present invention, the spatial features are fused with the extracted temporal features, including: By using a fully connected layer, spatial features and extracted temporal features are mapped to the same dimension and concatenated along the feature dimension to obtain a joint state representation; We utilize a multi-head attention mechanism to fuse joint state representations.
[0011] In some embodiments of the present invention, the original AIS trajectory sequence is cleaned, including: The original AIS trajectory sequence is preprocessed to obtain initial cleaned traffic flow data. The traffic flow data after initial cleaning is cropped using the spatial grid corresponding to the target water area, and macroscopic basic features are extracted from the cropped data. The extracted macroscopic basic features are imputed for missing values and outliers are removed to obtain cleaned traffic flow data.
[0012] In some embodiments of the present invention, trajectory preprocessing is performed on the original AIS trajectory sequence to obtain initially cleaned traffic flow data, including: Kinematic features are extracted from the original AIS trajectory sequence, and the enhanced trajectory points are obtained based on the extracted kinematic features. The enhanced trajectory points are mapped to a feature space constructed based on the kinematic feature change rate of neighboring points, and the density-based DBSCAN clustering algorithm is used to remove noise points from the enhanced trajectory points to obtain effective trajectory points. A cubic spline interpolation algorithm is used to smoothly reconstruct the effective trajectory points to obtain the traffic flow data after initial cleaning.
[0013] In some embodiments of the present invention, macroscopic fundamental characteristics include ship traffic flow, average speed, and ship density; Traffic flow data after initial cleaning is cropped using the spatial grid corresponding to the target water area, and macroscopic basic features are extracted from the cropped data, including: Based on the latitude and longitude coordinates of the valid trajectory points in the traffic flow data after initial cleaning, the valid trajectory points are mapped to the spatial grid to obtain the grid position of the valid trajectory points in the spatial grid; Based on the relationship between the spatial grid boundary and the grid position, the effective trajectory points are clipped to obtain clipped data; Ship traffic flow, average speed, and ship density were extracted from the cropped data.
[0014] In some embodiments of the present invention, the extracted macroscopic basic features are subjected to missing value imputation and outlier removal to obtain cleaned traffic flow data, including: The K-nearest neighbor algorithm is used to impute missing values in macroscopic basic features, and Gaussian mixture model is used to detect outliers in the imputed features. The outliers are then replaced with neighborhood smoothing values to obtain the final cleaned traffic flow data.
[0015] On the other hand, the present invention also provides a ship traffic flow prediction device, the device comprising: The data acquisition and cleaning module is used to acquire the original AIS trajectory sequence of vessels in the target waters and clean the original AIS trajectory sequence. The robust spatial topology construction module is used to obtain dynamic traffic flow correlation information from cleaned traffic flow data, fuse the dynamic traffic flow correlation information with geospatial location connectivity information to obtain an initial adjacency matrix, and denoise the initial adjacency matrix based on a low-rank representation mechanism of node embedding. The dynamic spatiotemporal feature encoding module is used to fuse the denoised robust adjacency matrix with the cleaned traffic flow data, extract spatial features from the fused matrix, and use a liquid neural network to extract temporal features from the extracted spatial features. The spatiotemporal feature fusion and prediction output module is used to fuse spatial features with extracted temporal features and obtain ship traffic flow prediction results based on the fused spatiotemporal features.
[0016] In the ship traffic flow prediction method and apparatus provided by this invention, dynamic traffic flow correlation information is obtained from cleaned traffic flow data and fused with geospatial connectivity information to construct an initial adjacency matrix. Further, the initial adjacency matrix is denoised based on a low-rank representation mechanism using node embedding to form a robust adjacency matrix. This process can explicitly capture the spatial correlation of ship traffic flow dynamics over time and suppress noise and spurious connections, thereby solving the problem of traditional adjacency matrices being susceptible to noise interference. In addition, the denoised robust adjacency matrix is fused with the cleaned traffic flow data, and spatial features are extracted from the fused matrix. The extracted spatial features are then input into a liquid neural network (LNN) for temporal feature extraction. This constructs a temporal modeling mechanism that can dynamically adjust the memory span and parameters to adaptively capture non-stationary, high-frequency dynamic changes, improving the accuracy and robustness of traffic flow temporal modeling in complex waters. The ship traffic flow prediction method provided in this invention achieves high-precision, multi-step, and stable prediction of ship density, speed, and flow in multiple segments under complex environments with missing AIS data, false connections in the topology, and strong non-stationarity of traffic flow. It also significantly improves the perception capability and early warning timeliness of navigation situation in complex waters, providing reliable data support for maritime supervision, waterway planning, and ship navigation plans. It has good practical value and prospects for promotion. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.
[0018] Figure 1 This is a flowchart illustrating the ship traffic flow prediction method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the liquid neural network provided in an embodiment of the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] 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 technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0021] "A and / or B" includes the following three combinations: A only, B only, and a combination of A and B.
[0022] The use of "applies to" or "configured to" in this invention implies an open and inclusive language, which does not exclude the applicability to or configuration to devices performing additional tasks or steps. Additionally, the use of "based on" implies openness and inclusivity, because processes, steps, calculations, or other actions "based on" one or more conditions or values may in practice be based on additional conditions or values beyond those conditions.
[0023] In this invention, the term "exemplary" is used to mean "serving as an example, illustration, or description." Any embodiment described as "exemplary" in this invention is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed herein.
[0024] The ship traffic flow prediction method and apparatus provided by the embodiments of the present invention are described below with reference to the accompanying drawings.
[0025] like Figure 1 As shown in the figure, an embodiment of the present invention provides a method for predicting ship traffic flow, which includes the following steps: S101, Obtain the original AIS trajectory sequence of the vessel in the target waters and clean the original AIS trajectory sequence.
[0026] S102: Obtain dynamic traffic flow correlation information from the cleaned traffic flow data, fuse the dynamic traffic flow correlation information with geospatial location connectivity information to obtain an initial adjacency matrix, and denoise the initial adjacency matrix based on the low-rank representation mechanism of node embedding.
[0027] S103, the denoised robust adjacency matrix is fused with the cleaned traffic flow data, and spatial features are extracted from the fused matrix. Then, a liquid neural network is used to extract temporal features from the extracted spatial features.
[0028] S104 fuses spatial features with extracted temporal features and obtains ship traffic flow prediction results based on the fused spatiotemporal features.
[0029] The ship traffic flow prediction method provided in this invention obtains dynamic traffic flow correlation information from cleaned traffic flow data and fuses it with geospatial connectivity information to construct an initial adjacency matrix. Further, based on a low-rank representation mechanism using node embedding, the initial adjacency matrix is denoised to form a robust adjacency matrix. This process explicitly captures the spatial correlation of ship traffic flow dynamics over time and suppresses noise and spurious connections, thus solving the problem of traditional adjacency matrices being susceptible to noise interference. In addition, the denoised robust adjacency matrix is fused with the cleaned traffic flow data, and spatial features are extracted from the fused matrix. The extracted spatial features are then input into a liquid neural network (LNN) for temporal feature extraction. This constructs a temporal modeling mechanism that can dynamically adjust the memory span and parameters to adaptively capture non-stationary, high-frequency dynamic changes, improving the accuracy and robustness of traffic flow temporal modeling in complex waters. The ship traffic flow prediction method provided in this invention achieves high-precision, multi-step, and stable prediction of ship density, speed, and flow in multiple segments under complex environments with missing AIS data, false connections in the topology, and strong non-stationarity of traffic flow. It also significantly improves the perception capability and early warning timeliness of navigation situation in complex waters, providing reliable data support for maritime supervision, waterway planning, and ship navigation plans. It has good practical value and prospects for promotion.
[0030] In some embodiments of the present invention, such as Figure 2 As shown, step S103 includes the following sub-steps: S1031, the hidden state vector of the current time window and the spatial features of the current time window are weighted and combined to obtain the combined state; and the hidden state vector of the current time window is subjected to basic decay processing to obtain the decayed state.
[0031] S1032, numerically discretize the combined state and the decayed state, and use the solved state to update the hidden state vector of the current time window to obtain the hidden state of the next time window.
[0032] S1033, based on the hidden state of each time window, and by integrating the spatial features along the time axis, the temporal features are obtained.
[0033] In some examples, to address the non-stationarity of maritime traffic flows, embodiments of the present invention introduce a liquid neural network (LNN) to process spatial features. Let the time series of the spatial features be... When it is input into an LNN, the hidden state of the LNN... The dynamic evolution is governed by the following ordinary differential equation: ; in, This indicates that LNN operates within a time window. The internal hidden state vector; This represents the rate of change of the hidden state over time; It is the basic decay factor used to control the rate at which a state is forgotten; That is, the state after decay; It is the sigmoid activation function; This is the internal state weight matrix; The external space feature weight matrix; It is the bias vector; This is a combined state.
[0034] In practical engineering implementations, continuous differential equations need to be discretized using numerical methods. This embodiment of the invention employs the Euler method to discretize and solve the aforementioned ordinary differential equations, assuming a time step of . Therefore, the hidden state discrete update rule is: ; in, Indicates the hidden state of the next time window; The time step is set to be consistent with the data sampling interval. This approach enables LNNs to be compatible with discrete-time-step training in deep learning frameworks.
[0035] Based on the aforementioned hidden state discrete update rule, the LNN integrates the spatial feature sequence along the time axis to output a deeply decoupled continuous spatiotemporal feature tensor. .
[0036] In some embodiments of the present invention, step S102 includes the following sub-steps: S1021, Construct a geographic adjacency matrix based on geospatial connectivity information.
[0037] In the geographic adjacency matrix, if two spatial grids are geographically adjacent or located in the same connectivity channel, the two spatial grids are assigned a higher connectivity weight to represent the inherent geographic association between the grids and reflect the geographic spatial connectivity.
[0038] S1022, Construct a dynamic traffic flow correlation matrix based on dynamic traffic flow correlation information.
[0039] Specifically, based on the cleaned traffic flow data at the current time step t, the dynamic traffic flow correlation matrix between each grid node is calculated. It is used to capture the functional association features between nodes that change dynamically over time.
[0040] S1023, for the geographical adjacency matrix Correlation matrix with dynamic traffic flow Perform linear weighted fusion to obtain the initial adjacency matrix. Indicatively, ,in, and To balance the hyperparameters of geographical priors and dynamic data relationships, and to satisfy... .
[0041] S1024: Based on the initial adjacency matrix, a joint optimization objective function is constructed, and the joint optimization objective function is jointly optimized using the backpropagation algorithm to finally obtain the denoised robust adjacency matrix. ; In the formula, This is the initial adjacency matrix; This represents the robust adjacency matrix after denoising. Represents the node embedding matrix. For the embedding dimension, N is the total number of spatial grid nodes (i.e., the total number of grids after the target water area is discretized). This represents the Frobenius norm, used to measure matrix reconstruction error. The nuclear norm (the sum of the singular values of a matrix) is used to constrain the low-rank property of the node embedding matrix. and The regularization hyperparameter is determined through cross-validation.
[0042] In this step, it is assumed that the graph structure can be obtained through a low-dimensional node feature matrix. To achieve the reconstructed representation, based on this assumption, a joint optimization objective function for graph structure denoising is constructed. This joint optimization objective function is integrated into the total loss function of model training (the model includes multi-layer GCN, liquid neural network LNN, multi-head attention fusion, and MLP), and the node embedding matrix... It is considered a learnable parameter and is jointly optimized end-to-end with other weight parameters in the model through the backpropagation algorithm.
[0043] Among them, the low-rank constraint term As a regularization term, it forces the learned graph structure to retain the main features of the waterway topology (i.e., low rank) while suppressing spurious connections caused by factors such as occasional fluctuations in traffic flow. This optimization method is directly integrated into the gradient descent training process, ensuring the stability and efficiency of model training and guaranteeing that the final graph structure accurately reflects the real waterway topology.
[0044] In some embodiments of the present invention, a smooth HuberLoss is used as the base loss during model training to reduce the adverse effects of extreme outliers on model gradient updates. The final joint training loss function is formalized as follows: ; in, This represents the total loss function value; The loss for the prediction task is represented by HuberLoss. and The error between; The data consists of real traffic flow labels after flow-level cleaning; The regularization loss term for graph topology denoising is, i.e. The objective function value is optimized. To balance the prediction task and the graph structure optimization task, the joint adjustment coefficient is usually set between 0.01 and 0.1.
[0045] Model training is performed using an end-to-end backpropagation mechanism based on gradient descent, enabling the model to adaptively correct the underlying physical spatial topology while continuously minimizing traffic flow prediction errors. The model optimizer uses the Adam optimizer, with an initial learning rate of 0.001 and a batch size of 64.
[0046] In some embodiments of the present invention, the denoised robust adjacency matrix is fused with the cleaned traffic flow data, and spatial feature extraction is performed on the fused matrix, including: Add self-loops to the denoised robust adjacency matrix to obtain the adjacency matrix with added self-loops.
[0047] The adjacency matrix with added self-loops is fused with the cleaned traffic flow data, and the fused matrix is input into a graph convolutional network to extract spatial features from the fused matrix.
[0048] In some examples, the robust adjacency matrix obtained after low-rank denoising optimization is... As a spatial topological prior, it is combined with the traffic flow tensor that has undergone sequence-level cleaning and input into the graph convolutional network (GCN) module.
[0049] For specific time steps To ensure that each spatial node effectively retains its original characteristics during the domain information aggregation process, the robust adjacency matrix is first... Perform the add loop operation: ; in, This represents the adjacency matrix after adding self-loops; This represents the identity matrix, used to ensure that the characteristics of the nodes themselves are not ignored.
[0050] Based on the adjacency matrix after adding self-loops The corresponding angle matrix A symmetric normalized Laplace matrix is constructed to achieve feature propagation between spatial nodes. Wherein, the... The spatial propagation rules of layer GCN are defined as follows: ; in, Indicates the first The hidden layer node feature matrix of the layer; Indicates the first The input feature matrix of the layer, when hour, That is, the initial input feature matrix is the cleaned traffic flow data; express The degree matrix, ; Indicates the first The learnable weight parameter matrix of the layer; To represent a non-linear activation function, the ReLU function is used, i.e. .
[0051] After multi-layer GCN aggregation, the output is a spatial feature representation matrix with high noise resistance. .
[0052] In some embodiments of the present invention, step S104 includes the following sub-steps: S1041 utilizes a fully connected layer to map spatial features and extracted temporal features to the same dimension and concatenate them along the feature dimension to obtain a joint state representation.
[0053] S1042 utilizes a multi-head attention mechanism to fuse joint state representations.
[0054] In some examples, fully connected layers are used to map spatial and temporal features to a unified latent feature dimension. After mapping, the spatial and temporal features are concatenated along the feature dimension to construct a joint state representation before fusion. A multi-head attention mechanism is introduced to perform cross-computation and deep fusion of features on the joint state representation.
[0055] Specifically, for the joint state representation, query matrices are generated using different linear mapping matrices. Key matrix Sum matrix In a single attention head, scaled dot product attention is used to calculate the spatiotemporal correlation weights between features: ; in, The query matrix represents the feature information that is currently of interest. The key matrix represents the index information of the features of interest. The value matrix represents the feature content that actually participates in the weighting; The dimension of the key vector; This is a scaling factor to prevent the softmax gradient from vanishing due to an excessively large dot product result. This is a normalized exponential function used to transform association weights into an effective probability distribution.
[0056] To enable the model to capture multi-scale, multi-dimensional spatiotemporal coupling features from multiple representation subspaces, a method is adopted. The parallel attention heads synchronously calculate the association weights, concatenate the outputs of all attention heads along the feature dimension, and then transform them through a linear output layer to obtain the final fused spatiotemporal features. .
[0057] Obtaining the fused spatiotemporal features Then, a multilayer perceptron (MLP) is used as a regression predictor to map the high-dimensional abstract features into prediction results of the target physical quantity. ; in, Represents the prediction result tensor. This represents the number of time steps for future predictions; N is the number of spatial grid nodes. To predict feature dimensions (such as traffic flow density, speed, etc.); This represents a multilayer perceptron network containing at least two fully connected layers and a nonlinear activation function.
[0058] In some embodiments of the present invention, step S101 includes the following sub-steps: S1011, Perform trajectory preprocessing on the original AIS trajectory sequence to obtain the initial cleaned traffic flow data.
[0059] S1012, the traffic flow data after initial cleaning is cropped using the spatial grid corresponding to the target water area, and macroscopic basic features are extracted from the cropped data.
[0060] S1013, perform missing value imputation and outlier removal on the extracted macro-basic features to obtain cleaned traffic flow data.
[0061] In some embodiments of the present invention, step S1011 includes the following sub-steps: S201, extract kinematic features from the original AIS trajectory sequence, and obtain the feature-enhanced trajectory points based on the extracted kinematic features.
[0062] In some examples, the original AIS trajectory sequence of the vessel in the target waterway is obtained. For each given vessel, its original trajectory is arranged in ascending order by timestamp to form a discrete state sequence. The kinematic features such as velocity, acceleration amplitude and turning rate are calculated for each trajectory point in the discrete state sequence to obtain the feature-enhanced trajectory point.
[0063] S202 maps the enhanced trajectory points to a feature space constructed based on the kinematic feature change rate of neighboring points, and uses the density-based DBSCAN clustering algorithm to remove noise points from the enhanced trajectory points to obtain valid trajectory points.
[0064] In some examples, the enhanced trajectory points are mapped to a feature space constructed based on the rate of change of kinematic features of neighboring trajectory points.
[0065] In the feature space, Euclidean distance is used to measure the spatial similarity between trajectory points, and a neighborhood radius parameter α and a minimum number of contained points threshold MinPts are set to define the local density. The neighborhood radius parameter α represents the maximum feature distance threshold, and its specific value is adaptively determined according to the AIS update frequency and the maximum speed of ships in the actual water area. It is used to determine whether different trajectory points belong to the same neighborhood. The minimum number of contained points threshold MinPts represents the minimum number of data points contained within a neighborhood radius α centered on a certain trajectory point.
[0066] Based on the aforementioned neighborhood radius parameter α and the minimum number of contained points threshold MinPts, trajectory points are calibrated and eliminated: if the number of trajectory points contained in the neighborhood of any trajectory point is not less than MinPts (MinPts=5), then the trajectory point is marked as a core point; if it falls within the neighborhood of a core point but does not meet the core point condition, then it is marked as a boundary point; if it is neither a core point nor a boundary point, then it is determined to be a noise point and eliminated, thereby obtaining valid trajectory points.
[0067] S203 uses a cubic spline interpolation algorithm to smoothly reconstruct the effective trajectory points to obtain the traffic flow data after initial cleaning.
[0068] In some examples, to address the issue of discontinuous time intervals in the trajectory after cleaning, embodiments of the present invention employ cubic spline interpolation technology for smooth reconstruction.
[0069] Specifically, let the time series of the effective trajectory points after cleaning be... , where t i t represents the acquisition time of the i-th valid trajectory point. i Corresponding longitude observation value l i The sequence of longitude observations for all trajectory points is as follows: A piecewise function is constructed for the aforementioned time series and longitude observation series. l(t) Make it in each time sub-interval The expression satisfies a cubic polynomial in t, and is true over the entire [t1, t2]. m It has a second continuous derivative.
[0070] Meanwhile, to ensure the reconstruction curve is accurate and smooth, the interpolation process needs to satisfy both interpolation and smoothness conditions. The interpolation condition requires the curve to pass strictly through all valid observation points to ensure consistency between the reconstruction result and the original observations; the smoothness condition requires continuity of position, velocity, and acceleration at the splicing points of adjacent intervals. Let the second derivative at the nodes be... Based on the continuity condition, we can derive the following about The system of tridiagonal linear equations is used. The chasing method is employed to efficiently solve the system of equations, obtaining the second derivatives at each node, and further calculating the coefficients of the cubic spline function in each time sub-interval, thereby obtaining a smooth trajectory curve as the initial cleaned traffic flow data.
[0071] In some embodiments of the present invention, the macroscopic fundamental characteristics include ship traffic flow, average speed, and ship density. Accordingly, step S1012 includes the following sub-steps: S301. Based on the latitude and longitude coordinates of the valid trajectory points in the traffic flow data after initial cleaning, the valid trajectory points are mapped to the spatial grid to obtain the grid position of the valid trajectory points in the spatial grid.
[0072] In some examples, the grid resolutions for the longitudinal and latitudinal directions are respectively... and Then the number of grid rows Number of columns The calculation expression is as follows: ; in, and These represent the maximum and minimum latitude values of the studied water area, respectively; and These represent the maximum and minimum longitude values of the studied water area, respectively. and These are the grid step sizes for latitude and longitude, respectively; This indicates the floor function.
[0073] Let any number of... The latitude and longitude coordinates of the valid trajectory points are: Then its corresponding grid row index and column indexes The calculation is as follows: ; ; in, This indicates a round-down operation; and These represent the minimum latitude and minimum longitude values of the studied water area, respectively. and These represent the grid step size in the latitude and longitude directions, respectively, and the grid position includes the grid row index. and column indexes .
[0074] S302, based on the relationship between the spatial grid boundary and the grid position, clips the valid trajectory points to obtain clipped data.
[0075] In some examples, to ensure that the index value is within a valid range, i.e., satisfying... and The grid is cropped based on the grid position of each valid trajectory point. If the grid row index of the valid trajectory point is... and column indexes If it exceeds the range, it will be clipped to the boundary grid. Then set it to 0, if Then set to The same applies to column indexes, so I won't go into detail.
[0076] S303 extracts ship traffic flow, average speed, and ship density from the cropped data.
[0077] In some examples, a fixed time sampling window is set in the time dimension. Based on spatial grids and temporal sampling windows, three macroscopic fundamental characteristic data—ship traffic flow, average speed, and ship density—are calculated and extracted, specifically including: Ship traffic flow To achieve this within a specific time window, through the first Line number The total number of ships in the grid is calculated using the following formula: ; in, Indicates the first Line number Column grid in the Ship traffic flow at each time step; This indicates the number of unique Maritime Mobile Service Identity (MMSI) codes detected within this spatiotemporal grid. As an indicator function, when the ship speed The value is 1 when it is greater than 0, and 0 otherwise, and is used to exclude stationary ships.
[0078] average speed To be within a specific time window, the first Line number The average ground speed (SpeedOverG) of all valid vessels in the column grid is calculated using the following formula: ; in, Indicates the first Line number Column grid in the Average speed at each time step; Indicates the first The speed of a ship relative to the ground within this spatiotemporal grid (unit: knots); This represents the number of valid ships with a velocity greater than 0 within the spatiotemporal grid, i.e. .
[0079] Ship density The formula for calculating the number of ships per unit area within a specific time window is as follows: ; in, Indicates the first Line number Column grid in the Ship density at each time step; Indicates the first Line number The actual physical area of the grid, usually measured in square nautical miles.
[0080] After extracting the above three features, for the first... At each time step, the traffic flow state across the entire waterway is represented as a three-dimensional tensor. The three dimensions correspond to three characteristic channels: ship traffic flow, average speed, and ship density.
[0081] In some embodiments of the present invention, the extracted macroscopic basic features are subjected to missing value imputation and outlier removal to obtain cleaned traffic flow data, including: The K-nearest neighbor algorithm is used to impute missing values in macroscopic basic features, and Gaussian mixture model is used to detect outliers in the imputed features. The outliers are then replaced with neighborhood smoothing values to obtain the final cleaned traffic flow data.
[0082] In some examples, for the missing feature values to be imputed, a vector set of macroscopic basic features is obtained, the Euclidean distance between this vector set and the historical state vectors is calculated, and the vector set with the smallest distance is selected. Each historical time step forms a nearest neighbor set.
[0083] The missing value imputation uses a KNN imputation formula based on inverse distance weighting: ; in, Indicates the first The grid in the first The interpolated eigenvalues at each time step; Denotes the nearest neighbor set, which contains A similar historical time window index; Indicates the first The weight of each nearest neighbor; Indicates the first Feature values of the nearest neighbor time windows; Indicates the current time window and the first Euclidean distance between the feature vectors of the nearest neighbor time windows; To prevent the smoothing constant from having a denominator of zero, it is usually set to... .
[0084] After imputing missing values, a Gaussian Mixture Model (GMM) is used to probabilistically model the normal traffic flow distribution in each grid. Assume the traffic flow state variables... Obey The probability density function formed by linear combinations of Gaussian distributions Its mathematical expression is as follows: ; in, Representing traffic flow state variables The mixture probability density value; The number of Gaussian components is determined by the Bayesian Information Criterion (BIC), and is preferably 3. Indicates the first The mixed weights of the Gaussian components satisfy the constraints. and ; Indicates the first The probability density function of a Gaussian component is given by: ; in, Indicates the first The mean of the Gaussian components; Indicates the first The variance of a Gaussian component; This represents the natural exponential function.
[0085] The normal generation probability of traffic flow observations is calculated using the Gaussian Mixture Model (GMM). Abrupt noise is identified by using a probability threshold, and outliers are replaced with neighborhood smoothing values. Finally, clean and stable cleaned traffic flow data is obtained. .
[0086] The ship traffic flow prediction method provided in this invention extends from a single macroscopic filtering to a multi-level collaborative cleaning of "microscopic trajectory - macroscopic flow level". It identifies and repairs microscopic trajectory deviations through DBSCAN clustering and cubic spline interpolation. At the same time, it eliminates macroscopic sequence mutation noise through KNN gap repair sequence and GMM anomaly filtering, thus preventing prediction distortion caused by high sensitivity.
[0087] On the other hand, embodiments of the present invention also provide a ship traffic flow prediction device, which includes a data acquisition and cleaning module, a robust spatial topology construction module, a dynamic spatiotemporal feature encoding module, and a spatiotemporal feature fusion and prediction output module.
[0088] The data acquisition and cleaning module is used to acquire the original AIS trajectory sequence of vessels in the target waters and clean the original AIS trajectory sequence.
[0089] The robust spatial topology construction module is used to obtain dynamic traffic flow correlation information from cleaned traffic flow data, fuse the dynamic traffic flow correlation information with geospatial location connectivity information to obtain an initial adjacency matrix, and denoise the initial adjacency matrix based on a low-rank representation mechanism of node embedding.
[0090] The dynamic spatiotemporal feature encoding module is used to fuse the denoised robust adjacency matrix with the cleaned traffic flow data, and to extract spatial features from the fused matrix. The extracted spatial features are then extracted using a liquid neural network.
[0091] The spatiotemporal feature fusion and prediction output module is used to fuse spatial features with extracted temporal features and obtain ship traffic flow prediction results based on the fused spatiotemporal features.
[0092] The ship traffic flow prediction device provided in this embodiment corresponds to the ship traffic flow prediction method provided in any of the above embodiments, and will not be described again here.
[0093] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0094] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0095] The above provides a detailed description of a ship traffic flow prediction method and apparatus provided by the embodiments of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A ship traffic flow prediction method, characterized by, The method includes: Obtain the original AIS trajectory sequence of the vessel in the target waters, and clean the original AIS trajectory sequence; Dynamic traffic flow correlation information is obtained from the cleaned traffic flow data. The dynamic traffic flow correlation information is fused with geospatial location connectivity information to obtain an initial adjacency matrix. The initial adjacency matrix is then denoised based on a low-rank representation mechanism with node embedding. The denoised robust adjacency matrix is fused with the cleaned traffic flow data, and spatial features are extracted from the fused matrix. Then, a liquid neural network is used to extract temporal features from the extracted spatial features. The spatial features are fused with the extracted temporal features, and the ship traffic flow prediction results are obtained based on the fused spatiotemporal features.
2. The ship traffic flow prediction method according to claim 1, characterized in that, The step of using a liquid neural network to extract temporal features from the extracted spatial features includes: The hidden state vector of the current time window and the spatial features of the current time window are weighted and combined to obtain the combined state; and the hidden state vector of the current time window is subjected to basic attenuation processing to obtain the attenuated state. The combined state and the decayed state are numerically discretized and solved. The hidden state vector of the current time window is updated using the solved state to obtain the hidden state of the next time window. The temporal features are obtained by integrating the spatial features along the time axis based on the hidden states of each time window.
3. The ship traffic flow prediction method according to claim 1, characterized in that, The step of fusing the dynamic traffic flow correlation information with geospatial location connectivity information to obtain an initial adjacency matrix, and denoising the initial adjacency matrix based on a low-rank representation mechanism of node embedding, includes: Based on the geospatial connectivity information, construct a geographic adjacency matrix; Based on the dynamic traffic flow correlation information, a dynamic traffic flow correlation matrix is constructed; The initial adjacency matrix is obtained by linearly weighting and fusing the geographic adjacency matrix and the dynamic traffic flow correlation matrix. Based on the initial adjacency matrix, a joint optimization objective function is constructed, and the joint optimization objective function is jointly optimized using the backpropagation algorithm to finally obtain the denoised robust adjacency matrix: ; In the formula, This is the initial adjacency matrix; This represents the robust adjacency matrix after denoising. Represents the node embedding matrix. For the embedding dimension, N is the total number of spatial grid nodes; This represents the Frobenius norm, used to measure matrix reconstruction error. This represents the nuclear norm, used to constrain the low-rank property of the node embedding matrix; and This is the regularization hyperparameter.
4. The ship traffic flow prediction method according to claim 1, characterized in that, The step of fusing the denoised robust adjacency matrix with the cleaned traffic flow data and extracting spatial features from the fused matrix includes: Add self-loops to the denoised robust adjacency matrix to obtain the adjacency matrix with added self-loops; The adjacency matrix with added self-loops is fused with the cleaned traffic flow data, and the fused matrix is input into a graph convolutional network to extract spatial features from the fused matrix.
5. The ship traffic flow prediction method according to claim 1, characterized in that, The fusion of the spatial features and the extracted temporal features includes: By using a fully connected layer, the spatial features and the extracted temporal features are mapped to the same dimension and concatenated along the feature dimension to obtain a joint state representation; The joint state representation is fused using a multi-head attention mechanism.
6. The ship traffic flow prediction method according to any one of claims 1 to 5, characterized by, The cleaning of the original AIS trajectory sequence includes: The original AIS trajectory sequence is preprocessed to obtain initial cleaned traffic flow data; The initial cleaned traffic flow data is cropped using the spatial grid corresponding to the target water area, and macroscopic basic features are extracted from the cropped data. The extracted macroscopic basic features are imputed for missing values and outliers are removed to obtain the cleaned traffic flow data.
7. The ship traffic flow prediction method according to claim 6, characterized in that, The process of preprocessing the original AIS trajectory sequence to obtain initially cleaned traffic flow data includes: Kinematic features are extracted from the original AIS trajectory sequence, and the enhanced trajectory points are obtained based on the extracted kinematic features. The enhanced trajectory points are mapped to a feature space constructed based on the kinematic feature change rate of neighboring points, and the density-based DBSCAN clustering algorithm is used to remove noise points from the enhanced trajectory points to obtain valid trajectory points. The effective trajectory points are smoothly reconstructed using a cubic spline interpolation algorithm to obtain the initial cleaned traffic flow data.
8. The ship traffic flow prediction method according to claim 6, characterized in that, The macro-level fundamental characteristics include ship traffic flow, average speed, and ship density; The process of cropping the initial cleaned traffic flow data using a spatial grid corresponding to the target water area and extracting macroscopic basic features from the cropped data includes: Based on the latitude and longitude coordinates of the effective trajectory points in the traffic flow data after initial cleaning, the effective trajectory points are mapped to the spatial grid to obtain the grid position of the effective trajectory points in the spatial grid; Based on the relationship between the boundary of the spatial grid and the grid position, the effective trajectory points are clipped to obtain the clipped data; The ship traffic flow, the average speed, and the ship density are extracted from the cropped data.
9. The ship traffic flow prediction method according to claim 6, characterized in that, The process of imputing missing values and removing outliers from the extracted macroscopic basic features to obtain the cleaned traffic flow data includes: The K-nearest neighbor algorithm is used to impute missing values in the macroscopic basic features, and a Gaussian mixture model is used to detect outliers in the imputed features. The outliers are then replaced with neighborhood smoothing values to obtain the final cleaned traffic flow data.
10. A vessel traffic flow prediction device characterized by comprising: The device includes: The data acquisition and cleaning module is used to acquire the original AIS trajectory sequence of vessels in the target waters and clean the original AIS trajectory sequence. A robust spatial topology construction module is used to obtain dynamic traffic flow correlation information from cleaned traffic flow data, fuse the dynamic traffic flow correlation information with geospatial location connectivity information to obtain an initial adjacency matrix, and denoise the initial adjacency matrix based on a low-rank representation mechanism of node embedding. The dynamic spatiotemporal feature encoding module is used to fuse the denoised robust adjacency matrix with the cleaned traffic flow data, extract spatial features from the fused matrix, and use a liquid neural network to extract temporal features from the extracted spatial features. The spatiotemporal feature fusion and prediction output module is used to fuse the spatial features with the extracted temporal features and obtain ship traffic flow prediction results based on the fused spatiotemporal features.