Visible light ship detection method and device based on multi-granularity feature enhancement, and medium

The sea fog image is defogged through multi-particle feature enhancement method and three-branch decision algorithm, combined with multi-particle detection head and super-resolution reconstruction network, the ship detection accuracy and speed problems under the influence of sea fog are solved, and more efficient detection effect.

CN119091150APending Publication Date: 2024-12-06TONGJI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411134366.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The prior art fails to fully consider the sea fog problem in ship detection, which makes it difficult to balance detection accuracy and speed, especially when small target detection has limitations.

Method used

The visible light ship detection method based on multi-particle size feature enhancement is adopted to defog the image through the automatic classification algorithm of sea fog degree of three decisions, and the multi-particle size detection head and super-resolution reconstruction convolutional subnet are used to extract ships of different particle sizes. Features, enabling fast and accurate detection.

Benefits of technology

It improves the accuracy and speed of ship detection, enhances the network's perception of subtle features, adapts to the needs of multi-scale ship detection, and reduces the rate of false detection and missed detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119091150A_ABST
    Figure CN119091150A_ABST
Patent Text Reader

Abstract

The invention relates to a visible light ship detection method and device based on multi-granularity feature enhancement, and a medium. The method comprises the following steps: S1, obtaining a to-be-detected visible light ship image; s2, for the visible light ship image, dividing the visible light ship image into a foggy image or a fogless image through a visible light image sea fog degree automatic classification algorithm based on three-way decision; s3, if the visible light ship image is divided into foggy images, performing accurate defogging processing on the visible light ship image; and S4, inputting all fog-free visible light ship images into a pre-trained multi-granularity feature enhancement network, extracting ship features of different granularities, and realizing visible light ship detection. Compared with the prior art, a three-way decision theory is introduced, a multi-granularity thought is fused, and a discriminative network structure is designed. Even if visible light ship detection is affected by sea fog and multi-scale ships, the method can still keep good universality and robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a visible light ship detection method, equipment and medium based on multi-granularity feature enhancement. Background Art

[0002] With the rapid development of economy, the demand for inland waterway shipping and ocean shipping is increasing. Ensuring shipping safety has become one of the important research contents in the field of modern shipping research. Ship object detection can not only greatly reduce the probability of collision accidents during navigation, ensure the safety of navigation and transportation, but also help to timely detect objects that enter illegally and operate illegally.

[0003] In the field of marine ship detection in the ocean background, various detection methods are constantly emerging. Among them, visible light images have attracted much attention due to their high resolution and rich texture information, and have become an important data source widely discussed and adopted by researchers. However, these images are easily affected by sea fog and multi-scale ships, resulting in missed detections and false detections, thereby reducing the detection accuracy. Therefore, how to achieve accurate ship detection in visible light images has become a challenging research topic.

[0004] Ship detection in visible light images is a typical target detection task that can be accomplished using traditional image processing or deep learning algorithms. Traditional marine ship detection methods, such as HOG, SIFT, and LBP, usually use hand-designed features combined with traditional classifiers. However, these methods not only have slow detection speeds, but also poor detection results. In recent years, technologies based on Convolutional Neural Networks (CNNs) have gradually replaced traditional methods and become a research hotspot. Some CNN-based marine ship detection methods use single-stage detectors to achieve fast and accurate detection. However, these methods have limitations in detecting small targets. In addition, some methods use two-stage detectors that are more effective for small targets, but have slower detection speeds.

[0005] Although these methods have improved the detection performance of ships of different scales to a certain extent, they have not fully considered the sea fog problem in ship detection. Given the unique characteristics of visible light ship data, including factors such as sea fog and multi-scale ships, it is urgent to design a general robust network structure that can improve detection performance while maintaining high-speed detection and achieve a balance between speed and accuracy to meet the high demand for ship detection. Summary of the invention

[0006] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and to provide a visible light ship detection method, equipment and medium based on multi-granularity feature enhancement, so as to solve or partially solve the problem of sea fog existing in ship detection that is not fully considered.

[0007] The purpose of the present invention can be achieved by the following technical solutions:

[0008] One aspect of the present invention provides a visible light ship detection method based on multi-granularity feature enhancement, comprising the following steps:

[0009] Step S1, obtaining a visible light ship image to be detected;

[0010] Step S2, for the visible light ship image, classifying the visible light ship image into a foggy image or a fog-free image by using a visible light image sea fog degree automatic classification algorithm based on three decisions;

[0011] Step S3, if the visible light ship image is classified as a foggy image, performing a defogging process on the visible light ship image;

[0012] Step S4, input all fog-free visible light ship images into a pre-trained multi-granularity feature enhancement network to extract ship features of different granularities to achieve visible light ship detection.

[0013] As a preferred technical solution, step S4 includes the following sub-steps:

[0014] Step S401, input all fog-free visible light ship images into the backbone sub-network with the detection head to obtain multiple feature maps of different scales;

[0015] Step S402, using multiple feature maps of different scales as inputs of a super-resolution reconstruction convolutional subnetwork to obtain a reconstructed feature map;

[0016] Step S403: using a multi-granularity detection head to extract ship features of different granularities, and obtain visible light ship detection results.

[0017] As a preferred technical solution, the backbone subnetwork with a detection head is an ELANet-1 network including a YOLOv7 detection head.

[0018] As a preferred technical solution, step S402 includes the following sub-steps:

[0019] Step S4021, based on the feature maps of multiple different scales, obtaining low-resolution feature maps of different scales by feature extraction;

[0020] Step S4022, based on the low-resolution feature maps of different scales, obtaining high-resolution feature maps of different scales through nonlinear mapping;

[0021] Step S4023, based on the high-resolution feature maps of different scales, obtain a reconstructed feature map by reconstruction mapping.

[0022] As a preferred technical solution, the super-resolution reconstruction convolutional subnetwork is pre-trained based on coordinate loss, target confidence loss and classification loss.

[0023] As a preferred technical solution, the step S2 comprises the following steps:

[0024] Step S201, obtaining multiple visible light ship images i j And calculate the corresponding entropy function value e(i j ) and the Laplace gradient function value l(i j ), construct the entropy function value sample set E and the Laplace gradient sample set L, and randomly select k samples from E as the initial mean vector μ m , where 1≤m≤k;

[0025] Step S202, initializing the cluster And calculate the sample e(i j ) and each mean vector μ m The distance between jm ;

[0026] Step S203, determine e(i j )’s cluster label λ j ;

[0027] Step S204: calculate the distance sample e(i j ) are assigned to the corresponding cluster

[0028] Step S205, update the mean vector μ' m ;

[0029] Step S206, repeat steps S202-S205 until the mean vector μ' before and after the update is m constant;

[0030] Step S207: dividing the multiple visible light ship images into foggy images and fog-free images based on the three-branch decision theory.

[0031] As a preferred technical solution, step S207 includes the following sub-steps:

[0032] Step S2071, using the entropy function value sample set E and the Laplace gradient sample set L, dividing the multiple visible light ship images into foggy images, fog-free images and uncertain images;

[0033] Step S2072, calculating the thresholds of the foggy image and the fog-free image;

[0034] Step S2073: Classify the uncertain image into a foggy image or a non-fog image by calculating the Euclidean distance between the uncertain image and the threshold.

[0035] As a preferred technical solution, step S2073 is implemented using the following formula:

[0036]

[0037] Among them, α and β are the thresholds of foggy images and non-fog images respectively, and C u represents a set of uncertain images, l(i j ) represents image i j The Laplace gradient function value, e(i j ) represents image i j The entropy function value of is the uncertain image C u and the Euclidean distance between α and β, B represents the distance between the uncertain image and the foggy image using the values ​​of the Laplace gradient function and the entropy function, and D represents the distance between the uncertain image and the fog-free image using the values ​​of the Laplace gradient function and the entropy function. If B>D, then image i j Assigned to the cluster of the haze-free image, otherwise image i j Clusters assigned to foggy images.

[0038] Another aspect of the present invention provides an electronic device, comprising: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the aforementioned visible light ship detection method based on multi-granularity feature enhancement.

[0039] Another aspect of the present invention provides a computer-readable storage medium comprising one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the aforementioned visible light ship detection method based on multi-granularity feature enhancement.

[0040] Compared with the prior art, the present invention has at least one of the following beneficial effects:

[0041] (1) Taking full account of the problem of sea fog in ship detection: Taking into account the influence of sea fog on the clarity of visible light ship images, the existing defogging algorithms usually directly process all visible light images including fog-free images, which may lead to over-defog, thereby reducing the contrast and details of fog-free images. The present invention performs image enhancement on the region of interest before performing ship detection, and realizes accurate defogging of foggy images through an automatic classification algorithm of the sea fog degree of visible light images based on three-branch decision, thereby further improving the accuracy of ship detection.

[0042] (2) Enhancing the network’s ability to perceive subtle features: Considering that not all discriminative features of visible light ship images can be directly obtained through the backbone network, the present invention applies a multi-granularity feature enhancement module that simulates the human visual system to the three different scale feature maps output by the detection head. By reconstructing the low-resolution feature map into a high-resolution feature map, more details and information are restored, thereby improving the clarity and details of the feature map and enhancing the network’s ability to perceive subtle features. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 Flow chart of the visible light ship detection method based on multi-granularity feature enhancement in the embodiment. DETAILED DESCRIPTION

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

[0045] Example 1

[0046] In view of the problem that the existing methods ignore excessive defogging, resulting in reduced contrast and details of fog-free images, and the limitation that the single granularity feature extraction method cannot effectively capture feature information of different scales, this embodiment provides a visible light ship detection method based on multi-granularity feature enhancement, which provides a multi-granularity feature enhancement network MFE-Net (Multi-granularity Feature Enhancement Network) for visible light ship detection, which can accurately locate and identify all ships of various scales under the background of sea fog. This method can accurately identify and locate all ships in any given visible light ship image to be detected using advanced deep learning ship algorithms.

[0047] This method mainly consists of three parts:

[0048] Image enhancement in the region of interest, corresponding to steps S2-S3, is intended to simulate the way humans make decisions in different situations, and to achieve accurate image defogging, thereby improving the clarity of the image and significantly improving the accuracy of ship detection. Considering the impact of sea fog on the clarity of visible light ship images, this embodiment needs to perform region of interest (ROI) image enhancement on the image before ship detection, so as to obtain the foggy image to be processed using the automatic classification algorithm of the image sea fog degree. Specifically, this embodiment uses three-way decisions (3WDs) for image sea fog degree classification. Simulate human thinking to solve problems. First, determine the acceptance domain and rejection domain. Then, study uncertainty. Finally, convert the objects in the uncertainty domain into acceptance domain and rejection domain to reduce their uncertainty. Therefore, by using three-way decisions to classify the image sea fog degree, accurate defogging of foggy images can be achieved, thereby further improving the accuracy of ship detection.

[0049] The backbone network, corresponding to step S4, uses the lightweight network ELANet-1, including ELAN and MP-1 structures. The ELAN and MP-1 structures are designed to improve feature extraction efficiency and representation capabilities. ELAN introduces a lightweight attention mechanism to help better capture important feature information in the image, while the MP-1 structure improves feature diversity and expression capabilities by modifying the point convolution layer.

[0050] The multi-granularity detection head, corresponding to step S4, learns the mapping relationship between feature maps on different granularity layers through an improved super-resolution convolutional neural network, successfully reconstructs and enhances the detailed information of the feature map to obtain richer and more accurate ship features of different granularities, thereby enhancing the performance of the model. This embodiment applies a multi-granularity feature enhancement module that simulates the human visual system to the three different scale feature maps output by the detection head, and restores more details and information by reconstructing low-resolution feature maps into high-resolution feature maps, thereby improving the clarity and details of the feature maps and enhancing the network's perception of subtle features. Specifically, the following article constructs an improved super-resolution reconstruction convolutional neural network (SRCNN) for the feature maps Y with scales of 20×20, 40×40, and 80×80 output by the detection head part of YOLOv7. 1 , Y 2 and Y 3Perform feature enhancement processing. The improved SRCNN reconstructs and enhances the detailed information of the feature map by learning the mapping relationship of the feature map. In this way, richer and more accurate feature representations can be obtained from different granularity layers to better capture the tiny features of ships of different scales. This multi-granularity enhancement strategy makes full use of the information of different granularity layers to improve the quality and details of the feature map. Therefore, the multi-granularity feature enhancement module can better adapt to the detection needs of multi-scale ships, thereby improving the overall performance of ship detection.

[0051] See also Figure 1 , the method comprises the following steps:

[0052] Step S1, obtaining a visible light ship image to be detected.

[0053] Step S2: for the visible light ship image, the visible light ship image is classified into a foggy image or a fog-free image by classifying the sea fog degree of the visible light image based on three decisions.

[0054] In the process of designing an automatic classification algorithm for the degree of sea fog in visible light images, classification is mainly based on different feature values ​​of the image. Considering the more accurate evaluation of foggy images and ensuring the efficiency of the algorithm, the entropy function value and Laplace gradient function value of the image are used as feature indicators, and they are input into the K-means algorithm based on 3WDs for classification, thereby obtaining foggy images and fog-free images. The key steps of the algorithm are described as follows.

[0055] Specifically, this step includes the following sub-steps:

[0056] The steps include:

[0057] Step S201, obtaining multiple visible light ship images i j And calculate the corresponding entropy function value and Laplace gradient function value, construct the entropy function value sample set E and the Laplace gradient sample set L, and randomly select k samples from E as the initial mean vector μ m , where 1≤m≤k.

[0058] The construction process of the entropy function value sample set and the Laplace gradient sample set is as follows:

[0059] For all images I = (i 1 ,i 2 ,...,i n ), calculate for each image i j The entropy function value e(i j ) and the Laplace gradient function value l(i j ), to construct the sample set E = (e (i 1 ),e(i 2),...,e(i n )) and L=(l(i 1 ),l(i 2 ),...,l(i n )). Image i j The entropy function can be expressed as:

[0060]

[0061] Where N is the number of gray levels in the image (N = 256), p a Represents the probability of each gray level. e(i j ) is larger, the clearer the image is, and vice versa. j The Laplace gradient function can be written as:

[0062]

[0063] g x (s,t)=g(s,t)*A

[0064] g y (s,t)=g(s,t)*A T

[0065]

[0066] Among them, g x and g y They are the Laplace horizontal convolution kernel A and the vertical convolution kernel A. T Convolution at pixel (s, t). l(i j ) is larger, the clearer the image is, and vice versa. Then, K-means algorithm and 3WDs theory will be used to cluster E and L respectively.

[0067] Step S202, initializing the cluster And calculate the sample e(i j ) and each mean vector μ m The distance between jm .

[0068] d jm It can be expressed as:

[0069] d jm =||e(i j )-μ m || 2 (1≤m≤k,j=1,2,...,n)

[0070] Step S203, determine e(i j )’s cluster label λj .

[0071] λ j =argmin m∈{1,2,...,n} d jm

[0072] Step S204: calculate the distance sample e(i j ) are assigned to the corresponding cluster e(i j ) and i j There is a one-to-one correspondence.

[0073] Step S205, update the mean vector μ' m , which can be expressed as:

[0074]

[0075] Step S206, repeat steps S202-S205 until the mean vector μ' before and after the update is m constant;

[0076] Step S207: divide the multiple visible light ship images into foggy images and fog-free images based on the three-branch decision theory. Use E to divide all images I into foggy images. and fog-free images Similarly, use L to divide all images I into foggy images and fog-free images

[0077] The specific step S207 includes the following sub-steps:

[0078] Step S2071, using the entropy function value sample set E and the Laplace gradient sample set L, the plurality of visible light ship images are divided into foggy images, fog-free images and uncertain images.

[0079] Based on the 3WDs theory, all images are classified into foggy images. Fog-free image And the uncertain image C u =I-(C b ∪C c ).

[0080] Step S2072, calculating the thresholds of the foggy image and the fog-free image.

[0081] The threshold α for foggy images and the threshold β for non-fog images are calculated as follows:

[0082]

[0083] Among them, l(i j ) represents image ij The Laplace gradient function value, e(i j ) represents image i j The entropy function value of .

[0084] Step S2073, by calculating the Euclidean distance between the uncertain image and the threshold, the uncertain image is classified as a foggy image or a non-fog image.

[0085] By calculating the uncertain image C u The Euclidean distance between α and β is used to determine C u The classification is as follows:

[0086]

[0087] Where B represents the distance between the uncertain image and the foggy image using the values ​​of the Laplace gradient function and the entropy function. D represents the distance between the uncertain image and the fog-free image using the values ​​of the Laplace gradient function and the entropy function. If B>D, then image i j (i j ∈C u ) is assigned to the cluster of the non-hazy image; otherwise, it is assigned to the cluster of the hazy image. u Classified as foggy image and fog-free images Thus, a fog-free image is obtained and foggy images

[0088] Step S3: if the visible light ship image is classified as a foggy image, defogging is performed on the visible light ship image.

[0089] In order to reduce the interference of sea fog on ship detection in visible light images, three defogging modules are designed in ROI image enhancement. In this process, the feature fusion attention network FFA-Net is introduced to process foggy images specifically to eliminate the influence of sea fog on visible light images and avoid excessive defogging of fog-free images. This operation improves the quality of data samples and greatly facilitates subsequent feature extraction.

[0090] Step S4, input all fog-free visible light ship images into a pre-trained multi-granularity feature enhancement network to extract ship features of different granularities to achieve visible light ship detection.

[0091] Specifically, this step includes the following sub-steps:

[0092] Step S401: input all fog-free visible light ship images into the backbone sub-network with a detection head to obtain multiple feature maps of different scales.

[0093] In this embodiment, the backbone network is implemented using the lightweight network ELANet-1 including ELAN and MP-1 structures, and the detection head is the detection head of YOLOv7. Under this configuration, the output of this step is the feature map Y with scales of 20×20, 40×40 and 80×80. 1 , Y 2 and Y 3 .

[0094] Step S402, multiple feature maps of different scales are used as inputs of the super-resolution reconstruction convolution subnetwork to obtain reconstructed feature maps. Compared with SRCNN, the improved SRCNN of this embodiment reduces the number of parameters while maintaining the same receptive field size, which is conducive to the model to obtain the best ship detection accuracy at a faster speed by adding MFEM. The improved SRCNN mainly includes three convolutional layers.

[0095] Specifically, step S402 includes the following sub-steps:

[0096] Step S4021, based on multiple feature maps of different scales, obtain low-resolution feature maps of different scales through feature extraction.

[0097] The first convolutional layer is used to extract and represent the low-resolution feature map, and its operation can be expressed as F 1 :

[0098] F 1 (Y i )=max(0,W 1 *Yi i +B 1 )(i=1,2,3)

[0099] Among them, F 1 Represents the mapping relationship of the feature extraction layer. 1 and B 1 Denote filter and bias respectively. W 1 It consists of 64 5×5 convolution kernels with a dilation rate of 2. 1 is a 64-dimensional vector, each element of which is associated with a filter. After the first layer, a 64-dimensional feature map is extracted for each low-resolution feature map.

[0100] Step S4022, based on the low-resolution feature maps of different scales, high-resolution feature maps of different scales are obtained through nonlinear mapping.

[0101] The second convolutional layer maps a 64-dimensional feature map to a 32-dimensional feature map. Its operation can be expressed as F 2 :

[0102] F 2 (Y i)=max(0,W 2 *F 1 (Y i )+B 2 )(i=1,2,3)

[0103] Among them, F 2 Represents the mapping relationship of the nonlinear mapping layer. 2 Contains 32 convolution kernels, and the size of each convolution kernel is 1×1. 2 is a 32-dimensional vector. After the second nonlinear mapping layer, the mapping process from low-resolution features to high-resolution features is completed.

[0104] Step S4023, based on the high-resolution feature maps of different scales, obtain a reconstructed feature map by reconstruction mapping.

[0105] The third convolutional layer recombines the high-resolution features obtained from the second layer, and its operation can be expressed as F:

[0106] F(Y i )=max(0,W 3 *F 2 (Y i )+B 3 )(i=1,2,3)

[0107] Where F represents the mapping relationship of the reconstruction layer. 3 Contains 3 convolution kernels, and the size of each convolution kernel is 5×5. 3 is a 3-dimensional vector.

[0108] Step S403, using a multi-granularity detection head to extract ship features of different granularities, classify and regress the positions of the ships in the visible light image, and output the category and position information of the ships.

[0109] In the training process of MFE-Net, the loss function consistent with YOLOv7 is adopted, and the learning of the multi-granularity feature enhancement network MFE-Net is supervised by using coordinate loss, target confidence loss and classification loss. Specifically, BCE Loss is used for target confidence loss and classification loss, and CIoU Loss is used for coordinate loss.

[0110] In summary, in order to eliminate the interference of sea fog and improve the feature recognition ability of ships of different scales, this embodiment provides a three-branch defogging module and a multi-granularity feature enhancement module. The former aims to simulate the way humans make decisions in different situations, by accurately classifying the degree of sea fog in the image, and taking corresponding measures according to the different degrees of sea fog to achieve accurate defogging. The latter aims to use an improved super-resolution convolutional neural network from a multi-granularity perspective to learn the mapping relationship of feature maps at different granularity layers, so as to successfully reconstruct and enhance the detailed information of the feature map to obtain richer and more accurate features of ships of different scales. This embodiment mainly faces the challenges of sea fog and multi-scale ships in visible light ship detection. For the first time, the three-branch decision theory is introduced, and the multi-granularity idea is integrated to design a discriminative network structure. Even when visible light ship detection is affected by sea fog and multi-scale ships, this method can still maintain good versatility and robustness.

[0111] Example 2

[0112] This embodiment provides an electronic device, including: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the visible light ship detection method based on multi-granularity feature enhancement as described in Example 1.

[0113] Example 3

[0114] This embodiment provides a computer-readable storage medium, including one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the visible light ship detection method based on multi-granularity feature enhancement as described in Example 1.

[0115] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A visible light ship detection method based on multi-granularity feature enhancement, characterized in that: The steps include: Step S1, obtaining a visible light ship image to be detected; Step S2, for the visible light ship image, classifying the visible light ship image into a foggy image or a fog-free image by using a visible light image sea fog degree automatic classification algorithm based on three decisions; Step S3, if the visible light ship image is classified as a foggy image, performing a defogging process on the visible light ship image; Step S4, input all fog-free visible light ship images into a pre-trained multi-granularity feature enhancement network to extract ship features of different granularities to achieve visible light ship detection.

2. The method for detecting ships using visible light based on multi-granularity feature enhancement according to claim 1, characterized in that: The step S4 includes the following sub-steps: Step S401, input all fog-free visible light ship images into the backbone sub-network with the detection head to obtain multiple feature maps of different scales; Step S402, using multiple feature maps of different scales as inputs of a super-resolution reconstruction convolutional subnetwork to obtain a reconstructed feature map; Step S403: using a multi-granularity detection head to extract ship features of different granularities, and obtain visible light ship detection results.

3. The method for detecting ships using visible light based on multi-granularity feature enhancement according to claim 2, characterized in that: The backbone subnetwork with a detection head is an ELANet-1 network including a YOLOv7 detection head.

4. The method for detecting ships using visible light based on multi-granularity feature enhancement according to claim 2, characterized in that: The step S402 includes the following sub-steps: Step S4021, based on the feature maps of multiple different scales, obtaining low-resolution feature maps of different scales by feature extraction; Step S4022, based on the low-resolution feature maps of different scales, obtaining high-resolution feature maps of different scales through nonlinear mapping; Step S4023, based on the high-resolution feature maps of different scales, obtain a reconstructed feature map by reconstruction mapping.

5. The method for detecting ships using visible light based on multi-granularity feature enhancement according to claim 2, characterized in that: The super-resolution reconstruction convolutional sub-network is pre-trained based on coordinate loss, target confidence loss and classification loss.

6. The method for detecting ships using visible light based on multi-granularity feature enhancement according to claim 1, characterized in that: The step S2 comprises the following steps: Step S201, obtaining multiple visible light ship images i j And calculate the corresponding entropy function value e(i j ) and the Laplace gradient function value l(i j ), construct the entropy function value sample set E and the Laplace gradient sample set L, and randomly select k samples from E as the initial mean vector μ m , where 1≤m≤k; Step S202, initializing the cluster And calculate the sample e(i j ) and each mean vector μ m The distance between jm ; Step S203, determine e(i j )’s cluster label λ j ; Step S204: calculate the distance sample e(i j ) are assigned to the corresponding cluster Step S205, update the mean vector μ' m ; Step S206, repeat steps S202-S205 until the mean vector μ' before and after the update is m constant; Step S207: dividing the multiple visible light ship images into foggy images and fog-free images based on the three-branch decision theory.

7. The method for detecting ships using visible light based on multi-granularity feature enhancement according to claim 6, characterized in that: The step S207 includes the following sub-steps: Step S2071, using the entropy function value sample set E and the Laplace gradient sample set L, dividing the multiple visible light ship images into foggy images, fog-free images and uncertain images; Step S2072, calculating the thresholds of the foggy image and the fog-free image; Step S2073: Classify the uncertain image into a foggy image or a non-fog image by calculating the Euclidean distance between the uncertain image and the threshold.

8. The method for detecting ships using visible light based on multi-granularity feature enhancement according to claim 7, characterized in that: The step S2073 is implemented by the following formula: Among them, α and β are the thresholds of foggy images and non-fog images respectively, Cu represents the set of uncertain images, and l(i j ) represents image i j The Laplace gradient function value, e(i j ) represents image i j The entropy function value of is the uncertain image C u and the Euclidean distance between α and β, B represents the distance between the uncertain image and the foggy image using the values ​​of the Laplace gradient function and the entropy function, and D represents the distance between the uncertain image and the fog-free image using the values ​​of the Laplace gradient function and the entropy function. If B>D, then image i j Assigned to the cluster of the haze-free image, otherwise image i j Clusters assigned to foggy images.

9. An electronic device, characterized in that: include: One or more processors and a memory, wherein the memory stores one or more programs, wherein the one or more programs include instructions for executing the visible light ship detection method based on multi-granularity feature enhancement as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that: It comprises one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs comprise instructions for executing the visible light ship detection method based on multi-granularity feature enhancement as claimed in any one of claims 1 to 8.