A ship detection and tracking method under bridge area monitoring scene
By improving the deformable multi-branch YOLOX network and feature extraction method, and combining Kalman filtering and ResNet50-ibn network, the robustness problem of ship detection and tracking in bridge area monitoring scenarios is solved, and the detection accuracy of small target ships at long distances and the tracking stability of occluded ships are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUHAN UNIV OF TECH CHONGQING RES INST
- Filing Date
- 2023-09-11
- Publication Date
- 2026-06-02
AI Technical Summary
In bridge area monitoring scenarios, existing ship detection and tracking methods lack robustness, making it difficult to effectively detect small target ships at long distances and maintain stable tracking under obstructed conditions.
A deformable multi-branch YOLOX network combined with Kalman filtering and ResNet50-ibn network is used to construct a ship detection and tracking model suitable for bridge area monitoring scenarios through improved loss function and feature extraction method. The IOU and cosine distance are used to measure ship motion and appearance features, and trajectory matching is performed by combining Hungarian algorithm and cascade matching strategy.
It improves the detection accuracy of small target vessels at long distances and the tracking stability of obstructed vessels in bridge area monitoring scenarios, achieving high-precision vessel tracking results.
Smart Images

Figure CN117132951B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of ship detection and tracking technology, and relates to a ship detection and tracking method in a bridge area monitoring scenario. Background Technology
[0002] Bridges are crucial nodes spanning waterways and connecting transportation channels on both sides of a body of water, forming an important part of highway and railway networks. However, while the numerous and densely distributed bridges provide convenient transportation for goods and residents on both sides, they also bring significant safety risks: bridge piers within the bridge area can restrict the width of waterways, increasing the complexity of the navigation environment and significantly raising the probability of maritime accidents. Currently, the risk of ship-bridge collisions has become one of the major sources of maritime traffic safety. Therefore, it is essential to take proactive measures, employing ship detection and tracking technologies to strengthen the supervision of vessels within the bridge area, and to prevent ship collisions and serious incidents such as bridge damage and collapse.
[0003] Before the breakthroughs in deep learning technology, traditional ship target detection for ship detection and tracking can be divided into static ship target detection based on feature extraction and dynamic ship target detection based on inter-frame difference and background modeling. However, both have significant limitations, such as weak robustness, being greatly affected by factors such as ship occlusion and adverse weather conditions, and poor detection performance for stationary or slowly moving ships. Traditional ship target tracking methods can be divided into generative models based on joint distribution and discriminative models based on conditional distribution. These models can usually only perform tracking tasks for a single ship and have low tracking robustness.
[0004] With the continuous iteration of computer graphics processing equipment and the rapid development of deep learning technology, deep learning-based ship target detection and tracking algorithms have found fertile ground for vigorous development. Currently, deep learning-based ship target detection has become the most widely used method in the field of ship target detection, and detection-based tracking has become a new paradigm in ship tracking. Compared to traditional methods, deep learning-based ship detection and tracking methods can track multiple ships simultaneously and exhibit higher accuracy and stronger robustness in practical applications.
[0005] Monitoring equipment in bridge areas is often installed on the bridge deck or piers, with a monitoring range of several kilometers. However, small, distant vessels in the monitored images typically provide insufficient visual information for detection. Furthermore, when a vessel is obstructed from view, the visual information it provides is severely compromised, potentially impairing vessel detection and tracking performance and hindering the effectiveness of general detection and tracking methods. Therefore, addressing the challenges of large vessel size variations in bridge areas, small vessel sizes at long distances, limited feature sets, and frequent vessel obstruction, and proposing an improved general detection and tracking method for bridge area monitoring scenarios, is of significant practical importance. Summary of the Invention
[0006] In view of this, the purpose of this invention is to provide a ship detection and tracking method in bridge area monitoring scenarios, which solves the problem of insufficient robustness of existing technologies in bridge area monitoring scenarios. It is applicable to ship detection and tracking in bridge area monitoring scenarios, and can effectively improve the detection accuracy of small target ships at long distances and the tracking stability of ships with obstructions, thereby achieving high-precision ship tracking in bridge area monitoring scenarios.
[0007] To achieve the above objectives, the present invention provides the following technical solution:
[0008] A method for ship detection and tracking in a bridge area monitoring scenario, specifically including the following steps:
[0009] S1: Collect video stream data from bridge area monitoring scenarios, select images and video clips for annotation, and construct a ship detection and multi-target tracking dataset;
[0010] S2: Construct a deformable multi-branch YOLOX network and input the collected dataset into the deformable multi-branch YOLOX network for training, thereby obtaining a ship detection model;
[0011] S3: Input the bridge area video images into the trained ship detection model for detection, and output the ship detection results;
[0012] S4: Based on the ship inspection results, Kalman filtering and ResNet50-ibn network are used to extract the ship's motion and appearance features respectively;
[0013] S5: Based on the confidence level of the detection results and the extracted features, match the ships detected in the current video frame with historical trajectories and output the tracking results.
[0014] Furthermore, in step S2, a deformable multi-branch YOLOX network is constructed. Specifically, the CSP module in the original YOLOX network is uniformly replaced with the DC2S module, and a CBAM hybrid attention module is added before the input of the Neck part. CIoU is used to replace IoU as the localization loss of the YOLOX network, and Focal loss is used to replace BCE loss as the positive example judgment loss. Among them, the DC2S module is a deformable multi-branch gradient path module and an important component of the feature extraction backbone network, which is used to improve the detection performance of distant ship targets in the bridge area.
[0015] Furthermore, in step S2, the structure of the DC2S module is as follows: First, the CBS module processes the features once. Then, through a Split operation, half of the channel features are used as secondary gradient branches to directly participate in parallel concatenation. The other half of the channel features are input into the main gradient branch composed of n deformable residual components for further feature extraction. In the main gradient branch, DC2S no longer adopts a simple serial mode like the CSP module. Instead, based on the serialization of deformable residual components, the outputs of each deformable residual component are concatenated in parallel, thereby enriching the feature information and improving the efficiency of gradient backflow. The result after concatenating the main gradient flow and the secondary gradient flow is adjusted by the CBS module to achieve a high degree of fusion of multi-branch features.
[0016] Furthermore, in step S2, the expression for the CIoU loss function is:
[0017]
[0018]
[0019]
[0020] Where d is the Euclidean distance between the ground truth bounding box and the target bounding box, and c is the diagonal length of the minimum bounding rectangle between the ground truth bounding box and the target bounding box. is the weighting function; v is a positive tradeoff parameter used to measure the consistency of the aspect ratio between the ground truth bounding box and the target bounding box; w gt and h gt represents the width and height of the real bounding box, respectively, while w and h represent the width and height of the target bounding box, respectively.
[0021] Furthermore, in step S2, the expression for the Focal loss function is:
[0022] L FL =-(1-p t ) γ log(p t )
[0023]
[0024] Among them, L FL This represents the Focal loss, where γ is the modulation coefficient used to reduce the weight of easily classified samples and increase the weight of difficult-to-classify samples; p t This represents the probability of correctly classifying the target. To predict the probability, y is the label used to determine whether an example is positive.
[0025] Furthermore, in step S4, the ship motion features are extracted using Kalman filtering, specifically including: employing... As state parameters of the Kalman filter system; during the initialization phase, the initial values of each rate of change are set to 0, and an 8×8 diagonal matrix is used as the covariance matrix of the system.
[0026] The state prediction equation and state observation equation of a Kalman filter system are defined by the following equations:
[0027] x k =Fx k-1 +Bu k +w k
[0028] z k =Hx k-1 +v k
[0029] Where, x k and z k Let B and u represent the state vector and observation vector of the system at time k, respectively; F is the state transition matrix, and B and u are the observation vectors of the system at time k. k These represent the control input matrix and control input vector, respectively; H is the observation matrix, and w k and v k Let Q and R represent state noise and observation noise, respectively, with a mean of 0 and covariances of Q and R.
[0030] Since the internal motion parameters of the ship are unknown in multi-target ship tracking scenarios, the parameters of the control input are not considered. In the prediction phase, the target ship is first estimated based on the state transition matrix:
[0031]
[0032] in, and Let represent the prior estimate of the system at time k and the posterior estimate of the system at time k-1, respectively, and F be the state transition matrix;
[0033] At the same time, it is necessary to calculate the covariance of the prior estimation error:
[0034]
[0035] in, This represents the covariance of the prior estimation error of the system at time k. Let represent the covariance of the posterior estimation error of the system at time k-1;
[0036] Subsequently, in the update phase, the Kalman gain needs to be calculated first:
[0037]
[0038] Among them, K k The Kalman gain represents the system's preference weights for the predicted and observed values.
[0039] Then calculate the optimal estimate:
[0040]
[0041] And update the covariance matrix
[0042]
[0043] Where E is an n-order identity matrix, and its right subscript n is the dimension of the observation.
[0044] Furthermore, in step S4, the ResNet50-ibn network model is used to extract the appearance features of the ship. Specifically, the ResNet50-ibn network is based on the ResNet50 network, and an instance normalization layer is added before the activation function of the output of the first three types of residual blocks to process the shallower features, thereby enhancing the robustness of the re-identification model to the occlusion conditions of ships in bridge area waters.
[0045] Furthermore, in step S4, the IOU distance is used as a measure of the ship's motion characteristics:
[0046] d (1) (i,j)=1-IOU(d j ,r i )
[0047] Where, d j r i d represents the bounding box of the detected j-th ship target and the predicted bounding box of the existing i-th ship trajectory obtained through the Kalman filter, respectively; (1) (i,j) represents the IOU distance between the i-th ship trajectory and the j-th target;
[0048] Cosine distance is used as a measure of a ship's external appearance.
[0049]
[0050] Where, r j This represents the appearance descriptor extracted from the j-th target detected in the current frame. Then it represents the k-th appearance descriptor of the i-th ship trajectory; d (2) (i,j) represents the cosine distance between the i-th ship trajectory and the j-th target. Furthermore, when calculating the cosine distance, a minimum threshold of 0.25 is set to exclude matching results with excessively low ship appearance similarity.
[0051] Furthermore, step S5 specifically includes: processing high-scoring and low-scoring detection results separately based on detection confidence; and simultaneously employing a feature integration strategy based on the detection result confidence as a comprehensive matching index, expressed as:
[0052] s ij =(1-c j 2 )d (1) (i,j)+c j 2 d (2) (i,j)
[0053] Among them, c j d represents the confidence level of the detection result of the j-th target. (1) (i,j),d (2) (i,j) represent the IOU distance and cosine distance between the i-th ship trajectory and the j-th target, respectively. ij The overall matching degree between the j-th target and the i-th ship trajectory;
[0054] The matching process employs the Hungarian algorithm and a cascaded matching strategy. After the initial matching is completed, the successfully matched trajectory will be directly used as the trajectory input for the next frame. The detection results of unsuccessfully matched trajectories will generate new trajectories for the next frame, and the unmatched trajectories will undergo a second matching.
[0055] The beneficial effects of this invention are as follows: This invention addresses the challenges of large variations in vessel size in bridge areas, small vessel size at long distances, few features, and frequent obstruction between vessels. By improving existing methods, it provides a vessel detection and tracking method suitable for bridge area monitoring scenarios, which can achieve good detection and tracking results in bridge area monitoring scenarios.
[0056] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0057] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:
[0058] Figure 1 This is a structural diagram of the DC2S module in an embodiment of the present invention;
[0059] Figure 2 This is a schematic diagram of the deformable multi-branch YOLOX network structure in an embodiment of the present invention;
[0060] Figure 3 This is a schematic diagram of the tracking process in an embodiment of the present invention. Detailed Implementation
[0061] The following specific examples 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. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0062] Please see Figures 1-3 This invention provides a method for ship detection and tracking in a bridge area monitoring scenario, which mainly includes the following steps:
[0063] S1: Collect video stream data from bridge area monitoring scenarios, select images and video clips for annotation, and construct a ship detection and multi-target tracking dataset.
[0064] First, a dataset of original bridge area video images was collected using cameras installed at different locations. Then, images and video clips with diversity and strong representativeness were selected from the dataset. The ship images and video clips were manually labeled in MS COCO and MOT standard formats, respectively. Finally, the dataset was divided into training and testing sets.
[0065] S2: Construct a deformable multi-branch YOLOX network and input the collected dataset into the deformable multi-branch YOLOX network for training and testing.
[0066] S21: Design the DC2S module.
[0067] The DC2S module can obtain richer feature information from the model by parallelizing more gradient flow branches. The specific structure is as follows: Figure 1The process first uses the CBS module to process the features. Then, a Split operation is used to directly participate in parallel concatenation as a secondary gradient branch, while the features from the other half of the channels are input into the main gradient branch, composed of n deformable residual components, for further feature extraction. In the main gradient branch, DC2S does not use a simple concatenation mode like the CSP module. Instead, it concatenates the outputs of each deformable residual component in parallel, enriching the feature information and improving the efficiency of gradient backflow. The result of concatenating the main and secondary gradient flows is then processed by the CBS module to adjust the number of channels, achieving a high degree of fusion of multi-branch features.
[0068] Because the appearance features of ships in the bridge area's waterway monitoring video images can change significantly with their position and angle, the DC2S module, based on the original residual components, employs deformable convolution to modify them, enhancing the network's ability to learn the features of ships of different sizes and shapes. During model computation, the deformable convolution learns the offset feature map of the convolution kernel through an additional convolution operation, and adjusts the original convolution operation based on the offset feature map. The size of the offset feature map is the same as the input feature map, with 3×N channels, where 3 represents the x-offset, y-offset, and weight coefficient of the pixel, and N represents the number of pixels in the convolution kernel.
[0069] S22: Improve the original YOLOX network by replacing all existing CSP modules with DC2S modules. Additionally, add a CBAM hybrid attention module before the input in the Neck section. The improved deformable multi-branch YOLOX network structure is as follows: Figure 2 As shown.
[0070] S23: Optimize the loss function in the network.
[0071] Using CIoU instead of IoU as the localization loss for YOLOX, CIoU can be expressed as:
[0072]
[0073]
[0074]
[0075] Where d is the Euclidean distance between the ground truth bounding box and the target bounding box, and c is the diagonal length of the minimum bounding rectangle between the ground truth bounding box and the target bounding box. is the weighting function, v is used to measure the consistency of the aspect ratio between the ground truth bounding box and the target bounding box.
[0076] Using Focal loss instead of BCE loss as the positive example judgment loss, Focal loss can be expressed as:
[0077] L FL =-(1-p t ) γ log(p t )
[0078]
[0079] in, To predict the probability, y is the label used to determine whether an example is positive.
[0080] S24: Train and test the model on the training set for 300 training epochs, with a batch size of 8 and a learning rate of 1.25 × 10⁻⁶. -3 The first 5 rounds use a small learning rate, and after training, the effect of the trained model is tested on the test set.
[0081] S3: Input the bridge area video images into the trained ship detection model for detection, and output the ship detection results.
[0082] First, video image data is collected in real time by the bridge area monitoring equipment and streamed to a remote server. Then, after the remote server receives the streamed video, it inputs the received video data into the detection model and outputs the detection results.
[0083] S4: Based on the ship inspection results, Kalman filtering and ResNet50-ibn network are used to extract the ship's motion and appearance features.
[0084] S41: Extract ship motion features using Kalman filtering, employing... These are used as state parameters of the Kalman filter system. During the initialization phase, the initial values of each rate of change are set to 0, and an 8×8 diagonal matrix is used as the covariance matrix of the system.
[0085] The state prediction equation and state observation equation of a Kalman filter system are defined by the following equations:
[0086] x k =Fx k-1 +Bu k +w k
[0087] z k =Hx k-1 +v k
[0088] Where, x k and z k Let B and u represent the state vector and observation vector of the system at time k, respectively; F is the state transition matrix, and B and u are the observation vectors of the system at time k. kThese represent the control input matrix and control input vector, respectively; H is the observation matrix, and w k and v k Let Q and R represent state noise and observation noise, respectively, with a mean of 0 and covariances of Q and R.
[0089] Since the internal motion parameters of the ship are unknown in the multi-target ship tracking scenario, the parameters of the control input are not considered.
[0090] In the prediction phase, the target vessel will first be estimated based on the state transition matrix:
[0091]
[0092] At the same time, it is necessary to calculate the covariance of the prior estimation error:
[0093]
[0094] Subsequently, in the update phase, the Kalman gain needs to be calculated first:
[0095]
[0096] Then calculate the optimal estimate:
[0097]
[0098] And update the covariance matrix
[0099]
[0100] Where F is the state transition matrix, and Let K and K-1 represent the prior estimate of the system at time k and the posterior estimate of the system at time k-1, respectively. and Let K represent the covariance of the prior estimation error of the system at time k and the covariance of the posterior estimation error of the system at time k-1, respectively. k is the Kalman gain, representing the system's preference weights for the predicted and observed values.
[0101] S42: The ResNet50-ibn network model is used to extract the appearance features of ships. Based on the ResNet50 network, an instance normalization layer is added before the activation function of the first three types of residual block outputs to process the shallower features, thereby enhancing the robustness of the re-identification model to the occlusion conditions of ships in bridge area waters.
[0102] S43: Use IoU distance and cosine distance as indicators for measuring ship motion characteristics and appearance characteristics, respectively.
[0103] d (1)(i,j)=1-IOU(d j ,r i )
[0104]
[0105] Where, d (1) (i,j),d (2) (i,j) represent the IoU distance and cosine distance between the i-th ship trajectory and the j-th target, respectively; d j r i and r represent the bounding box of the detected j-th ship target and the predicted bounding box of the existing i-th ship trajectory obtained through the Kalman filter, respectively. j This represents the appearance descriptor extracted from the j-th target detected in the current frame. This represents the k-th appearance descriptor of the i-th ship trajectory. Furthermore, when calculating the cosine distance, a minimum threshold of 0.25 is set to exclude matches with excessively low ship appearance similarity.
[0106] S5: Based on the confidence level of the detection results and the extracted features, match the ships detected in the current video frame with historical trajectories and output the tracking results.
[0107] S51: Based on the confidence level of each detected ship target, those with a confidence level higher than 0.6 are considered high-scoring detection results, and those with a confidence level lower than 0.6 but higher than 0.2 are considered low-scoring detection results.
[0108] S52: Perform matching between high-resolution detection results and tracking trajectories. During matching, both ship motion features predicted by the Kalman filter and ship appearance features extracted by ResNet50-ibn are considered. When determining the weights of the two features, a feature integration strategy based on the confidence level of the detection results is used as the comprehensive matching index.
[0109] s ij =(1-c j 2 )d (1) (i,j)+c j 2 d (2) (i,j)
[0110] Among them, c j d represents the confidence level of the detection result of the j-th target. (1) (i,j),d (2) (i,j) represent the IOU distance and cosine distance between the i-th ship trajectory and the j-th target, respectively. ij Let be the overall matching degree between the j-th target and the i-th ship trajectory.
[0111] The matching process adopts the Hungarian algorithm and cascaded matching strategy. After the initial matching is completed, the successfully matched trajectory will be directly used as the trajectory input for the next frame. The detection results of the unsuccessful matching will generate new trajectories and input them into the next frame. The unmatched trajectory will be input into S53 for secondary matching.
[0112] S53: Perform IOU matching between the unmatched trajectories in S52 and the low-scoring detection results. The IOU threshold is set to 0.7. The successfully matched trajectories are directly used as the trajectory input for the next frame. The detection results that fail to match need to be judged by confidence. The detection results with confidence below 0.4 will be directly discarded and deleted. The detection results with confidence above 0.4 will be the same as in S52, generating a new trajectory to be input into the next frame. The unmatched trajectories are input into S54 for further judgment.
[0113] S54: For the trajectory that failed to match in S53, first determine whether the trajectory is in the verification state (i.e., the trajectory has matched the detection result more than 3 times consecutively). For the trajectory in the non-verification state, delete it directly. If the trajectory is in the verification state, further consider whether it is in the restricted state (due to the problem of ships being occluded for a long time in the ship tracking scenario in the bridge area, the restricted state is defined as the trajectory and the detection result have not matched for 60 seconds consecutively). For the trajectory in the restricted state, delete it directly. The trajectory that is not in the restricted state continues to be used as the trajectory input for the next frame, and the detection result that matches it is expected.
[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for ship detection and tracking in a bridge area monitoring scenario, characterized in that, The method specifically includes the following steps: S1: Collect video stream data from bridge area monitoring scenarios, select images and video clips for annotation, and construct a ship detection and multi-target tracking dataset; S2: Construct a deformable multi-branch YOLOX network and input the collected dataset into the deformable multi-branch YOLOX network for training, thereby obtaining a ship detection model; A deformable multi-branch YOLOX network is constructed by replacing the CSP module in the original YOLOX network with the DC2S module, and adding a CBAM hybrid attention module before the input of the Neck part. CIoU is used to replace IoU as the localization loss of the YOLOX network, and Focal loss is used to replace BCE loss as the positive example judgment loss. Among them, the DC2S module is a deformable multi-branch gradient path module and an important component of the feature extraction backbone network, which is used to improve the detection performance of distant ship targets under the bridge area. The structure of the DC2S module is as follows: First, the CBS module processes the features once. Then, through a Split operation, half of the channel features are used as secondary gradient branches to directly participate in parallel concatenation. The other half of the channel features are input into the main gradient branch composed of n deformable residual components for further feature extraction. In the main gradient branch, DC2S concatenates the outputs of each deformable residual component in parallel based on the concatenation of the deformable residual components. The result after concatenating the main gradient stream and the secondary gradient stream is adjusted by the CBS module to achieve a high degree of fusion of multi-branch features. S3: Input the bridge area video images into the trained ship detection model for detection, and output the ship detection results; S4: Based on the ship inspection results, Kalman filtering and ResNet50-ibn network are used to extract the ship's motion and appearance features respectively; S5: Based on the confidence level of the detection results and the extracted features, match the ships detected in the current video frame with historical trajectories and output the tracking results; specifically including the following steps: S51: Based on the confidence level of each detected ship target, those with a confidence level higher than 0.6 are considered high-scoring detection results, and those with a confidence level lower than 0.6 but higher than 0.2 are considered low-scoring detection results; S52: Perform matching between high-resolution detection results and tracking trajectories. During matching, both ship motion features predicted by the Kalman filter and ship appearance features extracted by ResNet50-ibn are considered. When determining the weights of the two features, a feature integration strategy based on the confidence level of the detection results is used as the comprehensive matching index. in, Indicates the first The confidence level of the target detection results , The first The ship's trajectory is the same as the first IOU distance and cosine distance between targets For the first The first goal and the first The overall matching degree of the ship trajectories; The matching process adopts the Hungarian algorithm and cascaded matching strategy. After the initial matching is completed, the successfully matched trajectory will be directly used as the trajectory input for the next frame. The detection results of the unsuccessful matching will generate new trajectories and input them into the next frame. The unmatched trajectory will be input into S53 for secondary matching. S53: Perform IOU matching between the unmatched trajectories in S52 and the low-scoring detection results. The IOU threshold is set to 0.
7. The successfully matched trajectories are directly used as the trajectory input for the next frame. The detection results that fail to match need to be judged by confidence. The detection results with confidence below 0.4 will be directly discarded and deleted. The detection results with confidence above 0.4 will be the same as in S52, generating a new trajectory to be input into the next frame. The unmatched trajectories are input into S54 for further judgment. S54: For the trajectory that failed to match in S53, first determine whether the trajectory is in the verification state, that is, the trajectory has matched the detection result more than 3 times consecutively. For the trajectory in the non-verification state, delete it directly. If the trajectory is in the verification state, further consider whether it is in the restriction state. The restriction state is defined as the trajectory and the detection result have not matched for 60 seconds consecutively. For the trajectory in the restriction state, delete it directly. The trajectory in the non-restriction state continues to be used as the trajectory input for the next frame, and the detection result that matches it is expected.
2. The ship detection and tracking method according to claim 1, characterized in that, In step S2, the expression for the CIoU loss function is: in, This represents the Euclidean distance between the ground truth bounding box and the target bounding box. It is the diagonal length of the smallest bounding rectangle between the true bounding box and the target bounding box. For weighting functions; It is a positive trade-off parameter used to measure the consistency of the aspect ratio between the ground truth bounding box and the target bounding box; and These represent the width and height of the actual bounding box, respectively. and These represent the width and height of the target bounding box, respectively.
3. The ship detection and tracking method according to claim 1, characterized in that, In step S2, the expression for the Focal loss function is: in, This represents the Focal loss; γ is the modulation coefficient, used to reduce the weight of easily classified samples and increase the weight of difficult-to-classify samples. This represents the probability of correctly classifying the target. To predict the probability magnitude, The label is used to determine whether an example is positive.
4. The ship detection and tracking method according to claim 1, characterized in that, In step S4, the ship motion features are extracted using Kalman filtering, specifically including: employing... As state parameters of the Kalman filter system; during the initialization phase, the initial values of each rate of change are set to 0, and an 8×8 diagonal matrix is used as the covariance matrix of the system; The state prediction equation and state observation equation of a Kalman filter system are defined by the following equations: in, and These respectively represent the system in The state vector and observation vector at each moment; Here is the state transition matrix. , These represent the control input matrix and the control input vector, respectively. For the observation matrix, and These represent values with a mean of 0 and a covariance of . Q and R State noise and observation noise; Since the internal motion parameters of the ship are unknown in multi-target ship tracking scenarios, the parameters of the control input are not considered. In the prediction phase, the target ship is first estimated based on the state transition matrix. in, and They represent Prior estimates of time-series systems and Posterior estimation of the time-series system; At the same time, it is necessary to calculate the covariance of the prior estimation error: in, express The covariance of the prior estimation error of the time-series system. express The covariance of the posterior estimation error of the time-series system; Subsequently, in the update phase, the Kalman gain needs to be calculated first: in, The Kalman gain represents the system's preference weights for the predicted and observed values. Then calculate the optimal estimate: And update the covariance matrix in, E for n The right subscript of an identity matrix of order n is... n Dimension of the observation.
5. The ship detection and tracking method according to claim 1, characterized in that, In step S4, the ResNet50-ibn network model is used to extract the appearance features of the ship. Specifically, the ResNet50-ibn network is based on the ResNet50 network, and an instance normalization layer is added before the activation function of the output of the first three types of residual blocks to process the shallower features, thereby enhancing the robustness of the re-identification model to the occlusion conditions of ships in bridge area waters.
6. The ship detection and tracking method according to claim 1, characterized in that, In step S4, the IOU distance is used as a measure of the ship's motion characteristics: in, , Representing the detected number The ship target boundary box and the existing first The predicted bounding boxes of the ship trajectories obtained by applying a Kalman filter; Indicates the first The ship's trajectory is the same as the first IOU distance between targets; Cosine distance is used as a measure of a ship's external appearance. in, Represents the number detected in the current frame The appearance descriptor extracted from each target. Then it represents the first The first of the ship's tracks One appearance descriptor; Indicates the first The ship's trajectory is the same as the first The cosine distance between the targets.