An unmanned surface vehicle oriented target detection and tracking method and system
By employing YOLOv8 and ByteTrack models combined with Kalman filters and camera motion compensation techniques, the problems of high computational load and missed detection in unmanned surface vessel target detection and tracking are solved, achieving efficient and low-cost target detection and tracking.
Patent Information
- Application Number
- CN202411684387.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2044-11-22
AI Technical Summary
Among existing unmanned surface vessel target detection and tracking methods, the Mobilenetv3-YOLOv4 algorithm has a large amount of computation and parameters, resulting in high hardware burden and energy consumption costs. Meanwhile, the KCF correlation filter algorithm is prone to missing detections in complex water environments, leading to a decrease in tracking accuracy.
We employ the YOLOv8 target detection model, use the HGNetv2 backbone network structure and the ByteTrack target tracking model, introduce the BYTE association strategy, and combine Kalman filter and camera motion compensation technology to optimize the target detection and tracking process.
It reduces the hardware burden and energy consumption costs of unmanned surface vessels (USVs), while improving the accuracy of target detection and the robustness of tracking, and reducing the false detection rate.
Smart Images

Figure CN119723407B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of unmanned ship target detection and tracking, and particularly relates to a target detection and tracking method and system for unmanned ships. BACKGROUND
[0002] Unmanned ships have a wide range of applications in various fields, such as civilian fields and military fields. Unmanned ships rely heavily on information provided by visual perception systems during autonomous navigation. Target detection and tracking technology is a key part of visual perception systems. Currently, various target detection and tracking algorithms have been applied to unmanned ships and complex water surface scenarios. These algorithms have improved the autonomous navigation capabilities and task execution efficiency of unmanned ships to some extent.
[0003] A patent discloses an unmanned ship target detection and tracking method. The method uses a Mobilenetv3-YOLOv4 target detection algorithm to detect water surface targets and a KCF correlation filter target tracking algorithm to track water surface targets. However, although the Mobilenetv3-YOLOv4 algorithm has excellent detection performance, its computational complexity and parameter quantity are relatively large, which undoubtedly increases the hardware burden and energy consumption cost of resource-limited unmanned ship devices. In addition, the algorithm still needs to be improved in terms of lightweight to meet more extensive application requirements. On the other hand, although the KCF correlation filter algorithm has good tracking stability, it may miss some targets in complex and variable water surface environments, which reduces tracking accuracy and affects the autonomous navigation and task execution of unmanned ships. SUMMARY
[0004] To overcome the above-mentioned defects, the present application provides a target detection and tracking method and system for unmanned ships. The present application aims to solve the problems of the existing unmanned ship target detection and tracking method, which uses a Mobilenetv3-YOLOv4 target detection algorithm for water surface target detection, has relatively large computational complexity and parameter quantity, and uses a KCF correlation filter target tracking algorithm for water surface target tracking, which may miss some targets and reduce tracking accuracy.
[0005] To achieve the above-mentioned purpose, the present application adopts the following technical solutions:
[0006] A target detection and tracking method for unmanned ships includes the following steps:
[0007] Step S1: Collect video frames of the water surface environment.
[0008] Step S2: establishing a YOLOv8 target detection model and a ByteTrack target tracking model, wherein the YOLOv8 target detection model adopts an HGNetv2 backbone network structure, and the ByteTrack target tracking model contains a BYTE association strategy;
[0009] Step S3: inputting the video frames of the water surface environment into the YOLOv8 target detection model for water surface target detection, and outputting a water surface target detection frame set;
[0010] Step S4: inputting the water surface target detection frame set and the video frames of the water surface environment into the ByteTrack target tracking model for water surface target tracking, and outputting a water surface target tracking path set.
[0011] Preferably, in step S2, during the establishment of the YOLOv8 target detection model, the following sub-steps are specifically included: constructing an HGNetv2 backbone network, wherein the HGNetv2 backbone network includes a Stage1 layer, a Stage2 layer, a Stage3 layer and a Stage4 layer; constructing a neck network; introducing a multi-path coordinate attention mechanism between the Stage4 layer of the HGNetv2 backbone network and the neck network.
[0012] Preferably, in step S4, during the inputting of the water surface target detection frame set and the video frames of the water surface environment into the ByteTrack target tracking model for water surface target tracking, the following sub-steps are specifically included:
[0013] using a Kalman filter to predict the water surface target position to obtain a water surface target predicted position;
[0014] correcting the water surface target predicted position through camera motion compensation to obtain a corrected water surface target position, wherein the correction of the water surface target predicted position through camera motion compensation specifically includes the following sub-steps:
[0015] extracting a predicted bounding box in the video frames of the water surface environment using a global motion estimation technology in OpenCV;
[0016] calculating an affine transformation matrix using a RANSAC algorithm The specific expression of the affine transformation matrix is as follows:
[0017]
[0018] wherein k is a positive integer; R is a two-dimensional plane rotation matrix; and V is a translation transformation vector;
[0019] transforming the predicted bounding box coordinates in the video frames of the water surface environment in the k-1 frame to the predicted bounding box coordinates in the video frames of the water surface environment in the k frame using the affine transformation matrix.
[0020] Preferably, in step S2, the following steps are further included: performing Pytorch training on the YOLOv8 target detection model to obtain a Pytorch model; converting the Pytorch model into an ONNX model through a torch.onnx.export interface; performing a simplification operation on the ONNX model to obtain a Simplify ONNX model; and converting the Simplify ONNX model into a TensorRT inferable engine model using a trtexec tool.
[0021] Another aspect of the present application provides an unmanned surface vehicle-oriented target detection and tracking system, which comprises:
[0022] A collection module configured to collect video frames of a water surface environment;
[0023] A first establishing module configured to establish a YOLOv8 target detection model, wherein the YOLOv8 target detection model adopts an HGNetv2 backbone network structure;
[0024] A second establishing module configured to establish a ByteTrack target tracking model, wherein the ByteTrack target tracking model contains a BYTE association strategy;
[0025] A target detection module configured to input the video frames of the water surface environment into the YOLOv8 target detection model to perform water surface target detection, and output a water surface target bounding box set;
[0026] A target tracking module configured to input the water surface target bounding box set and the video frames of the water surface environment into the ByteTrack target tracking model to perform water surface target tracking, and output a water surface target tracking path set.
[0027] Preferably, the first establishing module comprises: a first construction submodule configured to construct an HGNetv2 backbone network, wherein the HGNetv2 backbone network comprises a Stage1 layer, a Stage2 layer, a Stage3 layer, and a Stage4 layer; a second construction submodule configured to construct a neck network; and an introduction submodule configured to introduce a multi-path coordinate attention mechanism between the Stage4 layer of the HGNetv2 backbone network and the neck network.
[0028] Preferably, the target tracking module comprises:
[0029] A prediction submodule configured to predict a water surface target position using a Kalman filter to obtain a water surface target predicted position;
[0030] A correction submodule configured to correct the water surface target predicted position through camera motion compensation to obtain a corrected water surface target position;
[0031] The correction submodule comprises:
[0032] The extraction subunit is configured to extract a prediction bounding box in a video frame of a water surface environment using a global motion estimation technique in OpenCV.
[0033] The calculation subunit is configured to calculate an affine transformation matrix using a RANSAC algorithm The specific expression is as follows:
[0034]
[0035] wherein k is a positive integer; R is a two-dimensional plane rotation matrix; and V is a translation transformation vector.
[0036] The transformation subunit is configured to transform the prediction bounding box coordinates in the video frame of the water surface environment in the k-1th frame to the prediction bounding box coordinates in the video frame of the water surface environment in the kth frame using the affine transformation matrix.
[0037] Preferably, the method further comprises: a model training module configured to perform Pytorch training on the YOLOv8 target detection model to obtain a Pytorch model; a first model conversion module configured to convert the Pytorch model into an ONNX model through a torch.onnx.export interface; a model simplification module configured to perform a simplification operation on the ONNX model to obtain a Simplify ONNX model; and a second model conversion module configured to convert the Simplify ONNX model into a TensorRT inferable engine model using a trtexec tool.
[0038] The technical scheme provided by the embodiments of the present application can include the following beneficial effects:
[0039] In the present scheme, the YOLOv8 target detection model is used to detect the water surface target. Compared with the existing Mobilenetv3-YOLOv4 target detection algorithm, the YOLOv8 target detection model uses the HGNetv2 backbone network structure, which reduces the parameter quantity and calculation quantity of the backbone network as much as possible without losing the feature extraction capability, thereby reducing the hardware burden and energy consumption cost of the unmanned ship device. The ByteTrack target tracking model is used to track the water surface target. Compared with the existing KCF correlation filtering algorithm, the ByteTrack target tracking model introduces the BYTE association strategy, which can consider each low-score detection box, thereby reducing the missed detection situation and improving the tracking accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0040] Figure 1A step flow chart of a target detection and tracking method for unmanned surface vehicles. DETAILED DESCRIPTION
[0041] Embodiments of the present application are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and are only used to explain the present application, and cannot be understood as a limitation of the present application.
[0042] A target detection and tracking method for unmanned surface vehicles, comprising the following steps:
[0043] Step S1: Collecting video frames of the water surface environment;
[0044] Step S2: Establishing a YOLOv8 target detection model and a ByteTrack target tracking model, wherein the YOLOv8 target detection model adopts an HGNetv2 backbone network structure, and the ByteTrack target tracking model contains a BYTE association strategy;
[0045] Step S3: Inputting the video frames of the water surface environment into the YOLOv8 target detection model for water surface target detection, and outputting a water surface target detection frame set;
[0046] Step S4: Inputting the water surface target detection frame set and the video frames of the water surface environment into the ByteTrack target tracking model for water surface target tracking, and outputting a water surface target tracking path set.
[0047] A target detection and tracking method for unmanned surface vehicles according to the present application, as shown in Figure 1As shown, the first step is to collect video frames of the water surface environment. In this embodiment, by mounting a camera on the unmanned ship, real-time capture of video frames of the water surface environment can be achieved. These video frames contain rich information about the environment around the unmanned ship and are the basis for subsequent target detection and tracking. The second step is to establish a YOLOv8 target detection model and a ByteTrack target tracking model. The YOLOv8 target detection model uses an HGNetv2 backbone network structure, and the ByteTrack target tracking model includes a BYTE association strategy. In this embodiment, the establishment of the YOLOv8 target detection model facilitates subsequent detection of water surface targets. The establishment of the ByteTrack target tracking model facilitates subsequent tracking of water surface targets. Further, the YOLOv8 model is an efficient target detection model. The YOLOv8 model uses an HGNetv2 backbone network structure in the backbone network part. The HGNetv2 backbone network is composed of a StemBlock module and an HG-Stage module. The StemBlock module is mainly responsible for preprocessing the input image, extracting low-level features, and gradually reducing the resolution and channel number, which helps to reduce the computational burden in the early stages of the network and provides better input for subsequent network layers. The HG-Stage module includes multiple depthwise separable convolutions DWConv and HGBlock modules. DWConv is composed of a depth convolution and a pointwise convolution. The depth convolution applies a convolution kernel to each input channel, and each channel uses an independent convolution kernel. The pointwise convolution uses a 1x1 convolution kernel to linearly combine each channel in the depth direction. DWConv is more efficient in terms of computational efficiency than ordinary convolution, especially on mobile devices and embedded devices. The HGBlock module includes multiple LightConv modules and uses 3x3 lightConv modules as much as possible based on the computing characteristics of GPUs. The lightConv model also applies the idea of depthwise separable convolution, which reduces the network parameter quantity and computational complexity while still maintaining effective learning of input features. The ByteTrack model is a multi-target tracking model based on the detection tracking paradigm. In conventional multi-target tracking algorithms of this paradigm, low-confidence detection boxes are directly discarded. However, the ByteTrack algorithm in this scheme introduces a BYTE association strategy to handle the association problem between targets in video frames. The BYTE association strategy considers each low-confidence detection box and can be used for matching as long as it is similar to the existing track. This simple and efficient method improves the accuracy of target tracking and reduces the problem of ID switching and track fragmentation.The third step is to input the video frames of the water surface environment into the YOLOv8 target detection model for water surface target detection, and output a set of water surface target detection boxes. In this embodiment, the video frames of the water surface environment are input into the YOLOv8 model, the YOLOv8 model processes each video frame of the water surface environment, and outputs a series of water surface target detection boxes. These water surface target detection boxes mark the position and size of the detected targets in the video frames of the water surface environment. The fourth step is to input the set of water surface target detection boxes and the video frames of the water surface environment into the ByteTrack target tracking model for water surface target tracking, and output a set of water surface target tracking paths. In this embodiment, the set of water surface target detection boxes and the current video frame are input into the ByteTrack model. The ByteTrack model tracks the targets in consecutive video frames according to the information of the detection boxes and the content of the video frames, and outputs the tracking path of each water surface target.
[0048] In this scheme, the YOLOv8 target detection model is used to detect water surface targets. Compared with the existing Mobilenetv3-YOLOv4 target detection algorithm, the YOLOv8 target detection model uses the HGNetv2 backbone network structure to reduce the parameter quantity and computational quantity of the backbone network as much as possible without losing the feature extraction capability, thereby reducing the hardware burden and energy consumption cost of the unmanned ship device. The ByteTrack target tracking model is used to track the water surface targets. Compared with the existing KCF correlation filtering algorithm, the ByteTrack target tracking model introduces the BYTE association strategy, which can consider each low-score detection box to reduce the missed detection situation and improve the tracking accuracy.
[0049] Preferably, in step S2, during the establishment of the YOLOv8 target detection model, the following sub-steps are included: constructing an HGNetv2 backbone network, wherein the HGNetv2 backbone network includes a Stage1 layer, a Stage2 layer, a Stage3 layer, and a Stage4 layer; constructing a neck network; introducing a multi-path coordinate attention mechanism between the Stage4 layer of the HGNetv2 backbone network and the neck network.
[0050] In this embodiment, by introducing the multi-path coordinate attention mechanism between the Stage4 layer of the HGNetv2 backbone network and the neck network, the detection performance of the YOLOv8 target detection model is improved. Further, the coordinate attention mechanism performs one-dimensional horizontal and vertical average pooling on the input features, and then performs a series of fusion, convolution and activation function operations, and finally performs residual connection with the input for output. Through the above operations, the coordinate attention mechanism can not only capture the channel information of the target but also capture the coordinate position information of the target. Based on the multi-path coordinate attention mechanism, in order to enable the coordinate attention mechanism to fuse information at different levels, multiple paths are added to the coordinate attention mechanism to enhance the performance of the coordinate attention mechanism on various targets. Compared with the coordinate attention mechanism, the multi-path coordinate attention mechanism proposed in this scheme adds the following paths. First, a global average pooling layer path is introduced. The output of the global average pooling layer path is averaged with the output of the original path and then weighted and fused, which can balance global information and local information and improve the comprehensive understanding of the model to the image content. Second, a high-low level information fusion path is added, which allows the model to fuse feature information from different levels. Finally, the outputs of the global average pooling layer path, the original path and the high-low level information fusion path are jointly used to form a more rich feature representation.
[0051] Preferably, in step S4, in the process of inputting the water surface target bounding box set and the video frame of the water surface environment into the ByteTrack target tracking model for water surface target tracking, the following sub-steps are included:
[0052] The Kalman filter is used to predict the position of the water surface target to obtain a water surface target predicted position;
[0053] The water surface target predicted position is corrected through camera motion compensation to obtain a corrected water surface target position. The correction of the water surface target predicted position through camera motion compensation includes the following sub-steps:
[0054] The global motion estimation technology in OpenCV is used to extract the predicted bounding box in the video frame of the water surface environment;
[0055] The RANSAC algorithm is used to calculate the affine transformation matrix The specific expression of the affine transformation matrix is as follows:
[0056]
[0057] where k is a positive integer; R is a two-dimensional plane rotation matrix; and V is a translation transformation vector.
[0058] The predicted bounding box coordinates in the (k-1)th frame of the water environment video frame are transformed to the predicted bounding box coordinates in the kth frame of the water environment video frame using an affine transformation matrix.
[0059] In this embodiment, the ByteTrack target tracking model performs trajectory matching during the target matching stage by measuring the correlation between the predicted target position and the detection box position obtained by the Kalman filter. Therefore, the stability of the Kalman filter determines the tracking performance of the ByteTrack target tracking model. In complex water surface scenarios, unmanned surface vessels inevitably experience fluctuations, leading to dynamic motion of the onboard camera. This dynamic motion can cause unpredictable deviations in the Kalman filter's predictions. Therefore, this solution uses camera motion compensation to correct the Kalman filter's prediction results, thereby improving the robustness of the ByteTrack target tracking model.
[0060] To further explain, the state variables of a Kalman filter can be described as follows:
[0061]
[0062] Where u represents the horizontal pixel coordinate of the target center; v represents the vertical pixel coordinate of the target center; a represents the aspect ratio of the target; and h represents the height of the target. and Let u, v, a, and h represent the rates of change of u, v, a, and h over time, respectively. Then, affine transformations need to be applied to the center point, aspect ratio, and height of the target. The specific steps are as follows: The first step is to construct a new two-dimensional planar rotation matrix. and the new translation transformation vector and The specific calculation formula is as follows:
[0063]
[0064] The second step is to obtain the covariance P of the Kalman filter at time k-1. k|k-1 and according to and P k|k-1 Calculate the covariance matrix P' of the Kalman filter. k|h-1 The specific calculation formula is as follows: The third step is based on and P' k|k-1 Calculate the state variables of the modified Kalman filter. The specific calculation formula is as follows:
[0065] Preferably, step S2 further includes the following step:
[0066] training the YOLOv8 target detection model in Pytorch to obtain a Pytorch model;
[0067] converting the Pytorch model into an ONNX model through a torch.onnx.export interface;
[0068] simplifying the ONNX model to obtain a Simplify ONNX model;
[0069] converting the Simplify ONNX model into a TensorRT inferable engine model using a trtexec tool.
[0070] In this embodiment, Pytorch is an open-source deep learning framework widely used in the field of machine learning and deep learning, the torch.onnx.export interface is an interface in PyTorch for converting a PyTorch model into an ONNX (Open Neural Network Exchange) format. The ONNX model is an open format for representing deep learning models. The trtexec tool is a tool provided by NVIDIA. The TensorRT inferable engine model is a high-efficiency model format created by the NVIDIA TensorRT library, which can convert deep learning models into a format that can be efficiently executed on NVIDIA GPUs.
[0071] Specifically, training the YOLOv8 target detection model in Pytorch helps to improve the detection accuracy of the YOLOv8 target detection model. Converting the Pytorch model into an ONNX model facilitates better deployment of the model on unmanned boat equipment in the future. Simplifying the ONNX model involves merging repeated nodes or constant nodes in the ONNX model into one node and deleting unnecessary nodes to reduce the number of nodes and the amount of calculation of the ONNX model. It also merges repeated layers in the ONNX model into one layer to reduce the amount of calculation and memory occupation of the ONNX model. By converting the Simplify ONNX model into a TensorRT inferable engine model, the structure of the Simplify ONNX model is further optimized, and its inference speed is improved.
[0072] Another aspect of the present application provides an unmanned boat-oriented target detection and tracking system, which comprises:
[0073] a collection module for collecting video frames of the water surface environment;
[0074] The first establishing module is configured to establish a YOLOv8 target detection model, wherein the YOLOv8 target detection model adopts an HGNetv2 backbone network structure.
[0075] The second establishing module is configured to establish a ByteTrack target tracking model, wherein the ByteTrack target tracking model comprises a BYTE association strategy.
[0076] The target detection module is configured to input a video frame of a water surface environment into the YOLOv8 target detection model to perform water surface target detection, and output a water surface target detection frame set.
[0077] The target tracking module is configured to input the water surface target detection frame set and the video frame of the water surface environment into the ByteTrack target tracking model to perform water surface target tracking, and output a water surface target tracking path set.
[0078] The target detection and tracking system for the unmanned ship is realized through the cooperation of the acquisition module, the first establishing module, the second establishing module, the target detection module and the target tracking module. In the present scheme, the YOLOv8 target detection model is used to detect the water surface target. Compared with the existing Mobilenetv3-YOLOv4 target detection algorithm, the YOLOv8 target detection model uses the HGNetv2 backbone network structure to reduce the parameter quantity and the calculation quantity of the backbone network as much as possible without losing the feature extraction capability, thereby reducing the hardware burden and the energy consumption cost of the unmanned ship device. The ByteTrack target tracking model is used to track the water surface target. Compared with the existing KCF correlation filtering algorithm, the ByteTrack target tracking model introduces the BYTE association strategy, which can consider each low-score detection frame, thereby reducing the missed detection condition and improving the tracking accuracy.
[0079] Preferably, the first establishing module comprises a first construction submodule configured to construct an HGNetv2 backbone network, wherein the HGNetv2 backbone network comprises a Stage1 layer, a Stage2 layer, a Stage3 layer and a Stage4 layer; a second construction submodule configured to construct a neck network; and an introduction submodule configured to introduce a multi-path coordinate attention mechanism between the Stage4 layer of the HGNetv2 backbone network and the neck network. In the present embodiment, the first construction submodule, the second construction submodule and the introduction submodule are configured to improve the detection performance of the YOLOv8 target detection model.
[0080] Preferably, the target tracking module comprises:
[0081] The prediction submodule is configured to predict the position of the water surface target by using a Kalman filter to obtain a predicted position of the water surface target.
[0082] The correction submodule is configured to correct the predicted position of the water surface target by camera motion compensation to obtain a corrected position of the water surface target.
[0083] The correction submodule includes:
[0084] The extraction subunit is configured to extract the predicted bounding box in the video frame of the water surface environment by using a global motion estimation technique in OpenCV.
[0085] The calculation subunit is configured to calculate the affine transformation matrix by using a RANSAC algorithm The specific expression is as follows:
[0086]
[0087] wherein k is a positive integer; R is a two-dimensional plane rotation matrix; and V is a translation transformation vector.
[0088] The transformation subunit is configured to transform the predicted bounding box coordinates in the video frame of the water surface environment in the k-1th frame to the predicted bounding box coordinates in the video frame of the water surface environment in the kth frame by using the affine transformation matrix.
[0089] In this embodiment, by setting the prediction submodule and the correction submodule, the robustness of the ByteTrack target tracking model can be improved.
[0090] Preferably, the method further comprises: a model training module configured to train the YOLOv8 target detection model by using Pytorch to obtain a Pytorch model; a first model conversion module configured to convert the Pytorch model into an ONNX model by using a torch.onnx.export interface; a model simplification module configured to perform a simplification operation on the ONNX model to obtain a Simplify ONNX model; and a second model conversion module configured to convert the Simplify ONNX model into a TensorRT inferable engine model by using a trtexec tool.
[0091] In this embodiment, by setting the model training module, the detection accuracy of the YOLOv8 target detection model can be improved. By setting the first model conversion module, the model can be better deployed on the unmanned ship device in the subsequent process. By setting the model simplification module, the number of nodes, the amount of calculation, and the memory occupation of the ONNX model can be reduced. By setting the second model conversion module, the structure of the Simplify ONNX model is further optimized, and the inference speed is improved.
[0092] In addition, each function unit in each embodiment of the present application can be integrated in one processing module, or each unit can exist physically separately, or two or more units can be integrated in one module. The integrated module can be realized in the form of hardware, or in the form of software function module. When the integrated module is realized in the form of software function module and sold or used as an independent product, it can also be stored in a computer readable storage medium.
[0093] Although the embodiments of the present application have been shown and described above, it should be understood by those ordinary skilled in the art that the above embodiments are exemplary and cannot be understood as limiting the present application, and those ordinary skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.
Claims
1. A target detection and tracking method for unmanned surface vessels, characterized in that: Includes the following steps: Step S1: Acquire video frames of the water surface environment; Step S2: Establish the YOLOv8 object detection model and the ByteTrack object tracking model. The YOLOv8 object detection model adopts the HGNetv2 backbone network structure, and the ByteTrack object tracking model includes the BYTE association strategy. Step S3: Input the video frames of the water surface environment into the YOLOv8 target detection model to detect water surface targets and output a set of water surface target detection boxes; Step S4: Input the set of water surface target detection boxes and the video frames of the water surface environment into the ByteTrack target tracking model to track water surface targets, and output the set of water surface target tracking paths; In step S2, the process of establishing the YOLOv8 object detection model specifically includes the following sub-steps: Construct the HGNetv2 backbone network, which includes Stage 1, Stage 2, Stage 3 and Stage 4; construct the neck network; introduce a multipath coordinate attention mechanism between Stage 4 of the HGNetv2 backbone network and the neck network. In step S4, the process of inputting the set of water surface target detection boxes and video frames of the water surface environment into the ByteTrack target tracking model for water surface target tracking specifically includes the following sub-steps: A Kalman filter is used to predict the position of the water surface target, and the predicted position of the water surface target is obtained. The predicted position of the water surface target is corrected by camera motion compensation to obtain the corrected position of the water surface target. The correction of the predicted position of the water surface target by camera motion compensation includes the following sub-steps: The predicted bounding boxes in the video frames of the water surface environment are extracted using global motion estimation techniques in OpenCV. The affine transformation matrix was calculated using the RANSAC algorithm. The specific expression is as follows: Where k is a positive integer; R is a two-dimensional plane rotation matrix; and V is a translation transformation vector. The predicted bounding box coordinates in the (k-1)th frame of the water environment video frame are transformed to the predicted bounding box coordinates in the kth frame of the water environment video frame using an affine transformation matrix.
2. The target detection and tracking method for unmanned surface vessels according to claim 1, characterized in that: Step S2 also includes the following steps: Train the YOLOv8 object detection model using PyTorch to obtain the PyTorch model; Convert a PyTorch model to an ONNX model using the torch.onnx.export interface; The ONNX model is simplified to obtain the Simplify ONNX model; Use the trtexec tool to convert a Simplify ONNX model into a TensorRT-inferenceable engine model.
3. A target detection and tracking system for unmanned surface vessels, using the target detection and tracking method for unmanned surface vessels as described in any one of claims 1-2, characterized in that: The system includes: The acquisition module is used to acquire video frames of the water surface environment; The first module is used to build a YOLOv8 object detection model, which adopts the HGNetv2 backbone network structure. The second module is used to build the ByteTrack target tracking model, which includes the BYTE association strategy. The target detection module is used to input video frames of the water surface environment into the YOLOv8 target detection model to detect water surface targets and output a set of water surface target detection boxes. The target tracking module is used to input the set of water surface target detection boxes and video frames of the water surface environment into the ByteTrack target tracking model to track water surface targets and output a set of water surface target tracking paths.
4. The target detection and tracking system for unmanned surface vessels according to claim 3, characterized in that: The first establishment module includes: The first construction submodule is used to build the HGNetv2 backbone network, which includes Stage 1, Stage 2, Stage 3 and Stage 4. The second construction submodule is used to build the neck network; A submodule is introduced to introduce a multipath coordinate attention mechanism between the Stage4 layer of the HGNetv2 backbone network and the neck network.
5. A target detection and tracking system for unmanned surface vessels according to claim 3, characterized in that: The target tracking module includes: The prediction submodule is used to predict the position of the water surface target using a Kalman filter, and obtain the predicted position of the water surface target. The correction submodule is used to correct the predicted position of the water surface target through camera motion compensation, so as to obtain the corrected position of the water surface target. The correction submodule includes: Extract sub-units to extract predicted bounding boxes from video frames of the water surface environment using global motion estimation techniques in OpenCV; The computational subunit is used to compute the affine transformation matrix using the RANSAC algorithm. The specific expression is as follows: Where k is a positive integer; R is a two-dimensional plane rotation matrix; and V is a translation transformation vector. The transformation subunit is used to transform the predicted bounding box coordinates in the (k-1)th frame of the water environment video frame to the predicted bounding box coordinates in the kth frame of the water environment video frame using an affine transformation matrix.
6. A target detection and tracking system for unmanned surface vessels according to claim 3, characterized in that: Also includes: The model training module is used to train the YOLOv8 object detection model using PyTorch to obtain the PyTorch model. The first model conversion module is used to convert PyTorch models into ONNX models through the torch.onnx.export interface; The model simplification module is used to simplify the ONNX model to obtain the Simplify ONNX model; The second model conversion module is used to convert Simplify ONNX models into TensorRT-inferenceable engine models using the trtexec tool.
Citation Information
Patent Citations
Steel product surface defect detection method based on FPDNet
CN118840345A
Multi-target tracking method for sea surface scene
CN118941595A