A ramw-yolov8 ship target detection method based on multi-scale features

By improving the C3Res_CA module, SPPF_AuxPool module, and MicroDetect layer of the YOLOv8 algorithm, as well as the WIoU loss function, the problems of anti-interference and small target detection in complex backgrounds of the YOLOv8 algorithm are solved, and high-precision ship target detection is achieved.

CN122176282APending Publication Date: 2026-06-09NANTONG UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANTONG UNIV
Filing Date
2026-03-19
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

The existing YOLOv8 algorithm has insufficient anti-interference ability under complex background noise, is difficult to effectively fuse multi-scale features, and is prone to missed detection and false detection when detecting small targets.

Method used

An improved RAMW-YOLOv8 algorithm is adopted, which enhances feature extraction capabilities by constructing the C3Res_CA module, improves feature fusion by introducing the SPPF_AuxPool module, adds a MicroDetect small target detection layer, and optimizes bounding box regression using the WIoU loss function.

Benefits of technology

It significantly improves the algorithm's anti-interference ability and small target detection accuracy in complex backgrounds, reduces missed detections and false detections, and achieves high-precision real-time ship target detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122176282A_ABST
    Figure CN122176282A_ABST
Patent Text Reader

Abstract

The application discloses a RAMW-YOLOv8 ship target detection method based on multi-scale features, and belongs to the ship detection field. In view of the problems of low detection precision of multi-scale ship targets and easy missed detection of small targets in complex water area, the application makes multi-directional improvements on the basis of YOLOv8: firstly, a coordinate attention mechanism is introduced and a C3Res_CA module is designed to enhance the feature extraction and background suppression capability; secondly, an SPPF_AuxPool module is constructed to fuse average pooling and adaptive pooling, and the multi-scale feature fusion effect is improved; thirdly, a 160*160 small target detection layer MicroDetect is added to enhance the small target recognition capability; finally, a WIoU loss function is used instead of CIoU to improve the convergence speed and robustness. The application collects images in real time through shipborne or unmanned aerial vehicle cameras, detects ship targets and outputs position, category and confidence information to a traffic management system or a monitoring platform, and provides accurate visual support for intelligent obstacle avoidance, path planning and traffic scheduling, and has high precision, strong robustness and good application prospect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of ship inspection, specifically a RAMW-YOLOv8 ship target detection method based on multi-scale features. Background Technology

[0002] Ship target detection enables real-time monitoring of vessel dynamics, preventing maritime accidents and improving waterway utilization. Accurate identification of vessel targets not only helps customs and border control departments combat smuggling and illegal fishing, but also provides data support for marine environmental protection, monitors ship pollution emissions, and safeguards marine ecological security. Therefore, research on real-time, high-precision ship target detection is of great significance.

[0003] Currently, numerous ship target detection algorithms have been proposed, mainly categorized into traditional target detection algorithms and deep learning-based target detection algorithms. Traditional target detection algorithms, such as histogram of oriented gradients (HOG) and scale-invariant feature transform (SIFT), heavily rely on manually selected features, resulting in low detection accuracy and poor generalization. Deep learning-based target detection algorithms can automatically learn rich feature representations from large amounts of data, achieving higher detection accuracy and stronger generalization ability, thus significantly improving detection accuracy and robustness. Depending on the detection stage, deep learning-based target detection algorithms can be further divided into region-based two-stage methods and regression-based single-stage methods. Two-stage methods first extract candidate regions, then classify these regions, and finally adjust their positions to determine whether these candidate regions contain targets and their locations. Common two-stage algorithms include convolutional neural networks (CNN), Fast R-CNN, and Faster R-CNN. These algorithms can perform target detection tasks with high accuracy, but they have high computational complexity, slow processing speed, and require massive amounts of training data. Single-stage methods directly classify and regress the location of the target without pre-extracting candidate regions. Common algorithms include single-shot multibox detector (SSD), task-aligned one-stage object detection (TOOD), real-time multi-detector (RTMDet), and the YOLO (you only look once) series. Among them, the YOLO algorithm has shown significant advantages in real-time object detection due to its high speed and lightweight characteristics and has gradually become one of the mainstream algorithms.

[0004] Since its initial proposal in 2016, the YOLO algorithm has developed rapidly, driven by various deep learning technologies. Subsequent iterations, such as YOLOv2 introducing prior boxes and YOLOv3 employing a feature pyramid network structure, established the fundamental principle of the subsequent YOLO series: directly predicting the bounding boxes and class probabilities of multiple objects in an image through an end-to-end trained neural network. YOLOv4 then replaced the neck network structure with a path aggregation network, which remains in use today. YOLOv5 achieved comprehensive improvements in algorithm structure, prediction accuracy, and speed. YOLOv8, as a new generation of object detection algorithm combining accuracy and efficiency, boasts a novel cross-stage feature fusion module, resulting in comprehensive improvements across various evaluation metrics. It has been widely applied to various computer vision tasks such as detection, segmentation, tracking, and pose estimation, becoming an ideal choice for object detection tasks such as ship inspection and marine surveillance.

[0005] In recent years, to further improve the accuracy of YOLOv8 algorithm in detecting ship targets, many scholars have made significant improvements in network structure, attention mechanism, module structure, and loss function. Regarding network structure improvements, Hui Zhuofan et al. adopted a weighted bidirectional feature pyramid network structure, improving multi-scale target detection performance by weighted fusion of features at different scales; YASIR et al. replaced the algorithm's backbone and neck network structures with HGNetv2 and slim-neck to enhance adaptability to complex scenes; Wang Haiqun et al. improved the algorithm's neck network using a bidirectional feature pyramid network structure, leveraging bidirectional information flow and learnable weights to enhance feature representation capabilities. In terms of attention mechanisms, Wang et al. dynamically adjusted the spatial receptive field by combining a large selective kernel attention mechanism, focusing more on key ship features; Yang Zhiyuan et al. integrated a selective attention mechanism into the algorithm's backbone, improving target detection performance by dynamically adjusting the receptive field of the feature extraction backbone network; Dong Ruiheng et al. combined an exponential moving average attention mechanism to achieve refined segmentation of ship edges. Regarding module improvements, YASIR et al. implemented a lightweight decoupling head using an efficient multi-scale convolutional parallel structure; Wang Lei et al. replaced the C2f module with a reparameterizable module to enhance feature extraction capabilities, and used a content-based adaptive feature reconstruction to replace nearest-neighbor upsampling, improving the problem of information loss for small targets; Huang et al. replaced the C2f module at the neck network with an dilated residual module, enhancing the algorithm's ability to recognize multi-scale targets and rich feature representations. Regarding loss function improvements, Yi et al. replaced the traditional CIoU loss function with the RIoU loss function to improve the algorithm's accuracy; Yang et al. used an improved bounding box regression, AWIoU, to improve algorithm accuracy while achieving lightweighting; Xu Degang et al. used the WIoU loss function to improve the network's bounding box regression performance, thereby increasing the algorithm's convergence speed and regression accuracy.

[0006] Existing research shows that various optimization strategies can effectively improve the performance of the YOLOv8 algorithm in ship detection, but there are still problems such as insufficient anti-interference ability in the face of complex background noise, inability to effectively fuse features of different scales when processing multi-scale targets, and frequent missed detections and false detections when detecting small targets. Summary of the Invention

[0007] The technical problem this invention aims to solve is to provide a RAMW-YOLOv8 ship target detection method based on multi-scale features. This method utilizes an improved RAMW-YOLOv8 algorithm to achieve high-precision real-time detection of multi-scale ship targets in complex aquatic environments, providing more accurate and robust perception data support for automatic collision avoidance by unmanned surface vessels, intelligent port monitoring, and ship traffic management. The method includes the following steps:

[0008] (1) Real-time image information of ports, nearshore and inland waterways is collected by ship-borne cameras or drone-borne cameras;

[0009] (2) The RAMW-YOLOv8 network is used as the main network structure for ship target detection to detect multi-scale ship targets in the image.

[0010] (3) Output the detected ship target location, category and confidence level information to the ship traffic management system or port intelligent monitoring platform in real time;

[0011] (4) The automatic collision avoidance system or port monitoring platform reads the target information of the vessel and makes real-time obstacle avoidance decisions, path planning or traffic scheduling;

[0012] The improved YOLOv8 algorithm in step (2) includes the following four aspects:

[0013] i. C3Res_CA module that integrates coordinate attention mechanism

[0014] To help the algorithm extract features that are helpful for detection more efficiently and reduce the influence of irrelevant or interfering information, based on the idea of ​​the C2f module in the backbone network, combined with multi-branch convolutional structure and residual structure, and introducing coordinate attention mechanism, the C3Res_CA module was constructed. Through the lightweight attention mechanism, the number of algorithm parameters and complexity are reduced slightly while enhancing the algorithm's feature extraction ability and feature fusion diversity. At the same time, it can adaptively adjust the weight of feature map according to the importance of the channel, making the algorithm more robust.

[0015] The structure of the C3Res_CA module is as follows: Figure 2As shown, the process involves extracting features from the feature map through multi-branch convolution and residual structure, combining the CA module to adaptively adjust the feature weights to enhance the target feature extraction capability, and then performing feature fusion and channel restoration after splicing.

[0016] The principle of the CA module is as follows: Figure 3 As shown, the calculation process is as follows: Let x∈R C×H×W The input feature map is defined as follows: C, H, and W represent the number of channels, height, and width of the feature map, respectively. The CA module performs average pooling on two independent axes (height and width) to generate a feature map embedding location-specific information. Global average pooling is then performed on the feature map in both the height and width directions to obtain the average value for each row and column.

[0017] (1) (2)

[0018] Here, i and j represent the x-coordinate and y-coordinate of a pixel in the feature map, respectively. The pooling results in the height and width directions are then concatenated to form a fused feature map, and a 1×1 convolutional transformation F1 is used to generate an intermediate feature map f ∈ R. C / r×1×(H+W) :

[0019] (3)

[0020] Where r represents the channel downsampling scaling factor. Then, f is split into two separate tensors f along the spatial dimension. h ∈R C / r×H f w ∈R C / r×W Using two other 1×1 convolution transformations F h F w The attention weights g in two independent spatial directions are obtained by using the sigmoid activation function σ(·). h and g w :

[0021] (4) (5)

[0022] Finally, regarding g h g w The feature map y is expanded and applied to the input, resulting in a reweighted feature map:

[0023] (6)

[0024] In the CA module, the compression factor r determines the "compression ratio" of the channel dimension during the attention generation process, i.e., the number of channels in the intermediate layer is:

[0025] (7)

[0026] Where C is the number of channels and the compression factor r is set to 32.

[0027] ii. Improvements to the SPPF_AuxPool module based on adaptive pooling

[0028] Ship images, especially those from ports, typically contain ships of various scales and shapes, accompanied by complex backgrounds and noise. The original SPPF module's overall workflow involves input features passing through a convolutional layer followed by three max-pooling layers. The max-pooling formula is as follows:

[0029] (8)

[0030] Where X is the input feature map, i and j represent the x and y coordinates of a pixel in the feature map, k is the window size for max pooling, and Y is the output feature map after max pooling. These feature maps at different scales are concatenated along the channel dimension and then output through the final convolutional layer. This design, when processing small-scale ships or complex backgrounds, is prone to losing some detailed features due to its single pooling method, resulting in a very limited ability to capture subtle features.

[0031] To better preserve key image information, this invention borrows the idea from the original SPPF module and combines it with a multi-branch pooling structure and feature fusion strategy to construct the SPPF_AuxPool module (e.g., Figure 4 As shown in the diagram, this improves the efficiency of feature extraction and reduces interference from irrelevant information. The added average pooling retains more background information, which is particularly important for complex input data such as ship images. Furthermore, the application of adaptive pooling allows the algorithm to dynamically adjust the pooling window size and stride based on the actual size of the input feature map. The formulas for adaptive max pooling and average pooling are as follows:

[0032] (9) (10)

[0033] Where X1 and X2 represent the feature maps input to the max pooling layer and average pooling layer, respectively, Y1 and Y2 represent the output feature maps after max pooling, and k1 and k2 represent the pooling window size, as shown in the following formula:

[0034] (11)

[0035] To achieve adaptive pooling, the SPPF_AuxPool module dynamically calculates the pooling window sizes k1 and k2 based on the size H×W of the input feature map using equation (11). This not only effectively handles multi-scale targets in complex backgrounds and avoids inconsistent feature extraction due to different input image sizes, but also extracts global information from the entire feature map through a fixed output, rather than being limited to local areas, thereby improving the robustness of the algorithm in small target detection and complex scenes.

[0036] iii. Multi-scale improvements by adding the MicroDetect small target detection layer

[0037] Depend on Figure 1 It is known that the YOLOv8 algorithm uses a three-scale detection mechanism, that is, using scales of 20×20, 40×40, and 80×80 to detect large, medium, and small targets in an image, respectively. This makes it difficult to extract features of small or occluded targets from complex backgrounds. Therefore, this invention introduces a detection layer specifically designed for small targets – MicroDetect (e.g., MicroDetect). Figure 1 (as shown), to enhance the algorithm's performance when handling complex scenarios.

[0038] The core idea of ​​the MicroDetect module is to significantly enhance the model's ability to perceive small targets by introducing higher-resolution feature maps and combining multi-scale feature fusion with refined feature extraction. This added detection layer enables the algorithm to make predictions on shallower, higher-resolution features, thus preserving more spatial detail and effectively capturing distant or extremely small-pixel-area ship targets, thereby reducing false negative and false positive rates.

[0039] iv. Loss Function Optimization

[0040] The traditional YOLOv8 algorithm uses the CIoU loss function, which requires the calculation of multiple additional terms, resulting in a slow convergence speed. Furthermore, it uses a fixed penalty term, which can lead to deviations in complex scenes when the anchor box and the target box overlap in height.

[0041] To further accelerate the algorithm's convergence speed and enhance its robustness and stability in complex scenarios, this invention introduces the WIoU loss function to replace the traditional CIoU loss function. The WIoU loss function formula is as follows:

[0042] (12)

[0043] Where β is the outlier degree, α and δ are hyperparameters used to control the mapping relationship between outlier degree and gradient gain, and R WIoU For high-quality anchor frame loss, L IoU The IoU loss function is shown in the following formula:

[0044] (13) (14)

[0045] Where (x, y) represents the coordinates of the center point of the prediction box, (x, y) gt y gt ) represents the coordinates of the center point of the true bounding box, w c h c The width and height of the minimum enclosing box, * indicates that w c and h c The gradient is not backpropagated, but used as a constant to avoid affecting the weight update of the network and reduce the adverse effects of model training. IoU represents the intersection-union ratio.

[0046] Compared with the prior art, the present invention has the following beneficial effects:

[0047] First, this invention replaces the original C2f module of YOLOv8 with the C3Res_CA module in the backbone network by constructing a C3Res_CA module that integrates a coordinate attention mechanism. This module combines a multi-branch convolutional structure, a residual structure, and a coordinate attention mechanism, enabling it to capture position-sensitive information in both height and width spatial directions and generate attention weights embedded with this positional information. This enhances the algorithm's ability to extract subtle ship features in complex backgrounds while effectively suppressing interference from background noise such as sea waves and shoreline buildings. Experiments show that this improvement significantly enhances the algorithm's anti-interference capability in complex aquatic environments, achieving a precision index of 91.2%, which is superior to the comparison algorithms.

[0048] Secondly, this invention replaces the original SPPF module in the YOLOv8 neck network with the SPPF_AuxPool module, which integrates average pooling and adaptive pooling. This module introduces an average pooling branch to retain more background context information, while employing adaptive pooling to dynamically calculate the pooling window size based on the input feature map size. This allows the algorithm to adapt to input images of different scales, enhancing its feature fusion capability for multi-scale ship targets. This design effectively solves the problem of detail feature loss caused by the original SPPF module's single max pooling, improving the algorithm's stability in multi-scale target detection.

[0049] Third, this invention introduces a detection layer specifically designed for small targets by adding a 160×160 MicroDetect small target detection layer, building upon the original three-scale detection mechanism (20×20, 40×40, 80×80). This layer utilizes high-resolution feature maps to capture richer detailed information, and through multi-scale feature fusion and refined feature extraction strategies, significantly enhances the algorithm's ability to identify distant small targets or occluded targets. Experimental results show that this invention achieves a Recall of 83.0% and an mAP@0.5 of 92.1%, effectively reducing missed and false detections of small targets.

[0050] Fourth, this invention introduces the WIoU loss function to replace the original CIoU loss function, dynamically adjusting the weight distribution in bounding box regression and adaptively adjusting the gradient gain based on the anchor box quality. This loss function controls the contribution of high-quality anchor boxes through outlier β, accelerating model convergence and enhancing the algorithm's robustness and stability in complex scenarios. Experiments show that this invention achieves 67.4% mAP@0.5:0.95, a significant improvement over the original YOLOv8 algorithm. Attached Figure Description

[0051] Figure 1 This is a structural diagram of the improved RAMW-YOLOv8 in this invention;

[0052] Figure 2 This is a comparison diagram of the improved module C3Res_CA of this invention and the C2f structure in the original YOLOv8 algorithm;

[0053] Figure 3 The calculation flowchart of the coordinate attention mechanism added to this invention;

[0054] Figure 4 This is a comparison diagram of the SPPF structure in the improved module SPPF_AuxPool of this invention and the original YOLOv8 algorithm.

[0055] Figure 5 This is a schematic diagram of the research scheme of the present invention.

[0056] Figure 6 This is a comparison of the results of the HRSID public dataset designed for ship target detection with the original YOLOv8 algorithm. Group a shows the original images from the HRSID dataset, group b shows the detection results from the YOLOv8 algorithm, and group c shows the detection results from the improved RAMW-YOLOv8 algorithm. Detailed Implementation

[0057] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings.

[0058] I. Ship Target Recognition and Extraction Based on RAMW-YOLOv8

[0059] Real-time image information of ports, nearshore waters, and inland waterways is acquired using shipborne cameras, UAV-borne cameras, or satellites. An improved RAMW-YOLOv8 network is used as the main network structure for ship target detection, enabling the detection of multi-scale ship targets in the images. The specific identification and extraction process includes the following steps:

[0060] a) Input preprocessing: The input image is adjusted to a fixed size of 640×640 as required by the model and then normalized.

[0061] b) Ship Feature Extraction: RAMW-YOLOv8 uses an improved backbone network as the feature extractor. This network replaces the original C2f module of YOLOv8 with the C3Res_CA module, which integrates coordinate attention mechanisms, multi-branch convolutional structures, and residual structures. The coordinate attention mechanism captures position-sensitive information in the height and width directions, generates attention weights, and applies them to the feature map, thereby enhancing the ability to extract subtle ship features against complex backgrounds while suppressing interference from background noise such as sea waves and shoreline buildings.

[0062] c) Feature Fusion: After feature extraction, RAMW-YOLOv8 uses an improved neck network structure to fuse multi-scale feature maps. The original SPPF module is replaced with the SPPF_AuxPool module, which fuses max pooling and average pooling and employs adaptive pooling. After the input feature map passes through convolutional layers, adaptive pooling is performed through max pooling and average pooling layers respectively, and the pooling window size is dynamically calculated according to the size of the input feature map. The pooled feature maps at different scales are concatenated along the channel dimension and then output through a final convolutional layer. This design preserves more background information and enhances adaptability to multi-scale targets.

[0063] d) Target Detection: An anchor-free decoupled detection head is used to completely separate the classification and regression branches; each feature layer outputs classification score, targetability score, and bounding box regression parameters. Based on the original three-scale detection layers (20×20, 40×40, 80×80), a 160×160 small target detection layer, MicroDetect, is added. This layer utilizes high-resolution feature maps to detect small-scale ship targets, capturing more detailed information through multi-scale feature fusion and refined feature extraction strategies, significantly reducing missed and false detections of small targets.

[0064] e) Loss Calculation and Training Label Allocation: During the training phase, a dynamic positive sample allocation strategy is adopted, with weighted allocation based on the classification score and the IoU product. The loss function consists of three parts: classification loss, target loss, and bounding box regression loss. The bounding box regression loss uses the WIoU loss function instead of the traditional CIoU loss function, and its expression is:

[0065]

[0066] By dynamically adjusting the weight allocation in bounding box regression, the convergence speed and robustness in complex scenarios are improved.

[0067] f) Post-processing during the inference stage: During inference, the classification confidence score output by the decoupled head is directly multiplied by the target score to obtain the final confidence score, and then non-maximum suppression is performed on each category.

[0068] g) Output results: The final output includes the category labels, confidence scores, and bounding box coordinates relative to the original image for all retained ship targets.

[0069] II. Information Transmission and Application Based on RAMW-YOLOv8 Detection Results

[0070] The location, category, and confidence level information of the vessels detected by RAMW-YOLOv8 are output to the vessel traffic management system or port intelligent monitoring platform for subsequent decision-making. Specifically, the following steps are included:

[0071] a) Determine the scope of the port's responsible waters and the location of areas that currently require key monitoring through the electronic nautical chart system of the port monitoring center.

[0072] b) RAMW-YOLOv8 detects and outputs the confidence level, bounding box coordinates, and converted latitude and longitude position information of all ships in the target waters in real time.

[0073] c) Push the detection results of RAMW-YOLOv8 to the data interface of the ship traffic management system or intelligent monitoring platform in real time.

[0074] d) Integrate RAMW-YOLOv8 detection results, AIS data, and radar data to form a dynamic distribution map of vessels throughout the entire waterway.

[0075] e) The system automatically calculates the risk of collision, illegal fishing, or pollution discharge between ships based on the ship's position, speed, course, and rules such as port anchorage, waterway, and restricted area.

[0076] f) When an anomaly is detected, the platform immediately issues an early warning and pushes it to law enforcement vessels, tugboats, or shore-based monitoring terminals to complete closed-loop monitoring.

[0077] This invention employs an improved RAMW-YOLOv8 algorithm for ship detection and identification, demonstrating superior performance in average accuracy. It can better capture small targets in complex backgrounds, reducing the missed detection rate of obstacles. It can provide more accurate and reliable visual detection support for intelligent navigation, automatic berthing and unberthing, port traffic management, and maritime law enforcement, showing promising application prospects. Experimental results for different algorithms are shown in Table 1. As can be seen from Table 1, the proposed RAMW-YOLOv8 algorithm achieves 91.2% precision and 83.0% recall, both higher than other comparative algorithms. It also shows significant advantages in mAP@0.5 (92.1%) and mAP@0.5:0.95 (67.4%), further demonstrating the superior performance of the RAMW-YOLOv8 algorithm in ship detection tasks with complex background images. These indicators show that RAMW-YOLOv8 can not only accurately detect targets but also effectively capture more targets in various complex situations, possessing strong practical application value. Although RAMW-YOLOv8 has improved parameters (10.71M) and computational cost (29.5GFLOPs) compared to the original YOLOv8, its inference speed still reaches 129.7FPS, sufficient for real-time applications. More importantly, this model achieves a significant leap in accuracy in ship inspection tasks (Precision increased to 91.2%, Recall to 83.0%, and mAP@0.5:0.95 to 67.4%), demonstrating superior overall accuracy-speed performance. This method maintains good real-time performance while ensuring high accuracy, making it particularly suitable for computationally limited shipborne and UAV edge platforms.

[0078] Table 1 Performance Comparison of Different Algorithms on the HRSID Dataset

[0079]

Claims

1. A RAMW-YOLOv8 ship target detection method based on multi-scale features, characterized in that, Includes the following steps: (1) Real-time acquisition of image information of ports, nearshore and inland waterways through image acquisition equipment; (2) Construct a RAMW-YOLOv8 network and use the RAMW-YOLOv8 network to detect multi-scale ship targets in the acquired image information; The RAMW-YOLOv8 network is obtained by improving the YOLOv8 network structure as follows: In the backbone network, the original C2f module of YOLOv8 is replaced with the C3Res_CA module, which integrates coordinate attention mechanism, multi-branch convolution structure and residual structure; In the neck network, the original SPPF module of YOLOv8 is replaced with the SPPF_AuxPool module, which integrates max pooling and average pooling and adopts adaptive pooling operation. In the detection head section, a small target detection layer MicroDetect with a size of 160×160 is added; The RAMW-YOLOv8 network was trained using the WIoU loss function; (3) Output the location, category and confidence level information of the detected ship targets to the ship traffic management system or port intelligent monitoring platform; (4) Provide the vessel target information to the vessel traffic management system or port intelligent monitoring platform for real-time obstacle avoidance decision-making, path planning or traffic scheduling.

2. The RAMW-YOLOv8 ship target detection method based on multi-scale features according to claim 1, characterized in that, The C3Res_CA module includes a coordinate attention module, which is used to: perform global average pooling on the input feature map in the height and width directions respectively to generate feature maps with embedded position information; concatenate the feature maps with embedded position information and then perform convolution transformation to obtain an intermediate feature map; split the intermediate feature map into two separate tensors along the spatial dimension, and then perform convolution transformation and sigmoid activation on them respectively to obtain attention weights in two independent spatial directions; and expand the attention weights and apply them to the input feature map to complete the reweighting of the feature map.

3. The RAMW-YOLOv8 ship target detection method based on multi-scale features according to claim 2, characterized in that, In the coordinate attention module, the compression factor r is set to 32 to determine the compression ratio of the channel dimension during the attention generation process. The number of channels in the intermediate layer is... , where C is the number of channels in the input feature map.

4. The RAMW-YOLOv8 ship target detection method based on multi-scale features according to claim 1, characterized in that, The structure of the SPPF_AuxPool module is as follows: after the input feature map passes through the convolutional layer, it undergoes adaptive pooling operations through the max pooling layer and the average pooling layer, respectively. The pooled feature maps of different scales are then concatenated along the channel dimension and output through the final convolutional layer. The adaptive pooling operation dynamically calculates the pooling window size based on the size of the input feature map, using the following formula: ; In the formula, k1 and k2 are the pooling window sizes of the max pooling layer and the average pooling layer, respectively, and H and W are the height and width of the input feature map, respectively. This indicates rounding up to the nearest integer.

5. The RAMW-YOLOv8 ship target detection method based on multi-scale features according to claim 1, characterized in that, The MicroDetect small target detection layer is located after the neck network and is used to detect small-scale ship targets using a 160×160 resolution feature map.

6. The RAMW-YOLOv8 ship target detection method based on multi-scale features according to claim 1, characterized in that, The expression for the WIoU loss function is: ; In the formula, β is the outlier degree, and α and δ are hyperparameters that control the mapping relationship between outlier degree and gradient gain. For high-quality anchor frame loss, This is the crossover ratio loss function.

7. The RAMW-YOLOv8 ship target detection method based on multi-scale features according to claim 1, characterized in that, The ship target information detected in step (3) includes: the ship target's category label, confidence score, and bounding box coordinates relative to the original image.

8. The RAMW-YOLOv8 ship target detection method based on multi-scale features according to claim 1, characterized in that, Step (4) specifically involves transmitting the ship target information to the automatic collision avoidance system of the unmanned surface vessel for real-time obstacle avoidance decision-making.

9. The RAMW-YOLOv8 ship target detection method based on multi-scale features according to claim 1, characterized in that, Step (4) specifically involves transmitting the vessel target information to the port intelligent monitoring platform or vessel traffic management system, integrating it with AIS data and radar data to form a dynamic distribution map of vessels in the entire waterway, which is used for port monitoring, vessel traffic management and maritime law enforcement.

10. The RAMW-YOLOv8 ship target detection method based on multi-scale features according to claim 1, characterized in that, The image acquisition device is a shipborne camera, a drone-borne camera, or a satellite image acquisition device.