Water surface ship target detection method and system for unmanned ship

The deformable multi-branch YOLOX method enhances ship target detection for unmanned boats by optimizing feature extraction and attention mechanisms, addressing the challenge of detecting small targets at a distance with improved accuracy and speed.

CN119091420AInactive Publication Date: 2024-12-06CETC NINGBO MARINE ELECTRONICS RES INST +1

Patent Information

Application Number
CN202411570358.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2024-12-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing ship target detection methods for unmanned boats struggle to accurately detect small-sized targets at a distance due to limited visual information, leading to incomplete and inaccurate tracking of dynamic targets in complex water environments.

Method used

A deformable multi-branch YOLOX ship target detection method is introduced, incorporating a deformable multi-branch gradient path module, hybrid attention mechanism, and optimized loss functions to enhance feature extraction and detection accuracy for long-distance small ship targets, while ensuring real-time performance.

Benefits of technology

The method significantly improves the detection accuracy and speed of small ship targets by adaptively adjusting feature extraction and attention mechanisms, ensuring precise identification even in challenging water conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119091420A_ABST
    Figure CN119091420A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image recognition, discloses a water surface ship target detection method and system for an unmanned ship, and aims to improve the detection precision of a long-distance small ship target in a navigation water area of the unmanned ship. The core of the method is to construct and train a target detection model based on a YOLOX-s network, and the model significantly enhances the small target detection capability and the model convergence speed by introducing a deformable multi-branch gradient path module with stronger feature extraction capability, adopting a mixed attention mechanism and optimizing a loss function. Meanwhile, the method further comprises the steps that unmanned ship camera equipment is used for collecting water surface image data, and the collected images are preprocessed, such as de-noising and enhancing. And finally, the trained target detection model is adopted to detect the preprocessed image, so that accurate detection of the long-distance ship is realized, and the navigation safety of the unmanned ship is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition, and in particular to a surface ship target detection method and system for an unmanned boat. Background Art

[0002] Unmanned boats are intelligent surface mobile platforms that can navigate completely autonomously. They can autonomously perceive unknown sea environments and monitor and track targets at sea. They integrate professional technologies such as artificial intelligence, communication, control, navigation and guidance, and cover multiple fields such as autonomous obstacle avoidance, path planning, cluster control, and target tracking. According to different application scenarios, unmanned boats can carry different sensors and specific equipment to perform related tasks such as sea reconnaissance, maritime operations, sea map construction, search and rescue, and marine resource exploration. Due to their small size, high flexibility, fast speed, good latency, and wide range of applications, they have broad application prospects in many fields.

[0003] When unmanned boats perform tasks such as sea area reconnaissance, port monitoring, and target tracking, they need to continuously and reliably identify surface targets to continuously obtain dynamic information about the targets. This requires unmanned boats to have a visual system with high-speed information processing capabilities. In the past, the tracking of surface targets mostly used aerial photography, satellites, radars, and infrared remote sensing images to obtain relevant information about the tracking targets. However, the information obtained by these methods is usually vague and cannot intuitively reflect the true state of the surface moving targets. Target tracking often fails due to inaccurate information. For example, radar images can only reflect the location information of the target, but cannot fully display the target's motion state and local posture information as well as the target's surrounding environment information, resulting in partial loss of target information. With the continuous advancement of video processing technology, the vision system of unmanned boats is becoming more and more information-based and intelligent. The vision-based unmanned boat can directly collect high-definition pictures through the camera to display the various motion states, local area characteristics, and surrounding environment information of the target's motion in real time. It can more comprehensively and intuitively display the dynamic information of the surface target, and improve the sensitivity and accuracy of the unmanned boat in tracking dynamic targets.

[0004] Using the vision system of unmanned boats to recognize dynamic targets has played a huge role in maintaining maritime safety and efficient unmanned civil operations. Due to the variability and complexity of the water environment, the research on visual recognition based on unmanned boats has always faced great challenges. With the continuous iteration of computer graphics processing equipment and the rapid development of deep learning technology, ship target detection algorithms based on deep learning have the soil on which they can flourish. At present, ship target detection based on deep learning has become the most widely used method in the field of ship target detection. In practical applications, mainstream ship target detection algorithms based on deep learning mostly use convolutional neural networks. Compared with the traditional feature descriptors designed manually, convolutional neural networks can extract deeper semantic features of ship targets, making the network have stronger expression and abstraction capabilities, thereby significantly improving the accuracy of ship target detection. However, small-sized ship targets in the distance in the image are usually difficult to provide enough visual information for detection. How to use limited visual information to better realize the detection of small ship targets at a distance is a major difficulty that needs to be solved in ship target detection. To this end, we propose a surface ship target detection method and system for unmanned boats. Summary of the invention

[0005] The purpose of the present invention is to provide a surface ship target detection method and system for an unmanned boat to solve the problems raised in the above background technology.

[0006] This paper proposes a deformable multi-branch YOLOX ship target detection method optimized for long-distance small ship targets. This method introduces a deformable multi-branch gradient path module with stronger feature extraction capability, adopts a hybrid attention mechanism to enhance the small target detection capability, optimizes the loss function to accelerate model convergence, and improves the detection effect of long-distance ship targets in unmanned boat navigation waters while meeting the real-time detection requirements, thus achieving accurate detection of long-distance ships.

[0007] To achieve the above object, the present invention provides the following technical solution: a surface ship target detection method for an unmanned boat, the method comprising: Build and train an object detection model for accurately identifying ships in images. The object detection model is based on the YOLOX-s network as the infrastructure and includes a deformable multi-branch gradient path module, a hybrid attention mechanism, and an improved loss function. Use unmanned ship camera equipment to collect water surface image data within the navigation area; Preprocess the collected images, including image denoising and image enhancement; Use the trained target detection model to detect the processed images.

[0008] Preferably, the deformable multi-branch gradient path module uses a CBS module to process features, and uses a Split operation to directly use the features of half of the channels as sub-gradient branches to participate in parallel splicing, and the features of the other half of the channels are input into a main gradient branch composed of multiple deformable residual components for further feature extraction; in the main gradient branch, the outputs of each deformable residual component are spliced ​​in parallel, and then the result of splicing the main gradient flow and the sub-gradient flow is adjusted through the CBS module to adjust the number of channels to achieve a high degree of fusion of multi-branch features.

[0009] Preferably, the deformable multi-branch gradient path module is based on the original residual component and is transformed by deformable convolution; the deformable convolution learns an offset for each point on the convolution kernel, which is used to adaptively adjust the structure of the convolution kernel according to changes in target size and shape; during the model operation process, the offset feature map of the convolution kernel is learned through additional convolution operations, and the original convolution operation is adjusted according to the offset feature map, wherein the size of the offset feature map is the same as the input feature, the number of channels is 3×N, 3 represents the x-axis offset, y-axis offset and weight coefficient of the pixel, and N represents the number of pixels in the convolution kernel.

[0010] Preferably, the hybrid attention mechanism includes a channel attention module and a spatial attention module, and the specific implementation steps include: Step 1: Use the channel attention module to process the input feature map, including: performing maximum pooling and average pooling operations in the spatial dimension, sending the pooled features to the shared fully connected layer, adding the output features element by element, and obtaining the attention weight of the channel dimension through the sigmoid activation function; Step 2: Perform element-wise multiplication of the channel attention weight obtained in step 1 and the input feature map to obtain an adjusted feature map; Step 3: Use the spatial attention module to process the adjusted feature map obtained in step 2, including: performing maximum pooling and average pooling operations on each spatial pixel of the feature map, splicing the pooled features, and fusing them through the convolution layer, and then obtaining the attention weight of the spatial dimension through the sigmoid activation function; Step 4: Perform element-by-element multiplication of the spatial attention weights obtained in step 3 and the adjusted feature map in step 2 to obtain the final feature map processed by the hybrid attention module.

[0011] Preferably, the improved loss function includes: using CIoU loss to replace the original IoU loss as the positioning loss. When calculating the overlap between the predicted box and the real box, CIoU loss additionally calculates two factors, namely, the center point distance and the aspect ratio, to accelerate the regression convergence speed of the predicted box and maintain the shape similarity between the predicted box and the real box. The specific algorithm is: in, is the Euclidean distance between the real box and the target box, is the diagonal length of the minimum circumscribed rectangle of the real box and the target box, is the weight function, Used to measure the consistency of the aspect ratio between the real box and the target box.

[0012] Preferably, the improved loss function includes: using the focus FL loss to replace the original BCE loss as the positive example judgment loss, which is used to solve the problem of imbalance between positive and negative samples in the detection task, so that the model pays more attention to the training of difficult-to-classify samples. The calculation formula of the FL loss is: in, is the specific value of the focal FL loss, is the probability value of being a positive example, is the predicted probability value, To determine whether it is a positive label, is an adjustable factor used to adjust the weights of positive and negative samples.

[0013] Preferably, the method of image denoising is: using Gaussian filtering to eliminate noise in the image, and replacing the value of each pixel in the image with the weighted average of the pixel values ​​in its neighborhood.

[0014] Preferably, the image enhancement method is: use the Sobel detection operator to perform a convolution operation on the image to calculate the gradient strength and direction of each pixel; traverse each pixel in the image, compare its gradient strength with the gradient strength of the adjacent pixel in its gradient direction, and if the current pixel is not a local maximum, set its gradient strength to zero.

[0015] Preferably, the performance of the target detection model is evaluated using precision and recall, where precision is the ratio of the number of positive samples detected by the model to the number of all detected samples; and recall is the ratio of the number of positive samples detected by the model to the number of labeled true samples.

[0016] Preferably, a surface ship target detection system for an unmanned boat comprises: A model building module, used to build a target detection model based on the YOLOX-s network as the basic architecture, the model includes a deformable multi-branch gradient path module, a hybrid attention mechanism and an improved loss function; An image data acquisition module uses an unmanned ship camera to collect water surface image data within the navigation area; Image preprocessing module, which preprocesses the collected images, including image denoising and image enhancement; The target detection module uses the trained target detection model to detect the preprocessed image to identify the ship target in the image; The result analysis module analyzes the output results of the target detection module and makes further action instructions based on the location and size information of the ship target; The data storage and management module is responsible for storing and managing all data generated during the operation of the system, including original image data, pre-processed image data, and target detection results; The user interaction interface module provides an interface for users to interact with the system and displays the system detection results.

[0017] Compared with the prior art, the present invention has the following beneficial effects: By introducing a deformable multi-branch gradient path module with stronger feature extraction capability, the present invention enhances the model's feature extraction capability for long-distance small ship targets, thereby improving the detection accuracy of these targets.

[0018] By adopting the hybrid attention mechanism, the present invention can focus more on small target ships in the image, effectively improving the detection effect of small target ships, so that the model can accurately identify small ships even in complex water surface environments.

[0019] By optimizing the loss function, the present invention accelerates the convergence process of the model, shortens the training time, and improves the stability of the model, so that the model can achieve higher detection performance more quickly. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 Schematic diagram of the deformable multi-branch YOLOX network structure; Figure 2 This is a comparison chart between DC2S and CSP modules; Figure 3 Schematic diagram of deformable convolution; Figure 4 Schematic diagram of channel attention and spatial attention modules; Figure 5 It is the schematic diagram of CBAM module; Figure 6 It is a schematic diagram of CIoU; Figure 7 This is a comparison chart of the detection effects of different detection methods; Figure 8 It is a schematic diagram of the overall structure of the present invention. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0022] See also Figure 1-8 The present invention provides a technical solution: a surface ship target detection method for an unmanned boat, the method comprising the steps of: Build and train the object detection model: The YOLOX-s network is selected as the infrastructure because it is lightweight and efficient, making it suitable for real-time detection on unmanned boats.

[0023] Based on the YOLOX-s network, a deformable multi-branch gradient path module is introduced. This module can enhance the model's feature extraction capability for ship targets, especially for small-sized and long-distance targets, and capture richer contextual information through a multi-branch structure to improve detection accuracy.

[0024] The hybrid attention mechanism is integrated, which can adaptively adjust the weight of the feature map, so that the model pays more attention to the ship target area, reduces the interference of background noise, and further improves the detection performance.

[0025] An improved loss function is designed and applied. The loss calculation method is optimized based on the small size and difficult-to-detect characteristics of ship targets, ensuring the model's sensitivity to small targets during training and achieving more accurate positioning and classification.

[0026] Collect water surface image data: The camera equipment carried by the unmanned boat continuously collects water surface image data in the water area during navigation, ensuring the diversity and representativeness of the data, including images under different weather conditions, lighting changes, water surface fluctuations, etc.

[0027] Image preprocessing: The collected images are preprocessed. First, image denoising is performed to reduce random noise in the image and improve image quality. Then image enhancement is performed to enhance the contrast of the image, making the distinction between the ship target and the background higher, which is convenient for subsequent detection.

[0028] Ship target detection: The preprocessed image is input into the trained target detection model, and the model outputs the location coordinates and category information of the ship target in the image.

[0029] The present invention will be further described below in conjunction with Examples 1 to 4: Embodiment 1: In the unmanned boat monitoring video images, the scale of ship targets varies greatly. Although the PA-FPN structure is used in YOLOX to achieve feature interaction and fusion between three different scales, it is difficult for the model to obtain sufficient features at the small target scale by relying solely on this strategy. In order to improve the feature extraction ability of the model without destroying the original gradient path, the present invention introduces a deformable multi-branch gradient path module (DC2S), which enables the model to improve the detection performance of long-distance ship targets.

[0030] See attached Figure 1 In YOLOX, the CSP module is divided into the main gradient flow branch (including multiple CBS modules and residual components) and the secondary gradient flow branch (a single CBS module), which accelerates the gradient reflux and improves the feature extraction capability. This invention will try to use the DC2S module to parallelize more gradient flow branches so that the model can obtain richer feature information. Figure 2 As shown in the figure, by comparing with the original CSP module, it can be seen that the DC2S module does not start dividing branches at the module input, but first uses the CBS module to process the features once, and then uses the Split operation to directly use the features of half of the channels as sub-gradient branches to participate in parallel splicing, and the features of the other half of the channels will be input into the main gradient branch composed of n deformable residual components for further feature extraction. In the main gradient branch, DC2S no longer chooses to adopt a simple series connection mode like the CSP module, but on the basis of series connection of deformable residual components, the outputs of each deformable residual component are spliced ​​in parallel, thereby enriching the feature information and improving the efficiency of gradient reflux. The result of splicing the main gradient flow and the sub-gradient flow will adjust the number of channels through the CBS module to achieve a high degree of fusion of multi-branch features.

[0031] In addition, since the appearance features of ships in the unmanned boat monitoring video images may change significantly with changes in their position and angle, the DC2S module uses deformable convolution to transform the original residual component, enhancing the network's ability to learn the features of ship targets of different sizes and shapes. The core idea of ​​deformable convolution is that it believes that the convolution kernel should not be a fixed rectangular structure, but should have its optimal convolution kernel structure at different stages, different feature maps, and even different pixels. Therefore, as shown in the attached figure Figure 3As shown in the figure, the deformable convolution proposes that an offset should be learned for each point on the convolution kernel, so that it can adaptively adjust the structure of the convolution kernel according to the changes in the target size and shape. During the model operation, the deformable convolution will learn the offset feature map of the convolution kernel through an additional convolution operation, and adjust the original convolution operation according to the offset feature map. The size of the offset feature map is the same as the input feature, and the number of channels is 3×N, 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.

[0032] Embodiment 2: In computer vision, the method by which humans can quickly filter out high-value areas from a large amount of visual information is called the attention mechanism. Since the attention mechanism has the characteristic of helping the human brain to analyze complex scene information more quickly and efficiently, attempts have been made to introduce it into the field of computer vision to improve the performance of tasks such as object classification, detection, and segmentation.

[0033] The hybrid attention mechanism includes a channel attention module and a spatial attention module. The specific implementation steps include: Step 1: Use the channel attention module to process the input feature map, including: performing maximum pooling and average pooling operations in the spatial dimension, sending the pooled features to the shared fully connected layer, adding the output features element by element, and obtaining the attention weight of the channel dimension through the sigmoid activation function; Step 2: Perform element-wise multiplication of the channel attention weight obtained in step 1 and the input feature map to obtain an adjusted feature map; Step 3: Use the spatial attention module to process the adjusted feature map obtained in step 2, including: performing maximum pooling and average pooling operations on each spatial pixel of the feature map, splicing the pooled features, and fusing them through the convolution layer, and then obtaining the attention weight of the spatial dimension through the sigmoid activation function; Step 4: Perform element-by-element multiplication of the spatial attention weights obtained in step 3 and the adjusted feature map in step 2 to obtain the final feature map processed by the hybrid attention module.

[0034] In the application scenario of unmanned boats performing surface ship detection, accurate detection of small-sized ship targets at long distances on a vast water surface is the difficulty and focus of improving the ship target detection capability of unmanned boats in navigation waters. Therefore, the present invention will introduce a convolutional block attention module (CBAM) to strengthen the model's attention to small ship targets, thereby improving the detection capability of small ship targets. CBAM is a plug-and-play hybrid attention module composed of a channel attention module (CAM) and a spatial attention module (SAM). As shown in the attached figure, Figure 4 As shown in the figure, in the channel attention module, the input feature map will first be subjected to maximum pooling and average pooling operations in the spatial dimension, and then the pooled features will be sent to the shared fully connected layer, and the output features will be added element by element, and finally the output weight will be obtained through the sigmoid activation function. The channel attention module can compress the information of the spatial dimension while keeping the channel dimension unchanged, so that the network can adaptively adjust the attention weight of each dimension information (such as making the network pay more attention to the shallow features that are more conducive to detecting distant ships). The spatial attention module performs maximum pooling and average pooling on each spatial pixel of the input feature map, and the pooled features will be spliced ​​and fused through a convolution, and finally input into the sigmoid activation function to obtain the weight. The spatial attention module can compress the channel dimension while keeping the spatial scale unchanged, thereby adaptively adjusting the weight of each position information (such as making the network pay more attention to the target features of distant ships near the water sky above the image).

[0035] Based on the channel attention module and the spatial attention module, CBAM simply integrates the two. Figure 5 As shown in the figure, CBAM first uses the channel attention module to obtain the network's attention weights for each dimension of information, and multiplies it with the input feature map through element-by-element multiplication to obtain the adjusted features. Subsequently, the features are input into the SAM module to obtain the network's attention weights for each position of information, and are also multiplied with the input of the module through element-by-element multiplication, ultimately achieving the network's attention to and extraction of key features.

[0036] Embodiment 3: YOLOX's original loss function exposed its limitations when faced with the task of detecting ship targets in unmanned boat navigation waters. First, since the pixel values ​​of small-sized ship targets at a long distance within the field of view of the unmanned boat are relatively small, even small pixel deviations will cause drastic fluctuations in the IoU value. At the same time, the IoU value alone can only determine the degree of overlap between the predicted box and the real box, and cannot reflect the difference in distance and shape between the two. As shown in the attached figure Figure 6 As shown in the figure, CIoU introduces two factors, namely, the center point distance and the aspect ratio, in addition to the overlapping area, so that the predicted box is constantly moved toward the real box during the iteration process, and the shape similarity between the predicted box and the real box is guaranteed as much as possible, which speeds up the regression convergence speed of the predicted box. Therefore, the present invention uses CIoU to replace IoU as the positioning loss of YOLOX, and the calculation formula of CIoU is: in, is the Euclidean distance between the real box and the target box, is the diagonal length of the minimum circumscribed rectangle of the real box and the target box, is the weight function, Used to measure the consistency of the aspect ratio between the real frame and the target frame. and The way to obtain is: in, and The width and height of the target box respectively, and are the width and height of the real box respectively.

[0037] In the unmanned boat monitoring scene, most pixels belong to the background, which leads to the imbalance of positive and negative samples in the detection. Based on this problem, the present invention uses the focus FL loss to replace the original BCE loss as the positive example judgment loss to solve the problem of imbalance between positive and negative samples in the detection task, so that the model pays more attention to the training of difficult-to-classify samples. The calculation formula of FL loss is: in, is the specific value of the focal FL loss, is the probability value of being a positive example, is the predicted probability value, To determine whether it is a positive label, is an adjustable factor used to adjust the weights of positive and negative samples.

[0038] Embodiment 4: In the image preprocessing stage, in order to reduce random noise in the image and improve image quality, Gaussian filtering is used for data denoising. The specific implementation steps are as follows: Step 1: Determine the Gaussian kernel size: Determine a suitable Gaussian kernel size (3x3, 5x5, or 7x7) based on the image noise level and processing requirements. The size of the Gaussian kernel will directly affect the denoising effect and computational complexity.

[0039] Step 2: Calculate Gaussian kernel weights: Each element in the Gaussian kernel is calculated using a Gaussian function, and its value represents the weight of the pixel at that location during the filtering process. The center value of the Gaussian function is the largest, and gradually decreases toward the surroundings, ensuring that the central pixel has the greatest impact on the result, while the influence of pixels far from the center gradually decreases.

[0040] Step 3, apply Gaussian filtering: Apply the calculated Gaussian kernel to each pixel in the image. For each pixel in the image, extract the neighboring pixels corresponding to the size of the Gaussian kernel with it as the center. Then, multiply the values ​​of these neighboring pixels with the weights of the corresponding positions in the Gaussian kernel, and sum all the products to get the new value of the pixel after Gaussian filtering. The calculation formula is: Where G(x,y) is the value of the Gaussian function at the two-dimensional coordinate (x,y) of the image, x and y are the pixel coordinates in two-dimensional space, σ is the standard deviation of the Gaussian distribution, e is the base of the natural logarithm, and π is pi.

[0041] Step 4: Traverse the entire image: Repeat the above steps and perform Gaussian filtering on each pixel in the image until the entire image has been traversed.

[0042] Step 5, output result: After the Gaussian filter processing, the noise level of the image is significantly reduced, the image quality is improved, and it is more convenient for subsequent image enhancement and target detection processing.

[0043] In order to enhance the contrast of the image and make the distinction between the ship target and the background higher, the present invention adopts an image enhancement method based on the Sobel detection operator. The specific implementation steps are as follows: Use the Sobel detection operator to perform convolution operations on the image. The Sobel operator includes two convolution kernels in the horizontal direction and the vertical direction, which are used to calculate the gradient of each pixel in the image in the horizontal direction and the vertical direction respectively. For each pixel, its gradient strength (i.e., the modulus of the gradient) and gradient direction (i.e., the angle of the gradient) are calculated by combining its gradients in the horizontal direction and the vertical direction.

[0044] Traverse each pixel in the image, and for each pixel, find its neighboring pixels in that direction according to its gradient direction. Compare the gradient strength of the current pixel with the gradient strength of the neighboring pixels in its gradient direction. If the gradient strength of the current pixel is not the local maximum (that is, there is a neighboring pixel with a gradient strength greater than the current pixel), set its gradient strength to zero.

[0045] After the above processing, each pixel in the image has its local maximum value of gradient intensity suppressed. Pixels that are not local maximum values ​​are suppressed, while pixels with local maximum values ​​are retained, thereby enhancing the contrast between the target and the background in the image. Finally, the enhanced image is output to facilitate subsequent target detection processing.

[0046] In order to comprehensively evaluate the performance of the target detection model, the present invention uses precision and recall as evaluation indicators. The following are the specific implementation steps: Precision is defined as the ratio of the number of positive samples correctly detected by the model (i.e. true positive samples TP, 1 Positives) to the number of all samples detected by the model (including true positive samples TP and false positive samples FP, 0 Positives). It can be expressed mathematically as: Precision = TP / (TP + FP).

[0047] Recall is defined as the ratio of the number of positive samples correctly detected by the model (i.e., true positive samples TP) to the number of actual labeled true samples (including true positive samples TP and false negative samples FN, 0 Negatives). It can be expressed mathematically as: Recall = TP / (TP + FN).

[0048] Label the test data set to identify the true category of each sample, including positive and negative samples. Use the trained target detection model to detect the test data set and obtain the model's prediction results for each sample.

[0049] Calculate precision and recall: According to the model's prediction results and actual annotations, count the number of true positives TP, false positives FP, and false negatives FN. Use the precision and recall formulas defined above to calculate the model's precision and recall, respectively.

[0050] The performance of the model is evaluated based on the calculated precision and recall. Generally speaking, the higher the precision and recall, the better the performance of the model. The precision and recall of different models can be compared to select the model with better performance.

[0051] The present invention provides a surface ship target detection system for an unmanned boat, the system specifically comprising the following modules: Model building module: This module is responsible for building a target detection model based on the YOLOX-s network. The model uses YOLOX-s as the basic architecture, and integrates a deformable multi-branch gradient path module, a hybrid attention mechanism, and an improved loss function on this basis, aiming to improve the ability to accurately identify ship targets in images.

[0052] Image data acquisition module: This module uses the camera equipment carried by the unmanned ship to collect real-time surface image data in the navigation area. These data will be used for subsequent model training and target detection tasks.

[0053] Image preprocessing module: preprocesses the collected raw image data, including steps such as image denoising and image enhancement. These preprocessing operations are aimed at improving image quality and improving the accuracy of target detection.

[0054] Target detection module: This module uses the trained target detection model to detect the preprocessed image. Through the model's reasoning process, it can identify the ship target in the image and output the corresponding detection results.

[0055] Result analysis module: Analyze the output results of the target detection module. According to the location and size information of the ship target, this module can make further action instructions, such as adjusting the navigation direction or speed of the unmanned boat.

[0056] Data storage and management module: This module is responsible for storing and managing all data generated during system operation. This includes raw image data, pre-processed image data, and target detection results. Effective data management can facilitate subsequent data analysis and model optimization.

[0057] User interaction interface module: provides an interface for users to interact with the system. Through this interface, users can intuitively view the system detection results and perform necessary parameter settings, model selection and other operations. This enhances the ease of use and flexibility of the system.

[0058] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0059] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A surface ship target detection method for an unmanned boat, characterized in that: The method comprises: Build and train an object detection model for accurately identifying ships in images. The object detection model is based on the YOLOX-s network as the infrastructure and includes a deformable multi-branch gradient path module, a hybrid attention mechanism, and an improved loss function. Use unmanned ship camera equipment to collect water surface image data within the navigation area; Preprocess the acquired images, including image denoising and image enhancement; Use the trained object detection model to detect the processed images.

2. A surface ship target detection method for an unmanned boat according to claim 1, characterized in that: The deformable multi-branch gradient path module uses the CBS module to process features, and uses the Split operation to directly use the features of half of the channels as sub-gradient branches to participate in parallel splicing, and the features of the other half of the channels are input into the main gradient branch composed of multiple deformable residual components for further feature extraction; In the main gradient branch, the outputs of each deformable residual component are spliced ​​in parallel, and then the result of splicing the main gradient flow and the sub-gradient flow is adjusted through the CBS module to adjust the number of channels to achieve a high degree of fusion of multi-branch features.

3. A surface ship target detection method for an unmanned boat according to claim 2, characterized in that: The deformable multi-branch gradient path module is based on the original residual component and is transformed by deformable convolution; the deformable convolution learns an offset for each point on the convolution kernel, which is used to adaptively adjust the structure of the convolution kernel according to changes in target size and shape; during the model operation process, the offset feature map of the convolution kernel is learned through additional convolution operations, and the original convolution operation is adjusted according to the offset feature map, wherein the size of the offset feature map is the same as the input feature, and the number of channels is 3×N, 3 represents the x-axis offset, y-axis offset and weight coefficient of the pixel, and N represents the number of pixels in the convolution kernel.

4. The surface ship target detection method for unmanned boat according to claim 1, characterized in that: The hybrid attention mechanism includes a channel attention module and a spatial attention module, and the specific implementation steps include: Step 1: Use the channel attention module to process the input feature map, including: performing maximum pooling and average pooling operations in the spatial dimension, sending the pooled features to the shared fully connected layer, adding the output features element by element, and obtaining the attention weight of the channel dimension through the sigmoid activation function; Step 2: Perform element-wise multiplication of the channel attention weight obtained in step 1 and the input feature map to obtain the adjusted feature map; Step 3: Use the spatial attention module to process the adjusted feature map obtained in step 2, including: performing maximum pooling and average pooling operations on each spatial pixel of the feature map, splicing the pooled features, and fusing them through the convolution layer, and then obtaining the attention weight of the spatial dimension through the sigmoid activation function; Step 4: Perform element-by-element multiplication of the spatial attention weights obtained in step 3 and the adjusted feature map in step 2 to obtain the final feature map processed by the hybrid attention module.

5. The surface ship target detection method for unmanned boat according to claim 1, characterized in that: The improved loss function includes: using CIoU loss to replace the original IoU loss as the positioning loss. When calculating the overlap between the predicted box and the real box, CIoU loss additionally calculates two factors, namely, the center point distance and the aspect ratio, to speed up the regression convergence speed of the predicted box and maintain the shape similarity between the predicted box and the real box. The specific algorithm is: in, is the Euclidean distance between the real box and the target box, is the diagonal length of the minimum circumscribed rectangle of the real box and the target box, is the weight function, Used to measure the consistency of the aspect ratio between the real box and the target box.

6. A surface ship target detection method for an unmanned boat according to claim 5, characterized in that: The improved loss function includes: using the focus FL loss to replace the original BCE loss as the positive example judgment loss, which is used to solve the problem of imbalance between positive and negative samples in the detection task, so that the model pays more attention to the training of difficult-to-classify samples. The calculation formula of the FL loss is: in, is the specific value of the focal FL loss, is the probability value of being a positive example, is the predicted probability value, To determine whether it is a positive label, is an adjustable factor used to adjust the weights of positive and negative samples.

7. The surface ship target detection method for unmanned boat according to claim 1, characterized in that: The method of image denoising is to use Gaussian filtering to eliminate noise in the image and replace the value of each pixel in the image with the weighted average of the pixel values ​​in its neighborhood.

8. The surface ship target detection method for unmanned boat according to claim 1, characterized in that: The image enhancement method is as follows: use the Sobel detection operator to perform a convolution operation on the image to calculate the gradient strength and direction of each pixel; traverse each pixel in the image, compare its gradient strength with the gradient strength of the adjacent pixels in its gradient direction, and set its gradient strength to zero if the current pixel is not a local maximum.

9. The surface ship target detection method for an unmanned boat according to claim 1, characterized in that: The performance of the target detection model is evaluated using precision and recall. Precision is the ratio of the number of positive samples detected by the model to the number of all detected samples; recall is the ratio of the number of positive samples detected by the model to the number of labeled true samples.

10. A surface ship target detection system for an unmanned boat, characterized in that: The system comprises: A model building module, used to build a target detection model based on the YOLOX-s network as the basic architecture, the model includes a deformable multi-branch gradient path module, a hybrid attention mechanism and an improved loss function; An image data acquisition module uses an unmanned ship camera to collect water surface image data within the navigation area; Image preprocessing module, which preprocesses the collected images, including image denoising and image enhancement; The target detection module uses the trained target detection model to detect the preprocessed image to identify the ship target in the image; The result analysis module analyzes the output results of the target detection module and makes further action instructions based on the location and size information of the ship target; The data storage and management module is responsible for storing and managing all data generated during the operation of the system, including original image data, pre-processed image data, and target detection results; The user interaction interface module provides an interface for users to interact with the system and displays the system detection results.

Citation Information

Patent Citations

  • Ship detection and tracking method in bridge area monitoring scene

    CN117132951A

  • Defect detection system for hollow bricks

    CN117522778A

  • LNG unloading arm target identification method based on improved YOLO-V5s model

    CN117649589A

Cited By

  • Coast defense monitoring target real-time extraction system and method based on edge calculation

    CN119942467A