Ship detection methods, unmanned boat route optimization methods and related equipment
By combining adaptive scale convolution, cross-layer residual connection and bidirectional feature pyramid module, the problem of feature loss in the EfficientDet model is solved, and the accuracy of ship detection and the navigation control capability of the unmanned boat are improved.
Patent Information
- Application Number
- CN202510764937.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-06-10
AI Technical Summary
In the existing technology, the EfficientDet model has the problem of backbone network feature loss in ship detection, resulting in low detection accuracy.
An adaptive scale convolution module is used to extract adaptive scale features from the initial image features. Feature fusion is performed by combining the cross-layer residual connection module and the bidirectional feature pyramid module. Channel attention learning is performed through the squeeze-excitation attention module to improve the accuracy of feature extraction and fusion.
The accuracy of ship detection has been improved, especially the detection performance of small targets and complex backgrounds, and the navigation control and environmental monitoring capabilities of unmanned boats have been enhanced.
Smart Images

Figure CN120279369B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of target detection technology, and specifically to a ship detection method, an unmanned boat route optimization method and related equipment. Background Art
[0002] When an unmanned aerial vehicle (UAV) is navigating the water, accurate detection of other vessels is crucial for its navigation and control. Traditional remote sensing methods, due to limitations in resolution and latency, struggle to accurately perceive surface targets in real time. However, computer vision technology, combined with the intelligent recognition system of high-definition cameras, can analyze target categories, motion trajectories, and surrounding environmental information in real time, significantly improving detection accuracy.
[0003] Prior art proposes a ship detection solution using EfficientDet. EfficientDet leverages the backbone network structure of EfficientNet and introduces a bidirectional feature pyramid network (BiFPN) for feature fusion. This enables the model to achieve excellent detection performance while maintaining a relatively small size. However, this prior art suffers from the following technical issues: While the BiFPN enables feature fusion at different scales, improving detection performance to a certain extent, the backbone network in EfficientDet loses features of small objects during the progressive downsampling process. In other words, prior art optimizes the subsequent fusion process of the backbone features and fails to address the technical issue of feature loss in the backbone network. Consequently, the accuracy of ship detection in this prior art solution remains low.
[0004] Therefore, there is an urgent need to provide a ship detection method, an unmanned boat route optimization method and related equipment to improve the accuracy of ship detection results. Summary of the Invention
[0005] In view of this, it is necessary to provide a ship detection method, an unmanned boat route optimization method and related equipment to solve the technical problem that the existing technology cannot solve the problem of feature loss during the backbone network feature extraction process, resulting in low ship detection accuracy.
[0006] In a first aspect, the present invention provides a ship detection method, comprising:
[0007] Acquire water surface images collected by equipment onboard the unmanned boat;
[0008] Downsampling the water surface image based on a backbone feature extraction module to obtain initial image features;
[0009] Performing adaptive scale feature extraction on the initial image features based on an adaptive scale convolution module to obtain adaptive scale features;
[0010] fusing the initial image features and the adaptive scale features based on a cross-layer residual connection module to obtain preliminary fused features;
[0011] Performing cross-scale connection and fusion on the preliminary fusion features based on a bidirectional feature pyramid module to obtain fusion features;
[0012] The fusion features are detected based on the detection head to obtain a ship detection result.
[0013] In some possible implementations, the adaptive scale convolution module includes multiple convolution layers with different convolution kernel sizes; then the adaptive scale feature extraction based on the adaptive scale convolution module on the initial image features to obtain the adaptive scale feature includes:
[0014] Based on the multiple convolutional layers, feature extraction of different scales is performed on the initial image features respectively, and multiple scale features are correspondingly obtained;
[0015] Acquire an adaptive weight of each of the convolutional layers, and weight the multiple scale features based on the adaptive weight to obtain the adaptive scale feature.
[0016] In some possible implementations, fusing the initial image features and the adaptive scale features based on a cross-layer residual connection module to obtain preliminary fused features includes:
[0017] Based on a cross-layer residual connection module, a residual connection operation is performed on the initial image features and the adaptive scale features to obtain preliminary fusion features.
[0018] In some possible implementations, the fused feature includes a plurality of fused sub-features. Before the detection head detects the fused feature to obtain a ship detection result, the method further includes:
[0019] Performing channel attention learning on the multiple fusion sub-features based on multiple squeeze-excitation attention modules corresponding one-to-one to the multiple fusion sub-features to obtain multiple channel attention features;
[0020] Then the detection head detects the fusion feature to obtain the ship detection result, including:
[0021] The ship detection result is obtained by detecting the multiple channel attention features based on the detection head.
[0022] In some possible implementations, the squeeze-excitation attention module includes a compression submodule, an excitation submodule, and a recalibration submodule, the compression submodule includes a global average pooling layer, and the excitation submodule includes a first fully connected layer, a first activation function layer, a second fully connected layer, and a second activation function layer;
[0023] Based on the squeeze-excitation attention module, channel attention learning is performed on the fusion sub-features to obtain channel attention features, including:
[0024] Performing feature compression on the fused sub-features based on the global average pooling layer to obtain compressed features;
[0025] Based on the first fully connected layer, the first activation function layer, the second fully connected layer, and the second activation function layer, the compressed features are sequentially subjected to dimensionality reduction, primary activation, dimensionality increase, and secondary activation processing to obtain an importance weight of each channel;
[0026] Based on the recalibration submodule, the importance weight and the fusion sub-feature are multiplied to obtain the channel attention feature.
[0027] In some possible implementations, the detection head includes a bounding box prediction detection head and a classification prediction detection head.
[0028] In some possible implementations, the backbone feature extraction module, the adaptive scale convolution module, the bidirectional feature pyramid module, the cross-layer residual connection module, the squeeze-excitation attention module, and the detection head constitute a ship detection model. The total loss function of the ship detection model during training is:
[0029]
[0030]
[0031]
[0032]
[0033]
[0034] Where, is the total loss function; is the classification loss function; is the regression loss function; is the channel weighted loss function; is the multi-scale adaptation loss function; 、 、 These are the first, second, and third hyperparameters that need to be optimized during the training of the ship detection model. is the category balance factor; is the focus factor; is the predicted probability of the target category; The weights are weighted according to the scale and difficulty of the physics; is the true position of the i-th target; is the predicted position of the i-th target; for SmoothL1 Loss function; Importance weights provided to the squeeze-excitation attention module; For scale The weight of .
[0035] In a second aspect, the present invention further provides a method for optimizing an unmanned boat route, comprising:
[0036] Collect water surface images based on the onboard image acquisition equipment;
[0037] determining a ship detection result based on the water surface image and the ship detection method;
[0038] Determining whether the preset route of the unmanned boat needs to be optimized based on the ship detection result, and optimizing the preset route when optimization is required;
[0039] The ship detection method is any one of the possible implementations described above.
[0040] In a third aspect, the present invention further provides a ship detection device, which is provided on an unmanned boat. The ship detection device includes: a memory and a processor, wherein:
[0041] The memory is used to store programs;
[0042] The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps of the ship detection method described in any one of the above possible implementations, and / or the steps of the unmanned boat route optimization method described in the above possible implementations.
[0043] In a fourth aspect, the present invention further provides a ship dispatching device, which is arranged on a shore side, and the ship dispatching device includes a data processing sub-device and a dispatching sub-device;
[0044] The data processing sub-device includes: a memory and a processor, wherein:
[0045] The memory is used to store programs;
[0046] The processor is coupled to the memory and is configured to execute the program stored in the memory to implement the steps of the ship detection method described in any one of the possible implementations and the steps of the unmanned boat route optimization method described in any one of the possible implementations;
[0047] The scheduling sub-device is used to receive the processing result of the data processing sub-device and schedule the unmanned boat based on the processing result;
[0048] or;
[0049] The scheduling sub-device is used to receive the detection results of the ship detection equipment and schedule the unmanned boat based on the detection results;
[0050] The ship dispatching device is the ship detection device described in the above possible implementation manner.
[0051] The beneficial effect of adopting the above embodiment is as follows: the ship detection method provided by the present invention takes into account the characteristics of large ship scale variations, small size of long-distance ships, and few features in the ship detection scenario. After the backbone feature extraction module downsamples the water surface image to obtain the initial image features, an adaptive scale convolution module is set to perform adaptive scale feature extraction on the initial image features, that is, adaptive scale feature extraction is performed on the initial image features to more completely retain the feature information, provide richer and more refined feature representation for the feature fusion of the subsequent bidirectional feature pyramid module, enhance the network's ability to obtain feature information of long-distance, small-target ships at a small target scale, and thereby improve the accuracy of the ship detection results.
[0052] Furthermore, before obtaining fusion features based on the bidirectional feature pyramid, the present invention fuses the initial image features and the adaptive scale features by setting a cross-layer residual connection module, thereby achieving a cross-connection between the initial image features and the adaptive scale features, maintaining the integrity of the initial image features, and fusing information at different scales, providing a richer and more diverse feature representation, thereby further improving the accuracy of the ship detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0054] Figure 1 A schematic flow chart of an embodiment of the ship detection method provided by the present invention;
[0055] Figure 2 A schematic structural diagram of an embodiment of a ship detection model provided by the present invention;
[0056] Figure 3 A schematic structural diagram of an embodiment of a backbone feature extraction module provided by the present invention;
[0057] Figure 4 A schematic diagram of the structure of an embodiment of the bidirectional feature pyramid module provided by the present invention;
[0058] Figure 5 A schematic diagram of the structure of an embodiment of the adaptive scale convolution module provided by the present invention;
[0059] Figure 6 A schematic diagram of the structure of an embodiment of the squeeze-motivate attention module provided by the present invention;
[0060] Figure 7 A schematic flow chart of an embodiment of the unmanned boat route optimization method provided by the present invention;
[0061] Figure 8 A schematic structural diagram of an embodiment of the ship detection equipment provided by the present invention;
[0062] Figure 9 This is a structural diagram of an embodiment of the ship dispatching equipment provided by the present invention. DETAILED DESCRIPTION
[0063] The following will provide a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0064] It should be understood that the schematic drawings are not drawn to scale. The flowcharts used in the present invention illustrate operations implemented according to some embodiments of the present invention. It should be understood that the operations of the flowcharts can be implemented out of sequence, and steps that have no logical contextual relationship can be reversed in order or implemented simultaneously. In addition, those skilled in the art, guided by the content of the present invention, can add one or more other operations to the flowcharts or remove one or more operations from the flowcharts. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and / or processor systems and / or microcontroller systems.
[0065] The terms "first" and "second" in the embodiments of the present invention are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a technical feature designated as "first" or "second" may explicitly or implicitly include at least one such feature.
[0066] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute a separate or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0067] The present invention provides a ship detection method, an unmanned boat route optimization method and related equipment, which are described below respectively.
[0068] Before discussing specific embodiments, it's important to note that the difference between ship detection in this invention and conventional target detection is that ship detection involves small targets, while conventional target detection involves general targets. Specifically, small targets are those with pixel values less than 32×32, while general targets are those with pixel values greater than or equal to 32×32. The fundamental difference between the two detection methods is that small targets have fewer features, while general targets have more. Therefore, general target detection methods cannot accurately detect small targets.
[0069] In an embodiment of the present invention, the ship detection method is performed based on a ship detection model. Figure 1 This is a flow chart of an embodiment of the ship detection method proposed in an embodiment of the present invention. Figure 2 The ship detection model includes a backbone feature extraction module, an adaptive scale convolution module, a cross-layer residual connection module, a bidirectional feature pyramid module and a detection head. Figure 1 and Figure 2 As shown, the ship detection method includes:
[0070] S101: Acquire a water surface image collected by equipment onboard the unmanned boat.
[0071] Specifically, the method of obtaining water surface images is: based on the high-precision camera equipment carried on the unmanned boat, the water surface image data of the water area is collected in real time.
[0072] S102: Down-sample the water surface image based on the backbone feature extraction module to obtain initial image features.
[0073] The number of downsampling times should be determined according to the size of the water surface image and the size of the ship in the water surface image. Figure 3 As shown in FIG, the backbone feature extraction module performs seven downsamplings. Since the ship is a small target, the features obtained from the first two downsamplings are discarded, and the image features P3, P4, P5, P6, and P7 obtained from the last five downsamplings are used as the initial image features.
[0074] S103 , performing adaptive scale feature extraction on the initial image features based on the adaptive scale convolution module to obtain adaptive scale features.
[0075] To achieve adaptive scale feature extraction for each initial image feature, the number of adaptive scale convolution modules is the same as the number of initial image features. When the initial image features are P3, P4, P5, P6, and P7 described in step S102, there are also five adaptive scale convolution modules, corresponding to the five initial image features. The resulting adaptive scale features are recorded as: fP3, fP4, fP5, fP6, and fP7.
[0076] S104: Fusing the initial image features and the adaptive scale features based on a cross-layer residual connection module to obtain preliminary fused features.
[0077] The number of preliminary fusion features is also consistent with the number of initial image features, that is, further feature extraction of each initial image feature is achieved.
[0078] The cross-layer residual connection module bridges the initial image features with the adaptive scale features, facilitating information flow and enabling deep features to leverage shallower details, thereby playing a greater role in detecting objects of varying scales. More importantly, this bridge preserves more of the original information from the initial feature map, helping to preserve the semantic information of small objects. Furthermore, deeper extraction is achieved through the deep network, preventing over-abstraction of deep features and improving detection performance for objects of varying scales.
[0079] S105. Based on the bidirectional feature pyramid module, the preliminary fusion features are connected and fused across scales to obtain fusion features.
[0080] Specifically, the structure of the bidirectional feature pyramid module is as follows: Figure 4 As shown, it includes three repeatedly stacked bidirectional fusion units, each of which includes a top-down fusion process and a bottom-up fusion process. The specific top-down fusion process and bottom-up fusion process are shown in Figure 4 As shown, no further details are given here.
[0081] S106: Detect the fused features based on the detection head to obtain a ship detection result.
[0082] In a specific embodiment of the present invention, Figure 2 As shown in the figure, the detection head includes a bounding box prediction detection head and a classification prediction detection head. That is, the ship detection process includes classification and regression tasks.
[0083] Among them, the features in the embodiments of the present invention all refer to feature maps.
[0084] It should be understood that the ship detection method in the embodiments of the present invention can be implemented in any device based on the ship detection method, such as an unmanned aerial vehicle. Specifically, the ship detection method is stored in the aforementioned device as a pre-programmed program. When the device is powered on, the program is invoked and the ship detection method is implemented.
[0085] Compared with the prior art, the ship detection method provided by the embodiment of the present invention takes into account the characteristics of ship detection scenarios, such as large ship scale variations, small size of long-distance ships, and few features. After the backbone feature extraction module downsamples the water surface image to obtain initial image features, an adaptive scale convolution module is provided to perform adaptive scale feature extraction on the initial image features. That is, adaptive scale feature extraction is performed on the initial image features to more completely retain feature information, providing richer and more refined feature representation for the feature fusion of the subsequent bidirectional feature pyramid module, thereby improving the network's ability to acquire feature information of long-distance, small-target ships at a small target scale, thereby improving the accuracy of ship detection results.
[0086] Furthermore, before obtaining fusion features based on the bidirectional feature pyramid, the embodiments of the present invention fuse the initial image features and the adaptive scale features based on a cross-layer residual connection module, thereby achieving a cross-connection between the initial image features and the adaptive scale features. This maintains the integrity of the initial image features and fuses information at different scales, providing a richer and more diverse feature representation, thereby further improving the accuracy of ship detection results.
[0087] To achieve the purpose of expanding the feature information of the initial image features, in some embodiments of the present invention, the adaptive scale convolution module includes multiple convolution layers with different convolution kernel sizes, and step S103 includes:
[0088] Based on multiple convolutional layers, the initial image features are extracted at different scales to obtain corresponding features at multiple scales.
[0089] The adaptive weights of each convolutional layer are obtained, and multiple scale features are weighted based on the adaptive weights to obtain adaptive scale features.
[0090] Among them, the adaptive scale feature It can be expressed as:
[0091]
[0092] Where, n is the total number of convolutional layers; For the i Adaptive weights for convolutional layers; is the scale feature obtained by the i-th convolutional layer.
[0093] The embodiment of the present invention provides multiple convolution layers with different convolution kernel sizes to extract features of different scales from the initial image features, thereby increasing features of different scales, that is, increasing the feature information content of the adaptive scale features finally obtained.
[0094] In a specific embodiment of the present invention, Figure 5 As shown in Figure 1, the adaptive scale convolution module includes three convolution layers with convolution kernels of 3×3, 5×5, and 7×7 respectively.
[0095] In some embodiments of the present invention, step S104 includes:
[0096] The initial image features and adaptive scale features are residually connected to obtain preliminary fusion features.
[0097] Specifically, the preliminary fusion features can be expressed as:
[0098]
[0099] Where, is the i-th initial image feature; is the i-th adaptive scale feature.
[0100] Since the water surface image includes not only ships but also other obstacles such as water ripples and islands, in order to enhance the ship features and suppress the features of other obstacles to improve the accuracy of ship detection results, in some embodiments of the present invention, such as Figure 2 As shown, the ship detection model also includes a squeeze-excitation attention module (SENet) corresponding to the fusion feature. Before step S106, the ship detection method also includes:
[0101] Based on multiple squeeze-excitation attention modules corresponding to multiple fusion sub-features one by one, channel attention learning is performed on multiple fusion sub-features to obtain multiple channel attention features (such as Figure 4 shown);
[0102] Then step S106 is specifically as follows:
[0103] The detection head detects the attention features of multiple channels and obtains the ship detection results.
[0104] This embodiment of the present invention adds SENet after each fused sub-feature. After feature extraction and fusion of each initial image feature, attention learning is performed on the fused sub-feature. This allows for selective enhancement and suppression of multi-scale features. It dynamically recalibrates each feature channel of each fused sub-feature, automatically strengthening key features and suppressing unimportant ones. This eliminates the noise or information unhelpful to the current detection task that is inevitably introduced by BiFPN when fusing multi-scale features, preventing this information from interfering with model judgment. Specifically, SENet adaptively learns channel weights to suppress the activation of these redundant channels, thereby improving feature purity. Furthermore, applying SENet layer by layer reduces confusion between features of different scales, enabling the model to better focus on objects of varying sizes. Furthermore, since feature maps of different scales capture objects of varying sizes, applying SENet layer by layer allows the model to better adapt to the feature representation of objects of varying scales, improving detection robustness. This strategy enables the model to more effectively utilize the multi-scale information extracted by BiFPN, ultimately improving object detection accuracy and performance.
[0105] Compared with the existing technology that only sets one SENet to realize attention learning of multiple fused sub-features, it pays attention to the features in each fused sub-feature, further avoiding the feature loss of the fused sub-features in the attention learning process. In this way, the ship detection model can focus more on features that are helpful for small or complex targets, thereby improving the detection performance of small objects, blurred targets and complex backgrounds.
[0106] In a specific embodiment of the present invention, Figure 6 As shown, the squeeze-excitation attention module includes a compression submodule, an excitation submodule and a recalibration submodule. The compression submodule includes a global average pooling layer, and the excitation submodule includes a first fully connected layer, a first activation function layer, a second fully connected layer, and a second activation function layer.
[0107] Based on the squeeze-excitation attention module, channel attention learning is performed on the fusion sub-features to obtain channel attention features, including:
[0108] The fused sub-features are compressed based on the global average pooling layer to obtain compressed features.
[0109] Compressed features of the cth channel It can be expressed as:
[0110]
[0111] Where, is the fusion sub-feature of the c-th channel; 、 is the height and width of the fused sub-feature.
[0112] Based on the first fully connected layer, the first activation function layer, the second fully connected layer and the second activation function layer, the compressed features are sequentially subjected to dimensionality reduction, primary activation, dimensionality increase and secondary activation to obtain the importance weight of each channel.
[0113] Importance Weight It can be expressed as:
[0114]
[0115] Where, is a compression feature; is the weight of the first fully connected layer; is the weight of the second fully connected layer; Specifically, the activation function of the first activation function layer is the ReLU function, and the activation function of the second activation function layer is the sigmoid function.
[0116] Based on the recalibration submodule, the importance weight and the fusion sub-feature are multiplied to obtain the channel attention feature.
[0117] By multiplying the importance weights with the fused sub-features, this embodiment of the present invention generates adjusted channel attention features that suppress information from unimportant channels based on the importance weights. The squeeze operation compresses global information, while the excitation operation learns inter-channel dependencies, enhancing channels containing critical information while suppressing redundant or noisy channels. This ultimately improves the model's detection capabilities for small objects and complex scenes, as well as its overall generalization and robustness.
[0118] In summary, this embodiment of the present invention implements a squeeze-and-excite attention module to adjust the weights of each channel, weight each channel, and perform channel-weighted weighting on the fused feature map. This achieves the goal of adaptively adjusting the importance of each channel, suppressing irrelevant features, and focusing on key targets (especially small objects). This further enables the ship detection model to learn complex image features, resulting in higher accuracy in ship detection.
[0119] It should be understood that before the ship detection model is actually tested, to ensure its performance, it must be trained, and a loss function must be used during the training process. To ensure the compatibility of the loss function with the improved ship detection model and to accelerate model convergence, in some embodiments of the present invention, the total loss function of the ship detection model during training is:
[0120]
[0121]
[0122]
[0123]
[0124]
[0125] Where, is the total loss function; is the classification loss function; is the regression loss function; is the channel weighted loss function; is the multi-scale adaptation loss function; 、 、 These are the first, second, and third hyperparameters that need to be optimized during the training of the ship detection model. is the category balance factor; is the focus factor; is the predicted probability of the target category; The weights are weighted according to the scale and difficulty of the physics; is the true position of the i-th target; is the predicted position of the i-th target; for SmoothL1 Loss function; Importance weights provided to the squeeze-excitation attention module; For scale The weight of .
[0126] Since the ship detection model of the embodiment of the present invention introduces adaptive scale convolution and channel weighting, the embodiment of the present invention sets the total loss function as the weighted sum of the classification loss function, the regression loss function, the channel weighted loss function and the multi-scale adaptation loss function, thereby improving the adaptability and detection accuracy of the ship detection model trained based on the total loss function to the ship detection scene.
[0127] During the actual training process, a sample set was first collected, and 20% of the images were randomly selected from the sample set as the test set. To ensure adequate model fit and generalization, 90% of the remaining images were added to the training set, while the remaining images served as the validation set to provide a reference for model training. Ultimately, the proportions of the training set, validation set, and test set in the sample set were 72%, 8%, and 20%, respectively.
[0128] Next, the model is trained, tested, and validated based on the total loss function. The performance metrics evaluated during testing and validation include detection accuracy and efficiency. Detection accuracy metrics include precision (P), recall (R), average precision (AP), and mean average precision (mAP). Detection efficiency metrics include the model's number of parameters, floating-point operations, and frame rate.
[0129] Furthermore, to verify the effectiveness of the embodiment of the present invention, the detection results of the embodiment of the present invention can be compared with those of the classical model.
[0130] In practical applications, ship detection results are used to provide a reference for the navigation of unmanned boats. Therefore, based on the ship detection method, such as Figure 7 As shown, an embodiment of the present invention further provides a method for optimizing an unmanned boat route, comprising:
[0131] S701. Collect water surface images based on the onboard image acquisition device.
[0132] Specifically, the image acquisition device may be a high-precision camera device that can continuously acquire water surface images at a preset frame rate.
[0133] S702, determining a ship detection result based on the water surface image and the ship detection method;
[0134] S703: Determine whether the preset route of the unmanned boat needs to be optimized based on the ship detection result, and optimize the preset route if optimization is required.
[0135] It should be understood that the preset route is the planned data imported before the unmanned boat is put into operation.
[0136] The specific method for determining whether optimization is needed is: based on the ship detection results, determine whether there is a risk of collision between the unmanned boat and the detected ship. If there is a risk of collision, the preset route needs to be optimized; otherwise, no optimization is required.
[0137] Specifically, the means for optimizing the preset route is: optimizing the preset route based on a preset path planning algorithm for the purpose of ensuring the navigation safety of the unmanned boat.
[0138] The ship detection method is any one of the ship detection methods described above.
[0139] In summary, the unmanned vehicle route optimization method proposed in the embodiments of this invention enhances the unmanned vehicle's autonomous navigation and obstacle avoidance capabilities. By accurately identifying ships on the water, the unmanned vehicle can obtain real-time information about the position, speed, and heading of surrounding vessels, enabling it to make accurate obstacle avoidance decisions. This not only helps reduce the risk of collisions but also improves the unmanned vehicle's navigation efficiency in busy waters.
[0140] Furthermore, embodiments of the present invention can help enhance the application of unmanned boats in areas such as marine environmental monitoring, water rescue, and border patrol. By identifying vessels on the water in real time, unmanned boats can promptly detect illegal activities or abnormal situations, providing important intelligence support to relevant departments. Furthermore, unmanned boats can operate in inclement weather or hazardous environments, reducing labor costs and safety risks.
[0141] like Figure 8 As shown, the present invention also provides a ship detection device 800 , which is provided on an unmanned boat. The ship detection device 800 includes a processor 801 , a memory 802 , and a display 803 . Figure 8 Only some of the components of the ship detection device 800 are shown, but it should be understood that implementation of all of the shown components is not required, and more or fewer components may be implemented instead.
[0142] In some embodiments, the memory 802 may be an internal storage unit of the ship detection device 800, such as a hard disk or memory of the ship detection device 800. In other embodiments, the memory 802 may be an external storage device of the ship detection device 800, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the ship detection device 800.
[0143] In some embodiments, the processor 801 can be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 802, such as the ship detection method and / or the unmanned boat route optimization method in the present invention.
[0144] In some embodiments, display 803 can be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 803 is used to display information about ship inspection device 800 and to present a visual user interface. Components 801-803 of ship inspection device 800 communicate with each other via a system bus.
[0145] In some embodiments of the present invention, when the processor 801 executes the ship detection program in the memory 802, the following steps may be implemented:
[0146] Acquire water surface images;
[0147] The water surface image is downsampled based on the backbone feature extraction module to obtain the initial image features;
[0148] Based on the adaptive scale convolution module, adaptive scale features are extracted from the initial image features to obtain adaptive scale features;
[0149] The initial image features and adaptive scale features are fused based on the cross-layer residual connection module to obtain preliminary fusion features;
[0150] Based on the bidirectional feature pyramid module, the preliminary fusion features are connected and fused across scales to obtain fusion features;
[0151] The fusion features are detected based on the detection head to obtain the ship detection results.
[0152] When the processor 801 executes the unmanned boat route optimization program in the memory 802, the following steps may be implemented:
[0153] Collect water surface images based on the onboard image acquisition equipment;
[0154] Determine a ship detection result based on the water surface image and the ship detection method;
[0155] Based on the ship detection results, it is determined whether the preset route of the unmanned boat needs to be optimized. If optimization is required, the preset route is optimized.
[0156] It should be understood that when the processor 801 executes the ship detection program and / or the unmanned boat route optimization program in the memory 802, in addition to the above functions, it can also implement other functions. For details, please refer to the description of the previous related method embodiments.
[0157] like Figure 9 As shown, the embodiment of the present invention further provides a ship dispatching device 900, which is set at the shore end. The ship dispatching device includes a data processing sub-device 901 and a dispatching sub-device 902;
[0158] The data processing sub-device 901 includes: a memory and a processor, wherein:
[0159] Memory, used to store programs;
[0160] A processor, coupled to the memory, configured to execute a program stored in the memory to implement the steps of the ship detection method in any one of the above embodiments and the steps of the unmanned boat route optimization method in any one of the above embodiments;
[0161] The scheduling sub-device 902 is used to receive the processing results of the data processing sub-device 901 and schedule the unmanned boat based on the processing results;
[0162] or;
[0163] The scheduling sub-device 902 is used to receive the detection results of the ship detection equipment and schedule the unmanned boat based on the detection results;
[0164] The ship dispatching device is the ship detection device in the above embodiment.
[0165] It should be noted that the specific implementation of the data processing sub-device 901 can be found in the ship detection device 800 in the above embodiment, and will not be described in detail here.
[0166] Those skilled in the art will appreciate that all or part of the process flow of the above-described method embodiment can be implemented by instructing related hardware (such as a processor, controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a magnetic disk, an optical disk, a read-only memory, or a random access memory.
[0167] The above is a detailed introduction to the ship detection method, unmanned boat route optimization method and related equipment provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A ship detection method, characterized in that: include: Acquire water surface images collected by equipment onboard the unmanned boat; Downsampling the water surface image based on a backbone feature extraction module to obtain initial image features; The backbone feature extraction module performs seven downsamplings, discards the features obtained from the first two downsamplings, and uses the image features obtained from the last five downsamplings as the initial image features; Performing adaptive scale feature extraction on the initial image features based on an adaptive scale convolution module to obtain adaptive scale features; The number of adaptive scale convolution modules is the same as the number of initial image features. There are five adaptive scale convolution modules, corresponding to the five initial image features respectively. fusing the initial image features and the adaptive scale features based on a cross-layer residual connection module to obtain preliminary fused features; the number of preliminary fused features is consistent with the number of initial image features; Performing cross-scale connection and fusion on the preliminary fusion features based on a bidirectional feature pyramid module to obtain fusion features; The fusion features are detected based on the detection head to obtain a ship detection result.
2. The ship detection method according to claim 1, characterized in that: The adaptive scale convolution module includes a plurality of convolution layers with different convolution kernel sizes; the adaptive scale convolution module is used to extract adaptive scale features from the initial image features to obtain adaptive scale features, including: Based on the multiple convolutional layers, feature extraction of different scales is performed on the initial image features respectively, and multiple scale features are correspondingly obtained; Acquire an adaptive weight of each of the convolutional layers, and weight the multiple scale features based on the adaptive weight to obtain the adaptive scale feature.
3. The ship detection method according to claim 1, characterized in that: The fusing of the initial image features and the adaptive scale features based on the cross-layer residual connection module to obtain preliminary fused features includes: Based on a cross-layer residual connection module, a residual connection operation is performed on the initial image features and the adaptive scale features to obtain preliminary fusion features.
4. The ship detection method according to claim 1, characterized in that: The fusion feature includes a plurality of fusion sub-features. Before the detection head detects the fusion feature to obtain the ship detection result, the method further includes: Performing channel attention learning on the multiple fusion sub-features based on multiple squeeze-excitation attention modules corresponding one-to-one to the multiple fusion sub-features to obtain multiple channel attention features; Then the detection head detects the fusion feature to obtain the ship detection result, including: The ship detection result is obtained by detecting the multiple channel attention features based on the detection head.
5. The ship detection method according to claim 4, characterized in that: The squeeze-excitation attention module includes a compression submodule, an excitation submodule and a recalibration submodule, wherein the compression submodule includes a global average pooling layer, and the excitation submodule includes a first fully connected layer, a first activation function layer, a second fully connected layer, and a second activation function layer; Based on the squeeze-excitation attention module, channel attention learning is performed on the fusion sub-features to obtain channel attention features, including: Performing feature compression on the fused sub-features based on the global average pooling layer to obtain compressed features; Based on the first fully connected layer, the first activation function layer, the second fully connected layer, and the second activation function layer, the compressed features are sequentially subjected to dimensionality reduction, primary activation, dimensionality increase, and secondary activation processing to obtain an importance weight of each channel; Based on the recalibration submodule, the importance weight and the fusion sub-feature are multiplied to obtain the channel attention feature.
6. The ship detection method according to claim 4, characterized in that: The detection head includes a bounding box prediction detection head and a classification prediction detection head.
7. The ship detection method according to claim 6, characterized in that: The backbone feature extraction module, the adaptive scale convolution module, the bidirectional feature pyramid module, the cross-layer residual connection module, the squeeze-excitation attention module, and the detection head constitute a ship detection model. The total loss function of the ship detection model during training is: ; ; ; ; ; Where, is the total loss function; is the classification loss function; is the regression loss function; is the channel weighted loss function; is the multi-scale adaptation loss function; 、 、 These are the first, second, and third hyperparameters that need to be optimized during the training of the ship detection model. is the category balance factor; is the focus factor; is the predicted probability of the target category; The weights are weighted according to the scale and difficulty of the physics; is the true position of the i-th target; is the predicted position of the i-th target; for SmoothL1 Loss function; Importance weights provided to the squeeze-excitation attention module; For scale The weight of .
8. A method for optimizing an unmanned boat route, characterized in that: include: Collect water surface images based on the onboard image acquisition equipment; determining a ship detection result based on the water surface image and the ship detection method; Determining whether the preset route of the unmanned boat needs to be optimized based on the ship detection result, and optimizing the preset route when optimization is required; Wherein, the ship detection method is the ship detection method described in any one of claims 1-7.
9. A ship detection device, installed on an unmanned boat, characterized in that: The ship detection device includes: a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps of the ship detection method described in any one of claims 1 to 7 above, and / or the steps of the unmanned boat route optimization method described in claim 8.
10. A ship dispatching device, arranged on the shore, characterized in that: The ship dispatching device includes a data processing sub-device and a dispatching sub-device; The data processing sub-device includes: a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is configured to execute the program stored in the memory to implement the steps of the ship detection method according to any one of claims 1 to 7 and the steps of the unmanned boat route optimization method according to claim 8; The scheduling sub-device is used to receive the processing result of the data processing sub-device and schedule the unmanned boat based on the processing result; or; The scheduling sub-device is used to receive the detection results of the ship detection equipment and schedule the unmanned boat based on the detection results; The ship dispatching equipment is the ship detection equipment according to claim 9.
Citation Information
Patent Citations
Method for detecting dense ship targets in any direction based on attention enhancement
CN116168240A
Target detection method based on improved BiFPN network
CN117788784A