Marine ship target identification method, device, electronic equipment and readable medium

Multi-scale feature maps are extracted through atrous convolution and pooling operations, combined with defogging and image enhancement technology, to solve the problem of low recognition accuracy of maritime ship target recognition at night and in severe weather conditions, achieving higher recognition accuracy and robustness.

CN117372829BActive Publication Date: 2024-09-24THE 711TH RES INST OF CHINA STATE SHIPBUILDING CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311387377.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-25
Publication Date
2024-09-24
Estimated Expiration
2043-10-25

AI Technical Summary

Technical Problem

The recognition accuracy of maritime ship target recognition is low at night and in bad weather conditions. The resolution of infrared cameras is not high, and sea fog causes image quality to decrease, leading to missed recognition problems.

Method used

It uses dilated convolution and pooling operations to extract multi-scale feature maps, fuses feature representations at different levels, and uses convolutional layers and fully connected layers to predict target bounding boxes and categories. It combines defogging and image enhancement technology to use visible light and infrared The image-trained model handles day and night conditions separately.

Benefits of technology

It improves the accuracy and robustness of maritime ship target recognition, improves the accuracy of low-resolution and small target recognition, and is suitable for target detection in different scales and complex scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117372829B
    Figure CN117372829B
Patent Text Reader

Abstract

The present application discloses a method, device, electronic device and readable medium for identifying marine ship targets. The method includes obtaining a navigation image of a ship to be identified; extracting features from the navigation image of the ship to obtain feature maps at different levels; extracting feature representations of the feature maps in a multi-scale manner by applying dilated convolution and pooling operations under a set dilated rate for the feature maps at each level; using upsampling and downsampling operations to fuse feature representations at different levels to obtain fused features; based on the fused features, using convolutional layers and fully connected layers to predict the bounding box and category of the target. The present application can enhance the feature extraction capability of images, learn richer and more representative features, and effectively improve the feature expression capability at different scales and complex scenes. Through the feature representation of multi-scale feature maps, information of different receptive field sizes can be captured, improving the detection capability and robustness of multi-scale targets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method, device and electronic equipment for identifying marine ship targets. Background Art

[0002] With the rapid development of the field of intelligent ships, the use of computer vision to assist ships in scene perception during navigation has become the choice of many ships. Machine vision methods that include target recognition algorithms can provide intelligent auxiliary judgment information for crew members, thereby effectively improving the safety of ships during navigation, and at the same time providing important technical support for the development of unmanned ships in the future. However, the actual marine environment is complex and changeable. Visible light cameras can only meet the recognition tasks during the day. Infrared cameras must be introduced for assistance under night conditions, but the resolution of infrared cameras is generally not high, which increases the difficulty of algorithm recognition. In addition, sea fog can cause poor conditions such as low visibility when sailing at sea, resulting in a serious decline in image quality. In addition, the scale of ship targets on the sea surface varies greatly, and ship targets at a distance are too small, which can easily cause problems such as missed recognition.

[0003] Therefore, how to apply the marine ship target recognition method to actual scenarios to effectively solve the ship target recognition task is a hot topic in current research. Summary of the invention

[0004] The technical purpose of the present application is to provide a method, device, electronic device and readable medium for identifying marine ship targets, which can improve the accuracy of marine ship target identification.

[0005] To achieve the above technical objectives, this application adopts the following method.

[0006] In a first aspect, the present application provides a method for identifying a marine ship target, comprising:

[0007] Acquire a navigation image of a ship to be identified;

[0008] Extracting features from the ship navigation image to obtain feature maps at different levels;

[0009] For the feature map at each level, extracting feature representation of the feature map in a multi-scale manner by applying dilated convolution and pooling operations under a set dilated rate;

[0010] Using upsampling and downsampling operations to fuse the feature representations at different levels to obtain fused features;

[0011] Based on the fused features, convolutional layers and fully connected layers are used to predict the bounding box and category of the target.

[0012] Furthermore, the method further comprises:

[0013] Defogging is performed based on the ship navigation image.

[0014] Furthermore, defogging is performed based on the ship navigation image, which includes:

[0015] The brightness and darkness variation amplitude of the edge portion of the ship navigation image is enhanced to obtain the enhanced ship navigation image.

[0016] Furthermore, based on the fused features, a convolutional layer and a fully connected layer are used to predict the bounding box and category of the target, including:

[0017] The fusion feature is spatially divided according to a preset spatial division size to obtain multiple sub-feature maps; the pixels in each sub-feature map are rearranged according to the channel order to form a new feature map; the feature maps of all the sub-feature maps are connected together in a set order to obtain the final optimized fusion feature;

[0018] Based on the finally optimized fusion features, convolutional layers and fully connected layers are used to predict the bounding box and category of the target.

[0019] Furthermore, the feature extraction is performed on the ship navigation image to obtain feature maps at different levels; for the feature map at each level, the feature representation of the feature map is extracted in a multi-scale manner by applying a dilated convolution and pooling operation under a set dilated rate; the feature representations at different levels are fused by upsampling and downsampling operations to obtain fused features; based on the fused features, the bounding box and category of the target are predicted by using a convolution layer and a fully connected layer, which is realized by a target recognition model;

[0020] The target recognition model is trained using the following method:

[0021] Obtaining a visible light ship navigation image training set and an infrared ship navigation image training set respectively, wherein the visible light ship navigation image training set and the infrared ship navigation image training set are both marked with target categories;

[0022] Based on the visible light ship navigation image training set, the target recognition model is trained until the loss function of the target recognition model converges, thereby obtaining a visible light ship target recognition model, so as to call the visible light ship target recognition model to perform marine ship target recognition under daytime conditions;

[0023] Based on the infrared ship navigation image training set, the target recognition model is trained until the loss function of the target recognition model converges, and an infrared ship target recognition model is obtained, so as to call the infrared ship target recognition model to perform marine ship target recognition under night conditions.

[0024] Furthermore, the method further includes determining whether the current condition is daytime or nighttime, and then determining whether to select the visible light ship target recognition model or the infrared ship target recognition model for marine ship target recognition;

[0025] Determine whether the current condition is daytime or nighttime, including:

[0026] For the ship navigation image to be identified, the r channel, the g channel, and the b channel are separately taken out, and the average value of each channel is calculated respectively;

[0027] The average RGB value of the ship navigation image is obtained by adding the average values ​​of the three channels and dividing by 3;

[0028] The average RGB value is compared with a preset value to determine whether it is day or night.

[0029] In a second aspect, an embodiment of the present application provides a marine ship target identification device, the device comprising:

[0030] An image acquisition module, used to acquire the navigation image of the ship to be identified;

[0031] The target recognition model is used to extract features from the ship navigation image to obtain feature maps at different levels; for the feature map at each level, by applying hole convolution and pooling operations under a set hole rate, the feature representation of the feature map is extracted in a multi-scale manner; upsampling and downsampling operations are used to fuse the feature representations at different levels to obtain fused features; based on the fused features, a convolution layer and a fully connected layer are used to predict the bounding box and category of the target.

[0032] Furthermore, the target recognition model includes a feature map extraction module, a dilated space convolution pooling pyramid, a feature fusion module, a target detection module and a loss function connected in sequence;

[0033] The feature map extraction module is used to extract features from the ship navigation image to obtain feature maps at different levels;

[0034] The atrous spatial convolution pooling pyramid is used to extract feature representations of the feature maps at each level in a multi-scale manner by applying atrous convolution and pooling operations under a set atrous rate;

[0035] The feature fusion module is used to fuse the feature representations at different levels by using upsampling and downsampling operations to obtain fused features;

[0036] The target detection module is used to predict the target bounding box and target category based on the fused features using a convolutional layer and a fully connected layer;

[0037] The loss function is used to calculate and optimize the difference between the target bounding box and the target category and the true label, and is used to optimize the parameters of the target recognition model.

[0038] Furthermore, the atrous spatial convolution pooling pyramid includes 1 convolution layer, 3 pooling pyramids and 1 ASPP pooling layer, wherein the convolution layer is connected to the 3 pooling pyramids respectively, and the 3 pooling pyramids are all connected to the ASPP pooling layer.

[0039] Furthermore, the device further comprises a feature optimization module, the feature optimization module having an input end and an output end, the input end is connected to the feature fusion module, and the output end is connected to the target detection module;

[0040] The feature optimization module is used to spatially divide the fusion feature according to a preset spatial division size to obtain multiple sub-feature maps; rearrange the pixels in each sub-feature map according to the channel order to form a new feature map; connect the feature maps of all the sub-feature maps together in a set order to obtain the final optimized fusion feature;

[0041] In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory;

[0042] The memory is used to store computer operation instructions;

[0043] The processor is used to execute the marine ship target identification method as described in any one of the first aspects by calling the computer operation instructions.

[0044] In a fourth aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement a method for identifying a marine ship target as described in any one of the first aspects.

[0045] Compared with the prior art, the method for identifying marine ship targets provided in the embodiment of the present application extracts feature maps at multiple levels from the ship navigation image. By applying dilated convolution and pooling operations to the feature maps at each level under a set dilated rate, the image feature extraction capability can be enhanced, richer and more representative features can be learned, and the feature expression capability at different scales and complex scenes can be effectively improved. Through the semantic features of multi-scale feature maps, information of different receptive field sizes can be captured, the detection capability of multi-scale targets can be improved, and the performance and robustness of target detection can be improved.

[0046] The marine ship target recognition device provided in the embodiment of the present application can improve the problem of low resolution of images and improve the accuracy of small target recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0048] Figure 1 This is a flow chart of a method for identifying a marine ship target provided in Example 1 of the present application;

[0049] Figure 2 This is a flow chart of a method for identifying a marine ship target provided in Embodiment 2 of the present application;

[0050] Figure 3 This is a rendering of the effect before the defogging step in the marine ship target recognition method provided by an embodiment of the present application;

[0051] Figure 4 This is a diagram showing the effect of the defogging step in the marine ship target recognition method provided by an embodiment of the present application;

[0052] Figure 5 This is a schematic diagram of the structure of a marine ship target identification device provided in Example 3 of the present application;

[0053] Figure 6 This is a schematic diagram of the structure of a marine ship target identification device provided in Example 4 of the present application;

[0054] Figure 7 This is a schematic diagram of the visible light recognition effect of the embodiment of the present application;

[0055] Figure 8 This is a schematic diagram of the infrared recognition effect of the embodiment of the present application;

[0056] Fig. 9 This is a schematic diagram of the structure of a marine ship target identification device provided by an embodiment of the present application;

[0057] Fig.10 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application;

[0058] Reference numerals:

[0059] 1-marine ship target recognition device, 10-image acquisition module, 20-target recognition model, 21-feature map extraction module, 22-void space convolution pooling pyramid, 23-feature fusion module, 24-target detection module, 25-loss function, 26-feature optimization module, 30-image defogging module, 40-image enhancement module, 2-electronic equipment, 210-processor, 220-memory, 230-bus, 240-communication module. DETAILED DESCRIPTION

[0060] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0061] There are various types and sizes of ships at sea, with different appearances, sizes, speeds and behavior patterns, which makes ship identification complex and difficult. In addition, when a ship is sailing at sea, the distance from which it is observed may be far, which can cause the ship details to be blurred or difficult to identify. Long-distance observation may also be affected by factors such as weather, sea conditions and atmospheric conditions, further increasing the challenge of ship identification.

[0062] Therefore, it is necessary to propose a method and device for identifying marine ship targets with higher recognition accuracy.

[0063] The method for identifying marine ship targets provided in the embodiment of the present application extracts feature maps at multiple levels from the ship navigation image. For the feature maps at each level, by applying hole convolution and pooling operations under the set hole rate, the feature extraction capability of the image can be enhanced, richer and more representative features can be learned, and the feature expression capability at different scales and complex scenes can be effectively improved. Through the semantic features of the multi-scale feature maps, information of different receptive field sizes can be captured, the detection capability of multi-scale targets can be improved, and the performance and robustness of target detection can be improved. In addition, in the embodiment of the present application, by spatially dividing the fused features according to the preset spatial division size, a plurality of sub-feature maps are obtained, and a new feature map is formed based on the sub-feature map, the complexity of the overall method can be reduced, and the memory usage and computational overhead can be reduced.

[0064] The marine ship target recognition device provided in the embodiment of the present application can improve the problem of low resolution of images and improve the accuracy of small target recognition.

[0065] The present application is further described below in conjunction with the accompanying drawings and specific embodiments.

[0066] Embodiment 1

[0067] like Figure 1 As shown, this embodiment provides a method for identifying a marine ship target, which can be applied to an electronic device. The method includes:

[0068] Step 101: Acquire a navigation image of a ship to be identified.

[0069] It is understandable that in a specific embodiment, a dual-spectrum (visible light / infrared) camera can be built and data collection can be completed. Optionally, the camera model is a Hikvision DS-2TD2667-25 dual-spectrum camera, in which the resolution of visible light is 2688×1520 and the resolution of infrared is 640×512. After determining the distance between the two cameras, they are mounted and fixed on a special aluminum profile bracket. The bracket is fixed to the fence in front of the cab on a tugboat, and as the tugboat enters the sea for operation, video data collection during the voyage is completed.

[0070] Step 102: extracting features from the ship navigation image to obtain feature maps at different levels.

[0071] In a specific embodiment, feature extraction of an image can be achieved through a convolutional neural network (CNN), in which a convolution operation is responsible for extracting features, such as a multi-layer convolutional neural network or a multi-scale convolutional neural network.

[0072] Step 103: For the feature map at each level, the feature representation of the feature map is extracted in a multi-scale manner by applying dilated convolution and pooling operations under a set dilation rate.

[0073] Step 104: Use upsampling and downsampling operations to fuse feature representations at different levels to obtain fused features. Downsampling can be used to extract higher-level semantic features, and upsampling can restore the spatial resolution of the feature map so that it can be fused with features at other levels. In a specific embodiment, each upsampled feature map is laterally connected to the corresponding downsampled feature map, and the laterally connected feature maps are fused by an element-by-element summation operation. In this way, a fused representation of feature maps at different scales can be obtained to provide a multi-level, multi-scale feature representation.

[0074] Step 105: Based on the fused features, the convolutional layer and the fully connected layer are used to predict the bounding box and category of the target.

[0075] In a specific example, a dilated spatial convolutional pooling pyramid 22 can be used to extract feature representations of feature maps on the layers in a multi-scale manner by applying dilated convolution and pooling operations at different dilation rates. Atrous Spatial Convolutional Pooling Pyramid 22 is ASPP, which stands for Atrous Spatial Pyramid Pooling, and can also be called dilated spatial pooling pyramid.

[0076] The embodiment of the present application can enhance the feature extraction capability of the image by applying dilated convolution and pooling operations at different dilation rates to the feature map, learn richer and more representative features, and effectively improve the feature expression capability at different scales and complex scenes. Through the semantic features of multi-scale feature maps, information of different receptive field sizes can be captured, and the detection capability of multi-scale targets can be improved, which can improve the performance and robustness of target detection, improve the problem of low-resolution images, and improve the accuracy of small target recognition.

[0077] Embodiment 2

[0078] This embodiment provides a method for identifying a marine ship target. Figure 2 As shown, including:

[0079] Step 201: Acquire a navigation image of a ship to be identified.

[0080] Step 202: extract features from the ship navigation image to obtain feature maps at different levels.

[0081] Step 203: For the feature map at each level, the feature representation of the feature map is extracted in a multi-scale manner by applying dilated convolution and pooling operations under a set dilation rate.

[0082] Step 204: Use upsampling and downsampling operations to fuse feature representations at different levels to obtain fused features.

[0083] Step 205: spatially divide the fused features according to a preset spatial division size to obtain multiple sub-feature maps; rearrange the pixels in each sub-feature map according to the channel order to form a new feature map; connect the feature maps of all sub-feature maps together in a set order to obtain the final optimized fused features.

[0084] Step 206: Based on the final optimized fusion features, the convolutional layer and the fully connected layer are used to predict the bounding box and category of the target.

[0085] This embodiment spatially divides the fused features according to a preset spatial division size to obtain multiple sub-feature maps, and forms a new feature map based on the sub-feature maps, which can reduce the complexity of the overall method, reduce memory usage and computational overhead.

[0086] In some embodiments, the target recognition model 20 may be used to implement steps 102 to 105 or steps 201 to 206. The target recognition model 20 is specifically described in the following embodiment.

[0087] In addition to using the camera to obtain the navigation image of the ship to be identified, steps 102 to 105 or steps 201 to 206 in this example can be implemented using the NVIDIA Jetson AGX Orin 32GB development kit. As an edge computing module, the NVIDIA Jetson AGX Orin 32GB has an AI computing capability of up to 275TOPS, which can effectively meet the model computing and application development requirements of this example.

[0088] On the basis of the first or second embodiment, the marine ship target recognition method provided in other embodiments further includes a defogging step, that is, performing defogging processing based on the ship navigation image.

[0089] In a specific embodiment, a dark channel algorithm process can be used. First, the dark channel of the original foggy image is calculated. According to the ascending order of the pixel values ​​in the dark channel, the atmospheric light component A is calculated. Then, the transmittance t of each pixel is calculated. The fog-free image is obtained according to the atmospheric light component A and the transmittance t. The dark channel algorithm parameters under sea fog conditions are tested. The main test parameters are the dark channel minimum filter radius r and the guided median filter radius R.

[0090] In some examples, in order to save computing resources and increase computing speed, the defogging step is set to be optional, which is not enabled in weather conditions with good visibility, but enabled in conditions of heavy fog. Therefore, a judgment module is set to decide whether to perform defogging.

[0091] In some examples, before performing defogging processing based on the ship navigation image, the process includes: enhancing the brightness and darkness variation amplitude of the edge portion of the ship navigation image to obtain an enhanced ship navigation image.

[0092] In the specific example, the USM sharpening enhancement algorithm is used for preprocessing. The USM sharpening enhancement algorithm generates a blurred image after low-pass filtering the original image. The original image is subtracted from the blurred image to obtain an image that retains high-frequency components. The high-frequency image is then amplified by a parameter and superimposed with the original image to obtain an enhanced image.

[0093] USM is a sharpening algorithm that mainly improves the visual effect by enhancing the brightness and darkness changes of the edge part of the image. Assuming that the original image is I, the Gaussian blurred image is G, and the sharpened image is D, the sharpening formula is:

[0094]

[0095] Where ω represents the weight, and its value range is 0.1 to 0.9, and the usual value is ω=0.6.

[0096] After obtaining the dark channel image, use guided filtering optimization to adjust the defogging effect by adjusting the dark channel minimum filter radius. The optimal parameters obtained in this example test are the dark channel minimum filter radius r = 4 and the mean filter radius R = 32 in the guided filter. The effect after defogging can be seen in Figure 3 and Figure 4 .

[0097] Embodiment 3

[0098] This embodiment provides a marine ship target identification device 1, such as Figure 5 As shown, the device comprises:

[0099] An image acquisition module 10 is used to acquire a navigation image of a ship to be identified;

[0100] The target recognition model 20 is used to extract features from each image block to obtain a feature map of each image block; for each feature map, the semantic features of the feature map are extracted in a multi-scale manner by applying dilated convolution and pooling operations at different dilation rates; upsampling and downsampling operations are used to fuse semantic features of different levels to obtain fused features; based on the fused features, the convolution layer and the fully connected layer are used to predict the bounding box and category of the target.

[0101] The target recognition model 20 used in the marine ship target recognition device 1 provided in the embodiment of the present application can improve the problems of low resolution and small target recognition.

[0102] In some embodiments, Figure 5 As shown, the target recognition model 20 includes a feature map extraction module 21, a dilated spatial convolution pooling pyramid 22, a feature fusion module 23, a target detection module 24 and a loss function 25 which are connected in sequence.

[0103] The feature map extraction module 21 is used to extract the feature representation of the feature map at each level in a multi-scale manner by applying hole convolution and pooling operations under a set hole rate. The feature fusion module 23 is used to fuse the feature representations of different levels using upsampling and downsampling operations to obtain fused features. The target detection module 24 is used to predict the target bounding box and target category based on the fused features using convolution layers and fully connected layers. The loss function 25 is used to calculate and optimize the difference between the target bounding box and target category and the true label, and is used to optimize the parameters of the target recognition model 20.

[0104] In some embodiments, the target recognition model 20 is an improved YOLOv7 network structure, and the backbone network feature map extraction module 21 in the prior art YOLOv7 network structure is used to extract features from the ship navigation image to obtain feature maps at different levels. YOLOv7 uses Darknet-53 as its backbone network. Darknet-53 is a 53-layer convolutional neural network used to extract features from input images.

[0105] The feature fusion module 23 is implemented using the neck network of the existing YOLOv7 network structure. YOLOv7 introduces a neck network called PANet (Path Aggregation Network) for fusing feature maps of different scales. PANet fuses feature maps of different levels through upsampling and downsampling operations to detect objects at different scales.

[0106] The target detection module 24 is implemented using the head network of the prior art YOLOv7 network structure. The head network of YOLOv7 is responsible for predicting the bounding box and category of the target. It consists of a series of convolutional layers and fully connected layers, and finally outputs the predicted bounding box coordinates and category probability.

[0107] YOLOv7 uses a loss function called YOLOv3 Loss 25 to train the network. This loss function 25 includes target box regression loss, target category loss, and target confidence loss, which are used to optimize network parameters.

[0108] In this embodiment, a dilated spatial convolution pooling pyramid 22 (ASPP module) is added to the backbone network in the improved YOLOV7 network structure. The dilated spatial convolution pooling pyramid includes a convolution layer (1×1), 3 pooling pyramids and 1 ASPP pooling layer. The difference between dilated convolution and general convolution Conv lies in the dilation rate. ASPP obtains feature maps of four scales after four dilated convolutions on the input feature map, thereby obtaining multi-scale information of the input image. The four dilated convolutions are: (1,1), (3,1, padding=6, dilation=6), (3,1, padding=12, dilation=12), (3,1, padding=18, dilation=18), so the ASPP module can effectively expand the receptive field of the convolutional neural network, where padding is a padding parameter used to control the padding method of the convolution operation.

[0109] Add a dilated spatial convolutional pooling pyramid 22 after the backbone network ELAN module. The feature map input to the dilated spatial convolutional pooling pyramid 22 is 20×20×1024. After the dilated spatial convolutional pooling pyramid 22 extracts and merges the features, all the features are cascaded through a 1×1 convolution layer and output to the head network SPPCSPC module. Compared with before the modification, the difference is that after the feature map passes through the dilated spatial convolutional pooling pyramid 22, the multi-scale information is significantly enhanced.

[0110] Embodiment 4

[0111] like Figure 6 In the present embodiment, the marine ship target recognition device 1 further includes a feature optimization module 26 having an input end and an output end, wherein the input end is connected to the feature fusion module 23, and the output end is connected to the target detection module 24. The feature optimization module 26 is used to spatially divide the fusion feature according to a preset spatial division size to obtain a plurality of sub-feature maps; rearrange the pixels in each sub-feature map according to the channel order to form a new feature map; and connect the feature maps of all the sub-feature maps together in a set order to obtain the final optimized fusion feature.

[0112] In this embodiment, the SPD-Conv module is used to implement the feature optimization module 26. The SPD-Conv module is a non-stride convolution connected after the SPD. For the feature map (S×S×c1), the sub-feature maps are downsampled according to a scale factor of 2. Four sub-feature maps (S / 2×S / 2×c1) are obtained by slicing in the SPD part, and the self-features are connected along the channel latitude to obtain the feature map (S / 2×S / 2×4c1). In order to retain more feature information, a non-stride convolution layer (i.e., stride=1) is used immediately afterwards. Placing the SPD-Conv module before the head network detection head can reduce excessive downsampling to a certain extent and better retain the detail information of low-resolution and small objects.

[0113] Add the SPD-Conv module before the RepConv module of the head network, after the last ELAN-W module cascade, and before the YOLO detection head to enhance the detection capabilities of low-resolution and small objects.

[0114] The YOLOv7 network structure is improved by adding an ASPP module (Atrous Spatial Pyramid Pooling) to its backbone network. The ASPP module can expand the receptive field without losing resolution and optimize the feature extraction function of the original backbone network. Considering the need to further improve the recognition effect of infrared cameras, this method also adds an SPD-Conv module (SpaceTo Depth) to the head network to further enhance low-resolution and small target recognition. SPD-Conv consists of a space-to-depth (SPD) layer and a convolution-free stride (Conv) layer. The role of the space-to-depth (SPD) layer is to reduce each spatial dimension of the input feature map to the channel dimension while retaining the information within the channel. This can be achieved by mapping each pixel or feature of the input feature map to a channel. In this process, the size of the spatial dimension is reduced, while the size of the channel dimension is increased. The non-stride convolution (Conv) layer is a standard convolution operation that is performed after the SPD layer. Unlike strided convolution, non-strided convolution does not move across the feature map, but performs convolution operations on each pixel or feature map. This helps reduce the over-downsampling problem that may occur in the SPD layer and retains more fine-grained information.

[0115] The SPD-Conv combination is to connect the SPD layer and the Conv layer in series. Specifically, the input feature map is first converted through the SPD layer, and then the output result is convolved through the Conv layer. This combination can reduce the size of the spatial dimension without losing information while retaining the information within the channel, which helps improve the detection performance of CNN for low-resolution images and small objects.

[0116] The embodiment of the present application is based on the actual difficulties in identifying marine ship targets, and proposes an improved YOLOv7 network structure to implement the target recognition model 20. It innovatively combines the SPD-Conv module and the ASPP module, which has the advantage of down-sampling feature maps while retaining the discriminant feature information, and ASPP helps to capture image context information at multiple scales, further improving the recognition accuracy. The improved network structure is applicable to both visible light and infrared recognition models. Compared with the network structure before modification, it can improve the accuracy of visible light and infrared recognition models respectively, and has a certain degree of universality.

[0117] In a specific example, implementing the above improved YOLOV7 network structure includes the following implementation steps:

[0118] (1) First build the new module in common.py.

[0119] (2) Register the new module in YOLO.py (i.e., register the dilated spatial convolutional pooling pyramid 22ASPP and SPD-Conv modules). Modify the original network structure configuration file YOLOv7.yaml and rename it to YOLOv7-custom.yaml.

[0120] The common.py file in the YOLOv5 source code. The common.py file contains common functions and classes of the YOLOv5 network structure.

[0121] YOLO.py is a common file that implements the main logic of the YOLO algorithm. This file usually contains the definition of the YOLO model, the calculation of the loss function 25, and the core functions such as forward propagation and backward propagation.

[0122] A common YOLO.py file usually covers the following functions:

[0123] Model definition: YOLO.py defines the structure of the YOLO model, including modules such as feature extraction backbone network, feature pyramid, prediction head (bounding box regression, category prediction, etc.). These modules are usually defined in the form of functions or classes and provide forward propagation methods.

[0124] Calculation of loss function 25: YOLO.py may contain code for calculating YOLO's loss function 25. Loss function 25 is used to measure the gap between the model prediction and the true label, usually including bounding box regression loss, category loss, and target existence loss.

[0125] Forward propagation: YOLO.py implements the forward propagation algorithm of the YOLO model, which passes the input image through the model to obtain the predicted bounding box, category confidence and other outputs. This includes the process of image preprocessing, feature extraction, feature fusion and prediction.

[0126] Backpropagation: YOLO.py may include an algorithm for updating model parameters by calculating the gradient of the loss function 25 and using gradient descent or other optimization methods to update the model parameters to improve the performance and accuracy of the model.

[0127] (3) Add ASPP and SPD-Conv layers in YOLOv7-custom.yaml, and finally use the new network structure in the training script train.py.

[0128] To add the ASPP module to the backbone network, the first step is to modify the common.py file and add the ASPP class to it. The second step is to modify the YOLO.py file and add the ASPP module to the parse_model method. The third step is to modify the YOLOv7.yaml file to YOLOv7-custom.yaml and add ASPP after the ELAN module in the backbone network.

[0129] To add the SPD-Conv module to the head network, the first step is to modify the common.py file and add a new SPD-Conv class to it. The second step is to modify the YOLO.py file and add the SPD-Conv module to the parse_model method. The third step is to continue to modify the YOLOv7-custom.yaml and add SPD-Conv after the last ELAN-W module cascade.

[0130] In actual application examples, it is necessary to pre-train the target recognition model 20. In the train.py, the model.yaml file is specified as YOLOv7-custom.yaml, and the network structure constructed by this method can be used for training.

[0131] Training data sets can be constructed based on real ship collection data and public data sets.

[0132] Optionally, based on the visible light video data, combined with other public data sets, a visible light image data set for ship target recognition is constructed. Based on the infrared video data, combined with other public data sets (such as the AIRI public data set), an infrared image data set for ship target recognition is constructed.

[0133] It is understandable that the target recognition model 20 is trained using the visible light image data set, and the training is stopped when the model accuracy meets the requirements to obtain the visible light ship target recognition model 20. The obtained visible light ship target recognition model 20 can perform ship target recognition based on the visible light image data.

[0134] The target recognition model 20 is trained using the infrared image data set. When the model accuracy meets the requirements, the training is stopped to obtain the infrared ship target recognition model 20. The infrared ship target recognition model 20 can perform ship target recognition based on the image data set at night.

[0135] When using manual labeling methods for data labeling, it is important to note that when screening the training data set, it is necessary to balance the proportion of various types of original data in the data set to avoid too many large or small targets in the training data to ensure the balance of the training samples.

[0136] As an example, the target recognition model 20 may include a visible light ship target recognition model 20 and an infrared ship target recognition model 20, both of which have the same network structure, such as the target recognition model 20 introduced above, but have different training data sets.

[0137] The visible light ship target recognition data set is used to train the visible light ship target recognition model 20, and the visible light ship target recognition model 20 adopts the target recognition model 20 introduced in the above embodiment. The convergence curve of the target recognition model 20 (improved YOLOv7 network structure) is shown in Table 1 below, and the average recognition accuracy is 0.982. Under the same conditions, if the YOLOv7 network structure of the prior art is used for training, the average recognition accuracy is 0.976. It can be seen that the target recognition model 20 provided in the embodiment of the present application can effectively improve the recognition accuracy of visible light ships.

[0138] Table 1 shows the experimental comparison results of the improved YOLOv7 network structure and the existing YOLOv7 network structure trained with the visible light dataset.

[0139] Table 1

[0140]

[0141] Similarly, the infrared ship target recognition model 20 is trained using the ship target recognition infrared data set, and the infrared ship target recognition model 20 adopts the target recognition model 20 introduced in the above embodiment. Its model convergence curve is shown in Table 2 below, and the average recognition accuracy is 0.920. Under the same conditions, if the YOLOv7 network structure of the prior art is used for training, the average recognition accuracy is 0.911. It can be seen that the target recognition model 20 provided in the embodiment of the present application can effectively improve the infrared ship recognition accuracy.

[0142] Table 2 shows the experimental comparison results of the improved YOLOv7 network structure and the existing YOLOv7 network structure trained with the infrared dataset.

[0143] Table 2

[0144]

[0145] In some embodiments, a day and night judgment module (not shown in the figure) can be added to the target recognition device. To simplify the calculation, the calculation logic of the day and night judgment module is determined by a statistical method. First, according to the video shot by the visible light camera, a data set containing 2000 pictures is created respectively, one of which is a set of pictures taken by the visible light camera during the day, and the other is a set of pictures taken by the visible light camera at night. The pictures of the two data sets are batch processed using the Pillow library. For a single picture, its r, g, and b channels are taken out separately to calculate their average values, and finally added and divided by 3 to obtain the average rgb value of the picture. After all the daytime picture sets are calculated, the average rgb value Rd of the daytime is obtained. Similarly, the same method is used for the night pictures to obtain the average rgb value Rn of the night, and the judgment standard (i.e., the preset value) Rz=(Rd+Rn) / 2 is set accordingly. In actual application, the average rgb value Rl of the collected visible light image is first calculated. When Rl>Rz, it is determined to be daytime, otherwise it is night.

[0146] According to the above judgment results, the visible light ship target recognition model 20 is called to perform real-time video detection and target recognition under daytime conditions. If it is judged to be night, the infrared ship target recognition model 20 is called to perform real-time video detection and target recognition. The detection result is to mark the recognition box in the video. The visible light and infrared recognition effects are shown in Figure 7 and Figure 8 .

[0147] The specific embodiment of the present application sets up day and night judgment modules, and calls the visible light ship target recognition model 20 to perform real-time video detection and target recognition during the day, and frames the detected ship in the real-time video. At night, the infrared ship target recognition model 20 is called to perform real-time video detection and target recognition, and frames the detected ship in the real-time video. In the embodiment of the present application, a dual-spectrum camera can be used to perform scene perception during real ship navigation, and the ship target recognition modules for day and night conditions are trained based on visible light and infrared videos, respectively, to achieve all-day target detection tasks and improve the efficiency of ship target recognition.

[0148] In some embodiments, Fig. 9 As shown, the marine ship target recognition device 1 also includes an image enhancement module 40, which is used to perform preprocessing using the USM sharpening enhancement algorithm. The USM generates a blurred image after low-pass filtering the original image, and the original image is subtracted from the blurred image to obtain an image retaining high-frequency components. The high-frequency image is then amplified by a parameter and superimposed with the original image to obtain an enhanced image.

[0149] In some embodiments, the marine ship target recognition device 1 further includes an image defogging module 30. The image defogging module 30 first calculates the dark channel of the original foggy image according to the dark channel algorithm process, calculates the atmospheric light component A according to the ascending order of the pixel values ​​in the channel, then calculates the transmittance t of each pixel, and obtains the fog-free image according to the atmospheric light component A and the transmittance t. The dark channel algorithm parameters under sea fog conditions are tested, and the main test parameters are the dark channel minimum filter radius r and the guided median filter radius R.

[0150] Optionally, in order to save computing resources and improve computing speed, the defogging module is set to be optional, which is not turned on under meteorological conditions with good visibility, and is turned on under heavy fog. Therefore, a judgment module is set to decide whether to perform defogging processing.

[0151] It should be noted that the functions of each functional module of the marine ship target identification device 1 in the embodiment of the present application can be specifically implemented according to the method in the above method embodiment, and its specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0152] In the embodiment of the present application, an image defogging module 30 is constructed, and the dark channel defogging method is combined with the USM (Unsharpen Mask) sharpening enhancement algorithm to provide a dark channel defogging method that is more suitable for sea fog conditions. Since sea fog involves a situation where the sky and sea water have a high similarity, directly using the dark channel defogging algorithm may fail in large areas of low-contrast sky, and may cause problems such as block effects in the distant sky. Therefore, this method proposes to use the USM sharpening enhancement algorithm first under sea fog conditions to remove interfering details and noise, sharpen edge features, and improve sea-sky line isolation. This method has a natural degree of sharpening and basically has no adverse effect on the subsequent dark channel algorithm. As a pre-data processing module of the target detection algorithm, the image defogging module 30 is set as an optional function and is enabled when the sea fog is large, which can further improve the recognition accuracy.

[0153] As an example, Fig.10 FIG. 4 shows a schematic diagram of the structure of an electronic device 2 to which the solution of an embodiment of the present invention is applicable. Fig.10 As shown in , the electronic device 2 may include a processor 210 and a memory 220. The processor 210 and the memory 220 are connected, such as through a bus 230. The processor 210 is used to execute the marine ship target recognition method shown in any of the above method embodiments by calling the computer operation instructions.

[0154] Optionally, the electronic device 2 may further include a communication module 240. It should be noted that in actual applications, the number of communication modules 240 is not limited to one, and the structure of the electronic device 2 does not constitute a limitation on the embodiment of the present invention.

[0155] Note that references in the specification to "one embodiment," "an embodiment," "an example embodiment," "some embodiments," etc. indicate that the described embodiments may include a particular feature, structure, or characteristic, but each embodiment may not necessarily include the particular feature, structure, or characteristic. Moreover, such phrases do not necessarily refer to the same embodiment. In addition, when a particular feature, structure, or characteristic is described in conjunction with an embodiment, whether or not explicitly described, it would be within the knowledge of a person skilled in the art to implement such feature, structure, or characteristic in conjunction with other embodiments.

[0156] The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be apparent to those skilled in the art, and the general principles defined herein may be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein, but should be granted the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for identifying marine ship targets. It is characterized in that include: Acquire a navigation image of a ship to be identified; Extracting features from the ship navigation image to obtain feature maps at different levels; For the feature map at each level, extracting feature representation of the feature map in a multi-scale manner by applying dilated convolution and pooling operations under a set dilated rate; Using upsampling and downsampling operations to fuse the feature representations at different levels to obtain fused features; The fused feature is spatially divided according to a preset spatial division size to obtain a plurality of sub-feature maps; the pixels in each of the sub-feature maps are rearranged according to the channel order to form a new feature map; Connecting all the feature maps of the sub-feature maps together in a set order to obtain the final optimized fusion feature; Based on the finally optimized fusion features, convolutional layers and fully connected layers are used to predict the bounding box and category of the target.

2. The method for identifying a marine vessel target according to claim 1, It is characterized in that The method further includes: performing defogging processing based on the ship navigation image.

3. The method for identifying marine ship targets according to claim 2, It is characterized in that Defogging is performed based on the ship navigation image, which includes: The brightness and darkness variation amplitude of the edge portion of the ship navigation image is enhanced to obtain the enhanced ship navigation image.

4. The method for identifying a marine vessel target according to claim 1, It is characterized in that Feature extraction is performed on the ship navigation image to obtain feature maps at different levels. For the feature map at each level, feature representation of the feature map is extracted in a multi-scale manner by applying hole convolution and pooling operations under a set hole rate, and the feature representations at different levels are fused by upsampling and downsampling operations to obtain fused features. Based on the fused features, the bounding box and category of the target are predicted by using a convolution layer and a fully connected layer, which is realized by a target recognition model; The target recognition model is trained using the following method: Obtaining a visible light ship navigation image training set and an infrared ship navigation image training set respectively, wherein the visible light ship navigation image training set and the infrared ship navigation image training set are both marked with target categories; Based on the visible light ship navigation image training set, the target recognition model is trained until the loss function of the target recognition model converges, thereby obtaining a visible light ship target recognition model, so as to call the visible light ship target recognition model to perform marine ship target recognition under daytime conditions; Based on the infrared ship navigation image training set, the target recognition model is trained until the loss function of the target recognition model converges, and an infrared ship target recognition model is obtained, so as to call the infrared ship target recognition model to perform marine ship target recognition under night conditions.

5. The method for identifying marine ship targets according to claim 4, It is characterized in that The method further includes determining whether the current condition is daytime or nighttime, and then determining to select the visible light ship target recognition model or the infrared ship target recognition model for marine ship target recognition; Determine whether the current condition is daytime or nighttime, including: For the ship navigation image to be identified, the r channel, the g channel, and the b channel are separately taken out, and the average value of each channel is calculated respectively; The average RGB value of the ship navigation image is obtained by adding the average values ​​of the three channels and dividing by 3; The average RGB value is compared with a preset value to determine whether it is day or night.

6. A marine ship target identification device, It is characterized in that The device comprises: An image acquisition module, used to acquire the navigation image of the ship to be identified; The target recognition model is used to extract features from the ship navigation image to obtain feature maps at different levels; for the feature map at each level, by applying dilated convolution and pooling operations under a set dilated rate, feature representations of the feature map are extracted in a multi-scale manner; and upsampling and downsampling operations are used to fuse the feature representations at different levels to obtain fused features; The feature optimization module is used to spatially divide the fusion feature according to a preset spatial division size to obtain multiple sub-feature maps; rearrange the pixels in each sub-feature map according to the channel order to form a new feature map; connect the feature maps of all the sub-feature maps together in a set order to obtain the final optimized fusion feature; The target recognition model is used to predict the bounding box and category of the target based on the finally optimized fusion features using convolutional layers and fully connected layers.

7. The marine vessel target identification device according to claim 6, It is characterized in that The target recognition model includes a feature map extraction module, a dilated spatial convolutional pooling pyramid, a feature fusion module, a target detection module and a loss function connected in sequence; The feature map extraction module is used to extract features from the ship navigation image to obtain feature maps at different levels; The atrous spatial convolution pooling pyramid is used to extract feature representations of the feature maps at each level in a multi-scale manner by applying atrous convolution and pooling operations under a set atrous rate; The feature fusion module is used to fuse the feature representations at different levels by using upsampling and downsampling operations to obtain fused features; The target detection module is used to predict the target bounding box and target category based on the fused features using a convolutional layer and a fully connected layer; The loss function is used to calculate and optimize the difference between the target bounding box and the target category and the true label, and is used to optimize the parameters of the target recognition model.

8. The marine vessel target identification device according to claim 7, It is characterized in that The atrous spatial convolution pooling pyramid includes one convolution layer, three pooling pyramids and one ASPP pooling layer, wherein the convolution layer is connected to the three pooling pyramids respectively, and the three pooling pyramids are all connected to the ASPP pooling layer.

9. The marine vessel target identification device according to claim 7, It is characterized in that The feature optimization module has an input end and an output end, the input end is connected to the feature fusion module, and the output end is connected to the target detection module.

10. An electronic device, It is characterized in that include: Processor and memory; The memory is used to store computer operation instructions; The processor is used to execute the marine ship target identification method according to any one of claims 1 to 5 by calling the computer operation instructions.

11. A computer readable medium, It is characterized in that A computer program is stored thereon, and the computer program can be executed by a processor to implement the marine ship target identification method as described in any one of claims 1-5.