A ship detection method and device, electronic equipment and storage medium

CN118115870BActive Publication Date: 2026-10-27SHENZHEN RES INST OF BIG DATA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410227472.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-29
Publication Date
2026-10-27
Estimated Expiration
2044-02-29

AI Technical Summary

Technical Problem

[0002]目前,基于YOLO的SAR目标检测方法深入研究发现,通过机载或星载SAR拍摄的大场景下的船舶图像排列密集,目标重叠多,分辨率低且目标物体体积小,可移动船舰除了在海面正常行驶外,还存在海面作业、近岸航行、靠港停泊等多种行驶状态,多种状态下的复杂背景会导致更多的漏检

Benefits of technology

[0045]本申请提出的船舶检测方法和装置、电子设备及存储介质,其通过获取目标图像数据,将目标图像数据输入至目标船舶检测模型;其中,目标船舶检测模型包括:目标特征提取网络、目标特征加强网络、目标特征融合网络和目标检测网络;并通过目标特征提取网络对目标图像数据进行特征提取,得到初步船舶特征图,并将目标特征加强网络对初步船舶特征图进行特征加强处理,得到加强船舶特征图,能够加强初步船舶特征图中船舶的特征,加大船舶特征在图像特征的比例。进一步的,通过目标特征融合网络对初步船舶特征图和加强船舶特征图进行融合,得到融合船舶特征图,并通过目标检测网络对融合船舶特征图进行船舶检测,得到目标船舶检测结果,能够融合初步船舶特征图中的全局信息和加强船舶特征图中的船舶信息,使得融合船舶特征图包含不同层次的信息,目标检测网络能够从融合船舶特征图获取到全量和精准的特征,提高了对目标船舶的检测精准度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118115870B_ABST
    Figure CN118115870B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a ship detection method and device, electronic equipment and storage medium, belonging to the field of artificial intelligence. The method comprises: obtaining target image data; inputting the target image data into a preset target ship detection model; wherein the target ship detection model comprises a target feature extraction network, a target feature enhancement network, a target feature fusion network and a target detection network; performing feature extraction on the target image data through the target feature extraction network to obtain a preliminary ship feature map; obtaining a strengthened ship feature map through the target feature enhancement network from the preliminary ship feature map; obtaining a fused ship feature map through the target feature fusion network from the preliminary ship feature map and the strengthened ship feature map; and performing ship detection on the fused ship feature map through the target detection network to obtain a target ship detection result. The embodiments of the present application can improve the accuracy of ship detection in a complex background of various ship driving states.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a ship inspection method and apparatus, electronic equipment and storage medium. Background Technology

[0002] Current in-depth research on YOLO-based SAR target detection methods has revealed that in large-scale scenes captured by airborne or spaceborne SAR, ship images are densely packed with overlapping targets, exhibiting low resolution and small target size. Furthermore, mobile vessels, in addition to normal navigation on the sea surface, also engage in various operational states such as surface operations, near-shore navigation, and port berthing. The complex backgrounds under these diverse states lead to more missed detections. Therefore, improving the accuracy of ship detection under these complex backgrounds of various ship operational states has become a pressing technical challenge. Summary of the Invention

[0003] The main objective of this application is to provide a ship inspection method and apparatus, electronic device and storage medium, which aims to improve the accuracy of ship inspection under the complex background of various ship operating states.

[0004] To achieve the above objectives, a first aspect of this application provides a ship inspection method, the method comprising:

[0005] Acquire target image data; wherein, the target image data is a ship image containing multiple driving states;

[0006] The target image data is input into a preset target ship detection model; wherein, the target ship detection model includes: a target feature extraction network, a target feature enhancement network, a target feature fusion network, and a target detection network;

[0007] The target image data is used to extract features through the target feature extraction network to obtain a preliminary ship feature map.

[0008] The preliminary ship feature map is enhanced by the target feature enhancement network to obtain an enhanced ship feature map.

[0009] The target feature fusion network is used to fuse the preliminary ship feature map and the enhanced ship feature map to obtain a fused ship feature map.

[0010] The target detection network is used to detect ships in the fused ship feature map to obtain the target ship detection results.

[0011] According to some embodiments of the present invention, the target feature enhancement network includes: an aggregation multi-branch stacked sub-network and a reconstruction convolutional sub-network; the step of performing feature enhancement processing on the preliminary ship feature map through the target feature enhancement network to obtain an enhanced ship feature map includes:

[0012] The preliminary ship feature map is subjected to preliminary feature enhancement processing through the aggregated multi-branch stacked sub-network to obtain a preliminary enhanced ship feature map.

[0013] The enhanced ship feature map is obtained by reconstructing the spatial channel of the preliminary enhanced ship feature map through the reconstructed convolutional subnetwork.

[0014] According to some embodiments of the present invention, the aggregated multi-branch stacked sub-network includes: a deep convolutional feature extraction sub-module and a smooth convolutional feature extraction sub-module; the step of performing preliminary feature enhancement processing on the preliminary ship feature map through the aggregated multi-branch stacked sub-network to obtain a preliminary enhanced ship feature map includes:

[0015] The deep convolution feature extraction submodule extracts features from the preliminary ship feature map to obtain a deep convolution extracted feature map.

[0016] The smooth convolution feature extraction submodule extracts features from the preliminary ship feature map to obtain a smooth convolution extracted feature map.

[0017] The feature maps extracted by deep convolution and smooth convolution are aggregated to obtain the preliminary enhanced ship feature map.

[0018] According to some embodiments of the present invention, the reconstructed convolutional subnetwork includes: a spatial reconstruction submodule and a channel reconstruction submodule; the step of performing spatial channel reconstruction on the preliminary enhanced ship feature map through the reconstructed convolutional network to obtain the enhanced ship feature map includes:

[0019] The spatial reconstruction submodule performs spatial feature reconstruction on the aggregated ship feature map to obtain a spatial reconstructed feature map.

[0020] The enhanced ship feature map is obtained by reconstructing the spatial reconstruction feature map using the channel reconstruction submodule.

[0021] According to some embodiments of the present invention, the target feature fusion network includes: a feature pyramid submodule and an attention mechanism submodule; the step of fusing the preliminary ship feature map and the enhanced ship feature map through the target feature fusion network to obtain a fused ship feature map includes:

[0022] The feature pyramid submodule performs feature fusion on the preliminary ship feature map and the enhanced ship feature map to obtain a candidate fused feature map.

[0023] The attention mechanism submodule dynamically assigns weights to the candidate fused feature maps to obtain the fused ship feature map.

[0024] According to some embodiments of the present invention, the feature pyramid submodule includes: a shallow feature pyramid submodule and a deep feature pyramid submodule; the step of performing feature fusion on the preliminary ship feature map and the enhanced ship feature map through the feature pyramid submodule to obtain a candidate fused feature map includes:

[0025] The shallow feature pyramid submodule is used to perform feature pooling on the target ship feature map to obtain a shallow feature fusion map.

[0026] The deep feature pyramid submodule is used to perform feature pooling on the target ship feature map to obtain a deep feature fusion map.

[0027] The shallow feature fusion map and the deep feature fusion map are cascaded and fused to obtain the candidate fused feature map.

[0028] According to some embodiments of the present invention, before inputting the target image data into a preset target ship detection model, the method further includes:

[0029] The construction of the target ship detection model specifically includes:

[0030] Obtain a ship training dataset; wherein the ship training dataset includes: a ship image training set and a ship image verification set; the ship image training set consists of at least one ship image with multiple driving states.

[0031] The ship image training set is input into a preset original ship detection model; wherein, the original ship detection model includes: an original feature extraction network, an original feature enhancement network, an original feature fusion network, and an original target detection network;

[0032] The original feature extraction network is used to extract features from the ship image training set to obtain a preliminary ship feature map for training.

[0033] The original feature enhancement network is used to enhance the features of the initial training ship feature map to obtain a training enhanced ship feature map. The original feature fusion network is then used to fuse the training enhanced ship feature map and the initial training ship feature map to obtain a training fused ship feature map.

[0034] The original target detection network is used to perform ship detection on the trained fused ship feature map to obtain the training ship detection result;

[0035] The parameters of the original ship detection model are adjusted based on the training ship detection results and the ship image verification set to obtain the target ship detection model.

[0036] To achieve the above objectives, a second aspect of this application provides a ship inspection device, the device comprising:

[0037] An acquisition module is used to acquire target image data; wherein, the target image data is a ship image containing multiple driving states;

[0038] The input module is used to input the target image data into a preset target ship detection model; wherein, the target ship detection model includes: a target feature extraction network, a target feature enhancement network, a target feature fusion network, and a target detection network;

[0039] The feature extraction module is used to extract features from the target image data through the target feature extraction network to obtain a preliminary ship feature map;

[0040] The feature enhancement module is used to perform feature enhancement processing on the preliminary ship feature map through the target feature enhancement network to obtain an enhanced ship feature map;

[0041] The feature fusion module is used to fuse the preliminary ship feature map and the enhanced ship feature map through the target feature fusion network to obtain a fused ship feature map;

[0042] The identification module is used to perform ship detection on the fused ship feature map through the target detection network to obtain the target ship detection result.

[0043] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.

[0044] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.

[0045] The ship detection method, apparatus, electronic device, and storage medium proposed in this application acquire target image data and input it into a target ship detection model. The target ship detection model includes a target feature extraction network, a target feature enhancement network, a target feature fusion network, and a target detection network. The target feature extraction network extracts features from the target image data to obtain a preliminary ship feature map. The target feature enhancement network then enhances the features of the preliminary ship feature map to obtain an enhanced ship feature map, increasing the proportion of ship features in the image features. Furthermore, the target feature fusion network fuses the preliminary ship feature map and the enhanced ship feature map to obtain a fused ship feature map. The target detection network then performs ship detection on the fused ship feature map to obtain the target ship detection result. This method integrates global information from the preliminary ship feature map and ship information from the enhanced ship feature map, resulting in a fused ship feature map containing information at different levels. The target detection network can obtain comprehensive and accurate features from the fused ship feature map, improving the accuracy of target ship detection. Attached Figure Description

[0046] Figure 1 This is a flowchart of the ship inspection method provided in the embodiments of this application;

[0047] Figure 2 This is a flowchart of another ship inspection method provided in the embodiments of this application;

[0048] Figure 3 yes Figure 1 The flowchart of step S104 in the process;

[0049] Figure 4 yes Figure 3 The flowchart of step S301 in the process;

[0050] Figure 5 yes Figure 3 The flowchart of step S302 in the document;

[0051] Figure 6 yes Figure 1 The flowchart of step S105 in the process;

[0052] Figure 7 yes Figure 6 The flowchart of step S601 in the process;

[0053] Figure 8 This is a schematic diagram of the structure of the ship inspection device provided in the embodiments of this application;

[0054] Figure 9 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application;

[0055] Figure 10 This is a sub-network structure diagram provided in the embodiments of this application;

[0056] Figure 11 This is a diagram of the aggregated multi-branch stacked sub-network structure provided in the embodiments of this application;

[0057] Figure 12 This is a network structure diagram of the target ship detection model provided in the embodiments of this application. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0059] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0061] First, let's analyze some of the terms used in this application:

[0062] Feature extraction is the process of selecting, transforming, and extracting the most representative information from raw data, commonly used in pattern recognition and machine learning. In computer science and data science, feature extraction is a technique for transforming complex data into a simpler, more easily understood form to facilitate the application of machine learning algorithms. In image processing, feature extraction may involve extracting information such as texture, color, and shape from images. In natural language processing, feature extraction may involve extracting lexical, syntactic, or semantic information from text. Feature extraction plays a crucial role in pattern recognition, data mining, and machine learning tasks, helping algorithms better understand and process data.

[0063] Feature enhancement is a technique that improves the performance of pattern recognition and data analysis by highlighting or enhancing key features in data. It is commonly used in image processing, signal processing, and machine learning to emphasize important information and reduce irrelevant information, thereby improving model performance. In image processing, feature enhancement can be achieved by adjusting image contrast and brightness or applying filtering techniques. In signal processing, feature enhancement may involve using filters to highlight specific frequency components of the signal. This process helps improve the system's perception of key features, thus enhancing the accuracy and stability of the model.

[0064] Feature fusion refers to the technique of combining information from different data sources or feature extraction methods to improve model performance, accuracy, or robustness. In machine learning and pattern recognition, the goal of feature fusion is to integrate multiple features, enabling the model to more comprehensively capture the diversity and complexity of data. This can be achieved through simple feature-level fusion, decision-level fusion, or model-level fusion. Feature fusion has a wide range of applications, including computer vision, speech recognition, and medical image analysis. In computer vision, image features from different sensors can be fused to improve the accuracy of target recognition. In speech recognition, acoustic features and language model features can be fused to improve the performance of the speech recognition system.

[0065] Target detection is a crucial task in computer vision, aiming to identify objects in images or videos and determine their location and category. Unlike image classification, target detection requires models to not only identify the category of objects in an image but also to define their bounding boxes, indicating their precise location within the image. Target detection is widely used in autonomous driving, video surveillance, and medical image analysis. In autonomous driving, target detection can be used to identify vehicles, pedestrians, and other obstacles on roads. In video surveillance, it can be used to detect abnormal behavior or track specific targets. In medical imaging, target detection can be used to identify and locate lesion regions.

[0066] Convolution is a mathematical operation commonly used to process signals, images, or other data. In deep learning, convolution is widely used in Convolutional Neural Networks (CNNs). A convolution operation involves applying one function (often called a kernel or filter) to another function (usually a local region of the input data) to produce an output. In image processing, convolution can be used to detect features such as edges and textures. In deep learning, CNNs use convolutional layers to learn and extract features from the input data, enabling tasks such as image classification and object detection.

[0067] Ship detection in synthetic aperture radar (SAR) images is a fundamental problem in the field of radar data processing. Existing research shows that traditional SAR radar image ship detection methods, such as constant false alarm rate (CFAR) and template matching, rely on manual extraction of ship features. While these methods can achieve satisfactory detection results in certain specific scenarios, they are gradually being replaced by other target detection algorithms, particularly deep learning techniques, due to the high difficulty, computational complexity, poor generalization ability, and long detection time associated with manual feature extraction.

[0068] With the rapid development of artificial intelligence technology, deep learning technology has been gradually applied to various industries. In ship detection using SAR radar images, given the shortcomings of traditional methods, researchers have broken through traditional limitations by combining deep learning technology with ship detection methods in SAR images. This has resulted in a new ship detection method that is not limited by scene, has outstanding feature self-learning capabilities, and requires no time-consuming or labor-intensive manual work. Furthermore, this new algorithm can autonomously detect ship targets simply by designing features. Currently, the mainstream deep learning-based target detection algorithms fall into three categories: two-stage detection algorithms based on region recommendation, single-stage target detection algorithms based on regression, and keypoint-based detection algorithms. Two-stage detection algorithms based on region recommendation include, for example, Region Convolutional Neural Networks (RCNN) and Faster RCNN. Compared to traditional methods, these algorithms can achieve higher detection accuracy and avoid the overhead of manual work. Single-stage target detection algorithms based on regression include, for example, YOLO and SSD (Single Shot MultiBox Detector). These algorithms can achieve faster detection speeds. Keypoint-based detection algorithms include, for example, CenterNet and FCOS. Such algorithms can simultaneously achieve good detection accuracy and speed.

[0069] A comparison of these three mainstream object detection algorithms reveals that region-based detection algorithms are more complex, have slower training speeds, consume more computational resources, and have lower real-time performance, failing to meet the requirements for real-time object detection. While keypoint-based detection methods offer high accuracy, they require more precise feature maps and more complex post-processing modules for screening and detection, resulting in complex models and significant design challenges. In contrast, regression-based single-stage detection algorithms, such as YOLO, have a more moderate model width and depth compared to the former, resulting in a lower false detection rate, faster detection speed, and higher real-time performance.

[0070] However, in-depth research on YOLO-based SAR target detection methods reveals that in large-scale scenes captured by airborne or spaceborne SAR, ship images are densely packed with overlapping targets, resulting in low resolution and small target size. Furthermore, mobile vessels engage in various operational states beyond normal surface navigation, including surface operations, near-shore navigation, and port berthing. These complex backgrounds lead to more missed detections. Additionally, to ensure low latency in real-time applications, the simplified YOLO algorithm processing module can only predict a fixed number of bounding boxes, resulting in poor accuracy and low recall in object location identification. While it offers significant advantages in accuracy and speed compared to other detectors, there is still considerable room for improvement.

[0071] Based on this, embodiments of this application provide a ship inspection method and apparatus, electronic equipment and storage medium, aiming to improve the accuracy of ship inspection under the complex background of various ship operating states.

[0072] This application provides a ship inspection method and apparatus, electronic device and storage medium, which are specifically described through the following embodiments. First, the ship inspection method in this application is described.

[0073] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0074] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0075] The ship inspection method provided in this application relates to the field of artificial intelligence technology. The ship inspection method provided in this application can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the ship inspection method, but is not limited to the above forms.

[0076] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0077] Figure 1 This is an optional flowchart of the ship inspection method provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps S101 to S106.

[0078] Step S101: Acquire target image data; wherein, the target image data is a ship image containing multiple driving states;

[0079] Step S102: Input the target image data into the preset target ship detection model; wherein, the target ship detection model includes: a target feature extraction network, a target feature enhancement network, a target feature fusion network, and a target detection network;

[0080] Step S103: Extract features from the target image data using a target feature extraction network to obtain a preliminary ship feature map;

[0081] Step S104: The preliminary ship feature map is enhanced by a target feature enhancement network to obtain an enhanced ship feature map;

[0082] Step S105: The preliminary ship feature map and the enhanced ship feature map are fused using a target feature fusion network to obtain a fused ship feature map;

[0083] Step S106: Detect ships by using a target detection network to analyze the fused ship feature map and obtain the target ship detection results.

[0084] Steps S101 to S106 of this embodiment involve acquiring target image data and inputting it into a target ship detection model. The target ship detection model includes a target feature extraction network, a target feature enhancement network, a target feature fusion network, and a target detection network. The target feature extraction network extracts features from the target image data to obtain a preliminary ship feature map. The target feature enhancement network then enhances the features of the preliminary ship feature map to obtain an enhanced ship feature map, increasing the proportion of ship features in the image features. Furthermore, the target feature fusion network fuses the preliminary ship feature map and the enhanced ship feature map to obtain a fused ship feature map. The target detection network then performs ship detection on the fused ship feature map to obtain the target ship detection result. This process integrates global information from the preliminary ship feature map and ship information from the enhanced ship feature map, resulting in a fused ship feature map containing information at different levels. The target detection network can obtain comprehensive and accurate features from the fused ship feature map, improving the accuracy of target ship detection.

[0085] Please see Figure 2 In some embodiments, prior to step S101, the ship detection method may include, but is not limited to, steps S201 to S206:

[0086] Step S201: Obtain the ship training dataset; wherein, the ship training dataset includes: ship image training set and ship image verification set; the ship image training set consists of at least one ship image with multiple driving states.

[0087] Step S202: Input the ship image training set into the preset original ship detection model; wherein, the original ship detection model includes: original feature extraction network, original feature enhancement network, original feature fusion network and original target detection network;

[0088] Step S203: Extract features from the ship image training set using the original feature extraction network to obtain a preliminary ship feature map for training.

[0089] Step S204: Enhance the features of the initial training ship feature map through the original feature enhancement network to obtain the enhanced training ship feature map, and fuse the enhanced training ship feature map and the initial training ship feature map through the original feature fusion network to obtain the fused training ship feature map.

[0090] Step S205: Detect ships using the original target detection network on the trained fused ship feature map to obtain the training ship detection results;

[0091] Step S206: Adjust the parameters of the original ship detection model based on the training ship detection results and the ship image verification set to obtain the target ship detection model.

[0092] In step S201 of some embodiments, the ship image training set is an image set of the ship in various states during its operation, including image sets of various operating states such as normal navigation on the sea surface, operation on the sea surface, navigation near the shore and berthing in port.

[0093] In step S202 of some embodiments, the original feature extraction network is a network structure used to extract global feature information from the ship image training set. The original feature enhancement network is a structural improvement on the original feature extraction network, used to focus on detailed features in the enhanced ship feature map image. The original feature fusion network is used to fuse the global feature information of the initial ship feature map and the ship feature information in the enhanced ship feature map to obtain a trained fused ship feature map, which contains feature information at multiple levels. The original object detection network is used to classify the trained fused ship feature map.

[0094] In step S203 of some embodiments, feature extraction is the process of selecting, transforming and extracting the most representative information from the ship image training set. This process can remove irrelevant information from the ship image training set and obtain the global features of the ship images in the ship image training set.

[0095] In step S204 of some embodiments, feature enhancement is a technique that improves pattern recognition and data analysis performance by highlighting or enhancing key features in the data, used to obtain key features of ship features from a preliminary training ship feature map. Feature fusion combines global features from the preliminary training ship feature map with ship features from the enhanced training ship feature map.

[0096] In step S205 of some embodiments, the original object detection network uses the ship feature map to detect the specific location of the ship and outputs the specific coordinates of the ship bounding box. The bounding box contains a ship, the maximum lateral length of the ship is the width of the box, the maximum vertical height of the ship is the height of the box, and the position of the box can completely frame the ship. The training ship detection result is a set of coordinates, and the coordinate values ​​of the upper left, upper right, lower left, and lower right of the bounding box are output.

[0097] In step S206 of some embodiments, the ship image validation set includes the coordinates of the bounding boxes of ships in the ship images. The training ship detection results are compared with the validation set, and the loss value between the training ship detection results and the ship image validation set is calculated using a loss function. Then, the model parameters in the network are adjusted according to the gradient descent method and the loss function to obtain the target ship detection model. The loss function is shown in Equation (1):

[0098]

[0099] Where w and h represent the width and height of the predicted bounding box, respectively, which are the width and height of the bounding box in the training ship detection results. gt and h gt represents the width and height of the ground truth bounding box, which are also the height and width of the validation set of the ship image. IOU represents the ratio of the intersection area of ​​the predicted bounding box and the ground truth bounding box to the union area of ​​the predicted bounding box and the ground truth bounding box. 'a' is the weight parameter, and 'v' represents the similarity between the length and width.

[0100] Steps S201 to S206 of this embodiment involve acquiring a ship image training set and inputting it into the original ship detection model. Feature extraction is performed on the original feature extraction network within the original ship detection model to obtain a preliminary training ship feature map. Feature enhancement is then performed on the preliminary training ship feature map to obtain a enhanced training ship feature map. This enhances the ship features in the preliminary ship feature map, increasing the proportion of ship features in the image features and improving the probability of accurate ship detection. Furthermore, the enhanced training ship feature map and the preliminary training ship feature map are fused together to obtain a fused training ship feature map. Object detection is then performed on the fused training ship feature map to obtain the training ship detection result. The model parameters are adjusted based on the training ship validation set and the training ship detection result, enabling the model to learn network parameters for accurate ship identification. This constructs a target ship detection model capable of accurately detecting ships, thereby improving the accuracy of target ship detection.

[0101] In step S101 of some embodiments, the target image data includes at least one ship image, which contains various states of the ship during its navigation. In one embodiment, the ship image includes various navigation states such as normal navigation on the sea surface, maritime operations, near-shore navigation, and berthing in port.

[0102] In step S102 of some embodiments, the target feature extraction network includes: convolutional blocks, stacked branch modules (ELANs), and pooling blocks. The stacked branch module (ELAN) is a network structure in the YOLO network model that, by controlling the shortest and longest gradient paths, enables the network to learn more features and has stronger robustness. See also... Figure 10 ELAN has two branches. The first branch uses a 1x1 convolution to change the number of channels. The second branch first uses a 1x1 convolution module, then four 3x3 convolution modules to extract features, and finally the four features are superimposed to obtain the feature extraction result.

[0103] The target feature enhancement network includes pooling blocks, multi-branch stacked modules, innovative multi-branch stacked modules (ELAN-V), and reconstructive convolutional modules.

[0104] Please see Figure 11 The innovative multi-branch module (ELAN-V) combines the multi-branch stacked module (ELAN) with the VoV-GSCSP module, a cross-level partial network designed using a one-time aggregation method. The first branch of ELAN-V modifies the number of channels using a 1x1 convolutionally normalized SiLU activation block (CBS). The second branch uses a 1x1 convolution to further change the number of channels, followed by four 3x3 VoV-GSCSP modules. VOV-GSCSP uses four different modules for splicing and combination: convolutionally normalized Mish activation block (CBM), grouped depthwise separable convolution (GSConv), GSbottleneck, and one-time aggregation network (VOVNet).

[0105] A CBM is a convolutional block consisting of a convolutional layer, a batch normalization layer, and a Mish activation function. The formula for calculating the Mish activation function is shown in equation (2):

[0106] f(x)=x*tanh(softplus(x))=x*tanh(ln(1+e x (2)

[0107] CBS is a convolutional block consisting of a convolutional layer, a batch normalization layer, and a SiLU activation function. The SiLU activation function is calculated as shown in equation (3):

[0108]

[0109] The initial ship feature map is processed through a pooling block and a multi-branch stacking module to obtain a feature map, which is then input into CBS. After passing through the convolutional layer and batch normalization layer of CBS, the first feature map is obtained. x is the channel value of the first feature map, and the channel is a matrix in the feature map. The channel value is the matrix value in the matrix.

[0110] Using two different activation functions, SiLU and Mish, within an ELAN-V module allows the network to approximate more complex nonlinear functions, thereby improving network performance and increasing its nonlinearity and expressive power. Furthermore, using two different activation functions simultaneously can create a more balanced gradient distribution, avoiding problems such as gradient vanishing or exploding, and also giving the network better generalization ability and robustness.

[0111] The reconstruction convolutional module is a convolutional layer that includes a spatial reconstruction unit (SRU) and a channel reconstruction unit (CRU). The SRU can use a separate reconstruction method to suppress spatial redundancy and a segmentation-transformation-fusion strategy to reduce channel redundancy. The combination of these two units can effectively limit feature redundancy and improve the quality and diversity of extracted features.

[0112] The target feature fusion network is used to fuse the initial target ship feature map and the enhanced target ship feature map to obtain a fused ship feature map. The target detection network user identifies the target based on the fused ship feature map and obtains the recognition result, which is a box in the ship image containing a ship. The width of the box is the same as the maximum width of the ship within the box, and the height of the box is the same as the maximum height of the ship within the box.

[0113] In step S103 of some embodiments, feature extraction is the process of selecting, transforming and extracting the most representative information from the target image data, which can remove irrelevant information from the target image data and obtain the key features of the ship image therein.

[0114] Please see Figure 3 In some embodiments, step S104 may include, but is not limited to, steps S301 to S302:

[0115] Step S301: Perform preliminary feature enhancement processing on the preliminary ship feature map by aggregating multi-branch stacked sub-networks to obtain a preliminary enhanced ship feature map;

[0116] Step S302: Spatial channel reconstruction is performed on the preliminary enhanced ship feature map by reconstructing the convolutional subnetwork to obtain the enhanced ship feature map.

[0117] Please see Figure 4 In some embodiments, step S301 may include, but is not limited to, steps S401 to S403:

[0118] Step S401: The preliminary feature map of ships is extracted by the deep convolution feature extraction submodule to obtain the deep convolution extracted feature map;

[0119] Step S402: The preliminary feature map of ships is extracted by the smooth convolution feature extraction submodule to obtain the smooth convolution extracted feature map;

[0120] Step S403: The feature maps extracted by deep convolution and smooth convolution are aggregated to obtain a preliminary enhanced ship feature map.

[0121] In step S401 of some embodiments, the deep convolutional feature extraction submodule is a submodule in the second branch of the innovative multi-branch module (ELAN-V), namely the VOV-GSCSP submodule. The preliminary feature map of the ship is input into the VOV-GSCSP module for feature extraction to obtain the deep convolutional extracted feature map.

[0122] In step S402 of some embodiments, the smooth convolution feature extraction submodule is a submodule in the first branch of the innovative multi-branch module (ELAN-V), namely the CBS module.

[0123] Please see Figure 11 In step S403 of some embodiments, ELAN-V has two branches. The submodule of the first branch outputs a deep convolution feature map, and the submodule of the second branch outputs a smooth convolution feature map. The deep convolution feature map and the smooth convolution feature map are concatenated and convolved to obtain a preliminary enhanced ship feature map.

[0124] In the embodiments of this application, steps S401 to S403 involve extracting features from the preliminary ship feature map using a deep convolution feature extraction submodule to obtain a deep convolution extracted feature map, and then extracting features from the preliminary ship feature map using a smooth convolution feature extraction submodule to obtain a smooth convolution extracted feature map. The features from the deep convolution extracted feature map and the smooth convolution extracted feature map are then aggregated to obtain a preliminary enhanced ship feature map. This allows the preliminary enhanced ship feature map to have a stronger ship feature representation capability, improves the subsequent object detection network's perception of ship features, and improves the accuracy of ship detection.

[0125] Please see Figure 5 In some embodiments, step S302 may include, but is not limited to, steps S501 to S502:

[0126] Step S501: The spatial feature reconstruction of the aggregated ship feature map is performed through the spatial reconstruction submodule to obtain the spatial reconstruction feature map;

[0127] Step S502: Channel feature reconstruction is performed on the spatial reconstruction feature map through the channel reconstruction submodule to obtain an enhanced ship feature map.

[0128] In step S501 of some embodiments, the spatial reconstruction submodule is a submodule that uses separation and reconstruction methods to reduce spatially redundant features. During the spatial feature reconstruction of the aggregated ship feature map, the aggregated ship feature map is first normalized to reduce scale differences between different feature maps. Then, weights are generated from the normalized feature map by applying normalization and activation functions. Further, based on the generated weights, the input features are separated into multiple sub-feature sets. Finally, these separated feature sets are transformed and recombined to produce a spatially refined feature output, i.e., the spatially reconstructed feature map.

[0129] In step S502 of some embodiments, the channel reconstruction submodule adopts a segmentation-transformation-fusion strategy to reduce the channel redundant features. First, it performs different 1x1 convolution processing through different proportion paths to segment the spatial reconstruction feature map and obtain segmented features. Then, it further transforms the segmented features through convolution blocks and passes the transformed features through pooling layers and activation functions to form the final channel refined features, that is, the enhanced ship feature map.

[0130] Steps S501 to S502, as illustrated in this embodiment, involve reconstructing spatial features from the aggregated ship feature map to obtain a reconstructed spatial feature map. Then, channel feature reconstruction is performed on the reconstructed spatial feature map to obtain an enhanced ship feature map. This reduces unnecessary information in the aggregated ship feature map, improves its effective feature representation capability, and thus enhances the subsequent target detection network's perception of ship features, thereby improving the accuracy of ship detection.

[0131] Steps S301 to S302, as illustrated in this embodiment, enhance the waveguide ship feature map by aggregating a multi-branch stacked sub-network to obtain a preliminary enhanced ship feature map. This allows the preliminary enhanced ship feature map to have a stronger ship feature representation capability, improving the subsequent target detection network's perception of ship features. Furthermore, spatial channel reconstruction is performed on the preliminary enhanced ship feature map by a reconstructed convolutional sub-network to obtain an enhanced ship feature map. This reduces unnecessary information in the aggregated ship feature map, improves the effective feature representation capability of the aggregated ship feature map, thereby enhancing the subsequent target detection network's perception of ship features and improving the accuracy of ship detection.

[0132] Please see Figure 6In some embodiments, step S105 may include, but is not limited to, steps S601 to S602:

[0133] Step S601: The preliminary ship feature map and the enhanced ship feature map are fused through the feature pyramid submodule to obtain a candidate fused feature map;

[0134] Step S602: Dynamic weight allocation is performed on the candidate fusion feature maps through the attention mechanism submodule to obtain the fusion ship feature map.

[0135] Please see Figure 7 In some embodiments, step S601 may include, but is not limited to, steps S701 to S703:

[0136] Step S701: The target ship feature map is pooled through the shallow feature pyramid submodule to obtain a shallow feature fusion map.

[0137] Step S702: The feature map of the target ship is pooled through the deep feature pyramid submodule to obtain a deep feature fusion map;

[0138] Step S703: The shallow feature fusion map and the deep feature fusion map are cascaded and fused to obtain a candidate fused feature map.

[0139] In step S701 of some embodiments, the shallow feature pyramid submodule performs small-scale pooling on the target ship feature map. By using a small pooling window, the target ship feature map is pooled over a small area to capture the local texture features of the ship.

[0140] In step S702 of some embodiments, the deep feature pyramid submodule performs large-scale pooling on the target ship feature map. By using a large pooling window, the target ship feature map is pooled over a large area to capture the global image features of the ship.

[0141] In step S703 of some embodiments, cascaded fusion refers to aligning the shallow feature fusion map and the deep feature fusion map on the channels, and then concatenating them according to the aligned channels. Each feature map consists of a series of matrices, which are called channels. Alignment on the channels means aligning the first dimension of the shallow feature fusion map with the first dimension of the deep feature fusion map according to the one-to-one correspondence of the matrix dimensions, aligning the remaining dimensions in turn, and then concatenating the matrices to obtain the candidate fused feature map.

[0142] Steps S701 to S703 as shown in the embodiments of this application perform feature pooling on the target ship feature map through the shallow feature pyramid submodule and feature pooling on the target ship feature map through the deep feature pyramid submodule, and then stitch the pooled results together. This can comprehensively use large-scale and small-scale pooling operations, so that the candidate fused feature image includes multi-scale feature information of the ship, thereby improving the accuracy of subsequent target detection network in detecting ships.

[0143] In step S602 of some embodiments, the attention mechanism submodule dynamically assigns weights to features in the candidate fusion feature map through an energy function, highlighting important features and suppressing irrelevant features. The energy function is shown in equation (4):

[0144]

[0145] Where t represents the channel value in the candidate fusion feature map, and x i M represents the channel value in that channel, M is the number of channel values ​​in that channel, and i is the index corresponding to the channel value. It is a linear transformation with respect to t. It's about x i linear transformation, w t It is the weight of the linear transformation, b t This is the bias term of the linear transformation. μ t It is the average of all channel values ​​other than the channel value in the target channel. It is the variance of the channel values ​​other than channel value t in the target channel.

[0146] In steps S601 to S602 of this embodiment, the feature pyramid submodule fuses the preliminary ship feature map and the enhanced ship feature map, so that the candidate fused feature image includes multi-scale feature information of the ship. Furthermore, the attention mechanism submodule dynamically assigns weights to the candidate fused feature map, highlighting important ship features and suppressing irrelevant ship features, thereby improving the accuracy of subsequent ship detection by the target detection network.

[0147] In step S106 of some embodiments, the target ship detection result is the coordinate information of four points of a box: the top left coordinate point, the bottom left coordinate point, the top right coordinate point, and the bottom right coordinate point. Connecting the top left and bottom left coordinate points, the bottom left and bottom right coordinate points, the bottom right and top right coordinate points, and the top right and top left coordinate points yields the box. A ship is contained within the box; the width of the box matches the maximum width of the ship, and the height of the box matches the maximum height of the ship.

[0148] Please see Figure 12First, the target image data is input into a convolutional group consisting of four CBS modules, which performs simple receptive field and dimensionality transformations on the SAR image data. Then, the transformed data undergoes feature extraction through a feature extraction network composed of four multi-branch stacked modules (ELAN) and a downsampling module (MP). A newly designed ELAN-V module is introduced after the fourth ELAN module to further enhance the network's feature extraction capabilities for ship images. The ELAN-V module, directly connected to the output, is called the identity branch, which preserves low-level semantic information such as edges and textures. The branch connected to the output after passing through multiple computational units and aggregation networks is called the dense branch, which extracts high-level semantic information such as object category and location. In the identity branch, features are extracted layer by layer through four ELAN and MP modules and a feature extraction enhancement module, ELAN-V. Finally, a new convolutional layer, SCConv, is added to the backbone network, allowing the backbone network data to undergo deeper network processing, resulting in better preservation of edge and texture characteristics. The extracted features are then fed into the SAM-FPN module for network fusion. The SAM-FPN module receives three branches from the ELAN backbone module, dividing it into a shallow feature pyramid and a deep feature pyramid. The outputs of the PPM module and the second branch of the backbone network, after CBS convolution, flow to the shallow feature pyramid, while the output of the first branch of the backbone network, after CBS convolution, flows to the deep feature pyramid. These two different levels of feature pyramids are designed to give the feature maps different resolutions and semantic information. The feature maps are then fused together through concatenation to obtain even better semantic data. The pyramid concatenation method consists of upsampling, downsampling, feature extraction, and feature fusion. The ELAN module is used to process the feature maps and extract better semantic information. The feature maps are then processed by CBS to adjust their dimensions. Before each feature fusion, upsampling and downsampling are used to match the size and dimensions of the high- and low-resolution feature maps with the output feature maps of the branches by scaling them up or down. Then, feature map concatenation combines the shallow and deep feature maps. The SimAM attention mechanism module dynamically allocates weights to highlight important information, resulting in better feature representations. The feature maps from the three branches, after SAM-FPN enhancement, are fed into the RepConv module for detection and recognition. Finally, non-maximum compression (NMS) is used to obtain the final detection result. During training, the validation set verifies the training results, and the training parameters are continuously adjusted and the weight file is updated through backpropagation. The optimal weight file is obtained when the training loss reaches its minimum and convergence occurs.

[0149] Please refer to Table 1. In one embodiment provided in this application, experiments were conducted using the SSDD and HRSID datasets for SAR ship detection. The datasets contain a total of 1160 images and 2456 ships, with an average of 2.12 ships per image. The HRSID dataset contains 5604 high-resolution SAR images and 16951 ship instances. The SAR images have different resolutions, polarizations, sea states, sea areas, and coastal ports. To verify the effectiveness of the improvements in this application, a series of improvements were added to YOLOv7, including the addition of ELAN-V (module 1), the addition of SCConv (module 2), the replacement of the PPM module (module 3), the addition of the Simam module (module 4), and the XIOU loss function (module 5). The experimental results are shown in Table (1):

[0150] Table 1 Comparison of ablation experiments on the SSDD dataset

[0151]

[0152] Table 1

[0153] When improving the traditional YOLOv7 algorithm using modules 1, 2, 3, 4, and 5, the overall precision, recall, and class mean precision (mAP) are significantly improved, while the total number of parameters and computational cost are correspondingly reduced. Specifically, compared to the traditional YOLOv7, the overall performance index (mAP) is improved by 3.8%, the number of parameters is reduced by 5.2%, and the computational cost is reduced by 3.1%.

[0154] Please refer to Table 2. In one embodiment provided in this application, experiments were conducted using the classic Faster R-CNN, YOLOv3, YOLOv5s, YOLOv7, and the present invention. The comparison results are shown in Table (2):

[0155]

[0156] Table 2

[0157] Specifically, in the SSDD dataset, the mAP metric is improved by 10.3%, 7.7%, 2.3%, and 3.8% compared to Faster R-CNN, YOLOv3, YOLOv5s, and YOLOv7, respectively, and by 20.1%, 16.7%, 12.6%, and 9.1% compared to the HRSID dataset. Therefore, it can be seen that the ship detection accuracy is improved through the embodiments of this application.

[0158] Please see Figure 8 This application also provides a ship inspection device that can implement the above-described ship inspection method. The device includes:

[0159] The acquisition module is used to acquire target image data; wherein, the target image data is a ship image containing multiple driving states;

[0160] The input module is used to input target image data into a preset target ship detection model; wherein, the target ship detection model includes: a target feature extraction network, a target feature enhancement network, a target feature fusion network, and a target detection network;

[0161] The feature extraction module is used to extract features from the target image data through the target feature extraction network to obtain a preliminary ship feature map;

[0162] The feature enhancement module is used to enhance the features of the preliminary ship feature map through the target feature enhancement network to obtain an enhanced ship feature map.

[0163] The feature fusion module is used to fuse the preliminary ship feature map and the enhanced ship feature map through the target feature fusion network to obtain the fused ship feature map;

[0164] The identification module is used to detect ships by using a target detection network to analyze the fused ship feature map and obtain the target ship detection results.

[0165] The specific implementation method of this ship inspection device is basically the same as the specific implementation method of the ship inspection method described above, and will not be repeated here.

[0166] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned ship detection method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0167] Please see Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:

[0168] The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.

[0169] The memory 902 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called and executed by the processor 901 to execute the ship detection method of the embodiments of this application.

[0170] The input / output interface 903 is used to implement information input and output;

[0171] The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0172] Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904);

[0173] The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.

[0174] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described ship detection method.

[0175] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0176] The ship detection method, ship detection device, electronic device, and storage medium provided in this application acquire target image data and input it into a target ship detection model. The target ship detection model includes a target feature extraction network, a target feature enhancement network, a target feature fusion network, and a target detection network. The target feature extraction network extracts features from the target image data to obtain a preliminary ship feature map. The target feature enhancement network then enhances the features of the preliminary ship feature map to obtain an enhanced ship feature map, increasing the proportion of ship features in the image features. Furthermore, the target feature fusion network fuses the preliminary ship feature map and the enhanced ship feature map to obtain a fused ship feature map. The target detection network then performs ship detection on the fused ship feature map to obtain the target ship detection result. This method integrates global information from the preliminary ship feature map and ship information from the enhanced ship feature map, enabling the fused ship feature map to contain information at different levels. This allows the target detection network to obtain comprehensive and accurate features from the fused ship feature map, improving the accuracy of target ship detection.

[0177] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0178] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

Claims

1. A ship inspection method, characterized in that, The method includes: Acquire target image data; wherein, the target image data is a ship image containing multiple driving states; The target image data is input into a preset target ship detection model; wherein, the target ship detection model includes: a target feature extraction network, a target feature enhancement network, a target feature fusion network, and a target detection network; The target image data is used to extract features through the target feature extraction network to obtain a preliminary ship feature map. The target feature enhancement network is used to enhance the features of the preliminary ship feature map to obtain an enhanced ship feature map. The target feature enhancement network includes an aggregation multi-branch stacked sub-network and a reconstruction convolutional sub-network. The enhancement process involves: performing preliminary feature enhancement on the preliminary ship feature map using the aggregation multi-branch stacked sub-network to obtain a preliminary enhanced ship feature map; and then performing spatial channel reconstruction on the preliminary enhanced ship feature map using the reconstruction convolutional sub-network to obtain the enhanced ship feature map. The target feature fusion network is used to fuse the preliminary ship feature map and the enhanced ship feature map to obtain a fused ship feature map. The target detection network is used to detect ships in the fused ship feature map to obtain the target ship detection results.

2. The method according to claim 1, characterized in that, The aggregated multi-branch stacked sub-network includes: a deep convolutional feature extraction sub-module and a smooth convolutional feature extraction sub-module; the preliminary feature enhancement processing of the preliminary ship feature map through the aggregated multi-branch stacked sub-network to obtain a preliminary enhanced ship feature map includes: The deep convolution feature extraction submodule extracts features from the preliminary ship feature map to obtain a deep convolution extracted feature map. The smooth convolution feature extraction submodule is used to extract features from the preliminary ship feature map to obtain a smooth convolution extracted feature map. The feature maps extracted by deep convolution and smooth convolution are aggregated to obtain the preliminary enhanced ship feature map.

3. The method according to claim 1, characterized in that, The reconstructed convolutional network includes a spatial reconstruction submodule and a channel reconstruction submodule; the process of performing spatial channel reconstruction on the preliminary enhanced ship feature map through the reconstructed convolutional network to obtain the enhanced ship feature map includes: The spatial reconstruction submodule is used to reconstruct the spatial features of the preliminary enhanced ship feature map to obtain a spatial reconstructed feature map. The enhanced ship feature map is obtained by reconstructing the spatial reconstruction feature map using the channel reconstruction submodule.

4. The method according to claim 1, characterized in that, The target feature fusion network includes a feature pyramid submodule and an attention mechanism submodule; the process of fusing the preliminary ship feature map and the enhanced ship feature map through the target feature fusion network to obtain a fused ship feature map includes: The feature pyramid submodule performs feature fusion on the preliminary ship feature map and the enhanced ship feature map to obtain a candidate fused feature map. The attention mechanism submodule dynamically assigns weights to the candidate fused feature maps to obtain the fused ship feature map.

5. The method according to claim 4, characterized in that, The feature pyramid submodule includes a shallow feature pyramid submodule and a deep feature pyramid submodule; the feature fusion of the preliminary ship feature map and the enhanced ship feature map through the feature pyramid submodule to obtain a candidate fused feature map includes: The shallow feature pyramid submodule is used to perform feature pooling on the target ship feature map to obtain a shallow feature fusion map. The deep feature pyramid submodule is used to perform feature pooling on the target ship feature map to obtain a deep feature fusion map. The shallow feature fusion map and the deep feature fusion map are cascaded and fused to obtain the candidate fused feature map.

6. The method according to claim 1, characterized in that, Before inputting the target image data into the preset target ship detection model, the method further includes: The construction of the target ship detection model specifically includes: Obtain a ship training dataset; wherein the ship training dataset includes: a ship image training set and a ship image verification set; the ship image training set consists of at least one ship image with multiple driving states; The ship image training set is input into a preset original ship detection model; wherein, the original ship detection model includes: an original feature extraction network, an original feature enhancement network, an original feature fusion network, and an original target detection network; The original feature extraction network is used to extract features from the ship image training set to obtain a preliminary ship feature map for training. The original feature enhancement network is used to enhance the features of the initial training ship feature map to obtain a training enhanced ship feature map. The original feature fusion network is then used to fuse the training enhanced ship feature map and the initial training ship feature map to obtain a training fused ship feature map. The original target detection network is used to perform ship detection on the trained fused ship feature map to obtain the training ship detection result; The parameters of the original ship detection model are adjusted based on the training ship detection results and the ship image verification set to obtain the target ship detection model.

7. A ship inspection device, characterized in that, The device includes: An acquisition module is used to acquire target image data; wherein, the target image data is a ship image containing multiple driving states; The input module is used to input the target image data into a preset target ship detection model; wherein, the target ship detection model includes: a target feature extraction network, a target feature enhancement network, a target feature fusion network, and a target detection network; The feature extraction module is used to extract features from the target image data through the target feature extraction network to obtain a preliminary ship feature map; A feature enhancement module is used to perform feature enhancement processing on the preliminary ship feature map through the target feature enhancement network to obtain an enhanced ship feature map. The target feature enhancement network includes an aggregation multi-branch stacked sub-network and a reconstruction convolutional sub-network. The process of performing feature enhancement processing on the preliminary ship feature map through the target feature enhancement network to obtain the enhanced ship feature map includes: performing preliminary feature enhancement processing on the preliminary ship feature map through the aggregation multi-branch stacked sub-network to obtain a preliminary enhanced ship feature map; and performing spatial channel reconstruction on the preliminary enhanced ship feature map through the reconstruction convolutional network to obtain the enhanced ship feature map. The feature fusion module is used to fuse the preliminary ship feature map and the enhanced ship feature map through the target feature fusion network to obtain a fused ship feature map; The identification module is used to perform ship detection on the fused ship feature map through the target detection network to obtain the target ship detection result.

8. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the ship inspection method according to any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the ship inspection method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Infrared ship target detection method based on improved yolov7

    CN117152691A