An intelligent early warning and response method for water area security inspection
By constructing a time-series prediction model based on LSTM and attention mechanism, and dynamically adjusting the alarm threshold, the problem of poor environmental adaptability of water security patrol system in complex hydrological environment is solved, and the system can achieve keen capture and accurate identification of anomalies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING HAIZHOU UNMANNED SHIP TECH CO LTD
- Filing Date
- 2026-04-28
- Publication Date
- 2026-06-02
AI Technical Summary
Existing waterway security patrol systems rely on preset static rule thresholds for anomaly detection, resulting in poor environmental adaptability and an inability to adapt to complex hydrological environments.
A time-series prediction model based on Long Short-Term Memory (LSTM) network and attention mechanism is constructed. By collecting real-time data on the state and environment of unmanned vessels, the importance weights of multi-dimensional state vectors are dynamically calculated to generate dynamic alarm thresholds and implement graded responses.
It enables sensitive detection and accurate identification of anomalies in complex aquatic environments, avoids false alarms caused by environmental noise, and improves the system's environmental adaptability.
Smart Images

Figure CN122132927A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of waterway security patrol technology, specifically to an intelligent early warning and response method for waterway security patrol. Background Technology
[0002] With the increasing awareness of social security and the growing demand for inland waterway security management, security standards for key waterways such as reservoirs, border rivers, and important ports are continuously being raised. Against this backdrop, automated inspection systems based on unmanned vessel technology, with their advantages of autonomous navigation, all-weather operation, high-precision data acquisition, and real-time transmission, can achieve routine and intelligent monitoring of waterways, effectively making up for the shortcomings of manual inspections and becoming an important technical means and development direction for improving waterway security.
[0003] However, most current water security patrol and early warning systems rely on preset static rule thresholds for anomaly detection. For example, a speed limit (such as 10 knots) is set, and an alarm is triggered when the speed of a target exceeds the threshold; or an electronic fence is set, and an alarm is triggered when a target enters a specific area. This results in poor environmental adaptability of the system, and the fixed thresholds cannot adapt to complex hydrological environments. Summary of the Invention
[0004] To address this issue, the present invention provides an intelligent early warning and response method for water area security patrol inspection, which solves the problem that existing technologies rely on preset static rule thresholds for anomaly judgment, resulting in poor environmental adaptability of the system and the inability of fixed thresholds to adapt to complex hydrological environments.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] A smart early warning and response method for waterway security patrol and inspection includes the following steps:
[0007] S1: Real-time acquisition of unmanned vessel's own status data and environmental perception data, and output of multi-dimensional sequence set at the current moment through preprocessing;
[0008] S2: Construct and train a time-series prediction model based on historical normal data, using a long short-term memory network and attention mechanism, and use it to calculate the importance weight of the hidden state vector at each historical time step in the multi-dimensional state vector. ;
[0009] Importance weight The calculation formula is as follows:
[0010]
[0011] in, For window size, For the current time step, To indicate the first The raw score at each time step Indicates the first The raw scores for each time step;
[0012] S3: Calculate the multidimensional sequence set based on the time series prediction model, output the predicted value of the future state, and determine the anomaly index by comparing the predicted value of the future state with the actual observation value at the current moment;
[0013] S4: Receive and store the results calculated continuously in S3 One abnormal index This forms a dynamic sequence, and the mean of the dynamic sequence is calculated. and standard deviation Then, the dynamic alarm threshold at the current moment is calculated. Then, the latest anomaly index calculated in S3 is used. Compare with dynamic alarm thresholds;
[0014] Dynamic alarm threshold The calculation formula is as follows:
[0015]
[0016] in, This is a preset sensitivity coefficient used to control the strictness of the alarm threshold;
[0017] S5: Based on anomaly index The results of comparing the dynamic alarm threshold output by S4 are used to classify the response.
[0018] Furthermore, the preprocessing includes time alignment processing and data integration processing;
[0019] The time alignment process uses a time protocol to give a unified timestamp to its own state data and environmental perception data;
[0020] The data integration process constructs a sliding time window of length N to integrate time-aligned self-state data and environmental perception data into a continuous multi-dimensional time-series vector sequence.
[0021] Furthermore, the specific details of the attention mechanism are as follows:
[0022] 1) Receive the hidden state vector and calculate the original score of the hidden state vector using the attention scoring function. ;
[0023] The calculation formula is as follows:
[0024]
[0025] in, The training weight vector is a multidimensional state vector. For the first The hidden state vector at each time step, The weight matrix for training, For bias terms, This is a transpose operation;
[0026] 2) Use the Softmax function to evaluate the raw scores. Normalization is performed to obtain importance weights. .
[0027] Furthermore, the specific steps of S3 are as follows:
[0028] S3.1: Input the multidimensional sequence set into the temporal prediction model, and use the attention mechanism determined in S2 to dynamically calculate the importance weight of the hidden state at each time step based on the current environmental context. ;
[0029] S3.2: Importance weights for the hidden state vector Perform weighted summation to generate a key vector that includes environmental feature information. and key vector After mapping through the fully connected layer of the time series prediction model, the output is a multidimensional state prediction value for future time periods. ;
[0030] S3.3: Read the actual observations at the same time after preprocessing in S1. And calculate the anomaly index between the multidimensional state predictions and the actual observations. .
[0031] Furthermore, the key vector The calculation formula is as follows:
[0032]
[0033] in, For the first The hidden state vector at each time step.
[0034] Furthermore, the anomaly index The calculation formula is as follows:
[0035]
[0036] in, This represents the total number of multidimensional feature vectors.
[0037] Furthermore, in S4, if the latest abnormal index If the dynamic alarm threshold is reached, an anomaly is determined to exist at the current moment, triggering a subsequent response mechanism. If the latest anomaly index... If the value is less than or equal to the dynamic alarm threshold, an abnormal state is determined to exist at the current moment, and no alarm is triggered.
[0038] Furthermore, the graded response in S5 includes a first level, a second level, and a third level; wherein, the first level is the level of concern, when the anomaly index... When the value is less than the dynamic alarm threshold and the dynamic alarm threshold value shows a continuous upward trend, a potential risk is identified.
[0039] The second level is the alarm level, when the abnormal index... When the value exceeds the dynamic alarm threshold and the value of the dynamic alarm threshold rises rapidly, it is judged as a high-risk sudden anomaly.
[0040] The third level is the manual review level, when abnormal indices... When the data consistently exceeds the dynamic alarm threshold, and the dynamic alarm threshold shows a gradual change, it indicates a new normal in the environment. At this point, the data segment for the current time period is uploaded to the cloud server, triggering a manual review process.
[0041] This invention has the following advantages: By constructing a time-series prediction model and utilizing an attention mechanism to dynamically calculate the importance weight of each feature dimension at the current moment, the invention enables the system to understand normal behavior patterns under different environmental conditions (such as changes in wind speed and water flow). When environmental complexity leads to aggravated normal fluctuations, step S4 automatically adjusts the dynamic alarm threshold, effectively avoiding false alarms caused by environmental noise such as wind and waves. When the environment is calm, the dynamic alarm threshold adaptively decreases, enabling the system to sensitively detect minute anomalies. This solves the problem that fixed thresholds cannot adapt to complex and changing aquatic environments and achieves adaptive adjustment of the threshold according to the environmental background.
[0042] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. Attached Figure Description
[0043] To more intuitively illustrate the prior art and this application, exemplary drawings are provided below. It should be understood that the specific shapes and structures shown in the drawings should not generally be regarded as limiting conditions for implementing this application; for example, based on the technical concept disclosed in this application and the exemplary drawings, those skilled in the art are able to easily make conventional adjustments or further optimizations to the addition / reduction / classification, specific shapes, positional relationships, connection methods, size ratios, etc. of certain units (components).
[0044] Figure 1 This is a flowchart illustrating the implementation of an intelligent early warning and response method for waterway security patrols according to the present invention. Detailed Implementation
[0045] The following specific embodiments illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. It should be understood that these embodiments are merely for further explanation of the present invention and should not be construed as limiting the scope of protection of the present invention. Technical engineers in the field can make some non-essential improvements and adjustments to the present invention based on the above-described content. 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.
[0046] Please see Figure 1 A smart early warning and response method for waterway security patrol and inspection includes the following steps:
[0047] S1: Real-time collection of unmanned vessel's own status data and environmental perception data, and output of multi-dimensional sequence set of the current moment through preprocessing, providing a data foundation for subsequent accurate modeling, reducing the risk of false alarms caused by poor data quality from the source.
[0048] The vessel's own state data and environmental perception data are read in real time from various heterogeneous sensors deployed on the unmanned inspection vessel through hardware interfaces. The own state data includes the geographical coordinates (longitude and latitude) of the vessel output by the Global Positioning System (GPS) receiver; the inertial measurement unit (IMU) synchronously outputs the three-axis attitude angles of the hull, including roll angle, pitch angle and heading angle. The own state data describes the hull's own motion state and instantaneous attitude stability.
[0049] Environmental perception data includes information on the trajectory of surrounding vessels received by the Automatic Identification System (AIS), such as the identification code, speed and heading of unmanned vessels; the coordinates (distance, bearing) and reflection intensity of surrounding target points output by the radar system; the instantaneous flow velocity and direction angle of the water body measured by the flow velocity sensor; and the instantaneous wind speed and direction angle of the atmosphere recorded by the wind speed sensor.
[0050] Preprocessing includes time alignment and data integration. Time alignment uses the Precise Time Protocol (PTP, IEEE 1588) to assign a unified timestamp to the state data and environmental perception data. Based on this, the heterogeneous data streams output by GPS, IMU, radar, AIS, flow rate sensor and wind speed sensor are mapped to the same time coordinate system using the master clock as a reference.
[0051] Data integration processing constructs a sliding time window of length N to integrate time-aligned self-state data and environmental perception data into a continuous multidimensional time-series vector sequence. Each element in this sequence is a multidimensional feature vector, including specific values such as the ship's velocity component, the ship's heading angle, the relative distance and relative azimuth angle of surrounding targets, the acceleration vector of surrounding targets, the instantaneous water flow velocity component, and the instantaneous wind speed component, forming a complete multidimensional sequence set describing the current water situation.
[0052] S2: Construct and train a time-series prediction model based on a Long Short-Term Memory (LSTM) network and an attention mechanism using historical normal data, and use it to calculate the importance weights of the hidden state vector at each historical time step in the multi-dimensional state vector. .
[0053] For example, when input data shows drastic changes in water flow velocity, the attention mechanism automatically assigns higher weight to the water flow velocity feature, making it have a greater impact on the prediction results; when data shows frequent maneuvering of surrounding targets, the weight of the target acceleration feature is increased. This enables the system to understand normal behavior under different environments (such as wind and wave size), thus facilitating subsequent solutions to the problem that static thresholds cannot adapt to complex and changing aquatic environments, achieving environmental adaptation.
[0054] Historical normal data includes complete records of unmanned vessels performing normal patrol missions in the waters under different seasons and weather conditions (such as calm, strong winds, and rapid currents). The historical normal data is further divided into an input sequence and a label sequence. The input sequence includes a multi-dimensional state vector of the past N time steps, and the label sequence is the true state vector of the future M time steps.
[0055] Long Short-Term Memory (LSTM) networks are used to process time-series data. Through their internal forget gate, input gate, and output gate structure, at each time step, the LSTM first receives the multi-dimensional feature input of the current time step and the hidden state of the previous time step. These two are concatenated and then fed into three sigmoid activation function layers (forget gate, input gate, and output gate) to generate control signals between 0 and 1. The forget gate determines how much outdated information to discard from the previous cell state based on the current input and historical state. The input gate simultaneously determines the location of information to be updated through the sigmoid layer and generates new candidate memory content through the tanh layer (a neural network layer of activation functions), thus achieving accurate memory of long-term dependencies and filtering of short-term noise. Finally, the output gate, combined with the updated cell state, is activated by the tanh layer and modulated by the output gate signal, ultimately outputting a hidden state vector containing valid context information from the current time step and past events.
[0056] The attention mechanism is used to calculate the importance weights of the hidden state vector at each historical time step in the multi-dimensional state vector, in order to distinguish the contribution of information from different historical moments to the current prediction. The specific details are as follows:
[0057] 1) Receive the hidden state vector and calculate the original score of the hidden state vector using the attention scoring function. This facilitates reflecting the initial correlation between the hidden state vector and the current environment. The calculation formula is as follows:
[0058]
[0059] in, The training weight vector is a multidimensional state vector. For the first The hidden state vector at each time step, The weight matrix for training, For bias terms, This is the transpose operation.
[0060] 2) Use the Softmax function to evaluate the raw scores. Normalization is performed to obtain importance weights. The original score was transformed using the Softmax function. The data is compressed to the (0,1) interval, and the sum of the weights for all time steps is 1. A larger weight value indicates a higher contribution of the feature to predicting the state at the current time step. The calculation formula is as follows:
[0061]
[0062] in, For window size, For the current time step, To indicate the first The raw score at each time step.
[0063] S3: Based on the time series prediction model, calculate the multidimensional sequence set, output the predicted value of the future state, and determine the anomaly index by comparing the predicted value of the future state with the actual observed value at the current time; the specific steps of S3 are as follows:
[0064] S3.1: Input the multidimensional sequence set into the temporal prediction model, and use the attention mechanism determined in S2 to dynamically calculate the importance weight of the hidden state at each time step based on the current environmental context. ;
[0065] S3.2: Importance weights for the hidden state vector Perform weighted summation to generate a key vector that includes environmental feature information. and key vector After mapping through the fully connected layer of the time series prediction model, the output is a multidimensional state prediction value for future time periods. The calculation formula is as follows:
[0066]
[0067] S3.3: Read the actual observations at the same time after preprocessing in S1. And calculate the anomaly index between the multidimensional state predictions and the actual observations. This is used to indicate current environmental anomalies, thereby improving the sensitivity and accuracy of potential risk identification in complex and ever-changing aquatic environments. The calculation formula is as follows:
[0068]
[0069] in, This represents the total number of multidimensional feature vectors.
[0070] S4: Receive and store the results calculated continuously in S3 One abnormal index This forms a dynamic sequence, and the mean of the dynamic sequence is calculated. and standard deviation Then, the dynamic alarm threshold at the current moment is calculated. And the latest anomaly index calculated in S3 Compared with the dynamic alarm threshold, if the latest abnormal index If the dynamic alarm threshold is reached, an anomaly is determined to exist at the current moment, triggering the subsequent response mechanism. If the latest anomaly index... If the value is ≤ the dynamic alarm threshold, an abnormal state is determined to exist at the current moment, and no alarm is triggered. This ensures that anomaly detection is both adaptable to environmental changes and maintains the ability to detect real threats. The calculation formula is as follows:
[0071]
[0072] in, This represents the total number of dynamic sequences.
[0073] Standard deviation The calculation formula is as follows:
[0074]
[0075] Dynamic alarm threshold The calculation formula is as follows:
[0076]
[0077] in, This is a preset sensitivity coefficient used to control the strictness of the alarm threshold. When the environment is stable... When the fluctuation is small, the standard deviation Smaller, dynamic alarm threshold This reduces the overall sensitivity to subtle anomalies; when the environment is complex and the anomaly index is high... When the threshold fluctuates significantly, it automatically increases to avoid false alarms caused by environmental noise.
[0078] Each new anomaly index is calculated The window discards the oldest abnormal index. and input new abnormal index Ensure the window always contains the latest information. Historical anomaly index value.
[0079] S5: Based on anomaly index The results of comparing the dynamic alarm threshold output by S4 are used to classify the response.
[0080] The first level in the graded response is the level of concern: when the anomaly index... When the value is below the dynamic alarm threshold but shows a continuous upward trend, a potential risk is identified. In this case, the unmanned vessel will not trigger an alarm, but will automatically increase the sampling frequency and detection density of relevant sensors on the target to obtain more detailed data to confirm the trend development and prevent early hidden dangers from being missed.
[0081] The second level is the alarm level: when the abnormal index... When the value exceeds the dynamic alarm threshold and the displayed value increases rapidly, it is determined to be a high-risk sudden anomaly. The unmanned vessel immediately triggers its audible and visual deterrent device.
[0082] The third level is the manual review level: when the abnormal index... When the data consistently exceeds the dynamic alarm threshold but the trend is flat, it indicates a new normal in the environment (such as seasonal changes in water flow) rather than a temporary threat. In this case, the data segment for the current time period is uploaded to the cloud server, triggering a manual review process. Once manually confirmed as a new normal pattern, an online fine-tuning mechanism is initiated, updating the weight parameters of the LSTM model in step S2.
[0083] This invention constructs a temporal prediction model based on Long Short-Term Memory (LSTM) networks and an attention mechanism, transforming security detection from traditional static threshold comparison to anomaly analysis based on prediction residuals, thus improving the system's environmental adaptability. The attention mechanism dynamically calculates the importance weight of each feature dimension at the current moment, enabling the system to understand normal behavior patterns under different environmental conditions (such as wind speed and water flow changes). When environmental complexity exacerbates normal fluctuations, step S4 automatically adjusts the dynamic alarm threshold, effectively avoiding false alarms caused by environmental noise such as wind and waves. When the environment is calm, the dynamic alarm threshold adaptively decreases, allowing the system to sensitively detect subtle anomalies. This solves the problem that fixed thresholds cannot adapt to complex and changing aquatic environments and achieves adaptive threshold adjustment based on environmental background.
[0084] The following is a specific example:
[0085] Take, for example, the unmanned surface vessel (USV) security patrol mission at a large inland river port during a typhoon. At this time, the aquatic environment was extremely complex. Its own status data showed that the USV's roll and pitch angles fluctuated violently, and the attitude change frequency recorded by the inertial measurement unit (IMU) was much higher than usual. At the same time, in the environmental perception data, the instantaneous water flow velocity component measured by the flow velocity sensor surged from the normal 1.2 m / s to 3.5 m / s and the flow direction was turbulent. The instantaneous atmospheric wind speed recorded by the wind speed sensor reached the level of gale-force wind (G1). Moreover, the coordinates of the surrounding target points scanned by the radar system showed slight jitter due to sea clutter.
[0086] In phase S1, the heterogeneous data is aligned and integrated into a multidimensional sequence set input model through Precise Time Protocol (PTP). In phases S2 and S3, the attention mechanism analyzes the current input in real time and identifies that the drastic changes in the instantaneous water flow velocity component and the ship's heading angle are inevitable results of the typhoon environment, rather than abnormal accidents. Therefore, the importance weights are automatically calculated.
[0087] Long Short-Term Memory (LSTM) networks accurately predict the multidimensional state of the unmanned surface vessel (USV) under strong wind and jet stream conditions (including a large drift velocity and a specific range of attitude sway). The anomaly index R is then calculated. Because the actual observed values are highly consistent with the predicted values that conform to typhoon conditions, although the absolute values are large, the weighted residuals are extremely small, resulting in the anomaly index R remaining at a low level.
[0088] Meanwhile, during phase S4, K consecutive anomaly indices R were received. Due to recent significant environmental fluctuations, the calculated standard deviation increased, leading to an automatic upward adjustment of the dynamic alarm threshold. The final comparison showed that the current anomaly index R was significantly lower than the dynamically adjusted dynamic alarm threshold S, thus determining the current situation as a Level 1 concern response: automatically increasing the sampling frequency of the radar system and AIS receiver for this water area from 1Hz to 5Hz for more precise monitoring of potential threats.
[0089] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for intelligent early warning and response during waterway security patrols, characterized in that, Includes the following steps: S1: Real-time acquisition of unmanned vessel's own status data and environmental perception data, and output of multi-dimensional sequence set at the current moment through preprocessing; S2: Construct and train a time-series prediction model based on historical normal data, using a long short-term memory network and attention mechanism, and use it to calculate the importance weight of the hidden state vector at each historical time step in the multi-dimensional state vector. ; Importance weight The calculation formula is as follows: in, For window size, For the current time step, To indicate the first The raw score at each time step Indicates the first The raw scores for each time step; S3: Calculate the multidimensional sequence set based on the time series prediction model, output the predicted value of the future state, and determine the anomaly index by comparing the predicted value of the future state with the actual observation value at the current moment; S4: Receive and store the results calculated continuously in S3 One abnormal index This forms a dynamic sequence, and the mean of the dynamic sequence is calculated. and standard deviation Then, the dynamic alarm threshold at the current moment is calculated. Then, the latest anomaly index calculated in S3 is used. Compare with dynamic alarm thresholds; Dynamic alarm threshold The calculation formula is as follows: in, This is a preset sensitivity coefficient used to control the strictness of the alarm threshold; S5: Based on anomaly index The results of comparing the dynamic alarm threshold output by S4 are used to classify the response.
2. The intelligent early warning and response method for waterway security patrol according to claim 1, characterized in that, The preprocessing includes time alignment and data integration. The time alignment process uses a time protocol to give a unified timestamp to its own state data and environmental perception data; The data integration process constructs a sliding time window of length N to integrate time-aligned self-state data and environmental perception data into a continuous multi-dimensional time-series vector sequence.
3. The intelligent early warning and response method for waterway security patrol according to claim 1, characterized in that, The specific details of the attention mechanism are as follows: 1) Receive the hidden state vector and calculate the original score of the hidden state vector using the attention scoring function. ; The calculation formula is as follows: in, The training weight vector is a multidimensional state vector. For the first The hidden state vector at each time step, The weight matrix for training, For bias terms, This is a transpose operation; 2) Use the Softmax function to evaluate the raw scores. Normalization is performed to obtain importance weights. .
4. The intelligent early warning and response method for waterway security patrol and inspection according to claim 1, characterized in that, The specific steps of S3 are as follows: S3.1: Input the multidimensional sequence set into the temporal prediction model, and use the attention mechanism determined in S2 to dynamically calculate the importance weight of the hidden state at each time step based on the current environmental context. ; S3.2: Importance weights for the hidden state vector Perform weighted summation to generate a key vector that includes environmental feature information. and key vector After mapping through the fully connected layer of the time series prediction model, the output is a multidimensional state prediction value for future time periods. ; S3.3: Read the actual observations at the same time after preprocessing by S1. And calculate the anomaly index between the multidimensional state predictions and the actual observations. .
5. The intelligent early warning and response method for waterway security patrol and inspection according to claim 4, characterized in that, The key vector The calculation formula is as follows: in, For the first The hidden state vector at each time step.
6. The intelligent early warning and response method for waterway security patrol and inspection according to claim 4, characterized in that, The abnormal index The calculation formula is as follows: in, This represents the total number of multidimensional feature vectors.
7. The intelligent early warning and response method for waterway security patrol according to claim 1, characterized in that, If the latest abnormal index in S4 If the dynamic alarm threshold is reached, an anomaly is determined to exist at the current moment, triggering a subsequent response mechanism. If the latest anomaly index... If the value is less than or equal to the dynamic alarm threshold, an abnormal state is determined to exist at the current moment, and no alarm is triggered.
8. The intelligent early warning and response method for waterway security patrol according to claim 1, characterized in that, The graded response in S5 includes a first level, a second level, and a third level; among which, the first level is the level of concern, when the anomaly index... If the value is below the dynamic alarm threshold and the dynamic alarm threshold value shows a continuous upward trend, it is determined that there is a potential risk. The second level is the alarm level, when the abnormal index... When the value exceeds the dynamic alarm threshold and the value of the dynamic alarm threshold rises rapidly, it is judged as a high-risk sudden anomaly. The third level is the manual review level, when abnormal indices... When the data consistently exceeds the dynamic alarm threshold, and the dynamic alarm threshold shows a gradual change, it indicates that the environment has entered a new normal. At this point, the data segment for the current time period is uploaded to the cloud server, triggering the manual review process.