Ship encounter warning method and system based on graph attention network and ais
By constructing a dynamic encounter graph and graph attention network with differentiated encounter perception radius, the problem of difficulty in identifying ship interaction relationships in existing technologies is solved. This enables accurate identification of multi-ship collaborative covert illegal activities and generation of executable law enforcement tasks, thereby improving the response efficiency of maritime law enforcement.
Patent Information
- Application Number
- CN202611496622.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-24
- Publication Date
- 2026-11-27
AI Technical Summary
Existing technologies are unable to effectively identify the interaction relationships and group collaboration characteristics between ships, making it difficult to detect multi-ship collaborative covert illegal activities in a timely manner. Dynamic mapping accuracy is insufficient, deliberate concealment intentions cannot be identified, normal accompanying targets and suspicious coupled targets are easily confused, and executable law enforcement tasks cannot be generated. Existing early warning systems lack the ability to deeply mine the topological structure of abnormal subgraphs of groups.
By constructing a dynamic encounter graph with differentiated encounter perception radius and introducing a graph attention network, the interaction weights between ship nodes are adaptively learned, normal accompanying nodes in the waterway are suppressed, the weights of concealed coupled nodes are enhanced, multilateral highly coupled abnormal subgraphs are identified, and a concealed encounter pattern library is matched to generate law enforcement tasks carrying interception points and response time windows.
It achieves precise separation between normal navigation behavior and suspicious encounter patterns, automatically determines the type of violation, and generates executable law enforcement instructions, thereby improving the accuracy of identifying suspicious encounters at sea and the efficiency of law enforcement response.
Smart Images

Figure CN123182453A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ship traffic supervision and maritime safety law enforcement technology, specifically to a ship encounter early warning method and system based on graph attention networks and AIS. Background Technology
[0002] AIS (Automatic Information System) is a maritime safety and communication system applied between ships and shore, and between ships themselves. It automatically and continuously broadcasts static, dynamic, and voyage information of ships via the Very High Frequency (VHF) radio band to achieve ship identification, tracking, and monitoring. With the rapid development of the maritime transportation industry, the number of ships and traffic density have continued to increase, and encounters and interactions between ships have become increasingly frequent. Consequently, covert illegal activities such as illegal transshipment, smuggling, and human trafficking are also on the rise, posing a serious challenge to maritime safety supervision.
[0003] Currently, maritime regulatory authorities primarily rely on Automatic Identification Systems (AIS) to obtain dynamic information such as vessel position, speed, and heading, combined with radar monitoring and manual lookout, to monitor vessel activities within their jurisdictional waters. However, existing regulatory methods have the following shortcomings:
[0004] Firstly, while AIS data can reflect the movement status of individual ships, it is difficult to effectively characterize the interaction and group cooperation characteristics between ships. For covert illegal activities carried out by multiple ships in coordination (such as smuggling in formation, transshipment at sea, etc.), the method of analyzing individual ships in isolation is very likely to miss key clues.
[0005] Secondly, existing technologies typically use fixed encounter sensing distances or uniform distance thresholds to determine whether there is an encounter relationship between ships. This does not take into account the significant differences in maneuvering characteristics, dimensional parameters, and operating waters between different types of ships (such as merchant ships, fishing vessels, engineering vessels, and controlled goods transport vessels), resulting in insufficient mapping accuracy and a tendency to produce underreporting or false reporting.
[0006] Third, traditional encounter detection methods rely heavily on scalar indicators such as the nearest encounter distance (DCPA) and the nearest encounter time (TCPA) for threshold determination. They lack the ability to comprehensively analyze the relative motion of ships, the degree of deviation from the planned route, and the consistency of historical behavior, making it difficult to identify abnormal encounter patterns with deliberate concealment.
[0007] Fourth, there are a large number of normally accompanying vessels in the waterway (legal fleets traveling in the same direction and at the same speed). Existing algorithms have difficulty effectively distinguishing such normal accompanying targets from suspicious and concealed coupled targets, which can easily lead to misjudging normal navigation behavior as abnormal and resulting in a waste of law enforcement resources.
[0008] Fifth, existing early warning systems mostly focus on collision risk alerts for individual vessels, lacking the ability to deeply analyze the topological structure of abnormal subgraphs of a group, and are unable to generate executable law enforcement tasks with interception points and response time windows, thus reducing the rapid response capability of maritime law enforcement.
[0009] To address the aforementioned technical issues, there is an urgent need for an intelligent early warning method that can fully utilize AIS big data, model complex encounter relationships between ships through graph neural networks, accurately identify concealed encounter patterns, and generate executable law enforcement instructions. Summary of the Invention
[0010] The purpose of this invention is to overcome the shortcomings of the prior art and provide a ship encounter early warning method and system based on graph attention networks and AIS. It aims to solve the technical problems in the prior art, which are due to reliance on isolated analysis of single ships, fixed perception thresholds, scalar threshold judgment and lack of group subgraph mining capabilities, resulting in the difficulty in timely detection of multi-ship collaborative concealed illegal activities, insufficient accuracy of dynamic mapping, inability to identify deliberate concealment intentions, easy confusion between normal accompanying and suspicious coupled targets, and inability to generate executable law enforcement tasks.
[0011] In a first aspect, embodiments of this application provide a ship encounter early warning method based on graph attention networks and AIS, the method comprising:
[0012] Collect ship AIS messages and configure differentiated encounter sensing radii based on ship type;
[0013] A dynamic encounter map is constructed based on the encounter perception radius and the angle between the velocity vector, and edge features are encoded with the nearest encounter distance and the nearest encounter time.
[0014] The dynamic encounter graph is input into a graph attention network, and the attention mechanism is used to suppress the weight of normal accompanying nodes in the channel and enhance the weight of hidden coupling nodes, outputting a hidden layer representation of the ship.
[0015] Based on the hidden layer representation, identify the multi-sided highly coupled abnormal subgraph and match it with the corresponding pattern type in the preset hidden encounter pattern library;
[0016] The comprehensive early warning index is calculated based on the topological density of the abnormal subgraph, and law enforcement tasks carrying recommended interception points and response time windows are generated and issued.
[0017] Secondly, embodiments of this application provide a ship encounter warning system based on graph attention networks and AIS, applied to the method described in the first aspect, the system comprising:
[0018] The data acquisition module is used to collect ship AIS messages and configure differentiated encounter sensing radii according to ship type;
[0019] The dynamic encounter graph construction module is used to construct a dynamic encounter graph based on the angle between the encounter perception radius and the velocity vector, and to encode edge features with the nearest encounter distance and the nearest encounter time.
[0020] The graph neural network processing module is used to input the dynamic encounter graph into the graph attention network, use the attention mechanism to suppress the weight of the normal accompanying nodes of the waterway, enhance the weight of the hidden coupling nodes, and output the hidden layer representation of the ship.
[0021] An anomaly pattern recognition module is used to identify anomalous subgraphs with high multilateral coupling based on the hidden layer representation and match them with the corresponding pattern type in a preset hidden encounter pattern library.
[0022] The early warning decision output module is used to calculate the comprehensive early warning index based on the topological density of the abnormal subgraph, generate and issue law enforcement tasks carrying recommended interception points and response time windows.
[0023] Thirdly, embodiments of this application provide an electronic device, including:
[0024] processor;
[0025] Memory used to store processor-executable instructions;
[0026] The processor is configured to implement the ship encounter warning method based on graph attention network and AIS as described in the first aspect when executing the instructions.
[0027] Fourthly, embodiments of this application provide a computer-readable storage medium storing a program that instructs a device to perform the ship encounter warning method based on graph attention networks and AIS as described in the first aspect.
[0028] This invention constructs a dynamic encounter map with differentiated encounter perception radii and introduces a graph attention network. It adaptively learns the interaction weights between ship nodes globally, effectively suppressing normal accompanying nodes in the waterway and specifically enhancing hidden coupling nodes, thereby accurately separating normal navigation behavior from suspicious encounter patterns. Simultaneously, based on ship hidden layer representations, it identifies multilaterally highly coupled abnormal subgraphs and matches them with a hidden encounter pattern library, automatically determining specific violation types such as cargo transshipment, silent convoy avoidance, and pre-arrangement in prohibited areas. Based on the topological density of the abnormal subgraph, it generates structured enforcement work orders carrying recommended interception points and response time windows, directly converting the intelligent identification results into executable enforcement instructions. This invention effectively solves the technical problems of existing technologies, such as reliance on isolated single-ship analysis failing to represent multi-ship collaboration, insufficient mapping accuracy with fixed perception thresholds, difficulty in identifying deliberate concealment intentions with scalar thresholds, easy confusion between normal accompanying and suspicious targets, and lack of group subgraph mining capabilities to generate executable enforcement tasks. It significantly improves the identification accuracy and enforcement response efficiency of suspicious encounter behavior at sea. Attached Figure Description
[0029] Figure 1 This is a schematic diagram of a ship encounter early warning method based on graph attention network and AIS provided in an embodiment of this application.
[0030] Figure 2 This is an architecture diagram of a ship encounter warning system based on graph attention network and AIS provided in an embodiment of this application.
[0031] Figure 3 A schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0032] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them.
[0033] It should be noted that in the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the specification of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.
[0034] Based on the embodiments described in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0035] Example 1
[0036] Figure 1 This is a schematic flowchart illustrating a ship encounter early warning method based on graph attention networks and AIS, provided as an embodiment of this application. Figure 1 As shown, a ship encounter early warning method based on graph attention networks and AIS includes:
[0037] S1. Collect ship AIS messages and configure differentiated encounter perception radii based on ship type. Obtain basic ship data sources and set differentiated spatial perception boundaries for subsequent encounter relationship determination based on the navigation characteristics and risk levels of different ships.
[0038] Specifically, in this embodiment, configuring differentiated encounter sensing radii based on ship type includes:
[0039] S1.1 Identify the vessel type field specified in the vessel AIS message, and classify the vessel into at least the dangerous goods and controlled cargo transport category, the passenger transport category, and the general cargo transport category.
[0040] In this embodiment, the system receives and parses the vessel type field in the AIS message. This field identifies the vessel type according to the coding standards stipulated by the International Maritime Organization (IMO). The system classifies vessels into at least three categories based on preset classification rules: controlled goods transport vessels, referring to vessels carrying crude oil, liquefied natural gas, hazardous chemicals, and other goods requiring key supervision; passenger transport vessels, referring to passenger ships, ro-ro passenger ships, and other vessels whose primary function is to carry passengers; and general operations vessels, referring to general cargo ships, container ships, bulk carriers, and other general merchant ships.
[0041] S1.2. Call the preset maritime supervision strategy table to assign the minimum benchmark perception radius to vessels transporting controlled goods, the medium benchmark perception radius to vessels transporting personnel, and the maximum benchmark perception radius to vessels engaged in general operations.
[0042] In this embodiment, the system calls a pre-stored maritime regulatory strategy table, which configures the baseline perception radius for each category according to the ship's risk level. The transport of controlled goods carries the highest risk and is assigned the smallest baseline perception radius, such as 2 nautical miles, so that it can trigger an encounter judgment within a small range and maintain high vigilance; the transport of personnel carries the next highest risk and is assigned a medium baseline perception radius, such as 4 nautical miles; the general operation carries the lowest risk and is assigned the largest baseline perception radius, such as 6 nautical miles.
[0043] S1.3 In response to the real-time speed changes of the ship, the reference sensing radius is dynamically expanded or contracted, so that the forward sensing area of the ship is lengthened along the course at high speed, forming an elliptical encounter monitoring area to adapt to the range of collision risk propagation under high-speed motion.
[0044] In this embodiment, the system dynamically adjusts the baseline sensing radius based on the ground speed in the AIS message: at low speeds or when anchored, the sensing range shrinks to near the baseline value; at high speeds, the system stretches the forward sensing radius along the course, while the lateral radius remains unchanged or slightly shrinks, forming an elliptical monitoring area with its major axis pointing towards the course. This is because high-speed vessels sweep a larger area of water per unit time, and the collision risk extends significantly along the course. The elliptical area allows the system to detect potential targets ahead earlier, gaining more reaction time.
[0045] Specifically, the major axis radius and minor axis radius of the elliptical encounter monitoring area are determined according to the following formula:
[0046] , ,
[0047] ,
[0048] Among them, when hour, . The radius of the major axis of the elliptical monitoring area (the forward sensing distance along the heading direction); The minor axis radius of the elliptical monitoring area (lateral sensing distance perpendicular to the heading direction); The baseline sensing radius corresponding to the current type of ship (determined by S1.2); Real-time ground speed of the vessel (taken from AIS messages); The preset high-speed judgment threshold is used; when the speed is below this value, the monitoring area remains circular. The long axis stretch factor controls the degree to which the speed amplifies the forward sensing range. It is the short-axis contraction coefficient, which controls the degree of narrowing of the lateral sensing range at high speeds.
[0049] The system analyzes the ship's ground speed in real time from AIS messages. ,judge and The size relationship. If Exceed Calculate the major axis radius using the first formula and stretch it relative to the reference radius. Calculate the minor axis radius by multiplying the reference radius by the shrinkage coefficient. Calculations show that an elliptical region extending along the flight direction is formed; if Not exceeding Then the major axis equals the minor axis equals the reference radius, maintaining a circular monitoring area. (Tension coefficient) and shrinkage coefficient These are the preset adjustable parameters in the maritime regulatory strategy table.
[0050] S2. Construct a dynamic encounter map based on the encounter perception radius and the angle between the velocity vectors, and encode edge features with the nearest encounter distance and the nearest encounter time.
[0051] Specifically, in this embodiment, the construction of a dynamic encounter map based on the angle between the encounter sensing radius and the velocity vector includes:
[0052] S2.1 Using a single vessel as the central node, scan surrounding vessels within the same time window to filter out candidate vessels located within the forward fan-shaped monitoring area of the central node. The opening angle of the fan-shaped monitoring area is defined by the included angle of the velocity vector.
[0053] In this embodiment, the system uses each vessel as a central node and scans all surrounding vessels entering that area within the same time window (e.g., the first 5 minutes) within its encounter sensing radius. Unlike traditional circular full-area scanning, this embodiment uses a forward fan-shaped monitoring area for filtering. The apex of this fan is located at the current position of the central vessel, the centerline points in the course direction, and the opening angle is formed by extending a preset angle (e.g., 30° each, totaling 60°) on both sides of the course. The reason for using a fan-shaped area is that the main navigational risks of vessels are concentrated in the waters ahead in the forward direction, and the probability of encounters and interactions between vessels to the sides and behind is significantly reduced. Limiting the fan-shaped area can effectively reduce interference from irrelevant vessels.
[0054] Specifically, candidate ships Whether it falls into the center of the ship Within the forward sector-shaped monitoring area, the following criteria shall be used for determination:
[0055] ,
[0056] ,
[0057] ,
[0058] in, The angle between the heading of the center vessel and the direction in which the center vessel points towards the candidate vessel; For the elliptical monitoring area along The allowable radial distance in the direction is determined by the ellipse parameters and Joint decision; for The angle of deflection relative to the heading direction; Centered ships The velocity vector (including heading and speed information); Centered ships Pointing to candidate ships Position vector; Centered ships and candidate ships The current position vector (latitude and longitude converted to plane coordinates); The distance between the two ships is the Euclidean distance; when the monitoring area is circular. When the monitoring area is elliptical , for The deflection angle relative to the heading direction.
[0059] The system projects the latitude and longitude coordinates of the ship's position onto a plane coordinate system and calculates the position vector pointing from the center ship to the candidate ship. and its modulus By calculating the velocity vector With position vector Divide the dot product by the product of the two moduli, and then take the inverse cosine to obtain the included angle. If the included angle Less than the preset half-opening angle (e.g., 30°), and the Euclidean distance Less than the radial distance threshold If so, the candidate ship is determined to be located within the fan-shaped monitoring area. Elliptical radial distance The radial distance of each point on the elliptical boundary is dynamically calculated based on the deflection angle of the position vector relative to the heading to ensure consistency with the formula.
[0060] S2.2. Eliminate vessels that are in the fixed navigation mark obscuration area or have been identified as part of the same law enforcement formation by shore-based radar from the candidate vessels to avoid law enforcement targets on the same side being mistakenly included in the encounter area.
[0061] In this embodiment, the system further filters candidate vessels: First, it reads the location information of fixed navigation marks on the electronic nautical chart and eliminates vessels located within the navigation mark obstruction zone. The navigation mark obstruction zone refers to a designated radius range centered on a fixed navigation mark (such as a light buoy or beacon). Vessel signals within this area may be affected by physical obstruction or reflection interference from the navigation mark, resulting in unreliable location data. Second, the system receives target identification feedback from shore-based radar and eliminates government vessels already identified as belonging to the same law enforcement formation, avoiding the mistaken inclusion of friendly targets in the encounter chart construction.
[0062] S2.3. Establish directed edges between the retained central node and candidate ships, so that only unidirectional relationships from the central node to potential external interaction objects are retained in the graph structure, reducing redundant connections generated by parallel ships flowing downstream in the channel.
[0063] In this embodiment, the system establishes unidirectional directed edges between the central ship and each retained candidate ship, with the central node pointing to the candidate ship. This only represents the perception relationship between the central ship and the candidate ships, not the reverse perception. The reason for using directed edges is that there are a large number of ships traveling in the same direction downstream within the same channel. If undirected edges are used, parallel ships would be connected to each other in both directions, resulting in a large number of redundant edges. With directed edges, each ship points to the candidate target ahead, and parallel ships are not connected to each other, significantly reducing edge density. This allows the subsequent graph attention network to focus computational resources on ship pairs that actually have the potential for encounter and interaction.
[0064] Specifically, in this embodiment, encoding edge features using the nearest encounter distance and the nearest encounter time specifically includes:
[0065] S2.4. Within the sliding time window, extract the relative motion trajectories of the two ships and predict the nearest meeting point of the two ships in the future and the time required to reach that position.
[0066] In this embodiment, for each pair of ships with a directed connection, the system extracts the position, speed, and heading data of the two ships within a sliding time window (e.g., 12 minutes from the current moment). Assuming the two ships maintain uniform linear motion, the system calculates the relative position of the two ships when they are closest, based on the principle of relative motion, as the nearest meeting point. Simultaneously, it calculates the time required to reach that point, as the nearest meeting time. The sliding time window is updated in real-time with the AIS data stream, ensuring that the prediction results are dynamically updated as the actual movement of the ships changes.
[0067] Specifically, the nearest meeting point and the nearest meeting time are calculated using the following formula:
[0068] ,
[0069] ,
[0070] ,
[0071] Among them, it must meet the following requirements. ,and It does not exceed the upper limit of the sliding time window. The spatial coordinates of the nearest point of encounter; Centered ships and candidate ships The current position vector; Centered ships and candidate ships The velocity vector; The closest meeting time is the time from the current moment until the two ships reach the closest meeting point. This is the closest meeting distance, which is the shortest distance between the two ships at the nearest meeting point; It is the square of the relative velocity vector magnitude of the two ships.
[0072] The system treats both ships as moving at a constant velocity in a straight line, and their relative motion as such. First, the relative position vectors of the two ships are calculated. and relative velocity vector Recently, I'll encounter a time... This is derived by setting the dot product of the relative position vector and the relative velocity vector to zero (i.e., the distance is closest when the relative position and relative velocity are perpendicular). Substituting back into the extrapolation formula yields the location of the nearest meeting point. Then calculate the spatial distance between the two ships at this moment. .like A negative value indicates that the two ships are moving away from each other and do not constitute a valid encounter.
[0073] S2.5. The distance of the nearest meeting point from the coastline and whether the arrival time falls within the allowed time range for law enforcement response are injected as semantic information into the edge features.
[0074] In this embodiment, after calculating the nearest encounter point and the nearest encounter time, the system further introduces two types of regulatory semantic information for encoding: first, it queries the distance between the nearest encounter point and the coastline to determine the type of sea area it belongs to (e.g., nearshore waters, waterways, anchorages, or open offshore waters); second, it determines whether the nearest encounter time is less than a preset allowable enforcement response time range (e.g., 15 minutes). This semantic information is injected as an additional field into the edge features, enabling the edge features to carry high-level semantics such as sea area sensitivity and enforcement feasibility.
[0075] S2.6 When the nearest meeting point between two ships is located outside the anchorage or at the edge of the channel and the arrival time is shorter than the preset cruise cycle, increase the initial importance of the meeting point so that it receives priority attention in the subsequent graph attention network.
[0076] In this embodiment, the system performs an initial importance determination on encounter edges based on semantic information: when the nearest encounter point is located outside the anchorage and biased towards the edge of the channel (rather than in the center of the channel or inside the anchorage), and the nearest encounter time is shorter than a preset cruise cycle (e.g., 30 minutes), the edge is assigned a higher initial importance. The logic behind this determination is that normal encounters mostly occur in the center of the channel or inside the anchorage. Encounter points outside the anchorage and on the edge of the channel often indicate an intention to avoid regulatory oversight. Combined with the fact that the arrival time is shorter than the cruise cycle, it means that the opportunity for intervention has been missed. Increasing the importance of such edges can ensure that high-risk features receive priority attention in subsequent attention calculations.
[0077] S3. Input the dynamic encounter graph into a graph attention network, use the attention mechanism to suppress the weight of normal accompanying nodes in the waterway, enhance the weight of hidden coupling nodes, and output the hidden layer representation of the ship.
[0078] Specifically, in this embodiment, the use of an attention mechanism to suppress the weight of normally accompanying nodes in the channel includes: extracting the curvature of the navigation trajectories of the central vessel and its neighboring nodes within the historical observation period; if both trajectories extend along the same navigation lane and their curvature changes in a consistent trend, then the neighboring node is determined to be a normally accompanying target in the channel. In this embodiment, the system extracts the track sequences of the central vessel and its neighboring nodes within the historical observation period and calculates their respective trajectory curvatures. The navigation trajectory curvature reflects the degree of curvature of the vessel's track. If the trajectories of both vessels are located within the boundary of the same navigation lane, and the curvature changes in a basically consistent trend over time (such as traveling straight in the same direction or turning synchronously), then the neighboring node is determined to be a normally accompanying target in the channel.
[0079] In the calculation of attention coefficients in the graph attention network, a confidence discount is applied to the normally associated targets identified above, so that their contribution to the update of the central ship's features is lower than that of randomly scattered non-associated targets. In this embodiment, when calculating the attention coefficients, the system applies a confidence discount of less than 1 to the neighboring nodes that have been marked as normal associated targets, reducing their attention weight and making their contribution to the update of the central ship's features lower than that of non-associated targets. By suppressing the interference of normal associated targets, the system can focus computational resources on ship nodes that truly have suspicious characteristics.
[0080] Specifically, in this embodiment, the weighting of the enhanced concealed coupling node includes:
[0081] The system detects whether there is a deviation in the planned course between neighboring nodes and the central vessel; that is, the two vessels do not intersect at the planned course layer on the electronic chart, but maintain a stable connection for multiple consecutive time slices in the dynamic encounter chart. In this embodiment, the system reads and compares the planned course data of the two vessels. If the planned courses of the two vessels do not intersect on the electronic chart, but the two vessels remain connected for multiple consecutive time slices in the dynamic encounter chart, it indicates that the two vessels are suspected of deliberately adjusting their course to maintain close contact, and this is determined as a deviation in the planned course.
[0082] If the aforementioned deviation exists, and the two ships exhibit synchronous speed decreases or synchronous turning during the connection period, then when calculating the attention coefficient in the graph attention network, the attention weight of the neighboring node is multiplied by a preset trust gain coefficient greater than 1, so that its output hidden layer representation contains stronger cooperative anomaly semantics. In this embodiment, based on the confirmed deviation from the planned route, if the system further detects that the two ships exhibit synchronous speed changes or synchronous course deflections during the connection period, it determines that cooperative behavior exists, and adds a trust gain to the attention weight of the neighboring node in the graph attention network, so that the node's features receive a higher contribution during aggregation, thereby strengthening the cooperative anomaly semantics in the output hidden layer representation.
[0083] S4. Based on the hidden layer representation, identify the abnormal subgraph with high multi-sided coupling and match it with the corresponding pattern type in the preset hidden encounter pattern library.
[0084] Specifically, in this embodiment, identifying anomalous subgraphs with highly coupled polygons includes:
[0085] S4.1 Based on the similarity between the hidden layer representations of the ships, multiple ships with a representation distance less than a similarity threshold are grouped into the same local group. In this embodiment, the system performs pairwise similarity calculations on the hidden layer representations of each ship output by the graph attention network in a high-dimensional feature space. The hidden layer representation is a vector that integrates the ship's own motion state and its neighbor interaction information. The closer the representation distance, the more similar the behavioral patterns and interaction semantics of the two ships. The system presets a similarity threshold and groups multiple ships with a representation distance less than the threshold into the same local group, realizing automatic clustering of ships with similar behavioral semantics and providing candidate groups for subsequent abnormal subgraph screening.
[0086] Specifically, two ships and The similarity between hidden layer representations is calculated using the following formula:
[0087] ,
[0088] ,
[0089] in, and Ships and ships The hidden layer representation vector. and These are the modulus lengths of the two components. For ships and ships Cosine similarity of hidden layer representations; For ships and ships The cosine distance of the hidden layer representation; Ships for the output of the attention network and ships The hidden layer representation vector.
[0090] The graph attention network outputs a fixed-dimensional hidden layer representation vector for each ship node. After completing one graph propagation, the system extracts the hidden layer representations of all ships and calculates the cosine similarity for each pair of ships. The closer the value is to 1, the more similar the behavioral patterns and interaction semantics of the two ships are. The cosine similarity is converted to cosine distance using an inverse cosine transform. The smaller the cosine distance, the more similar the two ships are. The system has a preset similarity threshold. (Corresponding to the cosine distance threshold), will Ships are grouped into the same local group to achieve ship clustering based on behavioral semantics.
[0091] S4.2. Calculate the proportion of actually established meeting edges within the local group to the total number of possible edges within the group to obtain the interaction density within the group. In this embodiment, the system counts the actual number of meeting edges within each local group defined in S4.1, and simultaneously calculates the total number of possible pairwise edges between all ships within the group. Dividing the former by the latter yields the interaction density. For example, a group containing 5 ships has a maximum possible number of edges of 10. If there are actually 8 meeting edges, the interaction density is 80%. The interaction density reflects the actual closeness of interaction among members within the group.
[0092] Specifically, the interaction density within a group is calculated using the following formula:
[0093] ,
[0094] in, For local groups Interaction density; For the group The actual number of encounter edges established within the area; For the group The number of ship nodes within.
[0095] The system counts the number of nodes within each local population defined by S4.1. and the actual number of directed edges Since the encounter graph is a directed graph, one bidirectional interaction corresponds to two directed edges. The actual number of interacting ship pairs is counted according to the undirected graph standard. The maximum possible number of edges is the number of pairwise combinations of all ships within the group, i.e. The interaction density is obtained by dividing the actual number of edges by the maximum possible number of edges. The closer the value is to 1, the closer the interaction within the group.
[0096] S4.3 When the interaction density is higher than the level of normal waterway intersections, and the spatial center of gravity of the local group moves toward the offshore hidden waters within a continuous time window, the local group is extracted as a candidate anomaly subgraph.
[0097] In this embodiment, the system compares the calculated interaction density with a preset threshold for normal waterway intersection levels. This threshold reflects the average interaction density between normally navigating vessels in the same waterway. When the group interaction density is significantly higher than this level, it indicates that there are abnormally high frequency encounters within the group. Simultaneously, the system calculates the average position of all vessels within the group as its spatial centroid and tracks the movement of this centroid over multiple consecutive time windows. If the centroid continues to move towards concealed waters offshore, it further corroborates that the group intends to evade regulation. Local groups that simultaneously meet both of these conditions are extracted as candidate abnormal subgraphs and proceed to the subsequent pattern matching stage.
[0098] Specifically, the direction and speed of continuous drift of the spatial center of gravity are calculated using the following formula:
[0099] ,
[0100] ,
[0101] ,
[0102] in, For the group The spatial center of gravity at any given moment; For the first in the group A ship in Position vector at any given time; The time interval between two consecutive time windows; For the spatial center of gravity in time interval The drift vector within; Distance to the nearest coastline The position vector of the nearest point; The vector is the spatial centroid pointing in the direction of the shore.
[0103] Within each time window, the system takes the geometric mean of the positions of all ships in the group as the spatial centroid of the group. Subtracting the current centroid from the previous centroid gives the drift vector. It determines whether the center of gravity continues to move in the same direction. Simultaneously, it calculates the direction of the shortest line connecting the center of gravity to the nearest coastline. ,like It points towards offshore in multiple consecutive time windows (i.e.) If the group is moving towards sheltered waters offshore, then it is determined that the group is moving towards sheltered waters offshore.
[0104] Specifically, in this embodiment, matching the corresponding pattern type in the preset concealed encounter pattern library includes:
[0105] S4.4. Read the topological shape and ship attribute combination of the candidate abnormal subgraph. In this embodiment, the concealed encounter pattern library is a pre-installed structured knowledge base in the system, storing topological templates of several typical illegal encounter behaviors and corresponding ship attribute combination conditions. Each template includes a topological shape description, attribute constraint rules, and a corresponding pattern type label. The system matches the candidate abnormal subgraph with each template in the library and outputs the pattern type with the highest matching degree. The system reads the candidate abnormal subgraph extracted in S4.3, obtains the node connection topology (i.e., the edge distribution pattern between each ship) and the static attribute information of each ship (including ship type, load status, AIS message transmission frequency, etc.), and provides a basis for subsequent pattern matching.
[0106] S4.5 If the subgraph presents a star-shaped connection structure of one ship to multiple ships, and the central ship is heavily loaded while the peripheral ships are lightly loaded or empty, then it is matched as a cargo transshipment pattern. In this embodiment, when the topology of the candidate abnormal subgraph is a star-shaped structure in which one central ship is simultaneously connected to multiple peripheral ships, and the peripheral ships are not connected to each other, the system further reads the load status of each ship. If the central ship is heavily loaded with a deep draft, and the peripheral ships are lightly loaded or empty with a shallow draft, the system matches the subgraph as a cargo transshipment pattern. The matching logic is as follows: illegal cargo transshipment at sea usually involves a heavily loaded mother ship anchored or sailing at low speed, with multiple lightly loaded small ships berthing in sequence to receive the cargo, forming a typical "center-periphery" star structure.
[0107] S4.6. If the subgraph presents a closed loop or chain structure, and the AIS message transmission intervals of each ship within the subgraph exhibit a synchronous periodic absence, then it is matched as a formation silent avoidance mode. In this embodiment, when the topology of a candidate abnormal subgraph presents multiple ships connected end-to-end to form a closed loop or chain structure, the system further extracts the AIS message transmission timestamps of each ship within the subgraph and calculates their respective message transmission interval sequences. If the message transmission intervals of multiple ships exhibit synchronous periodic extensions or absences within the same time period (e.g., multiple ships simultaneously extend their AIS transmission intervals from the normal several seconds to several minutes), it indicates that these ships are synchronously implementing AIS silent operations to reduce the probability of being detected by the monitoring system, and the system matches the subgraph as a formation silent avoidance mode.
[0108] S4.7 If all nodes in the subgraph are in a low-speed navigation state, and the spatial center of gravity remains continuously within the buffer zone outside the boundary of the sensitive sea area, then it is matched as a pre-arrangement mode for the restricted area. In this embodiment, when the ground speed of all ships in the candidate abnormal subgraph is lower than the preset low-speed threshold, the system further tracks the drift trajectory of the spatial center of gravity of the subgraph within a continuous time window. If the center of gravity remains continuously within the preset buffer zone outside the boundary of the sensitive sea area (such as the territorial sea baseline, military exercise area, marine protected area, etc.), neither entering the sensitive sea area nor moving away, the system matches the subgraph as a pre-arrangement mode for the restricted area. The judgment logic of this mode is that multiple ships continuously loitering at low speed outside the boundary of the sensitive sea area, neither entering nor moving away, usually constitutes a probing pre-reconnaissance or assembly behavior awaiting unified action instructions in the restricted area or other restricted waters, which is an abnormal activity with a clear security threat.
[0109] S5. Calculate the comprehensive early warning index based on the topological density of the abnormal subgraph, generate and issue law enforcement tasks carrying recommended interception points and response time windows. Based on the interaction density of the abnormal subgraph, combined with the Sigmoid nonlinear enhancement term of the interaction density and the preset risk weight corresponding to the pattern type matched by the abnormal subgraph, calculate the comprehensive early warning index by weighted fusion, generate and issue law enforcement tasks carrying recommended interception points and response time windows.
[0110] Specifically, in this embodiment, generating the law enforcement task carrying recommended interception points and response time windows specifically includes:
[0111] S5.1. Based on the motion vectors and current positions of each vessel within the candidate anomaly submap, extrapolate their convergence center point within a preset future time period, and map the convergence center point to the nearest suitable channel segment for interception, as a recommended interception point. In this embodiment, the system extrapolates the trajectory of each vessel's current motion vector within the candidate anomaly submap over a future period to calculate the possible convergence center position of multiple vessels, and then maps this position to the nearest suitable channel segment for interception by law enforcement vessels, outputting it as a recommended interception point.
[0112] Specifically, the convergence center point after the preset time T is calculated using the following formula:
[0113] ,
[0114] ,
[0115] Where T is the preset future projection duration; For the first The extrapolated position of the ship after time T; For the first The current position vector of the vessel; For the first The velocity vector of a ship; M is the total number of ships in the anomaly subgraph; This represents the location of the convergence center point of all ships within the subgraph after time T.
[0116] The system uses the current moment as the starting point to assign position vectors to each ship within the subgraph. Add velocity vector The product of the product and the extrapolation duration T yields the extrapolated position of each ship after time T. Then, the geometric mean of all extrapolated positions is taken as the convergence center point. When the trajectories of various ships converge within a relatively small area, the vicinity of the convergence center point is the potential work site.
[0117] S5.2. Starting from the current position of the law enforcement base or patrol boat, and combining its preparation time and cruising speed within its jurisdiction, the system calculates the latest departure time that can arrive at the interception point before the rendezvous time, thus forming the cutoff boundary of the response time window. In this embodiment, the system uses the position of the law enforcement base or patrol boat as the starting point, and calculates the latest departure time that can arrive at the interception point before the extrapolated rendezvous time based on its preparation time and cruising speed. This time is the cutoff boundary of the law enforcement response time window, and law enforcement forces must depart before this time to successfully intercept the vessel.
[0118] Specifically, the latest departure time that law enforcement can successfully intercept is calculated using the following formula:
[0119] ,
[0120] in, The latest departure time (absolute time); The estimated rendezvous time for multiple ships within the sub-map (by...) (or the result of extrapolation is determined); Preparation time for law enforcement units (time required from receiving instructions to departure). The location vector of the recommended interception point (determined by S5.1); This is the current location vector of the law enforcement base or patrol boat; The cruising speed of law enforcement vessels within their jurisdiction.
[0121] The system uses rendezvous time The final deadline for reaching the interception point must be calculated backwards from that point: first, deduct the travel time required for the law enforcement vessel to travel from its current position to the interception point (spatial distance divided by cruising speed). ), and then deduct the preparation time. Get the latest departure time Law enforcement forces must be in They must depart beforehand, otherwise they will not be able to reach the interception point before the rendezvous time.
[0122] S5.3. The recommended interception point, the latest departure time, and the pattern type corresponding to the abnormal sub-graph are encapsulated into a structured law enforcement work order, and sent to the display terminal of the target law enforcement unit via the shore-sea communication link, so that the unit can initiate the departure process based on the cutoff boundary. In this embodiment, the system encapsulates the recommended interception point, the latest departure time, and the pattern type into a structured work order, and sends it to the law enforcement unit terminal via the shore-sea communication link. The terminal prompts or automatically initiates departure based on the cutoff boundary.
[0123] Specifically, the comprehensive early warning index is calculated using the following formula:
[0124] ,
[0125] in, Preset risk weights are assigned to match the anomaly subgraph with the pattern type; different pattern types correspond to different risk weights. value. This is a comprehensive early warning index; The interaction density of the abnormal subgraph (calculated by S4.2); These are the weighting coefficients for each item; is the steepness coefficient of the Sigmoid function, which controls the degree of nonlinear amplification of the warning index by the interaction density.
[0126] The system will increase the interaction density Risk weights based on pattern type By weighting factor A linear weighted fusion method is used, where the second term is a nonlinear enhancement term. When the interaction density exceeds a certain level, a marginally increasing amplification effect is formed through the Sigmoid function, improving the early warning sensitivity of high-density anomaly sub-maps. The calculated comprehensive early warning index... If the threshold is exceeded, the law enforcement task generation process is triggered.
[0127] Example 2
[0128] like Figure 2 As shown, this application provides an architecture diagram of a ship encounter warning system based on graph attention networks and AIS, applied to the ship encounter warning method based on graph attention networks and AIS as described in Embodiment 1, including:
[0129] The data acquisition module 210 is used to collect ship AIS messages and configure differentiated encounter sensing radii according to ship type.
[0130] The dynamic encounter graph construction module 220 is used to construct a dynamic encounter graph based on the angle between the encounter sensing radius and the velocity vector, and to encode edge features with the nearest encounter distance and the nearest encounter time.
[0131] The graph neural network processing module 230 is used to input the dynamic encounter graph into the graph attention network, use the attention mechanism to suppress the weight of the normally accompanying nodes of the waterway, enhance the weight of the hidden coupling nodes, and output the hidden layer representation of the ship.
[0132] The anomaly pattern recognition module 240 is used to identify anomalous subgraphs with high multilateral coupling based on the hidden layer representation and match them with the corresponding pattern type in the preset hidden encounter pattern library.
[0133] The early warning decision output module 250 is used to calculate the comprehensive early warning index based on the topological density of the abnormal subgraph, generate and issue law enforcement tasks carrying recommended interception points and response time windows.
[0134] Figure 3 This is an electronic device provided in one embodiment of this application. For example... Figure 3 As shown, the electronic device includes at least the following components: processor 301 and memory 300, communication interface 303, and bus 302.
[0135] In this embodiment of the application, memory 300 is used to store executable instructions of processor 301, which, when configured to execute instructions, implements the method as described in the first aspect.
[0136] In embodiments of this application, a computer-readable storage medium includes instructions that instruct a device to perform the method as described in the first aspect. For example, the instructions instruct the device to perform... Figure 1 The method is shown in the process steps.
[0137] In one embodiment of this application, the program operating in the electronic device may be a program that controls a central processing unit (CPU) or similar device to achieve the functions of the above-described embodiments of the present invention (a program that enables the computer to function). Information processed by these systems is then temporarily stored in random access memory (RAM) during processing, and subsequently stored in various ROMs such as read-only memory (FlashROM) and hard disk drives (HDDs), and read, corrected, and written by the CPU as needed.
[0138] It should be noted that a portion of the electronic device described above can also be implemented using a computer. In this case, the program for implementing the control function can be recorded on a computer-readable recording medium, and the program recorded on the recording medium can be read into the computer and executed.
[0139] It should be noted that the computer mentioned here refers to a computer built into an electronic device, employing hardware including an operating system and peripheral devices. Furthermore, computer-readable recording media refers to removable media such as floppy disks, magneto-optical disks, ROMs, and CD-ROMs, as well as storage systems such as hard drives built into the computer.
[0140] Furthermore, computer-readable recording media can include: media that dynamically stores programs for short periods of time, such as communication lines used when transmitting programs via networks like the Internet or communication lines like telephone lines; and media that store programs for fixed periods of time, such as volatile memory inside a computer that serves as a server or client in this case. In addition, the aforementioned program can be a program used to implement the above-mentioned functions, or it can be a program that can implement the above-mentioned functions by combining them with programs already recorded in the computer.
[0141] Furthermore, the electronic device in the above embodiments can also be implemented as an assembly (system group) composed of multiple systems. Each system constituting the system group can possess some or all of the functions or functional blocks of the electronic device in the above embodiments. As a system group, it is sufficient to have all the functions or functional blocks of the electronic device.
[0142] Those skilled in the art should recognize that the above embodiments are only used to illustrate this application and are not intended to limit this application. Any appropriate changes and variations made to the above embodiments within the essential spirit and scope of this application fall within the scope of protection claimed in this application.
Claims
1. A ship encounter early warning method based on graph attention network and AIS, characterized in that, Includes the following steps: Collect ship AIS messages and configure differentiated encounter sensing radii based on ship type; A dynamic encounter map is constructed based on the encounter perception radius and the angle between the velocity vector, and edge features are encoded with the nearest encounter distance and the nearest encounter time. The dynamic encounter graph is input into a graph attention network, and the attention mechanism is used to suppress the weight of normal accompanying nodes in the waterway and enhance the weight of hidden coupling nodes, outputting a hidden layer representation of the ship. Based on the hidden layer representation, identify the multi-sided highly coupled abnormal subgraph and match it with the corresponding pattern type in the preset hidden encounter pattern library; The comprehensive early warning index is calculated based on the topological density of the abnormal subgraph, and law enforcement tasks carrying recommended interception points and response time windows are generated and issued.
2. The method according to claim 1, characterized in that, The configuration of differentiated encounter perception radii based on ship type specifically includes: Identify the vessel type field specified in the vessel's AIS message, and classify the vessel into at least the dangerous goods and controlled cargo transport category, the passenger transport category, and the general cargo transport category; The system calls up a pre-set maritime regulatory strategy table, assigning the minimum baseline perception radius to vessels transporting controlled goods, a medium baseline perception radius to vessels transporting personnel, and the maximum baseline perception radius to vessels engaged in general operations. In response to changes in the ship's real-time speed, the reference sensing radius is dynamically expanded or contracted, so that the forward sensing area of the ship is lengthened along the course at high speeds, forming an elliptical encounter monitoring area to adapt to the range of collision risk propagation under high-speed motion.
3. The method according to claim 1, characterized in that, The construction of the dynamic encounter map based on the encounter sensing radius and the angle between the velocity vectors specifically includes: Using a single vessel as the central node, surrounding vessels within the same time window are scanned, and candidate vessels located within the forward fan-shaped monitoring area of the central node are selected. The opening angle of the fan-shaped monitoring area is defined by the velocity vector angle. Eliminate vessels from the candidate vessels that are in the fixed navigation mark obscuration area or have been identified by shore-based radar as part of the same law enforcement formation, to avoid law enforcement targets on the same side being mistakenly included in the encounter area; By establishing directed edges between the retained central node and candidate ships, the graph structure retains only the unidirectional relationship from the central node to the external potential interaction object, reducing redundant connections generated by parallel ships traveling downstream in the channel.
4. The method according to claim 1, characterized in that, The method of encoding edge features using the nearest encounter distance and the nearest encounter time specifically includes: Within the sliding time window, the relative motion trajectories of the two ships are extracted to predict the nearest meeting point of the two ships in the future and the time required to reach that position; The distance of the nearest meeting point from the coastline and whether the arrival time falls within the allowed time range for law enforcement response are injected as semantic information into the edge features. When the nearest meeting point between two ships is located outside the anchorage or at the edge of the channel, and the arrival time is shorter than the preset cruise cycle, the initial importance of the meeting point is increased, so that it receives priority attention in the subsequent graph attention network.
5. The method according to claim 1, characterized in that, The method of using attention mechanisms to suppress the weights of normally accompanying nodes in the channel specifically includes: Extract the curvature of the navigation trajectory of the central vessel and its neighboring nodes within the historical observation period. If both trajectories extend along the same navigation channel and the curvature changes in the same direction, then the neighboring node is determined to be a normal accompanying target in the channel. In the process of calculating the attention coefficient of the graph attention network, a confidence discount is applied to the normal accompanying targets identified above, so that their contribution to the update of the central ship's features is lower than that of randomly scattered non-accompanying targets.
6. The method according to claim 1, characterized in that, The weights of the enhanced hidden coupling nodes specifically include: Detect whether there is a deviation between the planned route of the neighboring node and the central vessel, that is, the two vessels have no intersection at the planned route layer of the electronic chart, but maintain a stable connection for multiple consecutive time slices in the dynamic encounter chart. If the aforementioned divergence exists, and the two ships exhibit characteristics of synchronous speed decrease or synchronous turning during the connection period, then a trust gain is added to the neighbor node in the graph attention network, so that its output hidden layer representation contains stronger cooperative anomaly semantics.
7. The method according to claim 1, characterized in that, The identification of anomalous subgraphs with highly coupled polygons specifically includes: Based on the similarity between the hidden layer representations of the ships, multiple ships with a representation distance less than the similarity threshold are classified into the same local group; The interaction density within the local group is obtained by statistically analyzing the proportion of the number of actual encounter edges established within the local group to the total number of possible edges within the group. When the interaction density is higher than the level of normal waterway intersections, and the spatial center of gravity of the local group moves toward the offshore hidden waters within a continuous time window, the local group is extracted as a candidate anomaly subgraph.
8. The method according to claim 7, characterized in that, The matching of the corresponding pattern type in the preset concealed encounter pattern library specifically includes: Read the combination of topological shape and ship attributes of the candidate anomaly subgraph; If the subgraph presents a star-shaped connection structure of one ship to multiple ships, and the central ship is heavily loaded while the outer ships are lightly loaded or empty, then it is matched as a cargo transshipment mode. If the subgraph presents a closed structure in the form of a ring or chain, and the AIS message transmission interval of each ship in the subgraph shows a periodic lack of synchronization, then it is matched as the formation silent avoidance mode. If all nodes in the subgraph are in a low-speed navigation state and the spatial center of gravity remains in the buffer zone outside the boundary of the sensitive sea area, then it is matched as the pre-gathering mode of the no-navigation zone.
9. A ship encounter early warning system based on graph attention network and AIS, applied to the method described in any one of claims 1 to 8, characterized in that, The system includes: The data acquisition module is used to collect ship AIS messages and configure differentiated encounter sensing radii according to ship type; The dynamic encounter graph construction module is used to construct a dynamic encounter graph based on the angle between the encounter perception radius and the velocity vector, and to encode edge features with the nearest encounter distance and the nearest encounter time. The graph neural network processing module is used to input the dynamic encounter graph into the graph attention network, use the attention mechanism to suppress the weight of the normal accompanying nodes of the waterway, enhance the weight of the hidden coupling nodes, and output the hidden layer representation of the ship. An anomaly pattern recognition module is used to identify anomalous subgraphs with high multilateral coupling based on the hidden layer representation and match them with the corresponding pattern type in a preset hidden encounter pattern library. The early warning decision output module is used to calculate the comprehensive early warning index based on the topological density of the abnormal subgraph, generate and issue law enforcement tasks carrying recommended interception points and response time windows.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program that instructs the device to perform the ship encounter warning method based on graph attention networks and AIS as described in any one of claims 1 to 8.
