Target detection and tracking method and system for unmanned ship
By adopting the YOLOv8 target detection model and ByteTrack target tracking model on unmanned boats, the problems of large amount of calculations and large missed detection in the existing technology are solved, and more efficient target detection and tracking are achieved, reducing the hardware burden and improving accuracy.
Patent Information
- Application Number
- CN202411684387.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-11-22
AI Technical Summary
Among the existing unmanned boat target detection and tracking methods, the Mobilenetv3-YOLOv4 target detection algorithm has a large amount of calculation and parameters, which increases the hardware burden and energy consumption cost; while the KCF-related filtered target tracking algorithm may miss detection in complex water surface environments, resulting in a decrease in tracking accuracy.
Using the YOLOv8 object detection model and ByteTrack object tracking model, the YOLOv8 model reduces the amount of parameters and calculations through the HGNetv2 backbone network structure, and the ByteTrack model reduces missed detection by introducing BYTE correlation strategy.
Reduce the hardware burden and energy consumption cost of unmanned boat equipment, improve the accuracy of target tracking, and reduce missed inspections.
Smart Images

Figure CN119723407A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned boat target detection and tracking, and in particular to an unmanned boat target detection and tracking method and system. Background Art
[0002] Unmanned boats are widely used in various fields, such as civil and military fields. Unmanned boats rely heavily on the information provided by the visual perception system during autonomous navigation, and target detection and tracking technology is the key to the visual perception system. At present, a variety of target detection and tracking algorithms have been applied to unmanned boats and complex surface scenes. These algorithms have improved the autonomous navigation capability and mission execution efficiency of unmanned boats to a certain extent.
[0003] A patent discloses a method for detecting and tracking unmanned boat targets, which uses the Mobilenetv3-YOLOv4 target detection algorithm to detect surface targets, and uses the KCF correlation filter target tracking algorithm to track 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 for unmanned boat equipment with limited resources. In addition, the algorithm's performance in lightweighting still needs to be improved to meet a wider range of application needs. On the other hand, although the KCF correlation filter algorithm has good tracking stability, it may miss detections in complex and changeable water environments, resulting in reduced tracking accuracy, which in turn affects the autonomous navigation and mission execution of the unmanned boat. Summary of the invention
[0004] In view of the above-mentioned defects, the present invention proposes a target detection and tracking method and system for unmanned boats, aiming to solve the problems in the existing unmanned boat target detection and tracking method, that is, the Mobilenetv3-YOLOv4 target detection algorithm is used for surface target detection, which has a relatively large amount of calculation and parameters, and the KCF correlation filter target tracking algorithm is used for surface target tracking, which may result in missed detection and reduced tracking accuracy.
[0005] To achieve this object, the present invention adopts the following technical solutions:
[0006] A target detection and tracking method for an unmanned boat comprises the following steps:
[0007] Step S1: Collecting video frames of the water surface environment;
[0008] Step S2: Establish a YOLOv8 target detection model and a ByteTrack target tracking model, wherein the YOLOv8 target detection model adopts the HGNetv2 backbone network structure, and the ByteTrack target tracking model includes a BYTE association strategy;
[0009] Step S3: input the video frame of the water surface environment into the YOLOv8 target detection model to perform water surface target detection, and output a set of water surface target detection frames;
[0010] Step S4: 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 the water surface target tracking path set.
[0011] Preferably, in step S2, in the process of establishing 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; and 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, when the water surface target detection frame set and the video frame of the water surface environment are input into the ByteTrack target tracking model to perform water surface target tracking, the following sub-steps are specifically included:
[0013] The Kalman filter is used to predict the position of the surface target to obtain the predicted position of the surface target;
[0014] The predicted position of the surface target is corrected by camera motion compensation to obtain a corrected surface target position, wherein the predicted position of the surface target is corrected by camera motion compensation, specifically including the following sub-steps:
[0015] Use the global motion estimation technique in OpenCV to extract the predicted bounding box in the video frame of the water surface environment;
[0016] Use the RANSAC algorithm to calculate the affine transformation matrix The specific expression is as follows:
[0017]
[0018] Wherein, k is a positive integer; R is a two-dimensional plane rotation matrix; V is a translation transformation vector;
[0019] The affine transformation matrix is used to transform the predicted bounding box coordinates in the video frame of the k-1th frame of the water surface environment to the predicted bounding box coordinates in the video frame of the kth frame of the water surface environment.
[0020] Preferably, in step S2, the following steps are also included: performing Pytorch training on the YOLOv8 target detection model to obtain a Pytorch model; converting the Pytorch model into an ONNX model through the torch.onnx.export interface; simplifying the ONNX model to obtain a Simplify ONNX model; and using the trtexec tool to convert the Simplify ONNX model into a TensorRT inferable engine model.
[0021] Another aspect of the present application provides a target detection and tracking system for an unmanned boat, the system comprising:
[0022] A collection module, used for collecting video frames of the water surface environment;
[0023] The first building module is used to build a YOLOv8 target detection model, wherein the YOLOv8 target detection model adopts the HGNetv2 backbone network structure;
[0024] The second establishment module is used to establish a ByteTrack target tracking model, wherein the ByteTrack target tracking model includes a BYTE association strategy;
[0025] The target detection module is used to input the video frame of the water surface environment into the YOLOv8 target detection model to detect the water surface target and output a set of water surface target detection frames;
[0026] The target tracking module is used 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 track the water surface target and output the water surface target tracking path set.
[0027] Preferably, the first establishment module includes: a first construction submodule, used to construct the HGNetv2 backbone network, wherein the HGNetv2 backbone network includes Stage1 layer, Stage2 layer, Stage3 layer and Stage4 layer; a second construction submodule, used to construct the neck network; an introduction submodule, used 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 includes:
[0029] A prediction submodule is used to predict the position of a surface target using a Kalman filter to obtain a predicted position of the surface target;
[0030] A correction submodule is used to correct the predicted position of the surface target by camera motion compensation to obtain a corrected surface target position;
[0031] The revised submodules include:
[0032] An extraction subunit, for extracting a predicted bounding box in a video frame of a water surface environment using a global motion estimation technique in OpenCV;
[0033] The calculation subunit is used to calculate the affine transformation matrix using the RANSAC algorithm The specific expression is as follows:
[0034]
[0035] Wherein, k is a positive integer; R is a two-dimensional plane rotation matrix; V is a translation transformation vector;
[0036] The transformation subunit is used to transform the predicted bounding box coordinates in the video frame of the k-1th frame of the water surface environment to the predicted bounding box coordinates in the video frame of the kth frame of the water surface environment using an affine transformation matrix.
[0037] Preferably, it also includes: a model training module, which is used to perform Pytorch training on the YOLOv8 target detection model to obtain a Pytorch model; a first model conversion module, which is used to convert the Pytorch model into an ONNX model through the torch.onnx.export interface; a model simplification module, which is used to simplify the ONNX model to obtain a Simplify ONNX model; a second model conversion module, which is used to use the trtexec tool to convert the Simplify ONNX model into a TensorRT inferable engine model.
[0038] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0039] In this scheme, the YOLOv8 target detection model is used to detect surface targets. Compared with the existing Mobilenetv3-YOLOv4 target detection algorithm, the YOLOv8 target detection model adopts the HGNetv2 backbone network structure to reduce the number of parameters and calculations of the backbone network as much as possible without losing the ability to extract features, thereby reducing the hardware burden and energy consumption cost of the unmanned boat equipment. The ByteTrack target tracking model is used to track surface targets. Compared with the existing KCF correlation filtering algorithm, the ByteTrack target tracking model introduces the BYTE association strategy, which enables it to take into account each low-score detection frame, thereby reducing missed detections and improving tracking accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1The invention is a flowchart of the steps of a target detection and tracking method for an unmanned boat. DETAILED DESCRIPTION
[0041] The embodiments of the present invention are described in detail below, and examples of the embodiments 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 from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0042] A target detection and tracking method for an unmanned boat comprises the following steps:
[0043] Step S1: Collecting video frames of the water surface environment;
[0044] Step S2: Establish a YOLOv8 target detection model and a ByteTrack target tracking model, wherein the YOLOv8 target detection model adopts the HGNetv2 backbone network structure, and the ByteTrack target tracking model includes a BYTE association strategy;
[0045] Step S3: input the video frame of the water surface environment into the YOLOv8 target detection model to perform water surface target detection, and output a set of water surface target detection frames;
[0046] Step S4: 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 the water surface target tracking path set.
[0047] This scheme is a target detection and tracking method for unmanned boats, such as Figure 1As shown, the first step is to collect video frames of the water surface environment. In this embodiment, by carrying a camera on the unmanned boat, it is possible to capture video frames of the water surface environment in real time. These video frames contain rich information about the environment around the unmanned boat, which is 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 adopts the HGNetv2 backbone network structure, and the ByteTrack target tracking model includes a BYTE association strategy. In this embodiment, by establishing a YOLOv8 target detection model, it is beneficial to detect surface targets in the future. By establishing a ByteTrack target tracking model, it is beneficial to track surface targets in the future. Further explanation: YOLOv8 model is an efficient target detection model. YOLOv8 model adopts HGNetv2 backbone network structure in the backbone network part. HGNetv2 backbone network consists of StemBlock module and HG-Stage module. StemBlock module is mainly responsible for preprocessing input image, extracting underlying features, and gradually reducing resolution and number of channels, which helps to reduce computational burden in the early stage of network and provide better input for subsequent network layers. HG-Stage module contains multiple depth separable convolution DWConv and HGBlock modules. DWConv consists of depth convolution and point-by-point convolution. Depth convolution applies a convolution kernel on each input channel, and each channel uses an independent convolution kernel. Point-by-point convolution uses 1×1 convolution kernel and linearly combines each channel in the depth direction. DWConv is more efficient in computational efficiency than ordinary convolution, especially in mobile devices and embedded devices. The HGBlock module contains multiple LightConv modules, and uses 3×3 lightConv modules as much as possible based on the computing characteristics of the GPU. The lightConv model also applies the idea of deep separable convolution, which reduces the number of network parameters and computational complexity while still maintaining effective learning of input features. The ByteTrack model is a multi-target tracking model that uses a detection-based tracking paradigm. In conventional multi-target tracking algorithms of this paradigm, low-confidence detection frames are directly discarded, but in this solution, the ByteTrack algorithm introduces a BYTE association strategy, which is used to deal with the association problem of targets between video frames. Each low-score detection frame will be considered, and as long as they are similar enough to the existing trajectory, they can be used for matching. This simple and efficient method improves the accuracy of target tracking and reduces the problems of ID switching and trajectory fragmentation.The third step is to input the video frame 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 frames. In this embodiment, the video frame of the water surface environment is input into the YOLOv8 model, and the YOLOv8 model processes each video frame of the water surface environment and outputs a series of water surface target detection frames, which mark the position and size of the target detected in the video frame of the water surface environment. The fourth step is to input the water surface target detection frame set and the video frame 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 water surface target detection frame set and the current video frame are input into the ByteTrack model. The ByteTrack model tracks the target in continuous video frames based on the information of the detection frame and the content of the video frame, and outputs the tracking path of each water surface target.
[0048] In this scheme, the YOLOv8 target detection model is used to detect surface targets. Compared with the existing Mobilenetv3-YOLOv4 target detection algorithm, the YOLOv8 target detection model adopts the HGNetv2 backbone network structure to reduce the number of parameters and calculations of the backbone network as much as possible without losing the ability to extract features, thereby reducing the hardware burden and energy consumption cost of the unmanned boat equipment. The ByteTrack target tracking model is used to track surface targets. Compared with the existing KCF correlation filtering algorithm, the ByteTrack target tracking model introduces the BYTE association strategy, which enables it to take into account each low-score detection frame, thereby reducing missed detections and improving tracking accuracy.
[0049] Preferably, in step S2, in the process of establishing 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; and 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 a multi-path coordinate attention mechanism between the Stage4 layer of the HGNetv2 backbone network and the neck network, it is beneficial to improve the detection performance of the YOLOv8 target detection model. It is further explained that the coordinate attention mechanism performs one-dimensional horizontal and vertical average pooling on the input features, followed by a series of fusion, convolution and activation function operations, and finally performs a 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 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, this scheme adds multiple paths to the coordinate attention mechanism to work together, thereby enhancing the coordinate attention mechanism's ability to perform various targets. Compared with the coordinate attention mechanism, the multi-path coordinate attention mechanism proposed in this scheme has the following additional paths. First, the 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 fused, which can balance global information and local information and improve the model's comprehensive understanding of the image content; secondly, a high- and 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- and low-level information fusion path are combined to form a richer feature representation.
[0051] Preferably, in step S4, when the water surface target detection frame set and the video frame of the water surface environment are input into the ByteTrack target tracking model to perform water surface target tracking, the following sub-steps are specifically included:
[0052] The Kalman filter is used to predict the position of the surface target to obtain the predicted position of the surface target;
[0053] The predicted position of the surface target is corrected by camera motion compensation to obtain a corrected surface target position, wherein the predicted position of the surface target is corrected by camera motion compensation, specifically including the following sub-steps:
[0054] Use the global motion estimation technique in OpenCV to extract the predicted bounding box in the video frame of the water surface environment;
[0055] Use the RANSAC algorithm to calculate the affine transformation matrix The specific expression is as follows:
[0056]
[0057] Wherein, k is a positive integer; R is a two-dimensional plane rotation matrix; V is a translation transformation vector;
[0058] The affine transformation matrix is used to transform the predicted bounding box coordinates in the video frame of the k-1th frame of the water surface environment to the predicted bounding box coordinates in the video frame of the kth frame of the water surface environment.
[0059] In this embodiment, the ByteTrack target tracking model performs trajectory matching by measuring the correlation between the predicted position of the target and the position of the detection frame by the Kalman filter during the target matching stage, so the stability of the Kalman filter determines the tracking effect of the ByteTrack target tracking model. In complex water scenes, unmanned boats will inevitably fluctuate, causing the onboard camera to produce dynamic motion. This dynamic motion will cause the Kalman filter's prediction to produce unexpected deviations. Therefore, this solution corrects the prediction results of the Kalman filter through the method of camera motion compensation, thereby improving the robustness of the ByteTrack target tracking model.
[0060] To further illustrate, the state variables of the Kalman filter can be described as:
[0061]
[0062] Among them, u represents the horizontal pixel coordinate of the center of the target; v represents the vertical pixel coordinate of the center of the target; a represents the aspect ratio of the target; h represents the height of the target; and Respectively represent the rate of change of u, v, a and h over time. At this time, it is necessary to apply affine transformation 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 plane 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, in step S2, the following steps are also included:
[0066] Perform Pytorch training on the YOLOv8 target detection model to obtain a Pytorch model;
[0067] Convert the Pytorch model to an ONNX model through the torch.onnx.export interface;
[0068] Simplify the ONNX model to obtain the Simplify ONNX model;
[0069] Use the trtexec tool to convert the Simplify ONNX model to a TensorRT inferential engine model.
[0070] In this embodiment, Pytorch is an open source deep learning framework widely used in the fields of machine learning and deep learning, and the torch.onnx.export interface is an interface in PyTorch for converting a PyTorch model to the ONNX (OpenNeural Network Exchange) format. The ONNX model is an open format for representing deep learning models. The trtexec tool is a tool from NVIDIA. The TensorRT inferable engine model is an efficient 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, by training the YOLOv8 target detection model with Pytorch, it is helpful to improve the detection accuracy of the YOLOv8 target detection model. By converting the Pytorch model to the ONNX model, it is helpful to better deploy the model to the unmanned boat equipment in the future. The ONNX model is simplified. The simplification operation is to merge the repeated nodes or constant nodes in the ONNX model into one node, and delete unnecessary nodes to reduce the number of nodes and the amount of calculation of the ONNX model. The repeated layers in the ONNX model are merged into one layer to reduce the amount of calculation and memory usage of the ONNX model. By converting the Simplify ONNX model into a TensorRT inferable engine model, the Simplify ONNX model structure is further optimized to improve its inference speed.
[0072] Another aspect of the present application provides a target detection and tracking system for an unmanned boat, the system comprising:
[0073] A collection module, used for collecting video frames of the water surface environment;
[0074] The first building module is used to build a YOLOv8 target detection model, wherein the YOLOv8 target detection model adopts the HGNetv2 backbone network structure;
[0075] The second establishment module is used to establish a ByteTrack target tracking model, wherein the ByteTrack target tracking model includes a BYTE association strategy;
[0076] The target detection module is used to input the video frame of the water surface environment into the YOLOv8 target detection model to detect the water surface target and output a set of water surface target detection frames;
[0077] The target tracking module is used 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 track the water surface target and output the water surface target tracking path set.
[0078] This scheme is a target detection and tracking system for unmanned boats. Through the cooperation of the acquisition module, the first establishment module, the second establishment module, the target detection module and the target tracking module, the detection and tracking of surface targets are realized. In this scheme, the YOLOv8 target detection model is used to detect surface targets. Compared with the existing Mobilenetv3-YOLOv4 target detection algorithm, the YOLOv8 target detection model adopts the HGNetv2 backbone network structure to reduce the number of parameters and calculations of the backbone network as much as possible without losing the ability to extract features, thereby reducing the hardware burden and energy consumption cost of the unmanned boat equipment. The ByteTrack target tracking model is used to track surface targets. Compared with the existing KCF correlation filtering algorithm, the ByteTrack target tracking model introduces the BYTE association strategy, so that it can take into account each low-score detection frame, thereby reducing missed detections and improving tracking accuracy.
[0079] Preferably, the first building module includes: a first building submodule for building an HGNetv2 backbone network, wherein the HGNetv2 backbone network includes a Stage1 layer, a Stage2 layer, a Stage3 layer, and a Stage4 layer; a second building submodule for building a neck network; and an introduction submodule for introducing a multi-path coordinate attention mechanism between the Stage4 layer of the HGNetv2 backbone network and the neck network. In this embodiment, by setting the first building submodule, the second building submodule, and the introduction submodule, it is beneficial to improve the detection performance of the YOLOv8 target detection model.
[0080] Preferably, the target tracking module includes:
[0081] A prediction submodule is used to predict the position of a surface target using a Kalman filter to obtain a predicted position of the surface target;
[0082] A correction submodule is used to correct the predicted position of the surface target by camera motion compensation to obtain a corrected surface target position;
[0083] The revised submodules include:
[0084] An extraction subunit, for extracting a predicted bounding box in a video frame of a water surface environment using a global motion estimation technique in OpenCV;
[0085] The calculation subunit is used to calculate the affine transformation matrix using the RANSAC algorithm The specific expression is as follows:
[0086]
[0087] Wherein, k is a positive integer; R is a two-dimensional plane rotation matrix; V is a translation transformation vector;
[0088] The transformation subunit is used to transform the predicted bounding box coordinates in the video frame of the k-1th frame of the water surface environment to the predicted bounding box coordinates in the video frame of the kth frame of the water surface environment using an affine transformation matrix.
[0089] In this embodiment, by setting the prediction submodule and the correction submodule, it is helpful to improve the robustness of the ByteTrack target tracking model.
[0090] Preferably, it also includes: a model training module, used to perform Pytorch training on the YOLOv8 target detection model to obtain a Pytorch model; a first model conversion module, used to convert the Pytorch model into an ONNX model through the torch.onnx.export interface; a model simplification module, used to simplify the ONNX model to obtain a Simplify ONNX model; a second model conversion module, used to use the trtexec tool to convert the Simplify ONNX model into a TensorRT inferable engine model.
[0091] In this embodiment, by setting the model training module, it is beneficial to improve the detection accuracy of the YOLOv8 target detection model. By setting the first model conversion module, it is beneficial to better deploy the model to the unmanned boat equipment in the future. By setting the model simplification module, it is beneficial to reduce the number of nodes, calculation amount and memory usage of the ONNX model. By setting the second model conversion module, the Simplify ONNX model structure is further optimized to improve its reasoning speed.
[0092] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0093] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A target detection and tracking method for an unmanned boat, characterized in that: The following steps are involved: Step S1: Collecting video frames of the water surface environment; Step S2: Establish a YOLOv8 target detection model and a ByteTrack target tracking model, wherein the YOLOv8 target detection model adopts the HGNetv2 backbone network structure, and the ByteTrack target tracking model includes a BYTE association strategy; Step S3: input the video frame of the water surface environment into the YOLOv8 target detection model to perform water surface target detection, and output a set of water surface target detection frames; Step S4: 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 the water surface target tracking path set.
2. The target detection and tracking method for unmanned boat according to claim 1, characterized in that: In step S2, in the process of establishing the YOLOv8 target detection model, the following sub-steps are specifically included: Construct the HGNetv2 backbone network, which includes Stage1 layer, Stage2 layer, Stage3 layer and Stage4 layer; construct the neck network; introduce the multi-path coordinate attention mechanism between the Stage4 layer of the HGNetv2 backbone network and the neck network.
3. The target detection and tracking method for unmanned boat according to claim 1, characterized in that: In step S4, the process of inputting 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 specifically includes the following sub-steps: The Kalman filter is used to predict the position of the surface target to obtain the predicted position of the surface target; The predicted position of the surface target is corrected by camera motion compensation to obtain a corrected surface target position, wherein the predicted position of the surface target is corrected by camera motion compensation, specifically including the following sub-steps: Use the global motion estimation technique in OpenCV to extract the predicted bounding box in the video frame of the water surface environment; Use the RANSAC algorithm to calculate the affine transformation matrix The specific expression is as follows: Wherein, k is a positive integer; R is a two-dimensional plane rotation matrix; V is a translation transformation vector; The affine transformation matrix is used to transform the predicted bounding box coordinates in the video frame of the k-1th frame of the water surface environment to the predicted bounding box coordinates in the video frame of the kth frame of the water surface environment.
4. The target detection and tracking method for unmanned boat according to claim 1, characterized in that: In step S2, the following steps are also included: Perform Pytorch training on the YOLOv8 target detection model to obtain a Pytorch model; Convert the Pytorch model to an ONNX model through the torch.onnx.export interface; Simplify the ONNX model to obtain the Simplify ONNX model; Use the trtexec tool to convert the Simplify ONNX model to a TensorRT inferential engine model.
5. A target detection and tracking system for unmanned boats, using the target detection and tracking method for unmanned boats as claimed in any one of claims 1 to 4, characterized in that: The system comprises: A collection module, used for collecting video frames of the water surface environment; The first building module is used to build a YOLOv8 target detection model, wherein the YOLOv8 target detection model adopts the HGNetv2 backbone network structure; The second establishment module is used to establish a ByteTrack target tracking model, wherein the ByteTrack target tracking model includes a BYTE association strategy; The target detection module is used to input the video frame of the water surface environment into the YOLOv8 target detection model to detect the water surface target and output a set of water surface target detection frames; The target tracking module is used 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 track the water surface target and output the water surface target tracking path set.
6. The target detection and tracking system for unmanned boats according to claim 5, characterized in that: The first establishment module comprises: The first construction submodule is used to construct the HGNetv2 backbone network, wherein the HGNetv2 backbone network includes Stage1 layer, Stage2 layer, Stage3 layer and Stage4 layer; The second construction submodule is used to construct the neck network; A submodule is introduced to introduce a multi-path coordinate attention mechanism between the Stage4 layer of the HGNetv2 backbone network and the neck network.
7. The target detection and tracking system for unmanned boats according to claim 5, characterized in that: The target tracking module comprises: A prediction submodule is used to predict the position of a surface target using a Kalman filter to obtain a predicted position of the surface target; A correction submodule is used to correct the predicted position of the surface target by camera motion compensation to obtain a corrected surface target position; The revised submodules include: An extraction subunit, for extracting a predicted bounding box in a video frame of a water surface environment using a global motion estimation technique in OpenCV; The calculation subunit is used to calculate the affine transformation matrix using the RANSAC algorithm The specific expression is as follows: Wherein, k is a positive integer; R is a two-dimensional plane rotation matrix; V is a translation transformation vector; The transformation subunit is used to transform the predicted bounding box coordinates in the video frame of the k-1th frame of the water surface environment to the predicted bounding box coordinates in the video frame of the kth frame of the water surface environment using an affine transformation matrix.
8. The target detection and tracking system for unmanned boats according to claim 5, characterized in that: Also includes: Model training module, used to perform Pytorch training on the YOLOv8 target detection model to obtain a Pytorch model; The first model conversion module is used to convert the Pytorch model into an ONNX model 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 the Simplify ONNX model into a TensorRT inferential engine model 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
Deep apparent features and adaptive aggregation network-based multi-face tracking method
WO2020155873A1